File: /www/wwwroot/oa.sanjiangapp.com/www/js/zui/min.js
/*!
* ZUI: Zdoo template - v1.9.2 - 2021-02-05
* http://openzui.com
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2021 cnezsoft.com; Licensed MIT
*/
!function(t,e,i){"use strict";if("undefined"==typeof t)throw new Error("ZUI requires jQuery");t.zui||(t.zui=function(e){t.isPlainObject(e)&&t.extend(t.zui,e)});var a={all:-1,left:0,middle:1,right:2},s=0;t.zui({uuid:function(t){var e=1e5*(Date.now()-1580890015292)+10*Math.floor(1e4*Math.random())+s++%10;return t?e:e.toString(36)},callEvent:function(t,e,a){if("function"==typeof t){a!==i&&(t=t.bind(a));var s=t(e);return e&&(e.result=s),!(s!==i&&!s)}return 1},strCode:function(t){var e=0;if("string"!=typeof t&&(t=String(t)),t&&t.length)for(var i=0;i<t.length;++i)e+=i*t.charCodeAt(i);return e},getMouseButtonCode:function(t){return"number"!=typeof t&&(t=a[t]),t!==i&&null!==t||(t=-1),t},defaultLang:"en",clientLang:function(){var i,a=e.config;if("undefined"!=typeof a&&a.clientLang&&(i=a.clientLang),!i){var s=t("html").attr("lang");i=s?s:navigator.userLanguage||navigator.userLanguage||t.zui.defaultLang}return i.replace("-","_").toLowerCase()},langDataMap:{},addLangData:function(e,i,a){var s={};a&&i&&e?(s[i]={},s[i][e]=a):e&&i&&!a?(a=i,t.each(a,function(t){s[t]={},s[t][e]=a[t]})):!e||i||a||t.each(a,function(e){var i=a[e];t.each(i,function(t){s[t]||(s[t]={}),s[t][e]=i[t]})}),t.extend(!0,t.zui.langDataMap,s)},getLangData:function(e,i,a){if(!arguments.length)return t.extend({},t.zui.langDataMap);if(1===arguments.length)return t.extend({},t.zui.langDataMap[e]);if(2===arguments.length){var s=t.zui.langDataMap[e];return s?i?s[i]:s:{}}if(3===arguments.length){i=i||t.zui.clientLang();var s=t.zui.langDataMap[e],o=s?s[i]:{};return t.extend(!0,{},a[i]||a.en||a.zh_cn,o)}return null},lang:function(){return arguments.length&&t.isPlainObject(arguments[arguments.length-1])?t.zui.addLangData.apply(null,arguments):t.zui.getLangData.apply(null,arguments)},_scrollbarWidth:0,checkBodyScrollbar:function(){if(document.body.clientWidth>=e.innerWidth)return 0;if(!t.zui._scrollbarWidth){var i=document.createElement("div");i.className="scrollbar-measure",document.body.appendChild(i),t.zui._scrollbarWidth=i.offsetWidth-i.clientWidth,document.body.removeChild(i)}return t.zui._scrollbarWidth},fixBodyScrollbar:function(){if(t.zui.checkBodyScrollbar()){var e=t("body"),i=parseInt(e.css("padding-right")||0,10);return t.zui._scrollbarWidth&&e.css({paddingRight:i+t.zui._scrollbarWidth,overflowY:"hidden"}),!0}},resetBodyScrollbar:function(){t("body").css({paddingRight:"",overflowY:""})}}),t.fn.callEvent=function(e,a,s){var o=t(this),n=e.indexOf(".zui."),r=n<0?e:e.substring(0,n),l=t.Event(r,a);if(s===i&&n>0&&(s=o.data(e.substring(n+1))),s&&s.options){var d=s.options[r];"function"==typeof d&&(l.result=t.zui.callEvent(d,l,s))}return o.trigger(l),l},t.fn.callComEvent=function(t,e,a){a===i||Array.isArray(a)||(a=[a]);var s,o=this;o.trigger(e,a);var n=t.options[e];return n&&(s=n.apply(t,a)),s}}(jQuery,window,void 0),function(){"use strict";const t=function(t,e){if(arguments.length>1){var i;if(2==arguments.length&&"object"==typeof e)for(var a in e)void 0!==e[a]&&(i=new RegExp("({"+a+"})","g"),t=t.replace(i,e[a]));else for(var s=1;s<arguments.length;s++)void 0!==arguments[s]&&(i=new RegExp("({["+(s-1)+"]})","g"),t=t.replace(i,arguments[s]))}return t},e=function(t){if(null!==t){var e,i;return i=/\d*/i,e=t.match(i),e==t}return!1},i={formatString:t,string:{format:t,isNum:e}};window.$&&window.$.zui?$.zui(i):window.stringHelper=i.string,window.noStringPrototypeHelper||(String.prototype.format||(String.prototype.format=function(){var e=[].slice.call(arguments);return e.unshift(this),t.apply(this,e)}),String.prototype.isNum||(String.prototype.isNum=function(){return e(this)}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){return(void 0===e||e>this.length)&&(e=this.length),this.substring(e-t.length,e)===t}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(t,e){return e=!e||e<0?0:+e,this.substring(e,e+t.length)===t}}),String.prototype.includes||(String.prototype.includes=function(){return String.prototype.indexOf.apply(this,arguments)!==-1}))}(),/*!
* jQuery resize event - v1.1
* http://benalman.com/projects/jquery-resize-plugin/
* Copyright (c) 2010 "Cowboy" Ben Alman
* MIT & GPL http://benalman.com/about/license/
*/
function(t,e,i){"$:nomunge";function a(){s=e[r](function(){o.each(function(){var e=t(this),i=e.width(),a=e.height(),s=t.data(this,d);i===s.w&&a===s.h||e.trigger(l,[s.w=i,s.h=a])}),a()},n[h])}var s,o=t([]),n=t.resize=t.extend(t.resize,{}),r="setTimeout",l="resize",d=l+"-special-event",h="delay",c="throttleWindow";n[h]=250,n[c]=!0,t.event.special[l]={setup:function(){if(!n[c]&&this[r])return!1;var e=t(this);o=o.add(e),t.data(this,d,{w:e.width(),h:e.height()}),1===o.length&&a()},teardown:function(){if(!n[c]&&this[r])return!1;var e=t(this);o=o.not(e),e.removeData(d),o.length||clearTimeout(s)},add:function(e){function a(e,a,o){var n=t(this),r=t.data(this,d)||{};r.w=a!==i?a:n.width(),r.h=o!==i?o:n.height(),s.apply(this,arguments)}if(!n[c]&&this[r])return!1;var s;return"function"==typeof e?(s=e,a):(s=e.handler,void(e.handler=a))}}}(jQuery,this),function(t){"use strict";const e=864e5,i=function(t){return t instanceof Date||("number"==typeof t&&t<1e10&&(t*=1e3),t=new Date(t)),t},a=function(t){return i(t).getTime()},s=function(t,e){t=i(t),void 0===e&&(e="yyyy-MM-dd hh:mm:ss");var a={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),"S+":t.getMilliseconds()};/(y+)/i.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(var s in a)new RegExp("("+s+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?a[s]:("00"+a[s]).substr((""+a[s]).length)));return e},o=function(t,e){return t.setTime(t.getTime()+e),t},n=function(t,i){return o(t,i*e)},r=function(t){return new Date(i(t).getTime())},l=function(t){return t%4===0&&t%100!==0||t%400===0},d=function(t,e){return[31,l(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},h=function(t){return d(t.getFullYear(),t.getMonth())},c=function(t){return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},u=function(t,e){var i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(Math.min(i,h(t))),t},p=function(t,e){e=e||1;for(var i=new Date(t.getTime());i.getDay()!=e;)i=n(i,-1);return c(i)},f=function(t,e){return t.toDateString()===e.toDateString()},g=function(t,e){var i=p(t),a=n(r(i),7);return e>=i&&e<a},m=function(t,e){return t.getFullYear()===e.getFullYear()},v={formatDate:s,createDate:i,date:{ONEDAY_TICKS:e,create:i,getTimestamp:a,format:s,addMilliseconds:o,addDays:n,cloneDate:r,isLeapYear:l,getDaysInMonth:d,getDaysOfThisMonth:h,clearTime:c,addMonths:u,getLastWeekday:p,isSameDay:f,isSameWeek:g,isSameYear:m}};t.$&&t.$.zui?$.zui(v):t.dateHelper=v.date,t.noDatePrototypeHelper||(Date.ONEDAY_TICKS=e,Date.prototype.format||(Date.prototype.format=function(t){return s(this,t)}),Date.prototype.addMilliseconds||(Date.prototype.addMilliseconds=function(t){return o(this,t)}),Date.prototype.addDays||(Date.prototype.addDays=function(t){return n(this,t)}),Date.prototype.clone||(Date.prototype.clone=function(){return r(this)}),Date.isLeapYear||(Date.isLeapYear=function(t){return l(t)}),Date.getDaysInMonth||(Date.getDaysInMonth=function(t,e){return d(t,e)}),Date.prototype.isLeapYear||(Date.prototype.isLeapYear=function(){return l(this.getFullYear())}),Date.prototype.clearTime||(Date.prototype.clearTime=function(){return c(this)}),Date.prototype.getDaysInMonth||(Date.prototype.getDaysInMonth=function(){return h(this)}),Date.prototype.addMonths||(Date.prototype.addMonths=function(t){return u(this,t)}),Date.prototype.getLastWeekday||(Date.prototype.getLastWeekday=function(t){return p(this,t)}),Date.prototype.isSameDay||(Date.prototype.isSameDay=function(t){return f(t,this)}),Date.prototype.isSameWeek||(Date.prototype.isSameWeek=function(t){return g(t,this)}),Date.prototype.isSameYear||(Date.prototype.isSameYear=function(t){return m(this,t)}),Date.create||(Date.create=function(t){return i(t)}),Date.timestamp||(Date.timestamp=function(t){return a(t)}))}(window),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,a=this;t(this).one("bsTransitionEnd",function(){i=!0});var s=function(){i||t(a).trigger(t.support.transition.end)};return setTimeout(s,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(t,e){"use strict";var i="zui.draggable",a={container:"body",move:!0},s=0,o=function(e,i){var o=this;o.$=t(e),o.id=s++,o.options=t.extend({},a,o.$.data(),i),o.init()};o.DEFAULTS=a,o.NAME=i,o.prototype.init=function(){var a,s,o,n,r,l=this,d=l.$,h="before",c="drag",u="finish",p="."+i+"."+l.id,f="mousedown"+p,g="mouseup"+p,m="mousemove"+p,v=l.options,b=v.selector,y=v.handle,w=d,_="function"==typeof v.move,C=function(t){var e=t.pageX,i=t.pageY;r=!0;var s={left:e-o.x,top:i-o.y};w.removeClass("drag-ready").addClass("dragging"),v.move&&(_?v.move(s,w):w.css(s)),v[c]&&v[c]({event:t,element:w,startOffset:o,pos:s,offset:{x:e-a.x,y:i-a.y},smallOffset:{x:e-n.x,y:i-n.y}}),n.x=e,n.y=i,v.stopPropagation&&t.stopPropagation()},x=function(i){if(t(e).off(p),!r)return void w.removeClass("drag-ready");var s={left:i.pageX-o.x,top:i.pageY-o.y};w.removeClass("drag-ready dragging"),v.move&&(_?v.move(s,w):w.css(s)),v[u]&&v[u]({event:i,element:w,startOffset:o,pos:s,offset:{x:i.pageX-a.x,y:i.pageY-a.y},smallOffset:{x:i.pageX-n.x,y:i.pageY-n.y}}),i.preventDefault(),v.stopPropagation&&i.stopPropagation()},k=function(i){var l=t.zui.getMouseButtonCode(v.mouseButton);if(!(l>-1&&i.button!==l)){var d=t(this);if(b&&(w=y?d.closest(b):d),v[h]){var c=v[h]({event:i,element:w});if(c===!1)return}var u=t(v.container),p=w.offset();s=u.offset(),a={x:i.pageX,y:i.pageY},o={x:i.pageX-p.left+s.left,y:i.pageY-p.top+s.top},n=t.extend({},a),r=!1,w.addClass("drag-ready"),i.preventDefault(),v.stopPropagation&&i.stopPropagation(),t(e).on(m,C).on(g,x)}};y?d.on(f,y,k):b?d.on(f,b,k):d.on(f,k)},o.prototype.destroy=function(){var a="."+i+"."+this.id;this.$.off(a),t(e).off(a),this.$.data(i,null)},t.fn.draggable=function(e){return this.each(function(){var a=t(this),s=a.data(i),n="object"==typeof e&&e;s||a.data(i,s=new o(this,n)),"string"==typeof e&&s[e]()})},t.fn.draggable.Constructor=o}(jQuery,document),function(t,e,i){"use strict";var a="zui.droppable",s={target:".droppable-target",deviation:5,sensorOffsetX:0,sensorOffsetY:0,dropToClass:"drop-to"},o=0,n=function(e,i){var a=this;a.id=o++,a.$=t(e),a.options=t.extend({},s,a.$.data(),i),a.init()};n.DEFAULTS=s,n.NAME=a,n.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},n.prototype.init=function(){var s,o,n,r,l,d,h,c,u,p,f,g,m,v=this,b=v.$,y=v.options,w=y.deviation,_="."+a+"."+v.id,C="mousedown"+_,x="mouseup"+_,k="mousemove"+_,T=y.selector,D=y.handle,$=y.flex,S=y.container,M=y.canMoveHere,z=y.dropToClass,I=b,E=!1,U=S?t(y.container).first():T?b:t("body"),P=function(e){if(E&&(f={left:e.pageX,top:e.pageY},!(i.abs(f.left-c.left)<w&&i.abs(f.top-c.top)<w))){if(null===n){var a=U.css("position");"absolute"!=a&&"relative"!=a&&"fixed"!=a&&(d=a,U.css("position","relative")),n=I.clone().removeClass("drag-from").addClass("drag-shadow").css({position:"absolute",width:I.outerWidth(),transition:"none"}).appendTo(U),I.addClass("dragging"),v.trigger("start",{event:e,element:I,shadowElement:n,targets:s})}var h={left:f.left-p.left,top:f.top-p.top},m={left:h.left-u.left,top:h.top-u.top};n.css(m),t.extend(g,f);var b=!1;r=!1,$||s.removeClass(z);var _=null;if(s.each(function(){var e=t(this),i=e.offset(),a=e.outerWidth(),s=e.outerHeight(),o=i.left+y.sensorOffsetX,n=i.top+y.sensorOffsetY;if(f.left>o&&f.top>n&&f.left<o+a&&f.top<n+s&&(_&&_.removeClass(z),_=e,!y.nested))return!1}),_){r=!0;var C=_.data("id");I.data("id")!=C&&(l=!1),(null===o||o.data("id")!==C&&!l)&&(b=!0),o=_,$&&s.removeClass(z),o.addClass(z)}$?null!==o&&o.length&&(r=!0):(I.toggleClass("drop-in",r),n.toggleClass("drop-in",r)),M&&M(I,o)===!1||v.trigger("drag",{event:e,isIn:r,target:o,element:I,isNew:b,selfTarget:l,clickOffset:p,offset:h,position:{left:h.left-u.left,top:h.top-u.top},mouseOffset:f}),e.preventDefault()}},H=function(i){if(t(e).off(_),clearTimeout(m),E){if(E=!1,d&&U.css("position",d),null===n)return I.removeClass("drag-from"),void v.trigger("always",{event:i,cancel:!0});r||(o=null);var a=!0;f=i?{left:i.pageX,top:i.pageY}:g;var h={left:f.left-p.left,top:f.top-p.top},c={left:f.left-g.left,top:f.top-g.top};g.left=f.left,g.top=f.top;var b={event:i,isIn:r,target:o,element:I,isNew:!l&&null!==o,selfTarget:l,offset:h,mouseOffset:f,position:{left:h.left-u.left,top:h.top-u.top},lastMouseOffset:g,moveOffset:c};a=v.trigger("beforeDrop",b),a&&r&&v.trigger("drop",b),s.removeClass(z),I.removeClass("dragging").removeClass("drag-from"),n.remove(),n=null,v.trigger("finish",b),v.trigger("always",b),i&&i.preventDefault()}},L=function(i){var a=t.zui.getMouseButtonCode(y.mouseButton);if(!(a>-1&&i.button!==a)){var f=t(this);T&&(I=D?f.closest(T):f),I.hasClass("drag-shadow")||y.before&&y.before({event:i,element:I})===!1||(E=!0,s="function"==typeof y.target?y.target(I,b):U.find(y.target),o=null,n=null,r=!1,l=!0,d=null,h=I.offset(),u=U.offset(),u.top=u.top-U.scrollTop(),u.left=u.left-U.scrollLeft(),c={left:i.pageX,top:i.pageY},g=t.extend({},c),p={left:c.left-h.left,top:c.top-h.top},I.addClass("drag-from"),t(e).on(k,P).on(x,H),m=setTimeout(function(){t(e).on(C,H)},10),i.preventDefault(),y.stopPropagation&&i.stopPropagation())}};D?b.on(C,D,L):T?b.on(C,T,L):b.on(C,L)},n.prototype.destroy=function(){var i="."+a+"."+this.id;this.$.off(i),t(e).off(i),this.$.data(a,null)},n.prototype.reset=function(){this.destroy(),this.init()},t.fn.droppable=function(e){return this.each(function(){var i=t(this),s=i.data(a),o="object"==typeof e&&e;s||i.data(a,s=new n(this,o)),"string"==typeof e&&s[e]()})},t.fn.droppable.Constructor=n}(jQuery,document,Math),function(t){"use strict";if(!t.fn.droppable)throw new Error("Droppable requires for boards");var e="zui.boards",i=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.getLang(),this.init()};i.DEFAULTS={lang:"en",langs:{zh_cn:{append2end:"移动到末尾"},zh_tw:{append2end:"移动到末尾"},en:{append2end:"Move to the end."}}},i.prototype.getOptions=function(e){return e=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.getLang=function(){var i=this.options;this.langName=i.lang||t.zui.clientLang(),this.lang=t.zui.getLangData(e,this.langName,i.langs)},i.prototype.init=function(){var e=1,i=this.lang;this.$.find('.board-item:not(".disable-drop"), .board:not(".disable-drop")').each(function(){var a=t(this);a.attr("id")?a.attr("data-id",a.attr("id")):a.attr("data-id")||a.attr("data-id","board"+e++),a.hasClass("board")&&a.find(".board-list").append('<div class="board-item board-item-empty"><i class="icon-plus"></i> {append2end}</div>'.format(i)).append('<div class="board-item board-item-shadow"></div>'.format(i))}),this.bind()},i.prototype.bind=function(e){var i=this.$,a=this.options;i.droppable(t.extend({before:a.before,target:'.board-item:not(".disable-drop, .board-item-shadow")',flex:!0,selector:'.board-item:not(".disable-drop, .board-item-shadow")',start:function(t){i.addClass("dragging").find(".board-item-shadow").height(t.element.outerHeight())},drag:function(t){if(i.find(".board.drop-in-empty").removeClass("drop-in-empty"),t.isIn){var e=t.target.closest(".board").addClass("drop-in"),a=e.find(".board-item-shadow"),s=t.target;i.addClass("drop-in").find(".board.drop-in").not(e).removeClass("drop-in"),a.insertBefore(s),e.toggleClass("drop-in-empty",s.hasClass("board-item-empty"))}},drop:function(t){if(t.isNew){var e;"function"==typeof a.drop&&(e=a.drop(t)),e!==!1&&t.element.insertBefore(t.target)}},finish:function(){i.removeClass("dragging").removeClass("drop-in").find(".board.drop-in").removeClass("drop-in")}},a.droppable))},t.fn.boards=function(a){return this.each(function(){var s=t(this),o=s.data(e),n="object"==typeof a&&a;o||s.data(e,o=new i(this,n)),"string"==typeof a&&o[a]()})},t.fn.boards.Constructor=i}(jQuery),/*!
* jQuery Hotkeys Plugin
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Based upon the plugin by Tzury Bar Yochay:
* http://github.com/tzuryby/hotkeys
*
* Original idea by:
* Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
*/
function(t){function e(e){if("string"==typeof e.data){var i=e.handler,a=e.data.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&"text"!==e.target.type){var s="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],o=String.fromCharCode(e.which).toLowerCase(),n="",r={};e.altKey&&"alt"!==s&&(n+="alt+"),e.ctrlKey&&"ctrl"!==s&&(n+="ctrl+"),e.metaKey&&!e.ctrlKey&&"meta"!==s&&(n+="meta+"),e.shiftKey&&"shift"!==s&&(n+="shift+"),s?r[n+s]=!0:(r[n+o]=!0,r[n+t.hotkeys.shiftNums[o]]=!0,"shift+"===n&&(r[t.hotkeys.shiftNums[o]]=!0));for(var l=0,d=a.length;l<d;l++)if(r[a[l]])return i.apply(this,arguments)}}}}t.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:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})}(jQuery),function(t){"use strict";t.fn.fixOlPd=function(e){return e=e||10,this.each(function(){var i=t(this);i.css("paddingLeft",Math.ceil(Math.log10(i.children().length))*e+10)})},t(function(){t(".ol-pd-fix,.article ol").fixOlPd()})}(jQuery),function(t){"use strict";var e={zh_cn:'您的浏览器版本过低,无法体验所有功能,建议升级或者更换浏览器。 <a href="https://browsehappy.com/" target="_blank" class="alert-link">了解更多...</a>',zh_tw:'您的瀏覽器版本過低,無法體驗所有功能,建議升級或者更换瀏覽器。<a href="https://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="https://browsehappy.com/" target="_blank" class="alert-link">Learn more...</a>'},i=function(){for(var t=!1,e=11;e>5;e--)if(this.isIE(e)){t=e;break}this.ie=t,this.cssHelper()};i.prototype.cssHelper=function(){var e=this.ie,i=t("html");i.toggleClass("ie",e).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"),e&&i.addClass("ie-"+e).toggleClass("gt-ie-7 gte-ie-8 support-ie",e>=8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie",e<8).toggleClass("gt-ie-8 gte-ie-9",e>=9).toggleClass("lte-ie-8 lt-ie-9",e<9).toggleClass("gt-ie-9 gte-ie-10",e>=10).toggleClass("lte-ie-9 lt-ie-10",e<10).toggleClass("gt-ie-10 gte-ie-11",e>=11).toggleClass("lte-ie-10 lt-ie-11",e<11)},i.prototype.tip=function(i){var a=t("#browseHappyTip");a.length||(a=t('<div id="browseHappyTip" class="alert alert-dismissable alert-danger-inverse alert-block" style="position: relative; z-index: 99999"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><div class="container"><div class="content text-center"></div></div></div>'),a.prependTo("body")),i||(i=t.zui.getLangData("zui.browser",t.zui.clientLang(),e),"object"==typeof i&&(i=i.tip)),a.find(".content").html(i)},i.prototype.isIE=function(t){if(11===t)return this.isIE11();if(10===t)return this.isIE10();if(!t&&(this.isIE11()||this.isIE10()))return!0;var e=document.createElement("b");return e.innerHTML="<!--[if IE "+(t||"")+"]><i></i><![endif]-->",1===e.getElementsByTagName("i").length},i.prototype.isIE10=function(){return navigator.appVersion.indexOf("MSIE 10")!==-1},i.prototype.isIE11=function(){var t=navigator.userAgent;return t.indexOf("Trident")!==-1&&t.indexOf("rv:11")!==-1},t.zui({browser:new i}),t(function(){t("body").hasClass("disabled-browser-tip")||t.zui.browser.ie&&t.zui.browser.ie<8&&t.zui.browser.tip()})}(jQuery),function(t,e){"use strict";var i="zui.pager",a={page:1,recTotal:0,recPerPage:10},s={zh_cn:{pageOfText:"第 {0} 页",prev:"上一页",next:"下一页",first:"第一页",last:"最后一页","goto":"跳转",pageOf:"第 <strong>{page}</strong> 页",totalPage:"共 <strong>{totalPage}</strong> 页",totalCount:"共 <strong>{recTotal}</strong> 项",pageSize:"每页 <strong>{recPerPage}</strong> 项",itemsRange:"第 <strong>{start}</strong> ~ <strong>{end}</strong> 项",pageOfTotal:"第 <strong>{page}</strong>/<strong>{totalPage}</strong> 页"},zh_tw:{pageOfText:"第 {0} 頁",prev:"上一頁",next:"下一頁",first:"第一頁",last:"最後一頁","goto":"跳轉",pageOf:"第 <strong>{page}</strong> 頁",totalPage:"共 <strong>{totalPage}</strong> 頁",totalCount:"共 <strong>{recTotal}</strong> 項",pageSize:"每頁 <strong>{recPerPage}</strong> 項",itemsRange:"第 <strong>{start}</strong> ~ <strong>{end}</strong> 項",pageOfTotal:"第 <strong>{page}</strong>/<strong>{totalPage}</strong> 頁"},en:{pageOfText:"Page {0}",prev:"Prev",next:"Next",first:"First",last:"Last","goto":"Goto",pageOf:"Page <strong>{page}</strong>",totalPage:"<strong>{totalPage}</strong> pages",totalCount:"Total: <strong>{recTotal}</strong> items",pageSize:"<strong>{recPerPage}</strong> per page",itemsRange:"From <strong>{start}</strong> to <strong>{end}</strong>",pageOfTotal:"Page <strong>{page}</strong> of <strong>{totalPage}</strong>"}},o=function(e,a){var n=this;n.name=i,n.$=t(e),a=n.options=t.extend({},o.DEFAULTS,this.$.data(),a),n.langName=a.lang||t.zui.clientLang(),n.lang=t.zui.getLangData(i,n.langName,s),n.state={},n.set(a.page,a.recTotal,a.recPerPage,!0),n.$.on("click",".pager-goto-btn",function(){var e=t(this).closest(".pager-goto"),i=parseInt(e.find(".pager-goto-input").val());NaN!==i&&n.set(i)}).on("click",".pager-item",function(){var e=t(this).data("page");"number"==typeof e&&e>0&&n.set(e)}).on("click",".pager-size-menu [data-size]",function(){var e=t(this).data("size");"number"==typeof e&&e>0&&n.set(-1,-1,e)})};o.prototype.set=function(e,i,s,o){var n=this;"object"==typeof e&&null!==e&&(s=e.recPerPage,i=e.recTotal,e=e.page);var r=n.state;r||(r=t.extend({},a));var l=t.extend({},r);return"number"==typeof s&&s>0&&(r.recPerPage=s),"number"==typeof i&&i>=0&&(r.recTotal=i),"number"==typeof e&&e>=0&&(r.page=e),r.totalPage=r.recTotal&&r.recPerPage?Math.ceil(r.recTotal/r.recPerPage):1,r.page=Math.max(0,Math.min(r.page,r.totalPage)),r.pageRecCount=r.recTotal,r.page&&r.recTotal&&(r.page<r.totalPage?r.pageRecCount=r.recPerPage:r.page>1&&(r.pageRecCount=r.recTotal-r.recPerPage*(r.page-1))),r.skip=r.page>1?(r.page-1)*r.recPerPage:0,r.start=r.skip+1,r.end=r.skip+r.pageRecCount,r.prev=r.page>1?r.page-1:0,r.next=r.page<r.totalPage?r.page+1:0,n.state=r,o||l.page===r.page&&l.recTotal===r.recTotal&&l.recPerPage===r.recPerPage||n.$.callComEvent(n,"onPageChange",[r,l]),n.render()},o.prototype.createLinkItem=function(i,a,s){var o=this;a===e&&(a=i);var n=t('<a title="'+o.lang.pageOfText.format(i)+'" class="pager-item" data-page="'+i+'"/>').attr("href",i?o.createLink(i,o.state):"###").html(a);return s||(n=t("<li />").append(n).toggleClass("active",i===o.state.page).toggleClass("disabled",!i||i===o.state.page)),n},o.prototype.createNavItems=function(t){var i=this,a=i.$,s=i.state,o=s.totalPage,n=s.page,r=function(t,s){if(t===!1)return void a.append(i.createLinkItem(0,s||i.options.navEllipsisItem));s===e&&(s=t);for(var o=t;o<=s;++o)a.append(i.createLinkItem(o))};t===e&&(t=i.options.maxNavCount||10),r(1),o>1&&(o<=t?r(2,o):n<t-2?(r(2,t-2),r(!1),r(o)):n>o-t+2?(r(!1),r(o-t+2,o)):(r(!1),r(n-Math.ceil((t-4)/2),n+Math.floor((t-4)/2)),r(!1),r(o)))},o.prototype.createGoto=function(){var e=this,i=this.state,a=t('<div class="input-group pager-goto" style="width: '+(35+9*(i.page+"").length+25+12*e.lang["goto"].length)+'px"><input value="'+i.page+'" type="number" min="1" max="'+i.totalPage+'" placeholder="'+i.page+'" class="form-control pager-goto-input"><span class="input-group-btn"><button class="btn pager-goto-btn" type="button">'+e.lang["goto"]+"</button></span></div>");return a},o.prototype.createSizeMenu=function(){var e=this,i=this.state,a=t('<ul class="dropdown-menu"></ul>'),s=e.options.pageSizeOptions;"string"==typeof s&&(s=s.split(","));for(var o=0;o<s.length;++o){var n=s[o];"string"==typeof n&&(n=parseInt(n));var r=t('<li><a href="###" data-size="'+n+'">'+n+"</a></li>").toggleClass("active",n===i.recPerPage);a.append(r)}return t('<div class="btn-group pager-size-menu"><button type="button" class="btn dropdown-toggle" data-toggle="dropdown">'+e.lang.pageSize.format(i)+' <span class="caret"></span></button></div>').addClass(e.options.menuDirection).append(a)},o.prototype.createElement=function(e,i,a){var s=this,o=s.createLinkItem.bind(s),n=s.lang;switch(e){case"prev":return o(a.prev,n.prev);case"prev_icon":return o(a.prev,'<i class="icon '+s.options.prevIcon+'"></i>');case"next":return o(a.next,n.next);case"next_icon":return o(a.next,'<i class="icon '+s.options.nextIcon+'"></i>');case"first":return o(1,n.first);case"first_icon":return o(1,'<i class="icon '+s.options.firstIcon+'"></i>');case"last":return o(a.totalPage,n.last);case"last_icon":return o(a.totalPage,'<i class="icon '+s.options.lastIcon+'"></i>');case"space":case"|":return t('<li class="space" />');case"nav":case"pages":return void s.createNavItems();case"total_text":return t(('<div class="pager-label">'+n.totalCount+"</div>").format(a));case"page_text":return t(('<div class="pager-label">'+n.pageOf+"</div>").format(a));case"total_page_text":return t(('<div class="pager-label">'+n.totalPage+"</div>").format(a));case"page_of_total_text":return t(('<div class="pager-label">'+n.pageOfTotal+"</div>").format(a));case"page_size_text":return t(('<div class="pager-label">'+n.pageSize+"</div>").format(a));case"items_range_text":return t(('<div class="pager-label">'+n.itemsRange+"</div>").format(a));case"goto":return s.createGoto();case"size_menu":return s.createSizeMenu();default:return t("<li/>").html(e.format(a))}},o.prototype.createLink=function(i,a){i===e&&(i=this.state.page),a===e&&(a=this.state);var s=this.options.linkCreator;return"string"==typeof s?s.format(t.extend({},a,{page:i})):"function"==typeof s?s(i,a):"#page="+i},o.prototype.render=function(e){var i=this,a=i.state,s=i.options.elementCreator||i.createElement,o=t.isPlainObject(s);e=e||i.elements||i.options.elements,"string"==typeof e&&(e=e.split(",")),i.elements=e,i.$.empty();for(var n=0;n<e.length;++n){var r=t.trim(e[n]),l=o?s[r]||s:s,d=l.call(i,r,i.$,a);d===!1&&(d=i.createElement(r,i.$,a)),d instanceof t&&("LI"!==d[0].tagName&&(d=t("<li/>").append(d)),i.$.append(d))}var h=null;return i.$.children("li").each(function(){var e=t(this),i=!!e.children(".pager-item").length;h?h.toggleClass("pager-item-right",!i):i&&e.addClass("pager-item-left"),h=i?e:null}),h&&h.addClass("pager-item-right"),i.$.callComEvent(i,"onRender",[a]),i},o.DEFAULTS=t.extend({elements:["first_icon","prev_icon","pages","next_icon","last_icon","page_of_total_text","items_range_text","total_text"],prevIcon:"icon-double-angle-left",nextIcon:"icon-double-angle-right",firstIcon:"icon-step-backward",lastIcon:"icon-step-forward",navEllipsisItem:'<i class="icon icon-ellipsis-h"></i>',maxNavCount:10,menuDirection:"dropdown",pageSizeOptions:[10,20,30,50,100]},a),t.fn.pager=function(e){return this.each(function(){var a=t(this),s=a.data(i),n="object"==typeof e&&e;s||a.data(i,s=new o(this,n)),"string"==typeof e&&s[e]()})},o.NAME=i,o.LANG=s,t.fn.pager.Constructor=o,t(function(){t('[data-ride="pager"]').pager()})}(jQuery,void 0),+function(t){"use strict";var e="zui.tab",i=function(e){this.element=t(e)};i.prototype.show=function(){var i=this.element,a=i.closest("ul:not(.dropdown-menu)"),s=i.attr("data-target")||i.attr("data-tab");if(s||(s=i.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,"")),!i.parent("li").hasClass("active")){var o=a.find(".active:last a")[0],n=t.Event("show."+e,{relatedTarget:o});if(i.trigger(n),!n.isDefaultPrevented()){var r=t(s);this.activate(i.parent("li"),a),this.activate(r,r.parent(),function(){i.trigger({type:"shown."+e,relatedTarget:o})})}}},i.prototype.activate=function(e,i,a){function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),n?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),a&&a()}var o=i.find("> .active"),n=a&&t.support.transition&&o.hasClass("fade");n?o.one(t.support.transition.end,s).emulateTransitionEnd(150):s(),o.removeClass("in")};var a=t.fn.tab;t.fn.tab=function(a){return this.each(function(){var s=t(this),o=s.data(e);o||s.data(e,o=new i(this)),"string"==typeof a&&o[a]()})},t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=a,this},t(document).on("click.zui.tab.data-api",'[data-toggle="tab"], [data-tab]',function(e){e.preventDefault(),t(this).tab("show")})}(window.jQuery),function(t,e){"use strict";var i=1200,a=992,s=768,o=e(t),n=function(){var t=o.width();e("html").toggleClass("screen-desktop",t>=a&&t<i).toggleClass("screen-desktop-wide",t>=i).toggleClass("screen-tablet",t>=s&&t<a).toggleClass("screen-phone",t<s).toggleClass("device-mobile",t<a).toggleClass("device-desktop",t>=a)},r="",l=navigator.userAgent;l.match(/(iPad|iPhone|iPod)/i)?r+=" os-ios":l.match(/android/i)?r+=" os-android":l.match(/Win/i)?r+=" os-windows":l.match(/Mac/i)?r+=" os-mac":l.match(/Linux/i)?r+=" os-linux":l.match(/X11/i)&&(r+=" os-unix"),"ontouchstart"in document.documentElement&&(r+=" is-touchable"),e("html").addClass(r),o.resize(n),n()}(window,jQuery),+function(t){"use strict";var e='[data-dismiss="alert"]',i="zui.alert",a=function(i){t(i).on("click",e,this.close)};a.prototype.close=function(e){function a(){n.trigger("closed."+i).remove()}var s=t(this),o=s.attr("data-target");o||(o=s.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,""));var n=t(o);e&&e.preventDefault(),n.length||(n=s.hasClass("alert")?s:s.parent()),n.trigger(e=t.Event("close."+i)),e.isDefaultPrevented()||(n.removeClass("in"),t.support.transition&&n.hasClass("fade")?n.one(t.support.transition.end,a).emulateTransitionEnd(150):a())};var s=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var s=t(this),o=s.data(i);o||s.data(i,o=new a(this)),"string"==typeof e&&o[e].call(s)})},t.fn.alert.Constructor=a,t.fn.alert.noConflict=function(){return t.fn.alert=s,this},t(document).on("click."+i+".data-api",e,a.prototype.close)}(window.jQuery),+function(t){"use strict";var e="zui.collapse",i=function(e,a){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,a),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var i=t.Event("show."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var a=this.$parent&&this.$parent.find(".in");if(a&&a.length){var s=a.data(e);if(s&&s.transitioning)return;a.collapse("hide"),s||a.data(e,null)}var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0),this.transitioning=1;var n=function(){this.$element.removeClass("collapsing").addClass("in")[o]("auto"),this.transitioning=0,this.$element.trigger("shown."+e)};if(!t.support.transition)return n.call(this);var r=t.camelCase(["scroll",o].join("-"));this.$element.one(t.support.transition.end,n.bind(this)).emulateTransitionEnd(350)[o](this.$element[0][r])}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var i=t.Event("hide."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var a=this.dimension();this.$element[a](this.$element[a]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var s=function(){this.transitioning=0,this.$element.trigger("hidden."+e).removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[a](0).one(t.support.transition.end,s.bind(this)).emulateTransitionEnd(350):s.call(this)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var a=t.fn.collapse;t.fn.collapse=function(a){return this.each(function(){var s=t(this),o=s.data(e),n=t.extend({},i.DEFAULTS,s.data(),"object"==typeof a&&a);o||s.data(e,o=new i(this,n)),"string"==typeof a&&o[a]()})},t.fn.collapse.Constructor=i,t.fn.collapse.noConflict=function(){return t.fn.collapse=a,this},t(document).on("click."+e+".data-api","[data-toggle=collapse]",function(i){var a,s=t(this),o=s.attr("data-target")||i.preventDefault()||(a=s.attr("href"))&&a.replace(/.*(?=#[^\s]+$)/,""),n=t(o),r=n.data(e),l=r?"toggle":s.data(),d=s.attr("data-parent"),h=d&&t(d);r&&r.transitioning||(h&&h.find('[data-toggle=collapse][data-parent="'+d+'"]').not(s).addClass("collapsed"),s[n.hasClass("in")?"addClass":"removeClass"]("collapsed")),n.collapse(l)})}(window.jQuery),+function(t){"use strict";function e(){t(s).remove(),t(o).each(function(e){var s=i(t(this));s.hasClass("open")&&(s.trigger(e=t.Event("hide."+a)),e.isDefaultPrevented()||s.removeClass("open").trigger("hidden."+a))})}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var a;try{a=i&&t(i)}catch(s){}return a&&a.length?a:e.parent()}var a="zui.dropdown",s=".dropdown-backdrop",o="[data-toggle=dropdown]",n=function(e){t(e).on("click."+a,this.toggle)};n.prototype.toggle=function(s){var o=t(this);if(!o.is(".disabled, :disabled")){var n=i(o),r=n.hasClass("open");if(e(),!r){if("ontouchstart"in document.documentElement&&!n.closest(".navbar-nav").length&&t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click",e),n.trigger(s=t.Event("show."+a)),s.isDefaultPrevented())return;n.toggleClass("open").trigger("shown."+a),o.focus()}return!1}},n.prototype.keydown=function(e){if(/(38|40|27)/.test(e.keyCode)){var a=t(this);if(e.preventDefault(),e.stopPropagation(),!a.is(".disabled, :disabled")){var s=i(a),n=s.hasClass("open");if(!n||n&&27==e.keyCode)return 27==e.which&&s.find(o).focus(),a.click();var r=t("[role=menu] li:not(.divider):visible a",s);if(r.length){var l=r.index(r.filter(":focus"));38==e.keyCode&&l>0&&l--,40==e.keyCode&&l<r.length-1&&l++,~l||(l=0),r.eq(l).focus()}}}};var r=t.fn.dropdown;t.fn.dropdown=function(e){return this.each(function(){var i=t(this),a=i.data("dropdown");a||i.data("dropdown",a=new n(this)),"string"==typeof e&&a[e].call(i)})},t.fn.dropdown.Constructor=n,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=r,this};var l=a+".data-api";t(document).on("click."+l,e).on("click."+l,".dropdown form",function(t){t.stopPropagation()}).on("click."+l,o,n.prototype.toggle).on("keydown."+l,o+", [role=menu]",n.prototype.keydown)}(window.jQuery),+function(t,e){"use strict";function i(e,i,o){return this.each(function(){var n=t(this),r=n.data(a),l=t.extend({},s.DEFAULTS,n.data(),"object"==typeof e&&e);r||n.data(a,r=new s(this,l)),"string"==typeof e?r[e](i,o):l.show&&r.show(i,o)})}var a="zui.modal",s=function(i,s){var o=this;o.options=s,o.$body=t(document.body),o.$element=t(i),o.$backdrop=o.isShown=null,o.scrollbarWidth=0,s.moveable===e&&(o.options.moveable=o.$element.hasClass("modal-moveable")),s.remote&&o.$element.find(".modal-content").load(s.remote,function(){o.$element.trigger("loaded."+a)}),s.scrollInside&&t(window).on("resize."+a,function(){o.isShown&&o.adjustPosition(e,100)})};s.VERSION="3.2.0",s.TRANSITION_DURATION=300,s.BACKDROP_TRANSITION_DURATION=150,s.DEFAULTS={backdrop:!0,keyboard:!0,show:!0,position:"fit"};var o=function(e,i){var a=t(window);i.left=Math.max(0,Math.min(i.left,a.width()-e.outerWidth())),i.top=Math.max(0,Math.min(i.top,a.height()-e.outerHeight())),e.css(i)};s.prototype.toggle=function(t,e){return this.isShown?this.hide():this.show(t,e)},s.prototype.adjustPosition=function(i,s){var n=this;if(clearTimeout(n.reposTask),s)return void(n.reposTask=setTimeout(n.adjustPosition.bind(n,i,0),s));var r=n.options;if(i===e&&(i=r.position),i!==e&&null!==i){"function"==typeof i&&(i=i(n));var l=n.$element.find(".modal-dialog"),d=t(window).height(),h={maxHeight:"initial",overflow:"visible"},c=l.find(".modal-body").css(h);if(r.scrollInside&&c.length){var u=r.headerHeight,p=r.footerHeight,f=l.find(".modal-header"),g=l.find(".modal-footer");"number"!=typeof u&&(u=f.length?f.outerHeight():"function"==typeof u?u(f):0),"number"!=typeof p&&(p=g.length?g.outerHeight():"function"==typeof p?p(g):0),h.maxHeight=d-u-p,h.overflow=c[0].scrollHeight>h.maxHeight?"auto":"visible",c.css(h)}var m=Math.max(0,(d-l.outerHeight())/2);if("fit"===i?i={top:m>50?Math.floor(2*m/3):m}:"center"===i?i={top:m}:t.isPlainObject(i)||(i={top:i}),l.hasClass("modal-moveable")){var v=null,b=r.rememberPos;b&&(b===!0?v=n.$element.data("modal-pos"):t.zui.store&&(v=t.zui.store.pageGet(a+".rememberPos."+b))),i=t.extend(i,{left:Math.max(0,(t(window).width()-l.outerWidth())/2)},v),"inside"===r.moveable?o(l,i):l.css(i)}else l.css(i)}},s.prototype.setMoveable=function(){t.fn.draggable||console.error("Moveable modal requires draggable.js.");var e=this,i=e.options,s=e.$element.find(".modal-dialog").removeClass("modal-dragged");s.toggleClass("modal-moveable",!!i.moveable),e.$element.data("modal-moveable-setup")||s.draggable({container:e.$element,handle:".modal-header",before:function(){var t=s.css("margin-top");t&&"0px"!==t&&s.css("top",t).css("margin-top","").addClass("modal-dragged")},finish:function(s){var o=i.rememberPos;o&&(e.$element.data("modal-pos",s.pos),t.zui.store&&o!==!0&&t.zui.store.pageSet(a+".rememberPos."+o,s.pos))},move:"inside"!==i.moveable||function(t){o(s,t)}})},s.prototype.show=function(e,i){var o=this,n=t.Event("show."+a,{relatedTarget:e});o.$element.trigger(n),o.$element.toggleClass("modal-scroll-inside",!!o.options.scrollInside),o.isShown||n.isDefaultPrevented()||(o.isShown=!0,o.options.moveable&&o.setMoveable(),o.options.backdrop!==!1&&(o.setScrollbar(),o.$body.addClass("modal-open")),o.escape(),o.$element.on("click.dismiss."+a,'[data-dismiss="modal"]',function(t){o.hide(),t.stopPropagation()}),o.backdrop(function(){var n=t.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),n&&o.$element[0].offsetWidth,o.$element.addClass("in").attr("aria-hidden",!1),o.adjustPosition(i),o.enforceFocus();var r=t.Event("shown."+a,{relatedTarget:e});n?o.$element.find(".modal-dialog").one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(r)}).emulateTransitionEnd(s.TRANSITION_DURATION):o.$element.trigger("focus").trigger(r)}))},s.prototype.hide=function(e){e&&e.preventDefault&&e.preventDefault();var i=this;e=t.Event("hide."+a),i.$element.trigger(e),i.isShown&&!e.isDefaultPrevented()&&(i.isShown=!1,i.options.backdrop!==!1&&(i.$body.removeClass("modal-open"),i.resetScrollbar()),i.escape(),t(document).off("focusin."+a),i.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss."+a),t.support.transition&&i.$element.hasClass("fade")?i.$element.one("bsTransitionEnd",i.hideModal.bind(i)).emulateTransitionEnd(s.TRANSITION_DURATION):i.hideModal())},s.prototype.enforceFocus=function(){t(document).off("focusin."+a).on("focusin."+a,function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")}.bind(this))},s.prototype.escape=function(){this.isShown&&this.options.keyboard?t(document).on("keydown.dismiss."+a,function(i){if(27==i.which){var s=t.Event("escaping."+a),o=this.$element.triggerHandler(s,"esc");if(o!=e&&!o)return;this.hide()}}.bind(this)):this.isShown||t(document).off("keydown.dismiss."+a)},s.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$element.trigger("hidden."+a)})},s.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},s.prototype.backdrop=function(e){var i=this,o=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var n=t.support.transition&&o;if(this.$backdrop=t('<div class="modal-backdrop '+o+'" />').appendTo(this.$body),this.$element.on("mousedown.dismiss."+a,function(t){t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))}.bind(this)),n&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;n?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var r=function(){i.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",r).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):r()}else e&&e()},s.prototype.setScrollbar=function(){t.zui.fixBodyScrollbar()&&this.options.onSetScrollbar&&this.options.onSetScrollbar()},s.prototype.resetScrollbar=function(){t.zui.resetBodyScrollbar(),this.options.onSetScrollbar&&this.options.onSetScrollbar("")},s.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var n=t.fn.modal;t.fn.modal=i,t.fn.modal.Constructor=s,t.fn.modal.noConflict=function(){return t.fn.modal=n,this},t(document).on("click."+a+".data-api",'[data-toggle="modal"]',function(e){var s=t(this),o=s.attr("href"),n=null;try{n=t(s.attr("data-target")||o&&o.replace(/.*(?=#[^\s]+$)/,""))}catch(r){return}if(n.length){var l=n.data(a)?"toggle":t.extend({remote:!/#/.test(o)&&o},n.data(),s.data());s.is("a")&&e.preventDefault(),n.one("show."+a,function(t){t.isDefaultPrevented()||n.one("hidden."+a,function(){s.is(":visible")&&s.trigger("focus")})}),i.call(n,l,this,s.data("position"))}})}(jQuery,void 0),function(t,e,i){"use strict";if(!t.fn.modal)throw new Error("Modal trigger requires modal.js");var a="zui.modaltrigger",s="ajax",o=".zui.modal",n="string",r=function(e,i){e=t.extend({},r.DEFAULTS,t.ModalTriggerDefaults,i?i.data():null,e),this.isShown,this.$trigger=i,this.options=e,this.id=t.zui.uuid(),e.show&&this.show()};r.DEFAULTS={type:"custom",height:"auto",name:"triggerModal",fade:!0,position:"fit",showHeader:!0,delay:0,backdrop:!0,keyboard:!0,waittime:0,loadingIcon:"icon-spinner-indicator",scrollInside:!1},r.prototype.initOptions=function(i){if(i.url&&(!i.type||i.type!=s&&"iframe"!=i.type)&&(i.type=s),i.remote)i.type=s,typeof i.remote===n&&(i.url=i.remote);else if(i.iframe)i.type="iframe",typeof i.iframe===n&&(i.url=i.iframe);else if(i.custom&&(i.type="custom",typeof i.custom===n)){var a;try{a=t(i.custom)}catch(o){}a&&a.length?i.custom=a:"function"==typeof e[i.custom]&&(i.custom=e[i.custom])}return i},r.prototype.init=function(e){var i=this,s=t("#"+e.name);s.length&&(i.isShown||s.off(o),s.remove()),s=t('<div id="'+e.name+'" class="modal modal-trigger '+(e.className||"")+'">'+("string"==typeof e.loadingIcon&&0===e.loadingIcon.indexOf("icon-")?'<div class="icon icon-spin loader '+e.loadingIcon+'"></div>':e.loadingIcon)+'<div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button class="close" data-dismiss="modal">×</button><h4 class="modal-title"><i class="modal-icon"></i> <span class="modal-title-name"></span></h4></div><div class="modal-body"></div></div></div></div>').appendTo("body").data(a,i);var n=function(t,i){var a=e[t];"function"==typeof a&&s.on(i+o,a)};n("onShow","show"),n("shown","shown"),n("onHide","hide"),n("hidden","hidden"),n("loaded","loaded"),s.on("shown"+o,function(){i.isShown=!0}).on("hidden"+o,function(){i.isShown=!1}),this.$modal=s,this.$dialog=s.find(".modal-dialog"),e.mergeOptions&&(this.options=e)},r.prototype.show=function(i){var o=this,l=t.extend({},r.DEFAULTS,o.options,{url:o.$trigger?o.$trigger.attr("href")||o.$trigger.attr("data-url")||o.$trigger.data("url"):o.options.url},i),d=o.isShown;l=o.initOptions(l),d||o.init(l);var h=o.$modal,c=h.find(".modal-dialog"),u=l.custom,p=c.find(".modal-body").css("padding","").toggleClass("load-indicator loading",!!d),f=c.find(".modal-header"),g=c.find(".modal-content");h.toggleClass("fade",l.fade).addClass(l.className).toggleClass("modal-loading",!d).toggleClass("modal-scroll-inside",!!l.scrollInside),c.toggleClass("modal-md","md"===l.size).toggleClass("modal-sm","sm"===l.size).toggleClass("modal-lg","lg"===l.size).toggleClass("modal-fullscreen","fullscreen"===l.size),f.toggle(l.showHeader),f.find(".modal-icon").attr("class","modal-icon icon-"+l.icon),f.find(".modal-title-name").text(l.title||""),l.size&&"fullscreen"===l.size&&(l.width="",l.height="");var m=function(){clearTimeout(this.resizeTask),this.resizeTask=setTimeout(function(){o.adjustPosition(l.position)},100)},v=function(t,e){return"undefined"==typeof t&&(t=l.delay),setTimeout(function(){c=h.find(".modal-dialog"),l.width&&"auto"!=l.width&&c.css("width",l.width),l.height&&"auto"!=l.height&&(c.css("height",l.height),"iframe"===l.type&&p.css("height",c.height()-f.outerHeight())),o.adjustPosition(l.position),h.removeClass("modal-loading").removeClass("modal-updating"),d&&p.removeClass("loading"),"iframe"!=l.type&&(p=c.off("resize."+a).find(".modal-body").off("resize."+a),l.scrollInside&&(p=p.children().off("resize."+a)),(p.length?p:c).on("resize."+a,m)),e&&e()},t)};if("custom"===l.type&&u)if("function"==typeof u){var b=u({modal:h,options:l,modalTrigger:o,ready:v});typeof b===n&&(p.html(b),v())}else u instanceof t?(p.html(t("<div>").append(u.clone()).html()),v()):(p.html(u),v());else if(l.url){var y=function(){var t=h.callComEvent(o,"broken");"string"==typeof t&&p.html(t),v()};if(h.attr("ref",l.url),"iframe"===l.type){h.addClass("modal-iframe"),this.firstLoad=!0;var w="iframe-"+l.name;f.detach(),p.detach(),g.empty().append(f).append(p),p.css("padding",0).html('<iframe id="'+w+'" name="'+w+'" src="'+l.url+'" frameborder="no" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" allowtransparency="true" scrolling="auto" style="width: 100%; height: 100%; left: 0px;"></iframe>'),l.waittime>0&&(o.waitTimeout=v(l.waittime,y));var _=document.getElementById(w);_.onload=_.onreadystatechange=function(i){var s=!!l.scrollInside;if(o.firstLoad&&h.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){o.firstLoad=!1,l.waittime>0&&clearTimeout(o.waitTimeout);try{h.attr("ref",_.contentWindow.location.href);var n=e.frames[w].$;if(n&&"auto"===l.height&&"fullscreen"!=l.size){var r=n("body").addClass("body-modal").toggleClass("body-modal-scroll-inside",s);l.iframeBodyClass&&r.addClass(l.iframeBodyClass);var d=[],c=function(i){h.removeClass("fade");var a=r.outerHeight();if(i===!0&&l.onlyIncreaseHeight&&(a=Math.max(a,p.data("minModalHeight")||0),p.data("minModalHeight",a)),s){var o=l.headerHeight;"number"!=typeof o?o=f.outerHeight():"function"==typeof o&&(o=o(f));var n=t(e).height();a=Math.min(a,n-o)}for(d.length>1&&a===d[0]&&(a=Math.max(a,d[1])),d.push(a);d.length>2;)d.shift();p.css("height",a),l.fade&&h.addClass("fade"),v()};h.callComEvent(o,"loaded",{modalType:"iframe",jQuery:n}),setTimeout(c,100),r.off("resize."+a).on("resize."+a,c),s&&t(e).off("resize."+a).on("resize."+a,c)}else v();var u=l.handleLinkInIframe;u&&n("body").on("click","string"==typeof u?u:"a[href]",function(){t(this).is('[data-toggle="modal"]')||h.addClass("modal-updating")}),l.iframeStyle&&n("head").append("<style>"+l.iframeStyle+"</style>")}catch(i){v()}}}}else t.ajax(t.extend({url:l.url,success:function(i){try{var n=t(i);n.filter(".modal-dialog").length?c.parent().empty().append(n):n.filter(".modal-content").length?c.find(".modal-content").replaceWith(n):p.wrapInner(n)}catch(r){e.console&&e.console.warn&&console.warn("ZUI: Cannot recogernize remote content.",{error:r,data:i}),h.html(i)}h.callComEvent(o,"loaded",{modalType:s}),v(),l.scrollInside&&t(e).off("resize."+a).on("resize."+a,m)},error:y},l.ajaxOptions))}d||h.modal({show:"show",backdrop:l.backdrop,moveable:l.moveable,rememberPos:l.rememberPos,keyboard:l.keyboard,scrollInside:l.scrollInside})},r.prototype.close=function(t,i){var a=this;(t||i)&&a.$modal.on("hidden"+o,function(){"function"==typeof t&&t(),typeof i===n&&i.length&&!a.$modal.data("cancel-reload")&&("this"===i?e.location.reload():e.location=i);
}),a.$modal.modal("hide")},r.prototype.toggle=function(t){this.isShown?this.close():this.show(t)},r.prototype.adjustPosition=function(t){t=t===i?this.options.position:t,"function"==typeof t&&(t=t(this)),this.$modal.modal("adjustPosition",t)},t.zui({ModalTrigger:r,modalTrigger:new r}),t.fn.modalTrigger=function(e,i){return t(this).each(function(){var s=t(this),o=s.data(a),l=t.extend({title:s.attr("title")||s.text(),url:s.attr("href"),type:s.hasClass("iframe")?"iframe":""},s.data(),t.isPlainObject(e)&&e);return o?void(typeof e==n?o[e](i):l.show&&o.show(i)):(s.data(a,o=new r(l,s)),void s.on((l.trigger||"click")+".toggle."+a,function(e){l=t.extend(l,{url:s.attr("href")||s.attr("data-url")||s.data("url")||l.url}),o.toggle(l),s.is("a")&&e.preventDefault()}))})};var l=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var a=t(this);a.hasClass("modal")?l.call(a,e,i):a.modalTrigger(e,i)})},t.fn.modal.bs=l;var d=function(e){return e?e=t(e):(e=t(".modal.modal-trigger"),!e.length),e&&e instanceof t?e:null},h=function(i,s,o){var n=i;if("function"==typeof i){var r=o;o=s,s=i,i=r}i=d(i),i&&i.length?i.each(function(){t(this).data(a).close(s,o)}):t("body").hasClass("modal-open")||t(".modal.in").length||t("body").hasClass("body-modal")&&e.parent.$.zui.closeModal(n,s,o)},c=function(t,e){e=d(e),e&&e.length&&e.modal("adjustPosition",t)},u=function(e,i){"string"==typeof e&&(e={url:e});var s=d(i);s&&s.length&&s.each(function(){t(this).data(a).show(e)})};t.zui({reloadModal:u,closeModal:h,ajustModalPosition:c,adjustModalPosition:c}),t(document).on("click."+a+".data-api",'[data-toggle="modal"]',function(e){var i=t(this),s=i.attr("href"),o=null;try{o=t(i.attr("data-target")||s&&s.replace(/.*(?=#[^\s]+$)/,""))}catch(n){}o&&o.length||(i.data(a)?i.trigger(".toggle."+a):i.modalTrigger({show:!0})),i.is("a")&&e.preventDefault()}).on("click."+a+".data-api",'[data-dismiss="modal"]',function(){t.zui.closeModal()})}(window.jQuery,window,void 0),+function(t){"use strict";var e=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",t,e)};e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,a){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(a);for(var s=this.options.trigger.split(" "),o=s.length;o--;){var n=s[o];if("click"==n)this.$element.on("click."+this.type,this.options.selector,this.toggle.bind(this));else if("manual"!=n){var r="hover"==n?"mouseenter":"focus",l="hover"==n?"mouseleave":"blur";this.$element.on(r+"."+this.type,this.options.selector,this.enter.bind(this)),this.$element.on(l+"."+this.type,this.options.selector,this.leave.bind(this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,a){i[t]!=a&&(e[t]=a)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},e.prototype.show=function(e){var i=t.Event("show.zui."+this.type);if((e||this.hasContent())&&this.enabled){var a=this;if(a.$element.trigger(i),i.isDefaultPrevented())return;var s=a.tip();a.setContent(e),a.options.animation&&s.addClass("fade");var o="function"==typeof a.options.placement?a.options.placement.call(a,s[0],a.$element[0]):a.options.placement,n=/\s?auto?\s?/i,r=n.test(o);r&&(o=o.replace(n,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(o),a.options.container?s.appendTo(a.options.container):s.insertAfter(a.$element);var l=a.getPosition(),d=s[0].offsetWidth,h=s[0].offsetHeight;if(r){var c=a.$element.parent(),u=o,p=document.documentElement.scrollTop||document.body.scrollTop,f="body"==a.options.container?window.innerWidth:c.outerWidth(),g="body"==a.options.container?window.innerHeight:c.outerHeight(),m="body"==a.options.container?0:c.offset().left;o="bottom"==o&&l.top+l.height+h-p>g?"top":"top"==o&&l.top-p-h<0?"bottom":"right"==o&&l.right+d>f?"left":"left"==o&&l.left-d<m?"right":o,s.removeClass(u).addClass(o)}var v=a.getCalculatedOffset(o,l,d,h);a.applyPlacement(v,o);var b=function(){var t=a.hoverState;a.$element.trigger("shown.zui."+a.type),a.hoverState=null,"out"==t&&a.leave(a)};t.support.transition&&a.$tip.hasClass("fade")?s.one("bsTransitionEnd",b).emulateTransitionEnd(150):b()}},e.prototype.applyPlacement=function(t,e){var i,a=this.tip(),s=a[0].offsetWidth,o=a[0].offsetHeight,n=parseInt(a.css("margin-top"),10),r=parseInt(a.css("margin-left"),10);isNaN(n)&&(n=0),isNaN(r)&&(r=0),t.top=t.top+n,t.left=t.left+r,a.offset(t).addClass("in");var l=a[0].offsetWidth,d=a[0].offsetHeight;if("top"==e&&d!=o&&(i=!0,t.top=t.top+o-d),/bottom|top/.test(e)){var h=0;t.left<0&&(h=t.left*-2,t.left=0,a.offset(t),l=a[0].offsetWidth,d=a[0].offsetHeight),this.replaceArrow(h-s+l,l,"left")}else this.replaceArrow(d-o,d,"top");i&&a.offset(t)},e.prototype.replaceArrow=function(t,e,i){this.arrow().css(i,t?50*(1-t/e)+"%":"")},e.prototype.setContent=function(t){var e=this.tip(),i=t||this.getTitle();this.options.tipId&&e.attr("id",this.options.tipId),this.options.tipClass&&e.addClass(this.options.tipClass),e.find(".tooltip-inner")[this.options.html?"html":"text"](i),e.removeClass("fade in top bottom left right")},e.prototype.hide=function(){function e(){"in"!=i.hoverState&&a.detach()}var i=this,a=this.tip(),s=t.Event("hide.zui."+this.type);if(this.$element.trigger(s),!s.isDefaultPrevented())return a.removeClass("in"),t.support.transition&&this.$tip.hasClass("fade")?a.one(t.support.transition.end,e).emulateTransitionEnd(150):e(),this.$element.trigger("hidden.zui."+this.type),this},e.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},e.prototype.hasContent=function(){return this.getTitle()},e.prototype.getPosition=function(){var e=this.$element[0];return t.extend({},"function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{width:e.offsetWidth,height:e.offsetHeight},this.$element.offset())},e.prototype.getCalculatedOffset=function(t,e,i,a){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-a,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-a/2,left:e.left-i}:{top:e.top+e.height/2-a/2,left:e.left+e.width}},e.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},e.prototype.tip=function(){return this.$tip=this.$tip||t(this.options.template)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},e.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1},e.prototype.toggleEnabled=function(){this.enabled=!this.enabled},e.prototype.toggle=function(e){var i=e?t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type):this;i.tip().hasClass("in")?i.leave(i):i.enter(i)},e.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("zui."+this.type)};var i=t.fn.tooltip;t.fn.tooltip=function(i,a){return this.each(function(){var s=t(this),o=s.data("zui.tooltip"),n="object"==typeof i&&i;o||s.data("zui.tooltip",o=new e(this,n)),"string"==typeof i&&o[i](a)})},t.fn.tooltip.Constructor=e,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=i,this}}(window.jQuery),+function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");e.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTarget();if(e)return e.find(".arrow").length<1&&t.addClass("no-arrow"),void t.html(e.html());var i=this.getTitle(),a=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](a),t.removeClass("fade top bottom left right in"),this.options.tipId&&t.attr("id",this.options.tipId),this.options.tipClass&&t.addClass(this.options.tipClass),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.getTarget=function(){var e=this.$element,i=this.options,a=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return!!a&&("$next"==a?e.next(".popover"):t(a))},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},e.prototype.tip=function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip};var i=t.fn.popover;t.fn.popover=function(i){return this.each(function(){var a=t(this),s=a.data("zui.popover"),o="object"==typeof i&&i;s||a.data("zui.popover",s=new e(this,o)),"string"==typeof i&&s[i]()})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(window.jQuery),/*! TangBin: image.ready.js http://www.planeart.cn/?p=1121 */
function(t){"use strict";t.zui.imgReady=function(){var t=[],e=null,i=function(){for(var e=0;e<t.length;e++)t[e].end?t.splice(e--,1):t[e]();!t.length&&a()},a=function(){clearInterval(e),e=null};return function(a,s,o,n){var r,l,d,h,c,u=new Image;return u.src=a,u.complete?(s.call(u),void(o&&o.call(u))):(l=u.width,d=u.height,u.onerror=function(){n&&n.call(u),r.end=!0,u=u.onload=u.onerror=null},r=function(){h=u.width,c=u.height,(h!==l||c!==d||h*c>1024)&&(s.call(u),r.end=!0)},r(),u.onload=function(){!r.end&&r(),o&&o.call(u),u=u.onload=u.onerror=null},void(r.end||(t.push(r),null===e&&(e=setInterval(i,40)))))}}()}(jQuery),function(t,e,i){"use strict";if(!t.fn.modalTrigger)throw new Error("modal & modalTrigger requires for lightbox");if(!t.zui.imgReady)throw new Error("imgReady requires for lightbox");var a=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};a.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>'},a.prototype.getOptions=function(e){var i="image";return e=t.extend({},a.DEFAULTS,this.$.data(),e),e[i]||(e[i]=this.$.attr("src")||this.$.attr("href")||this.$.find("img").attr("src"),this.$.data(i,e[i])),e},a.prototype.init=function(){this.bindEvents()},a.prototype.initGroups=function(){var e=this.$.data("groups");e||(e=t('[data-toggle="lightbox"][data-group="'+this.options.group+'"], [data-lightbox-group="'+this.options.group+'"]'),this.$.data("groups",e),e.each(function(e){t(this).attr("data-group-index",e)})),this.groups=e,this.groupIndex=parseInt(this.$.data("group-index"))},a.prototype.setImage=function(t,e){void 0!==t&&(this.options.image=t),void 0!==e&&(this.options.caption=e)},a.prototype.show=function(t,e){this.setImage(t,e),this.$.triggerHandler("click")},a.prototype.bindEvents=function(){var a=this.$,s=this,o=this.options;return!!o.image&&void a.modalTrigger({type:"custom",name:"lightboxModal",position:"center",custom:function(a){s.initGroups();var n=a.modal,r=s.groups,l=s.groupIndex;n.addClass("modal-lightbox").html(o.modalTeamplate.format(o)).toggleClass("lightbox-with-caption","string"==typeof o.caption).removeClass("lightbox-full").data("group-index",l);var d=n.find(".modal-dialog"),h=t(e).width();t.zui.imgReady(o.image,function(){d.css({width:i.min(h,this.width)}),h<this.width+30&&n.addClass("lightbox-full"),a.ready(200)}),n.find(".prev").toggleClass("show",r.filter('[data-group-index="'+(l-1)+'"]').length>0),n.find(".next").toggleClass("show",r.filter('[data-group-index="'+(l+1)+'"]').length>0),n.find(".controller").click(function(){var s=t(this),o=n.data("group-index")+(s.hasClass("prev")?-1:1),l=r.filter('[data-group-index="'+o+'"]');if(l.length){var c=l.data("image"),u=l.data("caption");n.addClass("modal-loading").data("group-index",o).toggleClass("lightbox-with-caption","string"==typeof u).removeClass("lightbox-full"),n.find(".lightbox-img").attr("src",c),n.find(".caption > .content").text(u),h=t(e).width(),t.zui.imgReady(c,function(){d.css({width:i.min(h,this.width)}),h<this.width+30&&n.addClass("lightbox-full"),a.ready()})}return n.find(".prev").toggleClass("show",r.filter('[data-group-index="'+(o-1)+'"]').length>0),n.find(".next").toggleClass("show",r.filter('[data-group-index="'+(o+1)+'"]').length>0),!1})}})},t.fn.lightbox=function(e){var i="group"+(new Date).getTime();return this.each(function(){var s=t(this),o="object"==typeof e&&e;"object"==typeof o&&o.group?s.attr("data-lightbox-group",o.group):s.data("group")?s.attr("data-lightbox-group",s.data("group")):s.attr("data-lightbox-group",i),s.data("group",s.data("lightbox-group"));var n=s.data("zui.lightbox");n||s.data("zui.lightbox",n=new a(this,o)),"string"==typeof e&&n[e]()})},t.fn.lightbox.Constructor=a,t(function(){t('[data-toggle="lightbox"]').lightbox()})}(jQuery,window,Math),/*! bootbox.js v4.4.0 http://bootboxjs.com/license.txt */
function(t,e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):t.bootbox=e(t.jQuery)}(this,function t(e,i){"use strict";function a(t){var i=e.zui&&e.zui.getLangData?e.zui.getLangData("bootbox",f.locale,m):m[f.locale];return i?i[t]:m.en[t]}function s(t,e,i){t.stopPropagation(),t.preventDefault();var a="function"==typeof i&&i.call(e,t)===!1;a||e.modal("hide")}function o(t){var e,i=0;for(e in t)i++;return i}function n(t,i){var a=0;e.each(t,function(t,e){i(t,e,a++)})}function r(t){var i,a;if("object"!=typeof t)throw new Error("Please supply an object of options");if(!t.message)throw new Error("Please specify a message");return t=e.extend({},f,t),t.buttons||(t.buttons={}),i=t.buttons,a=o(i),n(i,function(t,s,o){if("function"==typeof s&&(s=i[t]={callback:s}),"object"!==e.type(s))throw new Error("button with key "+t+" must be an object");s.label||(s.label=t),s.className||(2===a&&("ok"===t||"confirm"===t)||1===a?s.className="btn-primary":s.className="btn-default")}),t}function l(t,e){var i=t.length,a={};if(i<1||i>2)throw new Error("Invalid argument length");return 2===i||"string"==typeof t[0]?(a[e[0]]=t[0],a[e[1]]=t[1]):a=t[0],a}function d(t,i,a){return e.extend(!0,{},t,l(i,a))}function h(t,e,i,a){var s={className:"bootbox-"+t,buttons:c.apply(null,e)};return u(d(s,a,i),e)}function c(){for(var t={},e=0,i=arguments.length;e<i;e++){var s=arguments[e],o=s.toLowerCase(),n=s.toUpperCase();t[o]={label:a(n)}}return t}function u(t,e){var a={};return n(e,function(t,e){a[e]=!0}),n(t.buttons,function(t){if(a[t]===i)throw new Error("button key "+t+" is not allowed (options are "+e.join("\n")+")")}),t}var p={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'>×</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' />"}},f={locale:e.zui&&e.zui.clientLang?e.zui.clientLang():"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},g={};g.alert=function(){var t;if(t=h("alert",["ok"],["message","callback"],arguments),t.callback&&"function"!=typeof t.callback)throw new Error("alert requires callback property to be a function when provided");return t.buttons.ok.callback=t.onEscape=function(){return"function"!=typeof t.callback||t.callback.call(this)},g.dialog(t)},g.confirm=function(){var t;if(t=h("confirm",["confirm","cancel"],["message","callback"],arguments),t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,!1)},t.buttons.confirm.callback=function(){return t.callback.call(this,!0)},"function"!=typeof t.callback)throw new Error("confirm requires a callback");return g.dialog(t)},g.prompt=function(){var t,a,s,o,r,l,h;if(o=e(p.form),a={className:"bootbox-prompt",buttons:c("cancel","confirm"),value:"",inputType:"text"},t=u(d(a,arguments,["title","callback"]),["confirm","cancel"]),l=t.show===i||t.show,t.message=o,t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,null)},t.buttons.confirm.callback=function(){var i;switch(t.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":i=r.val();break;case"checkbox":var a=r.find("input:checked");i=[],n(a,function(t,a){i.push(e(a).val())})}return t.callback.call(this,i)},t.show=!1,!t.title)throw new Error("prompt requires a title");if("function"!=typeof t.callback)throw new Error("prompt requires a callback");if(!p.inputs[t.inputType])throw new Error("invalid prompt type");switch(r=e(p.inputs[t.inputType]),t.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":r.val(t.value);break;case"select":var f={};if(h=t.inputOptions||[],!Array.isArray(h))throw new Error("Please pass an array of input options");if(!h.length)throw new Error("prompt with select requires options");n(h,function(t,a){var s=r;if(a.value===i||a.text===i)throw new Error("given options in wrong format");a.group&&(f[a.group]||(f[a.group]=e("<optgroup/>").attr("label",a.group)),s=f[a.group]),s.append("<option value='"+a.value+"'>"+a.text+"</option>")}),n(f,function(t,e){r.append(e)}),r.val(t.value);break;case"checkbox":var m=Array.isArray(t.value)?t.value:[t.value];if(h=t.inputOptions||[],!h.length)throw new Error("prompt with checkbox requires options");if(!h[0].value||!h[0].text)throw new Error("given options in wrong format");r=e("<div/>"),n(h,function(i,a){var s=e(p.inputs[t.inputType]);s.find("input").attr("value",a.value),s.find("label").append(a.text),n(m,function(t,e){e===a.value&&s.find("input").prop("checked",!0)}),r.append(s)})}return t.placeholder&&r.attr("placeholder",t.placeholder),t.pattern&&r.attr("pattern",t.pattern),t.maxlength&&r.attr("maxlength",t.maxlength),o.append(r),o.on("submit",function(t){t.preventDefault(),t.stopPropagation(),s.find(".btn-primary").click()}),s=g.dialog(t),s.off("shown.zui.modal"),s.on("shown.zui.modal",function(){r.focus()}),l===!0&&s.modal("show"),s},g.dialog=function(t){t=r(t);var a=e(p.dialog),o=a.find(".modal-dialog"),l=a.find(".modal-body"),d=t.buttons,h="",c={onEscape:t.onEscape};if(e.fn.modal===i)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");if(n(d,function(t,e){h+="<button data-bb-handler='"+t+"' type='button' class='btn "+e.className+"'>"+e.label+"</button>",c[t]=e.callback}),l.find(".bootbox-body").html(t.message),t.animate===!0&&a.addClass("fade"),t.className&&a.addClass(t.className),"large"===t.size?o.addClass("modal-lg"):"small"===t.size&&o.addClass("modal-sm"),t.title&&l.before(p.header),t.closeButton){var u=e(p.closeButton);t.title?a.find(".modal-header").prepend(u):u.css("margin-top","-10px").prependTo(l)}return t.title&&a.find(".modal-title").html(t.title),h.length&&(l.after(p.footer),a.find(".modal-footer").html(h)),a.on("hidden.zui.modal",function(t){t.target===this&&a.remove()}),a.on("shown.zui.modal",function(){a.find(".btn-primary:first").focus()}),"static"!==t.backdrop&&a.on("click.dismiss.zui.modal",function(t){a.children(".modal-backdrop").length&&(t.currentTarget=a.children(".modal-backdrop").get(0)),t.target===t.currentTarget&&a.trigger("escape.close.bb")}),a.on("escape.close.bb",function(t){c.onEscape&&s(t,a,c.onEscape)}),a.on("click",".modal-footer button",function(t){var i=e(this).data("bb-handler");s(t,a,c[i])}),a.on("click",".bootbox-close-button",function(t){s(t,a,c.onEscape)}),a.on("keyup",function(t){27===t.which&&a.trigger("escape.close.bb")}),e(t.container).append(a),a.modal({backdrop:!!t.backdrop&&"static",keyboard:!1,show:!1}),t.show&&a.modal("show"),a},g.setDefaults=function(){var t={};2===arguments.length?t[arguments[0]]=arguments[1]:t=arguments[0],e.extend(f,t)},g.hideAll=function(){return e(".bootbox").modal("hide"),g};var m={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"Confirm"},zh_cn:{OK:"确认",CANCEL:"取消",CONFIRM:"确认"},zh_tw:{OK:"確認",CANCEL:"取消",CONFIRM:"確認"}};return g.addLocale=function(t,i){return e.each(["OK","CANCEL","CONFIRM"],function(t,e){if(!i[e])throw new Error("Please supply a translation for '"+e+"'")}),m[t]={OK:i.OK,CANCEL:i.CANCEL,CONFIRM:i.CONFIRM},g},g.removeLocale=function(t){return delete m[t],g},g.setLocale=function(t){return g.setDefaults("locale",t)},g.init=function(i){return t(i||e)},g}),/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
Version 1.1.0
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
*/
function(){var t,e,i,a,s,o={}.hasOwnProperty,n=function(t,e){function i(){this.constructor=t}for(var a in e)o.call(e,a)&&(t[a]=e[a]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}},l={};a=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,a,s,o,n,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),n=e.childNodes,r=[],s=0,o=n.length;s<o;s++)a=n[s],r.push(this.add_option(a,i,e.disabled));return r},e.prototype.add_option=function(e,i,a){if("OPTION"===e.nodeName.toUpperCase())return""!==e.text?(null!=i&&(this.parsed[i].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,title:e.title,html:e.innerHTML,selected:e.selected,disabled:a===!0?a:e.disabled,group_array_index:i,classes:e.className,style:e.style.cssText,data:e.getAttribute("data-data"),search_keys:(t.trim(e.getAttribute("data-keys")||"")+e.value).replace(/,/," ")})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},e.prototype.escapeExpression=function(t){var e,i;return null==t||t===!1?"":/[\&\<\>\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&"})):t},e}(),a.select_to_array=function(t){var e,i,s,o,n;for(i=new a,n=t.childNodes,s=0,o=n.length;s<o;s++)e=n[s],i.add_node(e);return i.parsed},e=function(){function e(i,a){if(this.form_field=i,this.options=t.extend({},l,null!=a?a:{}),e.browser_is_supported()){var s=this.options.lang||t.zui.clientLang?t.zui.clientLang():"en",o=t.zui.clientLang?t.zui.clientLang():"en";t.isPlainObject(s)?this.lang=t.zui.getLangData?t.zui.getLangData("chosen",o,r):t.extend(s,r.en,r[o]):this.lang=t.zui.getLangData?t.zui.getLangData("chosen",s,r):r[s||o]||r.en,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 e.prototype.set_default_values=function(){var t=this,e=t.options;t.click_test_action=function(e){return t.test_active_click(e)},t.activate_action=function(e){return t.activate_field(e)},t.active_field=!1,t.mouse_on_container=!1,t.results_showing=!1,t.result_highlighted=null,t.allow_single_deselect=null!=e.allow_single_deselect&&null!=this.form_field.options[0]&&""===t.form_field.options[0].text&&e.allow_single_deselect,t.disable_search_threshold=e.disable_search_threshold||0,t.disable_search=e.disable_search||!1,t.enable_split_word_search=null==e.enable_split_word_search||e.enable_split_word_search,t.group_search=null==e.group_search||e.group_search,t.search_contains=e.search_contains||!1,t.single_backstroke_delete=null==e.single_backstroke_delete||e.single_backstroke_delete,t.max_selected_options=e.max_selected_options||1/0,t.drop_direction=e.drop_direction||"auto",t.drop_item_height=void 0!==e.drop_item_height?e.drop_item_height:25,t.max_drop_height=void 0!==e.max_drop_height?e.max_drop_height:240,t.middle_highlight=e.middle_highlight,t.compact_search=e.compact_search||!1,t.inherit_select_classes=e.inherit_select_classes||!1,t.display_selected_options=null==e.display_selected_options||e.display_selected_options,t.sort_value_splitter=e.sort_value_spliter||e.sort_value_splitter||",",t.sort_field=e.sort_field;var i=e.max_drop_width;return"string"==typeof i&&i.indexOf("px")===i.length-2&&(i=parseInt(i.substring(0,i.length-2))),t.max_drop_width=i,t.display_disabled_options=null==e.display_disabled_options||e.display_disabled_options},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||e.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||e.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||this.lang.no_results_text||e.default_no_result_text},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(t){var e=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return e.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(t){var e=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return e.blur_test()},100)},e.prototype.results_option_build=function(e){var i,a,s,o,n;i="",n=this.results_data;var r=e&&e.first?[]:null;for(s=0,o=n.length;s<o;s++)a=n[s],i+=a.group?this.result_add_group(a):this.result_add_option(a),r&&a.selected&&r.push(a);if(r){var l,d;if(this.sort_field&&this.is_multiple){l=t(this.sort_field);var h=l.val();if(d="string"==typeof h&&h.length?h.split(this.sort_value_splitter):[],d.length){var c={};for(s=0;s<d.length;++s)c[d[s]]=s;r.sort(function(t,e){var i=c[t.value],a=c[e.value];return void 0===i&&(i=0),void 0===a&&(a=0),i-a})}}for(d=[],s=0;s<r.length;++s)a=r[s],this.is_multiple?(this.choice_build(a),d.push(a.value)):this.single_set_selected_text(a.text);l&&l.length&&l.val(d.join(this.sort_value_splitter))}return i},e.prototype.result_add_option=function(t){var e,i;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),i=document.createElement("li"),i.className=e.join(" "),i.style.cssText=t.style,i.title=t.title,i.setAttribute("data-option-array-index",t.array_index),i.setAttribute("data-data",t.data),i.innerHTML=t.search_text,this.outerHTML(i)):""},e.prototype.result_add_group=function(t){var e;return(t.search_match||t.group_match)&&t.active_options>0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing&&(this.winnow_results(),this.autoResizeDrop())},e.prototype.reset_single_select_options=function(){var t,e,i,a,s;for(a=this.results_data,s=[],e=0,i=a.length;e<i;e++)t=a[e],t.selected?s.push(t.selected=!1):s.push(void 0);return s},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(t){return this.results_showing?this.winnow_results(1):this.results_show()},e.prototype.winnow_results=function(t){var e,i,a,s,o,n,r,l,d,h,c,u,p;for(this.no_results_clear(),o=0,r=this.get_search_text(),e=r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),s=this.search_contains?"":"^",a=new RegExp(s+e,"i"),h=new RegExp(e,"i"),p=this.results_data,c=0,u=p.length;c<u;c++)i=p[c],i.search_match=!1,n=null,this.include_option_in_results(i)&&(i.group&&(i.group_match=!1,i.active_options=0),null!=i.group_array_index&&this.results_data[i.group_array_index]&&(n=this.results_data[i.group_array_index],0===n.active_options&&n.search_match&&(o+=1),n.active_options+=1),i.group&&!this.group_search||(i.search_text=i.group?i.label:i.html,i.search_keys_match=this.search_string_match(i.search_keys,a),i.search_text_match=this.search_string_match(i.search_text,a),i.search_match=i.search_text_match||i.search_keys_match,i.search_match&&!i.group&&(o+=1),i.search_match?(i.search_text_match&&i.search_text.length?(l=i.search_text.search(h),d=i.search_text.substr(0,l+r.length)+"</em>"+i.search_text.substr(l+r.length),i.search_text=d.substr(0,l)+"<em>"+d.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(h),d=i.search_keys.substr(0,l+r.length)+"</em>"+i.search_keys.substr(l+r.length),i.search_text+=' <small style="opacity: 0.7">'+d.substr(0,l)+"<em>"+d.substr(l)+"</small>"),null!=n&&(n.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),o<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,a,s,o;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(a=t.replace(/\[|\]/g,"").split(" "),a.length))for(s=0,o=a.length;s<o;s++)if(i=a[s],e.test(i))return!0},e.prototype.choices_count=function(){var t,e,i,a;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,a=this.form_field.options,e=0,i=a.length;e<i;e++)t=a[e],t.selected&&""!=t.value&&(this.selected_option_count+=1);return this.selected_option_count},e.prototype.choices_click=function(t){if(t.preventDefault(),!this.results_showing&&!this.is_disabled)return this.results_show()},e.prototype.keyup_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),e){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(t.preventDefault(),this.results_showing)return this.result_select(t);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()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field&&this.form_field.classList&&this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(a){return e.browser_is_supported()?this.each(function(e){var s=t(this),o=s.data("chosen");"destroy"===a&&o?o.destroy():o||s.data("chosen",new i(this,t.extend({},s.data(),a)))}):this}}),i=function(e){function i(){return s=i.__super__.constructor.apply(this,arguments)}return n(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var a=this.form_field.getAttribute("data-css-class");return a&&e.push(a),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("<div />",i),this.is_multiple?this.container.html('<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>'):(this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div><div class="chosen-search"><input type="text" autocomplete="off" /></div></a><div class="chosen-drop"><ul class="chosen-results"></ul></div>'),this.compact_search?this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")):this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")),this.options.highlight_selected!==!1&&this.container.addClass("chosen-highlight-selected")),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.max_drop_width&&this.dropdown.addClass("chosen-auto-max-width"),this.options.no_wrap&&this.dropdown.addClass("chosen-no-wrap"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(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()},i.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))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(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()},i.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()},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=a.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.container.removeClass("chosen-with-search")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"),this.container.addClass("chosen-with-search"))),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},i.prototype.result_do_highlight=function(t,e){if(t.length){var i,a,s,o,n,r,l=-1;this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),s=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),n=this.search_results.scrollTop(),o=s+n,a=this.result_highlight.position().top+this.search_results.scrollTop(),i=a+r,this.middle_highlight&&(e||"always"===this.middle_highlight)?l=Math.min(a-r,Math.max(0,a-(s-r)/2)):i>=o?l=i-s>0?i-s:0:a<n&&(l=a),l>-1?this.search_results.scrollTop(l):this.result_highlight.scrollIntoView&&this.result_highlight.scrollIntoView()}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e=this;if(e.is_multiple&&e.max_selected_options<=e.choices_count())return e.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;e.results_showing=!0,e.search_field.focus(),e.search_field.val(e.search_field.val()),e.container.addClass("chosen-with-drop"),e.winnow_results(1);var i=e.drop_direction;if("function"==typeof i&&(i=i.call(this)),"auto"===i)if(e.drop_directionFixed)i=e.drop_directionFixed;else{var a=e.container.find(".chosen-drop"),s=a.outerHeight();e.drop_item_height&&s<e.max_drop_height&&(s=Math.min(e.max_drop_height,a.find(".chosen-results>.active-result").length*e.drop_item_height));var o=e.container.offset();o.top+s+30>t(window).height()+t(window).scrollTop()&&(i="up"),e.drop_directionFixed=i}return e.container.toggleClass("chosen-up","up"===i),e.autoResizeDrop(),e.form_field_jq.trigger("chosen:showing_dropdown",{chosen:e})},i.prototype.autoResizeDrop=function(){var e=this,i=e.max_drop_width;if(i){var a=e.container.find(".chosen-drop");a.removeClass("in");var s=0,o=a.find(".chosen-results"),n=o.children("li"),r=parseFloat(o.css("padding-left").replace("px","")),l=parseFloat(o.css("padding-right").replace("px","")),d=(isNaN(r)?0:r)+(isNaN(l)?0:l);n.each(function(){s=Math.max(s,t(this).outerWidth())}),a.css("width",Math.min(s+d+20,i)),e.fixDropWidthTimer=setTimeout(function(){e.fixDropWidthTimer=null,a.addClass("in"),e.winnow_results_set_highlight(1)},50)}},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){var t=this;return t.fixDropWidthTimer&&(clearTimeout(t.fixDropWidthTimer),t.fixDropWidthTimer=null),t.results_showing&&(t.result_clear_highlight(),t.container.removeClass("chosen-with-drop"),t.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:t}),t.drop_directionFixed=0),t.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.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"))},i.prototype.search_results_mouseup=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(e),this.search_field.focus()},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,a,s=this;return i=t("<li />",{"class":"search-choice"}).html("<span title='"+e.html+"'>"+e.html+"</span>"),e.disabled?i.addClass("search-choice-disabled"):(a=t("<a />",{"class":"search-choice-close","data-option-array-index":e.array_index}),a.bind("click.chosen",function(t){return s.choice_destroy_link_click(t)}),i.append(a)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){var t=this.form_field_jq.val();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();var e=this.form_field_jq.val(),i={selected:e};if(t===e||e.length||(i.deselected=t),this.form_field_jq.trigger("change",i),this.sync_sort_field(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=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?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.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[i.options_index].value}),this.sync_sort_field()),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.compact_search&&this.search_field.attr("placeholder",t),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.sync_sort_field=function(){var e=this;if(e.is_multiple&&e.sort_field){var i=t(e.sort_field);if(!i.length)return;var a=[];e.search_choices.find("li.search-choice").each(function(){var i=t(this),s=i.children(".search-choice-close").first().data("optionArrayIndex"),o=e.results_data[s];o&&o.selected&&a.push(o.value)}),i.val(a.join(e.sort_value_splitter)).trigger("change")}},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.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[e.options_index].value}),this.sync_sort_field(),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return 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")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("<div/>").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,a,s,o,n,r,l,d;if(this.is_multiple){for(a=0,r=0,o="position:absolute; left: -1000px; top: -1000px; display:none;",n=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,d=n.length;l<d;l++)s=n[l],o+=s+":"+this.search_field.css(s)+";";return e=t("<div />",{style:o}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e),i.DEFAULTS=l,i.LANGUAGES=r,t.fn.chosen.Constructor=i}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,a){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(a),this._init()},a=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},s=function(t,e){var i=Math.max(t.left,e.left),s=Math.max(t.top,e.top),o=Math.min(t.left+t.width,e.left+e.width),n=Math.min(t.top+t.height,e.top+e.height);return a(i,s,t)&&a(o,n,t)&&a(i,s,e)&&a(o,n,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,a){var s,o,n=this.options.selector,r=this;if(void 0===e)return void this.$.find(n).each(function(){r.toggle(this,i)});if("object"==typeof e?(s=t(e).closest(n),o=s.data("id")):(o=e,s=r.$.find('.slectable-item[data-id="'+o+'"]')),s&&s.length){if(o||(o=t.zui.uuid(),s.attr("data-id",o)),void 0!==i&&null!==i||(i=!r.selections[o]),!!i!=!!r.selections[o]){var l;"function"==typeof a&&(l=a(i)),l!==!0&&(r.selections[o]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:o,selections:r.selections,target:s,
selected:r.getSelectedArray()},r))}r.options.selectClass&&s.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this,i=e.$children=e.$.find(e.options.selector);e.selections={},i.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,a,o,n,r,l,d=this.options,h=this,c=d.ignoreVal,u=!0,p="."+this.name+"."+this.id,f="function"==typeof d.checkFunc?d.checkFunc:null,g="function"==typeof d.rangeFunc?d.rangeFunc:null,m=!1,v=null,b="mousedown"+p,y=function(){o&&h.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var a=g?g.call(this,o,i):s(o,i);if(f){var n=f.call(h,{intersect:a,target:e,range:o,targetRange:i});n===!0?h.select(e):n===!1&&h.unselect(e)}else a?h.select(e):h.multiKey||h.unselect(e)})},w=function(s){m&&(n=s.pageX,r=s.pageY,o={width:Math.abs(n-e),height:Math.abs(r-i),left:n>e?e:n,top:r>i?i:r},u&&o.width<c&&o.height<c||(a||(a=t('.selectable-range[data-id="'+h.id+'"]'),a.length||(a=t('<div class="selectable-range" data-id="'+h.id+'"></div>').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},h.options.rangeStyle)).appendTo(t("body")))),a.css(o),clearTimeout(l),l=setTimeout(y,10),u=!1))},_=function(e){t(document).off(p),clearTimeout(v),m&&(m=!1,a&&a.remove(),u||o&&(clearTimeout(l),y(),o=null),h.callEvent("finish",{selections:h.selections,selected:h.getSelectedArray()}),e.preventDefault())},C=function(s){if(m)return _(s);var o=t.zui.getMouseButtonCode(d.mouseButton);if(!(o>-1&&s.button!==o||h.altKey||3===s.which||h.callEvent("start",s)===!1)){var n=h.$children=h.$.find(d.selector);n.addClass("slectable-item");var r=h.multiKey?"multi":d.clickBehavior;if("single"===r&&h.unselect(),d.listenClick&&("multi"===r?h.toggle(s.target):"single"===r?h.select(s.target):"toggle"===r&&h.toggle(s.target,null,function(t){h.unselect()})),h.callEvent("startDrag",s)===!1)return void h.callEvent("finish",{selections:h.selections,selected:h.getSelectedArray()});e=s.pageX,i=s.pageY,a=null,u=!0,m=!0,t(document).on("mousemove"+p,w).on("mouseup"+p,_),v=setTimeout(function(){t(document).on(b,_)},10),s.preventDefault()}},x=d.container&&"default"!==d.container?t(d.container):this.$;d.trigger?x.on(b,d.trigger,C):x.on(b,C),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?h.multiKey=e:18===e&&(h.altKey=!0)}).on("keyup",function(t){h.multiKey=!1,h.altKey=!1})},i.prototype.callEvent=function(e,i){var a=t.Event(e+"."+this.name);this.$.trigger(a,i);var s=a.result,o=this.options[e];return"function"==typeof o&&(s=o.apply(this,Array.isArray(i)?i:[i])),s},t.fn.selectable=function(a){return this.each(function(){var s=t(this),o=s.data(e),n="object"==typeof a&&a;o||s.data(e,o=new i(this,n)),"string"==typeof a&&o[a]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),function(t,e,i){"use strict";var a=0,s='<div class="messager messager-{type} {placement}" style="display: none"><div class="messager-content"></div><div class="messager-actions"></div></div>',o={icons:{},type:"default",placement:"top",time:4e3,parent:"body",close:!0,fade:!0,scale:!0},n={},r=function(e,r){t.isPlainObject(e)?r=t.extend({},r,e):e&&(r?r.content=e:r={content:e});var l=this;r=l.options=t.extend({},o,r),l.id=r.id||a++;var d=n[l.id];d&&d.destroy(),n[l.id]=l,l.$=t(s.format(r)).toggleClass("fade",r.fade).toggleClass("scale",r.scale).attr("id","messager-"+l.id),r.cssClass&&l.$.addClass(r.cssClass);var h=!1,c=l.$.find(".messager-actions"),u=function(e){var a=t('<button type="button" class="action action-'+e.name+'"/>');"close"===e.name&&a.addClass("close"),e.html!==i&&a.html(e.html),e.icon!==i&&a.append('<i class="action-icon icon-'+e.icon+'"/>'),e.text!==i&&a.append('<span class="action-text">'+e.text+"</span>"),e.tooltip!==i&&a.attr("title",e.tooltip).tooltip(),a.data("action",e),c.append(a)};r.actions&&t.each(r.actions,function(t,e){e.name===i&&(e.name=t),"close"==e.name&&(h=!0),u(e)}),!h&&r.close&&u({name:"close",html:"×"}),l.$.on("click",".action",function(e){var i,a=t(this).data("action");r.onAction&&(i=r.onAction.call(this,a.name,a,l),i===!1)||"function"==typeof a.action&&(i=a.action.call(this,l),i===!1)||(l.hide(),e.stopPropagation())}),l.$.on("click",function(t){if(r.onAction){var e=r.onAction.call(this,"content",null,l);e===!0&&l.hide()}}),l.$.data("zui.messager",l),r.show&&l.message!==i&&l.show()};r.prototype.update=function(e,i){t.isPlainObject(e)?i=e:e&&(i?i.content=e:i={content:e});var a=this,s=a.options;a.$.removeClass("messager-"+s.type);var o=a.$.find(".messager-content");s.contentClass&&o.removeClass(s.contentClass),i&&(s=t.extend(s,i)),a.$.addClass("messager-"+s.type).toggleClass("messager-notification",!!s.notification),s.contentClass&&o.addClass(s.contentClass);var n=s.title,r=s.icon;if(e=s.content,o.empty(),n){var l=t('<div class="messager-title"></div>');l[s.html?"html":"text"](n),o.append(l)}if(e){var d=t('<div class="messager-text"></div>');d[s.html?"html":"text"](e),o.append(d)}var h=a.$.find(".messager-icon");if(r){var c=t.isPlainObject(r)?r.html:'<i class="icon-'+r+' icon"></i>';h.length?h.html(c):o.before('<div class="messager-icon">'+c+"<div>")}else h.remove();a.$.toggleClass("messager-has-icon",!!r),a.updateTime||s.onUpdate&&s.onUpdate.call(a,s),a.updateTime=Date.now()},r.prototype.show=function(a,s){var o=this,n=this.options;if("function"==typeof a){var r=s;s=a,r!==i&&(a=r)}if(o.isShow)return void o.hide(function(){o.show(a,s)});o.hiding&&(clearTimeout(o.hiding),o.hiding=null),o.update(a);var l=n.placement,d=t(n.parent),h=d.children(".messagers-holder."+l);if(h.length||(h=t("<div/>").attr("class","messagers-holder "+l).appendTo(d)),h.append(o.$),"center"===l){var c=t(e).height()-h.height();h.css("top",Math.max(-c,c/2))}return o.$.show().addClass("in"),n.time&&(o.hiding=setTimeout(function(){o.hide()},n.time)),o.isShow=!0,s&&s(),n.onShow&&n.onShow.call(o,n),o},r.prototype.hide=function(t,e){t===!0&&(e=!0,t=null);var i=this,a=i.options;if(i.$.hasClass("in")){i.$.removeClass("in");var s=function(){var s=i.$.parent();i.$.detach(),s.children().length||s.remove(),t&&t(!0),a.onHide&&a.onHide.call(i,e)};e?s():setTimeout(s,200)}else t&&t(!1),a.onHide&&a.onHide.call(i,e);i.isShow=!1},r.prototype.destroy=function(){var t=this;t.hide(function(){t.$.remove(),t.$=null},!0),delete n[t.id]};var l=function(e){if(e===i)t(".messager").each(function(){var e=t(this).data("zui.messager");e&&e.hide&&e.hide(!0)});else{var a=t("#messager-"+e).data("zui.messager");a&&a.hide&&a.hide()}},d=function(e,a){"string"==typeof a&&(a={type:a}),t.isPlainObject(e)&&(a=t.extend({},a,e),e=null),a=t.extend({},a),a.id===i&&l();var s=n[a.id]||new r(e,a);return s.show(),s},h={notification:!0,placement:"bottom-right",time:0,icon:"bell icon-2x"},c=function(e,i,a){var s=t.extend({id:t.zui.uuid()},h),o="string"==typeof e,n="string"==typeof i;return o&&n?a=t.extend(s,a,{title:e,content:i}):o&&t.isPlainObject(i)?a=t.extend(s,a,i,{title:e}):t.isPlainObject(e)?a=t.extend(s,a,i,e):o&&(a=t.extend(s,a,{title:e})),d(a)},u=function(t){return"string"==typeof t?{placement:t}:t},p={show:d,hide:l};r.all=n,r.DEFAULTS=o,r.NOTIFICATION_DEFAULTS=h,t.each({primary:0,success:"ok-sign",info:"info-sign",warning:"warning-sign",danger:"exclamation-sign",important:0,special:0},function(e,i){p[e]=function(a,s){return d(a,t.extend({type:e,icon:r.DEFAULTS.icons[e]||i||null},u(s)))}}),t.zui({Messager:r,showMessager:d,showNotification:c,messager:p})}(jQuery,window,void 0),function(t,e,i,a){"use strict";function s(t){if(t=t.toLowerCase(),t&&h.test(t)){var e;if(4===t.length){var i="#";for(e=1;e<4;e+=1)i+=t.slice(e,e+1).concat(t.slice(e,e+1));t=i}var a=[];for(e=1;e<7;e+=2)a.push(y("0x"+t.slice(e,e+2)));return{r:a[0],g:a[1],b:a[2],a:1}}throw new Error("Wrong hex string! (hex: "+t+")")}function o(e){return typeof e===f&&("transparent"===e.toLowerCase()||m[e.toLowerCase()]||h.test(t.trim(e.toLowerCase())))}function n(t){function e(t){return t=t<0?t+1:t>1?t-1:t,6*t<1?r+(n-r)*t*6:2*t<1?n:3*t<2?r+(n-r)*(2/3-t)*6:r}var i=t.h,a=t.s,s=t.l,o=t.a;i=d(i)%u/u,a=l(d(a)),s=l(d(s)),o=l(d(o));var n=s<=.5?s*(a+1):s+a-s*a,r=2*s-n,h={r:e(i+1/3)*c,g:e(i)*c,b:e(i-1/3)*c,a:o};return h}function r(t,i,a){return v(a)&&(a=0),v(i)&&(i=c),e.min(e.max(t,a),i)}function l(t,e){return r(t,e)}function d(t){return"number"==typeof t?t:parseFloat(t)}var h=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,c=255,u=360,p=100,f="string",g="object",m={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},v=function(t){return t===a},b=function(t){return!v(t)},y=function(t){return parseInt(t)},w=function(t){return y(l(d(t),c))},_=function(t,e,i,a){var o=this;if(o.r=o.g=o.b=0,o.a=1,b(a)&&(o.a=l(d(a),1)),b(t)&&b(e)&&b(i))o.r=w(t),o.g=w(e),o.b=w(i);else if(b(t)){var r=typeof t;if(r==f)if(t=t.toLowerCase(),"transparent"===t)o.a=0;else if(m[t])o.rgb(s(m[t]));else if(0===t.indexOf("rgb")){var h=t.substring(t.indexOf("(")+1,t.lastIndexOf(")")).split(",",4);o.rgb({r:h[0],g:h[1],b:h[2],a:h[3]})}else o.rgb(s(t));else if("number"==r&&v(e))o.r=o.g=o.b=w(t);else if(r==g&&b(t.r))o.r=w(t.r),b(t.g)&&(o.g=w(t.g)),b(t.b)&&(o.b=w(t.b)),b(t.a)&&(o.a=l(d(t.a),1));else if(r==g&&b(t.h)){var c={h:l(d(t.h),u),s:1,l:1,a:1};b(t.s)&&(c.s=l(d(t.s),1)),b(t.l)&&(c.l=l(d(t.l),1)),b(t.a)&&(c.a=l(d(t.a),1)),o.rgb(n(c))}}};_.prototype.rgb=function(t){var e=this;if(b(t)){if(typeof t==g)b(t.r)&&(e.r=w(t.r)),b(t.g)&&(e.g=w(t.g)),b(t.b)&&(e.b=w(t.b)),b(t.a)&&(e.a=l(d(t.a),1));else{var i=y(d(t));e.r=i,e.g=i,e.b=i}return e}return{r:e.r,g:e.g,b:e.b,a:e.a}},_.prototype.hue=function(t){var e=this,i=e.toHsl();return v(t)?i.h:(i.h=l(d(t),u),e.rgb(n(i)),e)},_.prototype.darken=function(t){var e=this,i=e.toHsl();return i.l-=t/p,i.l=l(i.l,1),e.rgb(n(i)),e},_.prototype.clone=function(){var t=this;return new _(t.r,t.g,t.b,t.a)},_.prototype.lighten=function(t){return this.darken(-t)},_.prototype.fade=function(t){return this.a=l(t/p,1),this},_.prototype.spin=function(t){var e=this.toHsl(),i=(e.h+t)%u;return e.h=i<0?u+i:i,this.rgb(n(e))},_.prototype.toHsl=function(){var t,i,a=this,s=a.r/c,o=a.g/c,n=a.b/c,r=a.a,l=e.max(s,o,n),d=e.min(s,o,n),h=(l+d)/2,p=l-d;if(l===d)t=i=0;else{switch(i=h>.5?p/(2-l-d):p/(l+d),l){case s:t=(o-n)/p+(o<n?6:0);break;case o:t=(n-s)/p+2;break;case n:t=(s-o)/p+4}t/=6}return{h:t*u,s:i,l:h,a:r}},_.prototype.luma=function(){var t=this.r/c,i=this.g/c,a=this.b/c;return t=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),i=i<=.03928?i/12.92:e.pow((i+.055)/1.055,2.4),a=a<=.03928?a/12.92:e.pow((a+.055)/1.055,2.4),.2126*t+.7152*i+.0722*a},_.prototype.saturate=function(t){var e=this.toHsl();return e.s+=t/p,e.s=l(e.s),this.rgb(n(e))},_.prototype.desaturate=function(t){return this.saturate(-t)},_.prototype.contrast=function(t,e,i){if(e=v(e)?new _(c,c,c,1):new _(e),t=v(t)?new _(0,0,0,1):new _(t),t.luma()>e.luma()){var a=e;e=t,t=a}return this.a<.5?t:(i=v(i)?.43:d(i),this.luma()<i?e:t)},_.prototype.hexStr=function(){var t=this.r.toString(16),e=this.g.toString(16),i=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==i.length&&(i="0"+i),"#"+t+e+i},_.prototype.toCssStr=function(){var t=this;return t.a>0?t.a<1?"rgba("+t.r+","+t.g+","+t.b+","+t.a+")":t.hexStr():"transparent"},_.isColor=o,_.names=m,_.get=function(t){return new _(t)},t.zui({Color:_})}(jQuery,Math,window,void 0),/*!
* ZUI: Generated from less code - v1.9.2 - 2021-02-05
* http://openzui.com
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2021 cnezsoft.com; Licensed MIT
*/
function(t){"use strict";var e=0,i=["primary","red","yellow","green","blue","purple","brown","dark"],a={primary:"#3280fc",secondary:"#145ccd",pale:"#ebf2f9",fore:"#353535",back:"#fff",grayDarker:"#222222",grayDark:"#333333",gray:"#808080",grayLight:"#dddddd",grayLighter:"#e5e5e5",grayPale:"#f1f1f1",white:"#fff",black:"#000",red:"#ea644a",yellow:"#f1a325",green:"#38b03f",blue:"#03b8cf",purple:"#8666b8",brown:"#bd7b46",greenPale:"#ddf4df",yellowPale:"#fff0d5",redPale:"#ffe5e0",bluePale:"#ddf3f5",brownPale:"#f7ebe1",purplePale:"#f5eeff",light:"#fff",dark:"#353535",success:"#38b03f",warning:"#f1a325",danger:"#ea644a",info:"#03b8cf",important:"#bd7b46",special:"#8666b8",successPale:"#ddf4df",warningPale:"#fff0d5",dangerPale:"#ffe5e0",infoPale:"#ddf3f5",importantPale:"#f7ebe1",specialPale:"#f5eeff"};a.get=function(s){"undefined"!=typeof s&&"random"!==s||(s=i[e++%i.length]);var o=a[s]?a[s]:s;return t.zui.Color?new t.zui.Color(o):o},t.zui({colorset:a}),t.zui.Color&&t.extend(t.zui.Color,a)}(jQuery),/*!
* Datetimepicker for Bootstrap
* Copyright 2012 Stefan Petre
* Licensed under the Apache License v2.0
*/
!function(t){function e(){return new Date(Date.UTC.apply(Date,arguments))}var i=function(e,i){var s=this;this.element=t(e),this.language=(i.language||this.element.data("date-language")||(t.zui&&t.zui.clientLang?t.zui.clientLang().replace("_","-"):"zh-cn")).toLowerCase(),this.lang=t.zui&&t.zui.getLangData?t.zui.getLangData("datetimepicker",this.language,a):a[this.language],this.isRTL=this.lang.rtl||!1,this.formatType=i.formatType||this.element.data("format-type")||"standard",this.format=o.parseFormat(i.format||this.element.data("date-format")||this.lang.format||o.getDefaultFormat(this.formatType,"input"),this.formatType),this.isInline=!1,this.isVisible=!1,this.isInput=this.element.is("input"),this.component=!!this.element.is(".date")&&this.element.find(".input-group-addon .icon-th, .input-group-addon .icon-time, .input-group-addon .icon-calendar").parent(),this.componentReset=!!this.element.is(".date")&&this.element.find(".input-group-addon .icon-remove").parent(),this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.linkField=i.linkField||this.element.data("link-field")||!1,this.linkFormat=o.parseFormat(i.linkFormat||this.element.data("link-format")||o.getDefaultFormat(this.formatType,"link"),this.formatType),this.minuteStep=i.minuteStep||this.element.data("minute-step")||5,this.pickerPosition=i.pickerPosition||this.element.data("picker-position")||"bottom-right",this.showMeridian=i.showMeridian||this.element.data("show-meridian")||!1,this.initialDate=i.initialDate||new Date,this.pickerClass=i.eleClass,this.pickerId=i.eleId,this._attachEvents(),this.formatViewType="datetime","formatViewType"in i?this.formatViewType=i.formatViewType:"formatViewType"in this.element.data()&&(this.formatViewType=this.element.data("formatViewType")),this.minView=0,"minView"in i?this.minView=i.minView:"minView"in this.element.data()&&(this.minView=this.element.data("min-view")),this.minView=o.convertViewMode(this.minView),this.maxView=o.modes.length-1,"maxView"in i?this.maxView=i.maxView:"maxView"in this.element.data()&&(this.maxView=this.element.data("max-view")),this.maxView=o.convertViewMode(this.maxView),this.wheelViewModeNavigation=!1,"wheelViewModeNavigation"in i?this.wheelViewModeNavigation=i.wheelViewModeNavigation:"wheelViewModeNavigation"in this.element.data()&&(this.wheelViewModeNavigation=this.element.data("view-mode-wheel-navigation")),this.wheelViewModeNavigationInverseDirection=!1,"wheelViewModeNavigationInverseDirection"in i?this.wheelViewModeNavigationInverseDirection=i.wheelViewModeNavigationInverseDirection:"wheelViewModeNavigationInverseDirection"in this.element.data()&&(this.wheelViewModeNavigationInverseDirection=this.element.data("view-mode-wheel-navigation-inverse-dir")),this.wheelViewModeNavigationDelay=100,"wheelViewModeNavigationDelay"in i?this.wheelViewModeNavigationDelay=i.wheelViewModeNavigationDelay:"wheelViewModeNavigationDelay"in this.element.data()&&(this.wheelViewModeNavigationDelay=this.element.data("view-mode-wheel-navigation-delay")),this.startViewMode=2,"startView"in i?this.startViewMode=i.startView:"startView"in this.element.data()&&(this.startViewMode=this.element.data("start-view")),this.startViewMode=o.convertViewMode(this.startViewMode),this.viewMode=this.startViewMode,this.viewSelect=this.minView,"viewSelect"in i?this.viewSelect=i.viewSelect:"viewSelect"in this.element.data()&&(this.viewSelect=this.element.data("view-select")),this.viewSelect=o.convertViewMode(this.viewSelect),this.forceParse=!0,"forceParse"in i?this.forceParse=i.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse")),this.picker=t(o.template).appendTo(this.isInline?this.element:"body").on({click:this.click.bind(this)}),this.wheelViewModeNavigation&&(t.fn.mousewheel?this.picker.on({mousewheel:this.mousewheel.bind(this)}):console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option")),this.isInline?this.picker.addClass("datetimepicker-inline"):this.picker.addClass("datetimepicker-dropdown-"+this.pickerPosition+" dropdown-menu"),this.isRTL&&(this.picker.addClass("datetimepicker-rtl"),this.picker.find(".prev span, .next span").toggleClass("icon-arrow-left icon-arrow-right")),t(document).on("mousedown",function(e){0===t(e.target).closest(".datetimepicker").length&&s.hide()}),this.autoclose=!1,"autoclose"in i?this.autoclose=i.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in i?this.keyboardNavigation=i.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),this.todayBtn=i.todayBtn||this.element.data("date-today-btn")||!1,this.todayHighlight=i.todayHighlight||this.element.data("date-today-highlight")||!1,this.weekStart=(i.weekStart||this.element.data("date-weekstart")||this.lang.weekStart||0)%7,this.weekEnd=(this.weekStart+6)%7,this.startDate=-(1/0),this.endDate=1/0,this.daysOfWeekDisabled=[],this.setStartDate(i.startDate||this.element.data("date-startdate")),this.setEndDate(i.endDate||this.element.data("date-enddate")),this.setDaysOfWeekDisabled(i.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.fillDow(),this.fillMonths(),this.update(),this.showMode(),this.isInline&&this.show()};i.prototype={constructor:i,_events:[],_attachEvents:function(){this._detachEvents(),this.isInput?this._events=[[this.element,{focus:this.show.bind(this),keyup:this.update.bind(this),keydown:this.keydown.bind(this)}]]:this.component&&this.hasInput?(this._events=[[this.element.find("input"),{focus:this.show.bind(this),keyup:this.update.bind(this),keydown:this.keydown.bind(this)}],[this.component,{click:this.show.bind(this)}]],this.componentReset&&this._events.push([this.componentReset,{click:this.reset.bind(this)}])):this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:this.show.bind(this)}]];for(var t,e,i=0;i<this._events.length;i++)t=this._events[i][0],e=this._events[i][1],t.on(e)},_detachEvents:function(){for(var t,e,i=0;i<this._events.length;i++)t=this._events[i][0],e=this._events[i][1],t.off(e);this._events=[]},show:function(e){this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.forceParse&&this.update(),this.place(),t(window).on("resize",this.place.bind(this)),e&&(e.stopPropagation(),e.preventDefault()),this.isVisible=!0,this.element.trigger({type:"show",date:this.date})},hide:function(e){this.isVisible&&(this.isInline||(this.picker.hide(),t(window).off("resize",this.place),this.viewMode=this.startViewMode,this.showMode(),this.isInput||t(document).off("mousedown",this.hide),this.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this.isVisible=!1,this.element.trigger({type:"hide",date:this.date})))},remove:function(){this._detachEvents(),this.picker.remove(),delete this.picker,delete this.element.data().datetimepicker},getDate:function(){var t=this.getUTCDate();return new Date(t.getTime()+6e4*t.getTimezoneOffset())},getUTCDate:function(){return this.date},setDate:function(t){this.setUTCDate(new Date(t.getTime()-6e4*t.getTimezoneOffset()))},setUTCDate:function(t){t>=this.startDate&&t<=this.endDate?(this.date=t,this.setValue(),this.viewDate=this.date,this.fill()):this.element.trigger({type:"outOfRange",date:t,startDate:this.startDate,endDate:this.endDate})},setFormat:function(t){this.format=o.parseFormat(t,this.formatType);var e;this.isInput?e=this.element:this.component&&(e=this.element.find("input")),e&&e.val()&&this.setValue()},setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e):(this.component&&this.element.find("input").val(e),this.element.data("date",e)),this.linkField&&t("#"+this.linkField).val(this.getFormattedDate(this.linkFormat))},getFormattedDate:function(t){return void 0==t&&(t=this.format),o.formatDate(this.date,t,this.language,this.formatType)},setStartDate:function(t){this.startDate=t||-(1/0),this.startDate!==-(1/0)&&(this.startDate=o.parseDate(this.startDate,this.format,this.language,this.formatType)),this.update(),this.updateNavArrows()},setEndDate:function(t){this.endDate=t||1/0,this.endDate!==1/0&&(this.endDate=o.parseDate(this.endDate,this.format,this.language,this.formatType)),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this.daysOfWeekDisabled=e||[],Array.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)),this.daysOfWeekDisabled=t.map(this.daysOfWeekDisabled,function(t){return parseInt(t,10)}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){var e=0;t("div").each(function(){var i=parseInt(t(this).css("zIndex"),10);i>e&&(e=i)});var i,a,s,o=e+10;this.component?(i=this.component.offset(),s=i.left,"bottom-left"!==this.pickerPosition&&"top-left"!==this.pickerPosition&&"auto-left"!==this.pickerPosition||(s+=this.component.outerWidth()-this.picker.outerWidth())):(i=this.element.offset(),s=i.left);var n=0===this.pickerPosition.indexOf("auto-"),r=n?(i.top+this.picker.outerHeight()>t(window).height()+t(window).scrollTop()?"top":"bottom")+(0===this.pickerPosition.lastIndexOf("-left")?"-left":"-right"):this.pickerPosition;a="top-left"===r||"top-right"===r?i.top-this.picker.outerHeight():i.top+this.height,this.picker.css({top:a,left:s,zIndex:o}).attr("class","datetimepicker dropdown-menu datetimepicker-dropdown-"+r),this.pickerClass&&this.picker.addClass(this.pickerClass),this.pickerId&&this.picker.attr("id",this.pickerId)}},update:function(){var t,e=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(t=arguments[0],e=!0):(t=this.element.data("date")||(this.isInput?this.element.val():this.element.find("input").val())||this.initialDate,("string"==typeof t||t instanceof String)&&(t=t.replace(/^\s+|\s+$/g,""))),t||(t=new Date,e=!1),this.date=o.parseDate(t,this.format,this.language,this.formatType),e&&this.setValue(),this.date<this.startDate?this.viewDate=new Date(this.startDate):this.date>this.endDate?this.viewDate=new Date(this.endDate):this.viewDate=new Date(this.date),this.fill()},fillDow:function(){for(var t=this.weekStart,e="<tr>";t<this.weekStart+7;)e+='<th class="dow">'+this.lang.daysMin[t++%7]+"</th>";e+="</tr>",this.picker.find(".datetimepicker-days thead").append(e)},fillMonths:function(){for(var t="",e=0;e<12;)t+='<span class="month">'+this.lang.monthsShort[e++]+"</span>";this.picker.find(".datetimepicker-months td").html(t)},fill:function(){if(null!=this.date&&null!=this.viewDate){var i=new Date(this.viewDate),a=i.getUTCFullYear(),s=i.getUTCMonth(),n=i.getUTCDate(),r=i.getUTCHours(),l=i.getUTCMinutes(),d=this.startDate!==-(1/0)?this.startDate.getUTCFullYear():-(1/0),h=this.startDate!==-(1/0)?this.startDate.getUTCMonth():-(1/0),c=this.endDate!==1/0?this.endDate.getUTCFullYear():1/0,u=this.endDate!==1/0?this.endDate.getUTCMonth():1/0,p=new e(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate()).valueOf(),f=new Date;if(this.picker.find(".datetimepicker-days thead th:eq(1)").text(this.lang.months[s]+" "+a),"time"==this.formatViewType){var g=r%12?r%12:12,m=(g<10?"0":"")+g,v=(l<10?"0":"")+l,b=this.lang.meridiem[r<12?0:1];this.picker.find(".datetimepicker-hours thead th:eq(1)").text(m+":"+v+" "+b.toUpperCase()),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(m+":"+v+" "+b.toUpperCase())}else this.picker.find(".datetimepicker-hours thead th:eq(1)").text(n+" "+this.lang.months[s]+" "+a),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(n+" "+this.lang.months[s]+" "+a);this.picker.find("tfoot th.today").text(this.lang.today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths();var y=e(a,s-1,28,0,0,0,0),w=o.getDaysInMonth(y.getUTCFullYear(),y.getUTCMonth());y.setUTCDate(w),y.setUTCDate(w-(y.getUTCDay()-this.weekStart+7)%7);var _=new Date(y);_.setUTCDate(_.getUTCDate()+42),_=_.valueOf();for(var C,x=[];y.valueOf()<_;)y.getUTCDay()==this.weekStart&&x.push("<tr>"),C="",y.getUTCFullYear()<a||y.getUTCFullYear()==a&&y.getUTCMonth()<s?C+=" old":(y.getUTCFullYear()>a||y.getUTCFullYear()==a&&y.getUTCMonth()>s)&&(C+=" new"),this.todayHighlight&&y.getUTCFullYear()==f.getFullYear()&&y.getUTCMonth()==f.getMonth()&&y.getUTCDate()==f.getDate()&&(C+=" today"),y.valueOf()==p&&(C+=" active"),(y.valueOf()+864e5<=this.startDate||y.valueOf()>this.endDate||t.inArray(y.getUTCDay(),this.daysOfWeekDisabled)!==-1)&&(C+=" disabled"),x.push('<td class="day'+C+'">'+y.getUTCDate()+"</td>"),y.getUTCDay()==this.weekEnd&&x.push("</tr>"),y.setUTCDate(y.getUTCDate()+1);this.picker.find(".datetimepicker-days tbody").empty().append(x.join("")),x=[];for(var k="",T="",D="",$=0;$<24;$++){var S=e(a,s,n,$);C="",S.valueOf()+36e5<=this.startDate||S.valueOf()>this.endDate?C+=" disabled":r==$&&(C+=" active"),this.showMeridian&&2==this.lang.meridiem.length?(T=$<12?this.lang.meridiem[0]:this.lang.meridiem[1],T!=D&&(""!=D&&x.push("</fieldset>"),x.push('<fieldset class="hour"><legend>'+T.toUpperCase()+"</legend>")),D=T,k=$%12?$%12:12,x.push('<span class="hour'+C+" hour_"+($<12?"am":"pm")+'">'+k+"</span>"),23==$&&x.push("</fieldset>")):(k=$+":00",x.push('<span class="hour'+C+'">'+k+"</span>"))}this.picker.find(".datetimepicker-hours td").html(x.join("")),x=[],k="",T="",D="";for(var $=0;$<60;$+=this.minuteStep){var S=e(a,s,n,r,$,0);C="",S.valueOf()<this.startDate||S.valueOf()>this.endDate?C+=" disabled":Math.floor(l/this.minuteStep)==Math.floor($/this.minuteStep)&&(C+=" active"),this.showMeridian&&2==this.lang.meridiem.length?(T=r<12?this.lang.meridiem[0]:this.lang.meridiem[1],T!=D&&(""!=D&&x.push("</fieldset>"),x.push('<fieldset class="minute"><legend>'+T.toUpperCase()+"</legend>")),D=T,k=r%12?r%12:12,x.push('<span class="minute'+C+'">'+k+":"+($<10?"0"+$:$)+"</span>"),59==$&&x.push("</fieldset>")):(k=$+":00",x.push('<span class="minute'+C+'">'+r+":"+($<10?"0"+$:$)+"</span>"))}this.picker.find(".datetimepicker-minutes td").html(x.join(""));var M=this.date.getUTCFullYear(),z=this.picker.find(".datetimepicker-months").find("th:eq(1)").text(a).end().find("span").removeClass("active");M==a&&z.eq(this.date.getUTCMonth()).addClass("active"),(a<d||a>c)&&z.addClass("disabled"),a==d&&z.slice(0,h).addClass("disabled"),a==c&&z.slice(u+1).addClass("disabled"),x="",a=10*parseInt(a/10,10);var I=this.picker.find(".datetimepicker-years").find("th:eq(1)").text(a+"-"+(a+9)).end().find("td");a-=1;for(var $=-1;$<11;$++)x+='<span class="year'+($==-1||10==$?" old":"")+(M==a?" active":"")+(a<d||a>c?" disabled":"")+'">'+a+"</span>",a+=1;I.html(x),this.place()}},updateNavArrows:function(){var t=new Date(this.viewDate),e=t.getUTCFullYear(),i=t.getUTCMonth(),a=t.getUTCDate(),s=t.getUTCHours();switch(this.viewMode){case 0:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&a<=this.startDate.getUTCDate()&&s<=this.startDate.getUTCHours()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&a>=this.endDate.getUTCDate()&&s>=this.endDate.getUTCHours()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&a<=this.startDate.getUTCDate()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&a>=this.endDate.getUTCDate()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 2:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 3:case 4:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},mousewheel:function(t){if(t.preventDefault(),t.stopPropagation(),!this.wheelPause){this.wheelPause=!0;var e=t.originalEvent,i=e.wheelDelta,a=i>0?1:0===i?0:-1;this.wheelViewModeNavigationInverseDirection&&(a=-a),this.showMode(a),setTimeout(function(){this.wheelPause=!1}.bind(this),this.wheelViewModeNavigationDelay)}},click:function(i){i.stopPropagation(),i.preventDefault();var a=t(i.target).closest("span, td, th, legend");if(1==a.length){if(a.is(".disabled"))return void this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate});switch(a[0].nodeName.toLowerCase()){case"th":switch(a[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var s=o.modes[this.viewMode].navStep*("prev"==a[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,s);break;case 1:this.viewDate=this.moveDate(this.viewDate,s);break;case 2:this.viewDate=this.moveMonth(this.viewDate,s);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,s)}this.fill();break;case"today":var n=new Date;n=e(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),0),n<this.startDate?n=this.startDate:n>this.endDate&&(n=this.endDate),this.viewMode=this.startViewMode,this.showMode(0),this._setDate(n),this.fill(),this.autoclose&&this.hide()}break;case"span":if(!a.is(".disabled")){var r=this.viewDate.getUTCFullYear(),l=this.viewDate.getUTCMonth(),d=this.viewDate.getUTCDate(),h=this.viewDate.getUTCHours(),c=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();if(a.is(".month")?(this.viewDate.setUTCDate(1),l=a.parent().find("span").index(a),d=this.viewDate.getUTCDate(),this.viewDate.setUTCMonth(l),this.element.trigger({type:"changeMonth",date:this.viewDate}),this.viewSelect>=3&&this._setDate(e(r,l,d,h,c,u,0))):a.is(".year")?(this.viewDate.setUTCDate(1),r=parseInt(a.text(),10)||0,this.viewDate.setUTCFullYear(r),this.element.trigger({type:"changeYear",date:this.viewDate}),this.viewSelect>=4&&this._setDate(e(r,l,d,h,c,u,0))):a.is(".hour")?(h=parseInt(a.text(),10)||0,(a.hasClass("hour_am")||a.hasClass("hour_pm"))&&(12==h&&a.hasClass("hour_am")?h=0:12!=h&&a.hasClass("hour_pm")&&(h+=12)),this.viewDate.setUTCHours(h),this.element.trigger({type:"changeHour",date:this.viewDate}),this.viewSelect>=1&&this._setDate(e(r,l,d,h,c,u,0))):a.is(".minute")&&(c=parseInt(a.text().substr(a.text().indexOf(":")+1),10)||0,this.viewDate.setUTCMinutes(c),this.element.trigger({type:"changeMinute",date:this.viewDate}),this.viewSelect>=0&&this._setDate(e(r,l,d,h,c,u,0))),0!=this.viewMode){var p=this.viewMode;this.showMode(-1),this.fill(),p==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide()}break;case"td":if(a.is(".day")&&!a.is(".disabled")){var d=parseInt(a.text(),10)||1,r=this.viewDate.getUTCFullYear(),l=this.viewDate.getUTCMonth(),h=this.viewDate.getUTCHours(),c=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();a.is(".old")?0===l?(l=11,r-=1):l-=1:a.is(".new")&&(11==l?(l=0,r+=1):l+=1),this.viewDate.setUTCFullYear(r),this.viewDate.setUTCMonth(l,d),this.element.trigger({type:"changeDay",date:this.viewDate}),this.viewSelect>=2&&this._setDate(e(r,l,d,h,c,u,0));var p=this.viewMode;this.showMode(-1),this.fill(),p==this.viewMode&&this.autoclose&&this.hide()}}}},_setDate:function(t,e){e&&"date"!=e||(this.date=t),e&&"view"!=e||(this.viewDate=t),this.fill(),this.setValue();var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&(i.change(),this.autoclose&&(!e||"date"==e)),this.element.trigger({type:"changeDate",date:this.date}),null===t&&(this.date=this.viewDate)},moveMinute:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return i.setUTCMinutes(i.getUTCMinutes()+e*this.minuteStep),i},moveHour:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return i.setUTCHours(i.getUTCHours()+e),i},moveDate:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return i.setUTCDate(i.getUTCDate()+e),i},moveMonth:function(t,e){if(!e)return t;var i,a,s=new Date(t.valueOf()),o=s.getUTCDate(),n=s.getUTCMonth(),r=Math.abs(e);if(e=e>0?1:-1,1==r)a=e==-1?function(){return s.getUTCMonth()==n}:function(){return s.getUTCMonth()!=i},i=n+e,s.setUTCMonth(i),(i<0||i>11)&&(i=(i+12)%12);else{for(var l=0;l<r;l++)s=this.moveMonth(s,e);i=s.getUTCMonth(),s.setUTCDate(o),a=function(){return i!=s.getUTCMonth()}}for(;a();)s.setUTCDate(--o),s.setUTCMonth(i);return s},moveYear:function(t,e){return this.moveMonth(t,12*e)},dateWithinRange:function(t){return t>=this.startDate&&t<=this.endDate},keydown:function(t){if(this.picker.is(":not(:visible)"))return void(27==t.keyCode&&this.show());var e,i,a,s=!1;switch(t.keyCode){case 27:this.hide(),t.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;e=37==t.keyCode?-1:1,viewMode=this.viewMode,t.ctrlKey?viewMode+=2:t.shiftKey&&(viewMode+=1),4==viewMode?(i=this.moveYear(this.date,e),a=this.moveYear(this.viewDate,e)):3==viewMode?(i=this.moveMonth(this.date,e),a=this.moveMonth(this.viewDate,e)):2==viewMode?(i=this.moveDate(this.date,e),a=this.moveDate(this.viewDate,e)):1==viewMode?(i=this.moveHour(this.date,e),a=this.moveHour(this.viewDate,e)):0==viewMode&&(i=this.moveMinute(this.date,e),a=this.moveMinute(this.viewDate,e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=a,this.setValue(),this.update(),t.preventDefault(),s=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;e=38==t.keyCode?-1:1,viewMode=this.viewMode,t.ctrlKey?viewMode+=2:t.shiftKey&&(viewMode+=1),4==viewMode?(i=this.moveYear(this.date,e),a=this.moveYear(this.viewDate,e)):3==viewMode?(i=this.moveMonth(this.date,e),a=this.moveMonth(this.viewDate,e)):2==viewMode?(i=this.moveDate(this.date,7*e),a=this.moveDate(this.viewDate,7*e)):1==viewMode?this.showMeridian?(i=this.moveHour(this.date,6*e),a=this.moveHour(this.viewDate,6*e)):(i=this.moveHour(this.date,4*e),a=this.moveHour(this.viewDate,4*e)):0==viewMode&&(i=this.moveMinute(this.date,4*e),a=this.moveMinute(this.viewDate,4*e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=a,this.setValue(),this.update(),t.preventDefault(),s=!0);break;case 13:if(0!=this.viewMode){var o=this.viewMode;this.showMode(-1),this.fill(),o==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide();t.preventDefault();break;case 9:this.hide()}if(s){var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change(),this.element.trigger({type:"changeDate",date:this.date})}},showMode:function(t){if(t){var e=Math.max(0,Math.min(o.modes.length-1,this.viewMode+t));e>=this.minView&&e<=this.maxView&&(this.element.trigger({type:"changeMode",date:this.viewDate,oldViewMode:this.viewMode,newViewMode:e}),this.viewMode=e)}this.picker.find(">div").hide().filter(".datetimepicker-"+o.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()},reset:function(t){this._setDate(null,"date")}},t.fn.datetimepicker=function(e){var a=Array.apply(null,arguments);return a.shift(),this.each(function(){var s=t(this),o=s.data("datetimepicker"),n="object"==typeof e&&e;o||s.data("datetimepicker",o=new i(this,t.extend({},t.fn.datetimepicker.defaults,s.data(),n))),"string"==typeof e&&"function"==typeof o[e]&&o[e].apply(o,a)})},t.fn.datetimepicker.defaults={pickerPosition:"auto-right"},t.fn.datetimepicker.Constructor=i;var a=t.fn.datetimepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["am","pm"],suffix:["st","nd","rd","th"],today:"Today"},"zh-cn":{days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",suffix:[],meridiem:[]},"zh-tw":{days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",suffix:[],meridiem:["上午","下午"]}},s=function(e){var i=a[e];return i||(i=t.zui&&t.zui.getLangData?a[e]=t.zui.getLangData("datetimepicker",this.language,a):a.en),i},o={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(t){return t%4===0&&t%100!==0||t%400===0},getDaysInMonth:function(t,e){return[31,o.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},getDefaultFormat:function(t,e){if("standard"==t)return"input"==e?"yyyy-mm-dd hh:ii":"yyyy-mm-dd hh:ii:ss";if("php"==t)return"input"==e?"Y-m-d H:i":"Y-m-d H:i:s";throw new Error("Invalid format type.")},validParts:function(t){if("standard"==t)return/hh?|HH?|p|P|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;if("php"==t)return/[dDjlNwzFmMnStyYaABgGhHis]/g;throw new Error("Invalid format type.")},nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,parseFormat:function(t,e){var i=t.replace(this.validParts(e),"\0").split("\0"),a=t.match(this.validParts(e));if(!i||!i.length||!a||0==a.length)throw new Error("Invalid date format.");return{separators:i,parts:a}},parseDate:function(a,o,n,r){if(a instanceof Date){var l=new Date(a.valueOf()-6e4*a.getTimezoneOffset());return l.setMilliseconds(0),l}if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(a)&&(o=this.parseFormat("yyyy-mm-dd",r)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(a)&&(o=this.parseFormat("yyyy-mm-dd hh:ii",r)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(a)&&(o=this.parseFormat("yyyy-mm-dd hh:ii:ss",r)),/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(a)){var d,h,c=/([-+]\d+)([dmwy])/,u=a.match(/([-+]\d+)([dmwy])/g);a=new Date;for(var p=0;p<u.length;p++)switch(d=c.exec(u[p]),h=parseInt(d[1]),d[2]){case"d":a.setUTCDate(a.getUTCDate()+h);break;case"m":a=i.prototype.moveMonth.call(i.prototype,a,h);break;case"w":a.setUTCDate(a.getUTCDate()+7*h);break;case"y":a=i.prototype.moveYear.call(i.prototype,a,h)}return e(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),0)}var f,g,d,u=a&&a.match(this.nonpunctuation)||[],a=new Date(0,0,0,0,0,0,0),m={},v=["hh","h","ii","i","ss","s","yyyy","yy","M","MM","m","mm","D","DD","d","dd","H","HH","p","P"],b={hh:function(t,e){return t.setUTCHours(e)},h:function(t,e){return t.setUTCHours(e)},HH:function(t,e){return t.setUTCHours(12==e?0:e)},H:function(t,e){return t.setUTCHours(12==e?0:e)},ii:function(t,e){return t.setUTCMinutes(e)},i:function(t,e){return t.setUTCMinutes(e)},ss:function(t,e){return t.setUTCSeconds(e)},s:function(t,e){return t.setUTCSeconds(e)},yyyy:function(t,e){return t.setUTCFullYear(e)},yy:function(t,e){return t.setUTCFullYear(2e3+e)},m:function(t,e){for(e-=1;e<0;)e+=12;for(e%=12,t.setUTCMonth(e);t.getUTCMonth()!=e;)t.setUTCDate(t.getUTCDate()-1);return t},d:function(t,e){return t.setUTCDate(e)},p:function(t,e){return t.setUTCHours(1==e?t.getUTCHours()+12:t.getUTCHours())}};if(b.M=b.MM=b.mm=b.m,b.dd=b.d,b.P=b.p,a=e(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds()),u.length==o.parts.length){for(var p=0,y=o.parts.length;p<y;p++){if(f=parseInt(u[p],10),d=o.parts[p],isNaN(f))switch(d){case"MM":g=t(s(n).months).filter(function(){var t=this.slice(0,u[p].length),e=u[p].slice(0,t.length);return t==e}),f=t.inArray(g[0],s(n).months)+1;break;case"M":g=t(s(n).monthsShort).filter(function(){var t=this.slice(0,u[p].length),e=u[p].slice(0,t.length);return t==e}),f=t.inArray(g[0],s(n).monthsShort)+1;break;case"p":case"P":f=t.inArray(u[p].toLowerCase(),s(n).meridiem)}m[d]=f}for(var w,p=0;p<v.length;p++)w=v[p],w in m&&!isNaN(m[w])&&b[w](a,m[w])}return a},formatDate:function(e,i,a,n){if(null==e)return"";var r;if("standard"==n)r={yy:e.getUTCFullYear().toString().substring(2),yyyy:e.getUTCFullYear(),m:e.getUTCMonth()+1,M:s(a).monthsShort[e.getUTCMonth()],MM:s(a).months[e.getUTCMonth()],d:e.getUTCDate(),D:s(a).daysShort[e.getUTCDay()],DD:s(a).days[e.getUTCDay()],p:2==s(a).meridiem.length?s(a).meridiem[e.getUTCHours()<12?0:1]:"",h:e.getUTCHours(),i:e.getUTCMinutes(),s:e.getUTCSeconds()},2==s(a).meridiem.length?r.H=r.h%12==0?12:r.h%12:r.H=r.h,r.HH=(r.H<10?"0":"")+r.H,r.P=r.p.toUpperCase(),r.hh=(r.h<10?"0":"")+r.h,r.ii=(r.i<10?"0":"")+r.i,r.ss=(r.s<10?"0":"")+r.s,r.dd=(r.d<10?"0":"")+r.d,r.mm=(r.m<10?"0":"")+r.m;else{if("php"!=n)throw new Error("Invalid format type.");r={y:e.getUTCFullYear().toString().substring(2),Y:e.getUTCFullYear(),F:s(a).months[e.getUTCMonth()],M:s(a).monthsShort[e.getUTCMonth()],n:e.getUTCMonth()+1,t:o.getDaysInMonth(e.getUTCFullYear(),e.getUTCMonth()),j:e.getUTCDate(),l:s(a).days[e.getUTCDay()],D:s(a).daysShort[e.getUTCDay()],w:e.getUTCDay(),N:0==e.getUTCDay()?7:e.getUTCDay(),S:e.getUTCDate()%10<=s(a).suffix.length?s(a).suffix[e.getUTCDate()%10-1]:"",a:2==s(a).meridiem.length?s(a).meridiem[e.getUTCHours()<12?0:1]:"",g:e.getUTCHours()%12==0?12:e.getUTCHours()%12,G:e.getUTCHours(),i:e.getUTCMinutes(),s:e.getUTCSeconds()},r.m=(r.n<10?"0":"")+r.n,r.d=(r.j<10?"0":"")+r.j,r.A=r.a.toString().toUpperCase(),r.h=(r.g<10?"0":"")+r.g,r.H=(r.G<10?"0":"")+r.G,r.i=(r.i<10?"0":"")+r.i,r.s=(r.s<10?"0":"")+r.s}for(var e=[],l=t.extend([],i.separators),d=0,h=i.parts.length;d<h;d++)l.length&&e.push(l.shift()),e.push(r[i.parts[d]]);return l.length&&e.push(l.shift()),e.join("")},convertViewMode:function(t){switch(t){case 4:case"decade":t=4;break;case 3:case"year":t=3;break;case 2:case"month":t=2;break;case 1:case"day":t=1;break;case 0:case"hour":t=0}return t},headTemplate:'<thead><tr><th class="prev"><i class="icon-arrow-left"/></th><th colspan="5" class="switch"></th><th class="next"><i class="icon-arrow-right"/></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr></tfoot>'};o.template='<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">'+o.headTemplate+o.contTemplate+o.footTemplate+'</table></div><div class="datetimepicker-hours"><table class=" table-condensed">'+o.headTemplate+o.contTemplate+o.footTemplate+'</table></div><div class="datetimepicker-days"><table class=" table-condensed">'+o.headTemplate+"<tbody></tbody>"+o.footTemplate+'</table></div><div class="datetimepicker-months"><table class="table-condensed">'+o.headTemplate+o.contTemplate+o.footTemplate+'</table></div><div class="datetimepicker-years"><table class="table-condensed">'+o.headTemplate+o.contTemplate+o.footTemplate+"</table></div></div>",t.fn.datetimepicker.DPGlobal=o,t.fn.datetimepicker.noConflict=function(){return t.fn.datetimepicker=old,this},t(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api",'[data-provide="datetimepicker"]',function(e){
var i=t(this);i.data("datetimepicker")||(e.preventDefault(),i.datetimepicker("show"))}),t(function(){t('[data-provide="datetimepicker-inline"]').datetimepicker()})}(window.jQuery),+function(t,e,i){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var a="zui.sortable",s={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},o="order",n=function(e,i){var a=this;a.$=t(e),a.options=t.extend({},s,a.$.data(),i),a.init()};n.DEFAULTS=s,n.NAME=a,n.prototype.init=function(){var e,i=this,a=i.$,s=i.options,n=s.selector,r=s.containerSelector,l=s.sortingClass,d=s.dragCssClass,h=s.targetSelector,c=s.reverse,u=function(e){e=e||i.getItems(1);var a=e.length;a&&e.each(function(e){var i=c?a-e:e;t(this).attr("data-"+o,i).data(o,i)})};u(),a.droppable({handle:s.trigger,target:h?h:r?n+","+r:n,selector:n,container:a,always:s.always,flex:!0,lazy:s.lazy,canMoveHere:s.canMoveHere,dropToClass:s.dropToClass,before:s.before,nested:!!r,mouseButton:s.mouseButton,stopPropagation:s.stopPropagation,start:function(t){d&&t.element.addClass(d),e=!1,i.trigger("start",t)},drag:function(t){if(a.addClass(l),t.isIn){var s=t.element,d=t.target,h=r&&d.is(r);if(h){if(!d.children(n).filter(".dragging").length){d.append(s);var p=i.getItems(1);u(p),i.trigger(o,{list:p,element:s})}return}var f=s.data(o),g=d.data(o);if(f===g)return u(p);f>g?d[c?"after":"before"](s):d[c?"before":"after"](s),e=!0;var p=i.getItems(1);u(p),i.trigger(o,{list:p,element:s})}},finish:function(t){d&&t.element&&t.element.removeClass(d),a.removeClass(l),i.trigger("finish",{list:i.getItems(),element:t.element,changed:e})}})},n.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(a,null)},n.prototype.reset=function(){this.destroy(),this.init()},n.prototype.getItems=function(e){var i=this.$.find(this.options.selector).not(".drag-shadow");return e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},n.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),s=i.data(a),o="object"==typeof e&&e;s?"object"==typeof e&&s.reset():i.data(a,s=new n(this,o)),"string"==typeof e&&s[e]()})},t.fn.sortable.Constructor=n}(jQuery,window,document),function(t,e){"use strict";var i,a,s="localStorage",o="page_"+t.location.pathname+t.location.search,n=function(){this.silence=!0;try{s in t&&t[s]&&t[s].setItem&&(this.enable=!0,i=t[s])}catch(n){}this.enable||(a={},i={getLength:function(){var t=0;return e.each(a,function(){t++}),t},key:function(t){var i,s=0;return e.each(a,function(e){return s===t?(i=e,!1):void s++}),i},removeItem:function(t){delete a[t]},getItem:function(t){return a[t]},setItem:function(t,e){a[t]=e},clear:function(){a={}}}),this.storage=i,this.page=this.get(o,{})};n.prototype.pageSave=function(){if(e.isEmptyObject(this.page))this.remove(o);else{var t,i=[];for(t in this.page){var a=this.page[t];null===a&&i.push(t)}for(t=i.length-1;t>=0;t--)delete this.page[i[t]];this.set(o,this.page)}},n.prototype.pageRemove=function(t){"undefined"!=typeof this.page[t]&&(this.page[t]=null,this.pageSave())},n.prototype.pageClear=function(){this.page={},this.pageSave()},n.prototype.pageGet=function(t,e){var i=this.page[t];return void 0===e||null!==i&&void 0!==i?i:e},n.prototype.pageSet=function(t,i){e.isPlainObject(t)?e.extend(!0,this.page,t):this.page[this.serialize(t)]=i,this.pageSave()},n.prototype.check=function(){if(!this.enable&&!this.silence)throw new Error("Browser not support localStorage or enable status been set true.");return this.enable},n.prototype.length=function(){return this.check()?i.getLength?i.getLength():i.length:0},n.prototype.removeItem=function(t){return i.removeItem(t),this},n.prototype.remove=function(t){return this.removeItem(t)},n.prototype.getItem=function(t){return i.getItem(t)},n.prototype.get=function(t,e){var i=this.deserialize(this.getItem(t));return"undefined"!=typeof i&&null!==i||"undefined"==typeof e?i:e},n.prototype.key=function(t){return i.key(t)},n.prototype.setItem=function(t,e){return i.setItem(t,e),this},n.prototype.set=function(t,e){return void 0===e?this.remove(t):(this.setItem(t,this.serialize(e)),this)},n.prototype.clear=function(){return i.clear(),this},n.prototype.forEach=function(t){for(var e=this.length(),a=e-1;a>=0;a--){var s=i.key(a);t(s,this.get(s))}return this},n.prototype.getAll=function(){var t={};return this.forEach(function(e,i){t[e]=i}),t},n.prototype.serialize=function(t){return"string"==typeof t?t:JSON.stringify(t)},n.prototype.deserialize=function(t){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return t||void 0}},e.zui({store:new n})}(window,jQuery),function(t){"use strict";var e="zui.datatable",i=t.zui.store,a=function(i,a){this.name=e,this.$=t(i),this.isTable="TABLE"===this.$[0].tagName,this.firstShow=!0,this.isTable?(this.$table=this.$,this.id="datatable-"+(this.$.attr("id")||t.zui.uuid())):(this.$datatable=this.$.addClass("datatable"),this.$.attr("id")?this.id=this.$.attr("id"):(this.id="datatable-"+t.zui.uuid(),this.$.attr("id",this.id))),this.getOptions(a),this.load(),this.callEvent("ready")};a.DEFAULTS={checkable:!1,checkByClickRow:!0,checkedClass:"active",checkboxName:null,selectable:!0,sortable:!1,storage:!0,fixedHeader:!1,fixedHeaderOffset:0,fixedLeftWidth:"30%",fixedRightWidth:"30%",flexHeadDrag:!0,scrollPos:"in",rowHover:!0,colHover:!0,hoverClass:"hover",colHoverClass:"col-hover",fixCellHeight:!0,mergeRows:!1,minColWidth:20,minFixedLeftWidth:200,minFixedRightWidth:200,minFlexAreaWidth:200},a.prototype.getOptions=function(e){var i=this.$;e=t.extend({},a.DEFAULTS,this.$.data(),e),e.tableClass=e.tableClass||"",e.tableClass=" "+e.tableClass+" table-datatable",t.each(["bordered","condensed","striped","condensed","fixed"],function(t,a){a="table-"+a,i.hasClass(a)&&(e.tableClass+=" "+a)}),(i.hasClass("table-hover")||e.rowHover)&&(e.tableClass+=" table-hover"),e.checkable&&t.fn.selectable||(e.selectable=!1),this.options=e},a.prototype.load=function(i){var a,s=this.options;if("function"==typeof i)i=i(this.data,this),i.keepSort=!0;else if(t.isPlainObject(i))this.data=i;else if("string"==typeof i){var o=t(i);o.length&&(this.$table=o.first(),this.$table.data(e,this),this.isTable=!0),i=null}else i=s.data;if(!i){if(!this.isTable)throw new Error("No data available!");i={cols:[],rows:[]},a=i.cols;var n,r,l,d,h,c,u=i.rows,p=this.$table;p.children("thead").children("tr:first").children("th").each(function(){r=t(this),a.push(t.extend({text:r.html(),flex:r.hasClass("flex-col"),width:"auto",cssClass:r.attr("class"),css:r.attr("style"),type:"string",ignore:r.hasClass("ignore"),sort:!r.hasClass("sort-disabled"),mergeRows:r.attr("merge-rows"),title:r.attr("title")},r.data()))}),p.children("tbody").children("tr").each(function(){l=t(this),h=t.extend({data:[],checked:!1,cssClass:l.attr("class"),css:l.attr("style"),id:l.attr("id")},l.data()),l.children("td").each(function(){if(d=t(this),c=d.attr("colspan")||1,h.data.push(t.extend({cssClass:d.attr("class"),css:d.attr("style"),text:d.html(),colSpan:c,title:d.attr("title")},d.data())),c>1)for(n=1;n<c;n++)h.data.push({empty:!0})}),u.push(h)});var f=p.children("tfoot");f.length&&(i.footer=t('<table class="table'+s.tableClass+'"></table>').append(f))}i.flexStart=-1,i.flexEnd=-1,a=i.cols,i.colsLength=a.length;for(var n=0;n<i.colsLength;++n){var g=a[n];g.flex&&(i.flexStart<0&&(i.flexStart=n),i.flexEnd=n)}0===i.flexStart&&i.flexEnd===i.colsLength&&(i.flexStart=-1,i.flexEnd=-1),i.flexArea=i.flexStart>=0,i.fixedRight=i.flexEnd>=0&&i.flexEnd<i.colsLength-1,i.fixedLeft=i.flexStart>0,i.flexStart<0&&i.flexEnd<0&&(i.fixedLeft=!0,i.flexStart=i.colsLength,i.flexEnd=i.colsLength),this.data=i,this.callEvent("afterLoad",{data:i}),this.render()},a.prototype.render=function(){var i,a,s,o,n=this,r=n.$datatable||(n.isTable?t('<div class="datatable" id="'+n.id+'"/>'):n.$datatable),l=n.options,d=n.data,h=n.data.cols,c=n.data.rows,u=l.checkable,p='<div class="datatable-rows-span datatable-span"><div class="datatable-wrapper"><table class="table"></table></div></div>',f='<div class="datatable-head-span datatable-span"><div class="datatable-wrapper"><table class="table"><thead></thead></table></div></div>';r.children(".datatable-head, .datatable-rows, .scroll-wrapper").remove(),r.toggleClass("sortable",l.sortable);var g,m,v,b=t('<div class="datatable-head"/>');for(i=t('<tr class="datatable-row datatable-row-left"/>'),s=t('<tr class="datatable-row datatable-row-right"/>'),o=t('<tr class="datatable-row datatable-row-flex"/>'),a=0;a<h.length;a++)v=h[a],g=a<d.flexStart?i:a>=d.flexStart&&a<=d.flexEnd?o:s,0===a&&u&&g.append('<th data-index="check" class="check-all check-btn"><i class="icon-check-empty"></i></th>'),v.ignore||(m=t('<th class="datatable-head-cell"/>'),m.toggleClass("sort-down","down"===v.sort).toggleClass("sort-up","up"===v.sort).toggleClass("sort-disabled",v.sort===!1),m.addClass(v.cssClass).addClass(v.colClass).html(v.text).attr({"data-index":a,"data-type":v.type,style:v.css,title:v.title}).css("width",v.width),g.append(m));var y;d.fixedLeft&&(y=t(f),y.addClass("fixed-left").find("table").addClass(l.tableClass).find("thead").append(i),b.append(y)),d.flexArea&&(y=t(f),y.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(l.tableClass).find("thead").append(o),b.append(y)),d.fixedRight&&(y=t(f),y.addClass("fixed-right").find("table").addClass(l.tableClass).find("thead").append(s),b.append(y)),r.append(b);var w,_,C,x,k,T,D,$,S=t('<div class="datatable-rows">'),M=c.length;i=t("<tbody/>"),s=t("<tbody/>"),o=t("<tbody/>");for(var z=0;z<M;++z){for(T=c[z],"undefined"==typeof T.id&&(T.id=z),T.index=z,w=t('<tr class="datatable-row"/>'),w.addClass(T.cssClass).toggleClass(l.checkedClass,!!T.checked).attr({"data-index":z,"data-id":T.id}),_=w.clone().addClass("datatable-row-flex"),C=w.clone().addClass("datatable-row-right"),w.addClass("datatable-row-left"),$=T.data.length,a=0;a<$;++a)D=T.data[a],a>0&&D.empty||(g=a<d.flexStart?w:a>=d.flexStart&&a<=d.flexEnd?_:C,0===a&&u&&(k=t('<td data-index="check" class="check-row check-btn"><i class="icon-check-empty"></i></td>'),l.checkboxName&&k.append('<input class="hide" type="checkbox" name="'+l.checkboxName+'" value="'+T.id+'">'),g.append(k)),h[a].ignore||(t.isPlainObject(D)?(D.row=z,D.index=a):D={text:D,row:z,index:a},T.data[a]=D,x=t('<td class="datatable-cell"/>'),x.html(D.text).addClass(D.cssClass).addClass(h[a].colClass).attr("colspan",D.colSpan).attr({"data-row":z,"data-index":a,"data-flex":!1,"data-type":h[a].type,style:D.css,title:D.title||""}).css("width",h[a].width),g.append(x)));i.append(w),o.append(_),s.append(C)}var I;d.fixedLeft&&(I=t(p),I.addClass("fixed-left").find("table").addClass(l.tableClass).append(i),S.append(I)),d.flexArea&&(I=t(p),I.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(l.tableClass).append(o),S.append(I)),d.fixedRight&&(I=t(p),I.addClass("fixed-right").find("table").addClass(l.tableClass).append(s),S.append(I)),r.append(S),d.flexArea&&r.append('<div class="scroll-wrapper"><div class="scroll-slide scroll-pos-'+l.scrollPos+'"><div class="bar"></div></div></div>');var E=r.children(".datatable-footer").detach();d.footer?(r.append(t('<div class="datatable-footer"/>').append(d.footer)),d.footer=null):E.length&&r.append(E),n.$datatable=r.data(e,n),n.isTable&&n.firstShow&&(n.$table.attr("data-datatable-id",this.id).hide().after(r),n.firstShow=!1),n.bindEvents(),n.refreshSize(),n.callEvent("render")},a.prototype.toggleAnimation=function(t){var e=this;void 0===t&&(t=e.$.hasClass("no-animation")),e.toggleAnimationTimer&&(clearTimeout(e.toggleAnimationTimer),e.toggleAnimationTimer=null),t?e.toggleAnimationTimer=setTimeout(function(){e.toggleAnimationTimer=null,e.$.removeClass("no-animation")},500):e.$.addClass("no-animation")},a.prototype.bindEvents=function(){var e=this,a=this.data,s=this.options,o=this.$datatable,n=e.$dataSpans=o.children(".datatable-head, .datatable-rows").find(".datatable-span"),r=e.$rowsSpans=o.children(".datatable-rows").children(".datatable-rows-span"),l=e.$headSpans=o.children(".datatable-head").children(".datatable-head-span"),d=e.$cells=n.find(".datatable-head-cell,.datatable-cell"),h=e.$dataCells=d.filter(".datatable-cell");e.$headCells=d.filter(".datatable-head-cell");var c=e.$rows=e.$rowsSpans.find(".datatable-row");if(s.rowHover){var u=s.hoverClass;r.on("mouseenter",".datatable-cell",function(){h.filter("."+u).removeClass(u),c.filter("."+u).removeClass(u),c.filter('[data-index="'+t(this).addClass(u).data("row")+'"]').addClass(u)}).on("mouseleave",".datatable-cell",function(){h.filter("."+u).removeClass(u),c.filter("."+u).removeClass(u)})}if(s.colHover){var p=s.colHoverClass;l.on("mouseenter",".datatable-head-cell",function(){d.filter("."+p).removeClass(p),d.filter('[data-index="'+t(this).data("index")+'"]').addClass(p)}).on("mouseleave",".datatable-head-cell",function(){d.filter("."+p).removeClass(p)})}if(a.flexArea){var f,g,m,v,b,y,w=o.find(".scroll-slide"),_=o.find(".datatable-span.flexarea"),C=o.find(".datatable-span.fixed-left"),x=o.find(".datatable-span.flexarea .table-datatable"),k=w.children(".bar"),T=e.id+"_scrollOffset";e.width=o.width(),o.resize(function(){e.width=o.width()});var D=function(t,e){v=Math.max(0,Math.min(f-g,t)),e||o.addClass("scrolling"),k.css("left",v),y=0-Math.floor((m-f)*v/(f-g)),x.css("left",y),o.toggleClass("scrolled-in",v>2).toggleClass("scrolled-out",v<f-g-2),s.storage&&i.pageSet(T,v)},$=function(){f=_.width(),w.css({width:f,left:C.width()}),m=0,x.first().find("tr:first").children("td,th").each(function(){m+=t(this).outerWidth()}),g=Math.floor(f*f/m),k.css("width",g),x.css("min-width",Math.max(f,m)),o.toggleClass("show-scroll-slide",m>f),b||f===g||(b=!0,D(i.pageGet(T,0),!0)),o.hasClass("size-changing")&&D(v,!0)};_.resize($),s.storage&&$();var S={move:!1,stopPropagation:!0,drag:function(t){D(k.position().left+t.smallOffset.x*(t.element.hasClass("bar")?1:-1))},finish:function(){o.removeClass("scrolling")}};t.fn.draggable?(k.draggable(S),s.flexHeadDrag&&o.find(".datatable-head-span.flexarea").draggable(S)):console.error("DataTable requires draggable.js to improve UI."),w.mousedown(function(t){var e=t.pageX-w.offset().left;D(e-g/2)})}if(s.checkable){var M,z=e.id+"_checkedStatus",I=s.checkedClass,E=function(){var o=r.first().find(".datatable-row"),n=o.filter("."+I);s.checkboxName&&o.find(".check-row input:checkbox").prop("checked",!1);var d={checkedAll:o.length===n.length&&n.length>0,checks:n.map(function(){return M=t(this).data("id"),s.checkboxName&&t(this).find(".check-row input:checkbox").prop("checked",!0),M}).toArray()};e.checks=d,t.each(a.rows,function(e,i){i.checked=t.inArray(i.id,d.checks)>-1}),l.find(".check-all").toggleClass("checked",!!d.checkedAll),s.storage&&i.pageSet(z,d),e.callEvent("checksChanged",{checks:d})},U=function(e,i){var a=t(e).closest("tr");void 0===i&&(i=!a.hasClass(I)),c.filter('[data-index="'+a.data("index")+'"]').toggleClass(I,!!i)},P="click.zui.datatable.check";if(s.selectable){var H={selector:".datatable-rows .datatable-row",trigger:".datatable-rows",start:function(e){var i=t(e.target).closest(".check-row, .check-btn");if(i.length)return i.is(".check-row")&&(U(i),E()),!1},rangeFunc:function(t,e){return Math.max(t.top,e.top)<Math.min(t.top+t.height,e.top+e.height)},select:function(t){U(t.target,!0)},unselect:function(t){U(t.target,!1)},finish:function(t){E()}};t.isPlainObject(s.selectable)&&t.extend(H,s.selectable),this.$datatable.selectable(H)}else this.$rowsSpans.off(P).on(P+"row",s.checkByClickRow?"tr":".check-row",function(){U(this),E()});if(this.$datatable.off(P).on("click.zui.datatable.check",".check-all",function(){e.toggleAnimation(!1),c.toggleClass(I,t(this).toggleClass("checked").hasClass("checked")),E(),e.toggleAnimation(!0)}).on(P+".none",".check-none",function(){e.toggleAnimation(!1),c.toggleClass(I,!1),E(),e.toggleAnimation(!0)}).on(P+".inverse",".check-inverse",function(){e.toggleAnimation(!1),c.toggleClass(I),E(),e.toggleAnimation(!0)}),s.storage){var L=i.pageGet(z);L&&(l.find(".check-all").toggleClass("checked",L.checkedAll),L.checkedAll?c.addClass(I):(c.removeClass(I),t.each(L.checks,function(t,e){c.filter('[data-id="'+e+'"]').addClass(I)})),L.checks.length&&E())}}if(s.fixedHeader){var A,O,F,N=o.children(".datatable-head"),j=s.fixedHeaderOffset||t(".navbar.navbar-fixed-top").height()||0,R=function(){A=o.offset().top,F=t(window).scrollTop(),O=o.height(),o.toggleClass("head-fixed",F+j>A&&F+j<A+O),o.hasClass("head-fixed")?N.css({width:o.width(),top:j}):N.attr("style","")};t(window).scroll(R),R()}s.sortable?(l.on("click","th:not(.sort-disabled, .check-btn)",function(){o.hasClass("size-changing")||e.sortTable(t(this))}),s.storage&&e.sortTable()):s.mergeRows&&this.mergeRows()},a.prototype.mergeRows=function(){for(var e=this.$rowsSpans.find(".datatable-cell"),i=this.data.cols,a=0;a<i.length;a++){var s=i[a];if(s.mergeRows){var o=e.filter('[data-index="'+a+'"]');if(o.length>1){var n,r;o.each(function(){var e=t(this);n&&e.html()===n.html()?(r=n.attr("rowspan")||1,"number"!=typeof r&&(r=parseInt(r),isNaN(r)&&(r=1)),n.attr("rowspan",r+1).css("vertical-align","middle"),e.remove()):n=e})}}}},a.prototype.sortTable=function(e){var i=t.zui.store,a=this.options,s=this.id+"_datatableSorter",o=a.storage?i.pageGet(s):null;if(e||(e=o?this.$headCells.filter('[data-index="'+o.index+'"]').addClass("sort-"+("up"===o.type?"down":"up")):this.$headCells.filter(".sort-up, .sort-down").first()),e.length){var n,r,l,d=this.data,h=d.cols,c=d.rows,u=this.$headCells;n=!e.hasClass("sort-up"),d.keepSort&&(n=!n),d.keepSort=null,u.removeClass("sort-up sort-down"),e.addClass(n?"sort-up":"sort-down"),l=e.data("index"),t.each(h,function(t,e){t==l||"up"!==e.sort&&"down"!==e.sort?t==l&&(e.sort=n?"up":"down",r=e.type):e.sort=!0});var p,f,g,m=this.$dataCells.filter('[data-index="'+l+'"]');c.sort(function(t,e){return t=t.data[l],e=e.data[l],p=m.filter('[data-row="'+t.row+'"]').text(),f=m.filter('[data-row="'+e.row+'"]').text(),"number"===r?(p=parseFloat(p),f=parseFloat(f)):"date"===r?(p=Date.parse(p),f=Date.parse(f)):(p=p.toLowerCase(),f=f.toLowerCase()),g=p<f?1:p>f?-1:0,n&&(g*=-1),g});var v,b,y,w=this.$rows,_=[];t.each(c,function(e,i){v=w.filter('[data-index="'+i.index+'"]'),v.each(function(e){y=t(this),b=_[e],b?b.after(y):y.parent().prepend(y),_[e]=y})}),o={index:l,type:n?"up":"down"},a.storage&&i.pageSet(s,o),this.callEvent("sort",{sorter:o})}},a.prototype.refreshSize=function(){var e,i=this.$datatable,a=this.options,s=this.data.rows;if(i.find(".datatable-span.fixed-left").css("width",a.fixedLeftWidth),i.find(".datatable-span.fixed-right").css("width",a.fixedRightWidth),a.fixCellHeight){var o=function(e){var i,a,s=0;return e.css("height","auto"),e.each(function(){i=t(this),a=i.attr("rowspan"),a&&1!=a||(s=Math.max(s,i.outerHeight()))}),s},n=this.$dataCells,r=this.$headCells,l=o(r);r.css("min-height",l).css("height",l);var d;for(e=0;e<s.length;++e){d=n.filter('[data-row="'+e+'"]');var h=o(d);d.css("min-height",h).css("height",h)}}},a.prototype.callEvent=function(t,e){var i=this.$.callEvent(t+"."+this.name,e,this).result;return!(void 0!==i&&!i)},t.fn.datatable=function(i,s){return this.each(function(){var o=t(this),n=o.data(e),r="object"==typeof i&&i;n||o.data(e,n=new a(this,r)),"string"==typeof i&&("load"!==i||!t.isPlainObject(s)||void 0!==s.keepSort&&null!==s.keepSort||(s.keepSort=!0),n[i](s))})},t.fn.datatable.Constructor=a}(jQuery),function(t,e,i){"use strict";t.fn.draggable||console.error("img-cutter requires draggable.js"),t.zui.imgReady||console.error("img-cutter requires image.ready.js");var a="zui.imgCutter",s=function(e,i){this.$=t(e),this.initOptions(i),this.init()};s.DEFAULTS={coverColor:"#000",coverOpacity:.6,defaultWidth:128,defaultHeight:128,minWidth:48,minHeight:48},s.prototype.callEvent=function(t,e){var s=this.$.callEvent(t+"."+a,e,this);return!(s.result!==i&&!s.result)},s.prototype.initOptions=function(e){this.options=t.extend({},s.DEFAULTS,this.$.data(),e),this.options.coverOpacityIE=100*this.options.coverOpacity,this.clipWidth=this.options.defaultWidth,this.clipHeight=this.options.defaultHeight},s.prototype.init=function(){this.initDom(),this.initSize(),this.bindEvents()},s.prototype.initDom=function(){this.$canvas=this.$.children(".canvas"),this.$img=this.$canvas.children("img"),this.$actions=this.$.children(".actions"),this.$btn=this.$.find(".img-cutter-submit"),this.$preview=this.$.find(".img-cutter-preview"),this.options.img=this.$img.attr("src"),this.$canvas.append('<div class="cover" style="background: {coverColor}; opacity: {coverOpacity}; filter:alpha(opacity={coverOpacityIE});"></div><div class="controller" style="width: {defaultWidth}px; height: {defaultHeight}px"><div class="control" data-direction="top"></div><div class="control" data-direction="right"></div><div class="control" data-direction="bottom"></div><div class="control" data-direction="left"></div><div class="control" data-direction="top-left"></div><div class="control" data-direction="top-right"></div><div class="control" data-direction="bottom-left"></div><div class="control" data-direction="bottom-right"></div></div><div class="cliper"><img src="{img}"/></div>'.format(this.options)),this.$cover=this.$canvas.children(".cover"),this.$controller=this.$canvas.children(".controller"),this.$cliper=this.$canvas.children(".cliper"),this.$chipImg=this.$cliper.children("img"),this.options.fixedRatio&&this.$.addClass("fixed-ratio")},s.prototype.resetImage=function(t){var e=this;e.options.img=t,e.$img.attr("src",t),e.$chipImg.attr("src",t),e.imgWidth=i,e.left=i,e.initSize()},s.prototype.initSize=function(){var a=this;a.imgWidth||t.zui.imgReady(a.options.img,function(){a.imgWidth=this.width,a.imgHeight=this.height,(this.width<a.options.minWidth||this.height<a.options.minHeight)&&(a.options.onSizeError&&a.options.onSizeError({width:this.width,height:this.height}),a.options.minWidth=e.min(this.width,a.options.minWidth),a.options.minHeight=e.min(this.height,a.options.minHeight)),a.callEvent("ready")});var s=setInterval(function(){a.imgWidth&&(clearInterval(s),a.width=e.min(a.imgWidth,a.$.width()),a.$canvas.css("width",this.width),a.$cliper.css("width",this.width),a.height=a.$canvas.height(),a.left===i&&(a.left=e.floor((a.width-a.$controller.width())/2),a.top=e.floor((a.height-a.$controller.height())/2)),a.refreshSize())},0)},s.prototype.refreshSize=function(t){var i=this.options;this.clipWidth=e.max(i.minWidth,e.min(this.width,this.clipWidth)),this.clipHeight=e.max(i.minHeight,e.min(this.height,this.clipHeight)),i.fixedRatio&&(t&&"height"===t?(this.clipWidth=e.max(i.minWidth,e.min(this.width,this.clipHeight*i.defaultWidth/i.defaultHeight)),this.clipHeight=this.clipWidth*i.defaultHeight/i.defaultWidth):(this.clipHeight=e.max(i.minHeight,e.min(this.height,this.clipWidth*i.defaultHeight/i.defaultWidth)),this.clipWidth=this.clipHeight*i.defaultWidth/i.defaultHeight)),this.left=e.min(this.width-this.clipWidth,e.max(0,this.left)),this.top=e.min(this.height-this.clipHeight,e.max(0,this.top)),this.right=this.left+this.clipWidth,this.bottom=this.top+this.clipHeight,this.$controller.css({left:this.left,top:this.top,width:this.clipWidth,height:this.clipHeight}),this.$cliper.css("clip","rect({0}px {1}px {2}px {3}px".format(this.top,this.left+this.clipWidth,this.top+this.clipHeight,this.left)),this.callEvent("change",{top:this.top,left:this.left,bottom:this.bottom,right:this.right,width:this.clipWidth,height:this.clipHeight})},s.prototype.getData=function(){var t=this;return t.data={originWidth:t.imgWidth,originHeight:t.imgHeight,scaleWidth:t.width,scaleHeight:t.height,width:t.right-t.left,height:t.bottom-t.top,left:t.left,top:t.top,right:t.right,bottom:t.bottom,scaled:t.imgWidth!=t.width||t.imgHeight!=t.height},t.data},s.prototype.bindEvents=function(){var i=this,a=this.options;this.$.resize(this.initSize.bind(this)),this.$btn.hover(function(){i.$.toggleClass("hover")}).click(function(){var e=i.getData();if(i.callEvent("before",e)){var s=a.post||a.get||a.url||null;null!==s&&t.ajax({type:a.post?"POST":"GET",url:s,data:e}).done(function(t){i.callEvent("done",t)}).fail(function(t){i.callEvent("fail",t)}).always(function(t){i.callEvent("always",t)})}}),this.$controller.draggable({move:!1,container:this.$canvas,drag:function(t){i.left+=t.smallOffset.x,i.top+=t.smallOffset.y,i.refreshSize()}}),this.$controller.children(".control").draggable({move:!1,container:this.$canvas,stopPropagation:!0,drag:function(t){var s=t.element.data("direction"),o=t.smallOffset,n=!1;switch(s){case"left":case"top-left":case"bottom-left":i.left+=o.x,i.left=e.min(i.right-a.minWidth,e.max(0,i.left)),i.clipWidth=i.right-i.left;break;case"right":case"top-right":case"bottom-right":i.clipWidth+=o.x,i.clipWidth=e.min(i.width-i.left,e.max(a.minWidth,i.clipWidth))}switch(s){case"top":case"top-left":case"top-right":i.top+=o.y,i.top=e.min(i.bottom-a.minHeight,e.max(0,i.top)),i.clipHeight=i.bottom-i.top,n=!0;break;case"bottom":case"bottom-left":case"bottom-right":i.clipHeight+=o.y,i.clipHeight=e.min(i.height-i.top,e.max(a.minHeight,i.clipHeight)),n=!0}i.refreshSize(n)}})},t.fn.imgCutter=function(e){return this.each(function(){var i=t(this),o=i.data(a),n="object"==typeof e&&e;o||i.data(a,o=new s(this,n)),"string"==typeof e&&o[e]()})},t.fn.imgCutter.Constructor=s,t(function(){t('[data-toggle="imgCutter"]').imgCutter()})}(jQuery,Math,void 0),function(t){"use strict";var e="zui.searchBox",i=function(e,a){var s=this;s.name=name,s.$=t(e),s.options=a=t.extend({},i.DEFAULTS,s.$.data(),a);var o=s.$.is(a.inputSelector)?s.$:s.$.find(a.inputSelector);if(o.length){var n=function(){s.changeTimer&&(clearTimeout(s.changeTimer),s.changeTimer=null)},r=function(){n();var t=s.getSearch();if(t!==s.lastValue){var e=""===t;o.toggleClass("empty",e),s.$.callComEvent(s,"onSearchChange",[t,e]),s.lastValue=t}};s.$input=o=o.first(),o.on(a.listenEvent,function(t){s.changeTimer=setTimeout(function(){r()},a.changeDelay)}).on("focus",function(t){o.addClass("focus"),s.$.callComEvent(s,"onFocus",[t])}).on("blur",function(t){o.removeClass("focus"),s.$.callComEvent(s,"onBlur",[t])}).on("keydown",function(t){var e=0,i=t.which;27===i&&a.escToClear?(this.setSearch("",!0),r(),e=1):13===i&&a.onPressEnter&&(r(),s.$.callComEvent(s,"onPressEnter",[t]));var o=s.$.callComEvent(s,"onKeyDown",[t]);o===!1&&(e=1),e&&t.preventDefault()}),s.$.on("click",".search-clear-btn",function(t){s.setSearch("",!0),r(),s.focus(),t.preventDefault()}),r()}else console.error("ZUI: search box init error, cannot find search box input element.")};i.DEFAULTS={inputSelector:'input[type="search"],input[type="text"]',listenEvent:"change input paste",changeDelay:500},i.prototype.getSearch=function(){return this.$input&&t.trim(this.$input.val())},i.prototype.setSearch=function(t,e){var i=this.$input;i&&(i.val(t),e||i.trigger("change"))},i.prototype.focus=function(){this.$input&&this.$input.focus()},t.fn.searchBox=function(a){return this.each(function(){var s=t(this),o=s.data(e),n="object"==typeof a&&a;o||s.data(e,o=new i(this,n)),"string"==typeof a&&o[a]()})},i.NAME=e,t.fn.searchBox.Constructor=i}(jQuery),function(t){"use strict";function e(e,i){if(e===!1)return e;if(!e)return i;e===!0?e={add:!0,"delete":!0,edit:!0,sort:!0}:"string"==typeof e&&(e=e.split(","));var a;return Array.isArray(e)&&(a={},t.each(e,function(e,i){t.isPlainObject(i)?a[i.action]=i:a[i]=!0}),e=a),t.isPlainObject(e)&&(a={},t.each(e,function(e,i){i?a[e]=t.extend({type:e},n[e],t.isPlainObject(i)?i:null):a[e]=!1}),e=a),i?t.extend(!0,{},i,e):e}function i(e,i,a){return i=i||e.type,t(a||e.template).addClass("tree-action").attr(t.extend({"data-type":i,title:e.title||""},e.attr)).data("action",e)}var a="zui.tree",s=0,o=function(e,i){this.name=a,this.$=t(e),this.getOptions(i),this._init()},n={sort:{template:'<a class="sort-handler" href="javascript:;"><i class="icon icon-move"></i></a>'},add:{template:'<a href="javascript:;"><i class="icon icon-plus"></i></a>'},edit:{template:'<a href="javascript:;"><i class="icon icon-pencil"></i></a>'},"delete":{template:'<a href="javascript:;"><i class="icon icon-trash"></i></a>'}};o.DEFAULTS={animate:null,initialState:"normal",toggleTemplate:'<i class="list-toggle icon"></i>'},o.prototype.add=function(e,i,a,s,o){var n,r=t(e),l=this.options;if(r.is("li")?(n=r.children("ul"),n.length||(n=t("<ul/>"),r.append(n),this._initList(n,r))):n=r,n){var d=this;Array.isArray(i)||(i=[i]),t.each(i,function(e,i){var a=t("<li/>").data(i).appendTo(n);void 0!==i.id&&a.attr("data-id",i.id);var s=l.itemWrapper?t(l.itemWrapper===!0?'<div class="tree-item-wrapper"/>':l.itemWrapper).appendTo(a):a;if(i.html)s.html(i.html);else if("function"==typeof d.options.itemCreator){var o=d.options.itemCreator(a,i);o!==!0&&o!==!1&&s.html(o)}else i.url?s.append(t("<a/>",{href:i.url}).text(i.title||i.name)):s.append(t("<span/>").text(i.title||i.name));d._initItem(a,i.idx||e,n,i),i.children&&i.children.length&&d.add(a,i.children)}),this._initList(n),a&&!n.hasClass("tree")&&d.expand(n.parent("li"),s,o)}},o.prototype.reload=function(e){var i=this;e&&(i.$.empty(),i.add(i.$,e)),i.isPreserve&&i.store.time&&i.$.find("li:not(.tree-action-item)").each(function(){var e=t(this);i[i.store[e.data("id")]?"expand":"collapse"](e,!0,!0)})},o.prototype._initList=function(a,s,o,n){var r=this;a.hasClass("tree")?(o=0,s=null):(s=(s||a.closest("li")).addClass("has-list"),s.find(".list-toggle").length||s.prepend(this.options.toggleTemplate),o=o||s.data("idx")),a.removeClass("has-active-item");var l=a.attr("data-idx",o||0).children("li:not(.tree-action-item)").each(function(e){r._initItem(t(this),e+1,a)});1!==l.length||l.find("ul").length||l.addClass("tree-single-item"),n=n||(s?s.data():null);var d=e(n?n.actions:null,this.actions);if(d){if(d.add&&d.add.templateInList!==!1){var h=a.children("li.tree-action-item");h.length?h.detach().appendTo(a):t('<li class="tree-action-item"/>').append(i(d.add,"add",d.add.templateInList)).appendTo(a)}d.sort&&a.sortable(t.extend({dragCssClass:"tree-drag-holder",trigger:".sort-handler",selector:"li:not(.tree-action-item)",finish:function(t){r.callEvent("action",{action:d.sort,$list:a,target:t.target,item:n})}},d.sort.options,t.isPlainObject(this.options.sortable)?this.options.sortable:null))}s&&(s.hasClass("open")||n&&n.open)&&s.addClass("open in")},o.prototype._initItem=function(a,s,o,n){if(void 0===s){var r=a.prev("li");s=r.length?r.data("idx")+1:1}if(o=o||a.closest("ul"),a.attr("data-idx",s).removeClass("tree-single-item"),!a.data("id")){var l=s;o.hasClass("tree")||(l=o.parent("li").data("id")+"-"+l),a.attr("data-id",l)}a.hasClass("active")&&o.parent("li").addClass("has-active-item"),n=n||a.data();var d=e(n.actions,this.actions);if(d){var h=a.find(".tree-actions");h.length||(h=t('<div class="tree-actions"/>').appendTo(this.options.itemWrapper?a.find(".tree-item-wrapper"):a),t.each(d,function(t,e){e&&h.append(i(e,t))}))}var c=a.children("ul");c.length&&this._initList(c,a,s,n)},o.prototype._init=function(){var i=this.options,o=this;this.actions=e(i.actions),this.$.addClass("tree"),i.animate&&this.$.addClass("tree-animate"),this._initList(this.$);var n=i.initialState,r=t.zui&&t.zui.store&&t.zui.store.enable;r&&(this.selector=a+"::"+(i.name||"")+"#"+(this.$.attr("id")||s++),this.store=t.zui.store[i.name?"get":"pageGet"](this.selector,{})),"preserve"===n&&(r?this.isPreserve=!0:this.options.initialState=n="normal"),this.reload(i.data),r&&(this.isPreserve=!0),"expand"===n?this.expand():"collapse"===n?this.collapse():"active"===n&&this.expandSelect(".active"),this.$.on("click",'.list-toggle,a[href="#"],.tree-toggle',function(e){var i=t(this),a=i.parent("li");o.callEvent("hit",{target:a,item:a.data()}),o.toggle(a),i.is("a")&&e.preventDefault()}).on("click",".tree-action",function(){var e=t(this),i=e.data();if(i.action&&(i=i.action),
"sort"!==i.type){var a=e.closest("li:not(.tree-action-item)");o.callEvent("action",{action:i,target:this,$item:a,item:a.data()})}})},o.prototype.preserve=function(e,i,a){if(this.isPreserve)if(e)i=i||e.data("id"),a=void 0===a&&e.hasClass("open"),a?this.store[i]=a:delete this.store[i],this.store.time=(new Date).getTime(),t.zui.store[this.options.name?"set":"pageSet"](this.selector,this.store);else{var s=this;this.store={},this.$.find("li").each(function(){s.preserve(t(this))})}},o.prototype.expandSelect=function(t){this.show(t,!0)},o.prototype.expand=function(t,e,i){t?(t.addClass("open"),!e&&this.options.animate?setTimeout(function(){t.addClass("in")},10):t.addClass("in")):t=this.$.find("li.has-list").addClass("open in"),i||this.preserve(t),this.callEvent("expand",t,this)},o.prototype.show=function(e,i,a){var s=this;e instanceof t||(e=s.$.find("li").filter(e)),e.each(function(){var e=t(this);if(s.expand(e,i,a),e)for(var o=e.parent("ul");o&&o.length&&!o.hasClass("tree");){var n=o.parent("li");n.length?(s.expand(n,i,a),o=n.parent("ul")):o=!1}})},o.prototype.collapse=function(t,e,i){t?!e&&this.options.animate?(t.removeClass("in"),setTimeout(function(){t.removeClass("open")},300)):t.removeClass("open in"):t=this.$.find("li.has-list").removeClass("open in"),i||this.preserve(t),this.callEvent("collapse",t,this)},o.prototype.toggle=function(t){var e=t&&t.hasClass("open")||t===!1||void 0===t&&this.$.find("li.has-list.open").length;this[e?"collapse":"expand"](t)},o.prototype.getOptions=function(e){this.options=t.extend({},o.DEFAULTS,this.$.data(),e),null===this.options.animate&&this.$.hasClass("tree-animate")&&(this.options.animate=!0)},o.prototype.toData=function(e,i){"function"==typeof e&&(i=e,e=null),e=e||this.$;var a=this;return e.children("li:not(.tree-action-item)").map(function(){var e=t(this),s=e.data();delete s["zui.droppable"];var o=e.children("ul");return o.length&&(s.children=a.toData(o)),"function"==typeof i?i(s,e):s}).get()},o.prototype.callEvent=function(e,i){var a;return"function"==typeof this.options[e]&&(a=this.options[e](i,this)),this.$.trigger(t.Event(e+"."+this.name,i)),a},t.fn.tree=function(e,i){return this.each(function(){var s=t(this),n=s.data(a),r="object"==typeof e&&e;n||s.data(a,n=new o(this,r)),"string"==typeof e&&n[e](i)})},t.fn.tree.Constructor=o,t(function(){t('[data-ride="tree"]').tree()})}(jQuery),function(t){t.fn.fixedDate=function(){return t(this).each(function(){var e=t(this).attr("autocomplete","off");"0000-00-00"==e.val()&&e.focus(function(){"0000-00-00"==e.val()&&e.val("").datetimepicker("update")}).blur(function(){""==e.val()&&e.val("0000-00-00")})})},window.datepickerOptions={language:t("html").attr("lang"),weekStart:1,todayBtn:1,autoclose:1,todayHighlight:1,startView:2,forceParse:0,showMeridian:1,format:"yyyy-mm-dd hh:ii",startDate:"1970-1-1"},t.extend(t.fn.datetimepicker.defaults,window.datepickerOptions),t(function(){var e={minView:2,format:"yyyy-mm-dd"},i={eleClass:"only-pick-time",startView:1,minView:0,maxView:1,format:"hh:ii"},a={minView:3,startView:3,format:"yyyy-mm"};t(".datepicker-wrapper").click(function(){t(this).find(".form-date, .form-datetime, .form-time, .form-month").datetimepicker("show").focus()}),t.fn.datepicker=function(i){return this.datetimepicker(t.extend({},e,i))},t.fn.timepicker=function(e){return this.datetimepicker(t.extend({},i,e))},t.fn.monthpicker=function(e){return this.datetimepicker(t.extend({},a,e))},t.fn.datepickerAll=function(){return this.find(".form-datetime").fixedDate().datetimepicker(),this.find(".form-date").fixedDate().datepicker(),this.find(".form-time").fixedDate().timepicker(),this.find(".form-month").fixedDate().monthpicker(),this},t("body").datepickerAll()})}(jQuery),function(t){"use strict";var e="zui.fileInput",i=t.BYTE_UNITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776},a=t.formatBytes=function(t,e,a){return void 0===e&&(e=2),a||(a=t<i.KB?"B":t<i.MB?"KB":t<i.GB?"MB":t<i.TB?"GB":"TB"),(t/i[a]).toFixed(e)+a},s=function(t){if("string"==typeof t){t=t.toUpperCase();var e=t.replace(/\d+/,"");t=parseFloat(t.replace(e,"")),t*=i[e]||i[e+"B"],t=Math.floor(t)}return t},o=function(i,n){var r=this;r.name=e;var l=r.$=t(i);n=r.options=t.extend({},o.DEFAULTS,this.$.data(),n),n.fileMaxSize&&"string"==typeof n.fileMaxSize&&(n.fileMaxSize=s(n.fileMaxSize));var d=r.$input=l.find('input[type="file"]');l.on("click",".file-input-btn",function(){d.trigger("click")}).on("click",".file-input-rename",function(){r.oldName=l.addClass("edit").find(".file-editbox").focus().val(),t.fn.fixInputGroup&&l.find(".input-group,.btn-group").fixInputGroup()}).on("click",".file-input-delete",function(){d.val(""),r.update(),n.onDelete&&n.onDelete(r)}).on("click",".file-name-cancel",function(){l.removeClass("edit").find(".file-editbox").focus().val(r.oldName)}).on("click",".file-name-confirm",function(){var e=l.find(".file-editbox"),i=t.trim(e.val());i.length?l.removeClass("edit").find(".file-title").text(i).attr("title",i):e.focus()}).on("change input paste",".file-editbox",function(){var e=t(this);e.attr("size",Math.max(5,e.val().length))}),d.on("change",function(){var t=r.getFile();t&&n.fileMaxSize&&t.size>n.fileMaxSize&&(d.val(""),(window.bootbox||window).alert(n.fileSizeError.format(a(n.fileMaxSize)))),r.update()}),r.update()};o.prototype.getFile=function(){var t=this.$input.prop("files");return t&&t[0]},o.prototype.update=function(){var t=this,e=t.$,i=t.getFile(),s=!i;e.toggleClass("normal",!s).toggleClass("empty",s),i?(t.oldName=i.name,e.find(".file-title").text(i.name).attr("title",i.name),e.find(".file-size").text(a(i.size)),e.find(".file-editbox").val(i.name).attr("size",i.name.length),t.options.onSelect&&t.options.onSelect(i,t)):e.find(".file-editbox").val("")},o.DEFAULTS={fileMaxSize:0,fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInput=function(i){return this.each(function(){var a=t(this),s=a.data(e),n="object"==typeof i&&i;s||a.data(e,s=new o(this,n)),"string"==typeof i&&s[i]()})},o.NAME=e,t.fn.fileInput.Constructor=o,t(function(){t('[data-provide="fileInput"]').fileInput()});var n="zui.fileInputList",r=function(e,i){var a=this;a.name=n;var s=a.$=t(e);i=a.options=t.extend({},r.DEFAULTS,this.$.data(),i),a.$template=s.find(".file-input").detach(),a.add()};r.prototype.add=function(){var t=this,e=t.options,i=t.$template.clone();"before"===e.appendWay?t.$.prepend(i):t.$.append(i),i.fileInput({fileMaxSize:e.eachFileMaxSize,fileSizeError:e.fileSizeError,onDelete:function(e){e.$.remove(),t.options.onDelete&&t.options.onDelete(e,t)},onSelect:function(e,i){t.add(),t.options.onSelect&&t.options.onSelect(e,i,t)}})},r.DEFAULTS={fileMaxSize:0,eachFileMaxSize:0,appendWay:"after",fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInputList=function(e){return this.each(function(){var i=t(this),a=i.data(n),s="object"==typeof e&&e;a||i.data(n,a=new r(this,s)),"string"==typeof e&&a[e]()})},r.NAME=n,t.fn.fileInputList.Constructor=r,t(function(){t('[data-provide="fileInputList"]').fileInputList()})}(jQuery),function(t,e){"use strict";var i="zui.table",a={zh_cn:{selectedItems:"已选择 <strong>{0}</strong> 项",attrTotal:"{0}总计 <strong>{1}</strong>"},zh_tw:{selectedItems:"已选择 <strong>{0}</strong> 项",attrTotal:"{0}总计 <strong>{1}</strong>"},en:{selectedItems:"Seleted <strong>{0}</strong> items",attrTotal:"{0} total <strong>{1}</strong>"},de:{selectedItems:"<strong>{0}</strong> ausgewählt",attrTotal:"{0} insgesamt <strong>{1}</strong>"},fr:{selectedItems:"<strong>{0}</strong> sélectionnés",attrTotal:"{0} total <strong>{1}</strong>"}},s=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),o=function(s,n){var r=this;r.name=i;var l=r.$=t(s);n=r.options=t.extend({},o.DEFAULTS,this.$.data(),n),r.langName=n.lang||t.zui.clientLang(),r.lang=t.zui.getLangData(i,r.langName,a),l.attr("id")||(l.attr("id","table-"+t.zui.uuid()),n.hot&&console.warn("ZUI: table hot replace id not defined, the element id attribute should be set.")),l.attr("data-ride")||l.attr("data-ride","table");var d=r.getTable();if(d.length){r.getTable().find("thead>tr>th").each(function(){var e=t(this);if(!e.attr("title")){var i=t.trim(e.find("a").text()||e.text()||"");i.length&&e.attr("title",i)}}),"auto"===n.checkable&&(n.checkable=!!l.find('input[type="checkbox"]').length),n.checkable&&(l.on("click",".check-all",function(){r.checkAll(!t(this).hasClass("checked"))}),n.checkOnClickRow===e&&(n.checkOnClickRow=!l.find('tr input[type="text"],tr textarea').length),n.checkOnClickRow&&l.on("click","tbody>tr",function(e){t(e.target).closest('.btn,a,.not-check,.form-control,input[type="text"],.chosen-container,td,th').length||r.checkRow(t(this))}),l.on("click",'tbody input[type="checkbox"],tbody label[for]',function(e){e.stopPropagation();var i=t(this);i.is("label")&&(i=i.closest(".checkbox-primary").find('input[type="checkbox"]')),r.checkRow(i.closest("tr"),i.is(":checked"))}),n.selectable&&t.fn.selectable&&l.selectable(t.extend({},{selector:r.isDataTable?".fixed-left tbody>tr":"tbody>tr",selectClass:"",trigger:".c-id",clickBehavior:"multi",listenClick:!1,select:function(e){r.checkRow(e.target,!0),z,t.cookie("ajax_dragSelected")||(t.cookie("ajax_dragSelected","on",{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("dragSelected"))},unselect:function(t){r.checkRow(t.target,!1)},rangeStyle:{border:"1px solid #006af1",backgroundColor:"rgba(50,128,252,0.2)",borderRadius:"2px"}},t.isPlainObject(n.selectable)?n.selectable:null)));var h=r.$form=l.is("form")?l:l.find("form");h.length&&(n.ajaxForm?h.ajaxForm(t.isPlainObject(n.ajaxForm)?n.ajaxForm:null):h.on("click","[data-form-action]",function(){h.attr("action",t(this).data("formAction")).submit()})),(n.fixFooter||n.fixHeader)&&(r.pageFooterHeight=t("#footer").outerHeight(),r.pageHeaderHeight=(t("#mainNavbar").outerHeight()||0)+(t("#menu").outerHeight()||0),r.updateFixUI(),t(window).on("scroll resize",function(){r.updateFixUI()}).on("sidebar.toggle querybox.toggle",function(){setTimeout(function(){r.updateFixUI()},200)})),n.group&&(l.on("click",".group-toggle",function(){r.toggleRowGroup(t(this).closest("tr").data("id"))}),t(document).on("click",".group-collapse-all",function(){r.toggleGroups(!1)}).on("click",".group-expand-all",function(){r.toggleGroups(!0)})),r.defaultStatistic=l.find(".table-statistic").html(),r.updateStatistic(),r.initModals(),r.checkItems={},r.updateCheckUI()}};o.prototype.reload=function(e){var i=this,a=i.options,s=a.replaceId;if(!s)return e&&e();"self"===s&&(s=i.$.attr("id"));var o=t("<div></div>");i.$.addClass("load-indicator loading"),o.load(window.location.href+" #"+s,function(){i.$.empty().html(o.children().html()).removeClass("load-indicator loading"),i.$.trigger("beforeTableReload"),i.updateStatistic(),i.initModals(),i.$.datepickerAll();var s=i.$.find("tbody>tr"),n=!1;t.each(i.checkItems,function(t,e){e&&(i.checkRow(s.filter('[data-id="'+t+'"]'),!0,!0),n=!0)}),n&&i.updateCheckUI(),i.$.trigger("tableReload");var r=t("#mainMenu>.btn-toolbar>.btn-active-text>.label");r.length&&r.text(i.getTable().find("tbody:first>tr:not(.table-children)").length),i.$.find('[data-ride="pager"]').pager(),e&&e(),a.afterReload&&a.afterReload()})},o.prototype.initModals=function(){var e=this,i=e.options,a=e.$.find(i.iframeModalTrigger);if(a.length){var s={type:"iframe",onHide:i.replaceId?function(){var a=t.cookie("selfClose");(1==a||i.hot)&&(t("#triggerModal").data("cancel-reload",1),e.reload(function(){t.cookie("selfClose",0)}))}:null};a.modalTrigger(s)}},o.prototype.getTable=function(){var t=this.$;if(this.isDataTable)return t.find("div.datatable");var e=t.is("table")?t:t.find("table:not(.fixed-header-copy)").first();return e.is(".datatable")&&(this.isDataTable=!0,e=t.find("div.datatable")),e},o.prototype.toggleGroups=function(e){var i=this,a={};i.$.find("tbody>tr").each(function(){var s=t(this).closest("tr").data("id");a[s]||i.toggleRowGroup(s,e)})},o.prototype.toggleRowGroup=function(i,a){var s=this.$.find('tbody>tr[data-id="'+i+'"]'),o=s.filter(".group-summary"),n=a===e?!o.hasClass("hidden"):!!a;s.not(".group-summary").toggleClass("hidden",!n),o.toggleClass("hidden",n),t("body").toggleClass("table-group-collapsed",!this.$.find("tbody>tr.group-summary.hidden").length)},o.prototype.updateStatistic=function(){var i=this,a=i.$.find(".table-statistic");if(a.length){if(i.defaultStatistic===e&&(i.defaultStatistic=a.html()),i.options.statisticCreator)return void a.html(i.options.statisticCreator(i)||i.defaultStatistic);var s=i.statisticCols;if(!s&&s!==!1){s={};var o=!1;i.getTable().find("thead th").each(function(e){var i=t(this),a=i.data("statistic");a&&(o=!0,s[e]={format:a,name:t.trim(i.text())})}),i.statisticCols=!!o&&s}var n=0;s&&t.each(s,function(t){s[t].total=0,s[t].checkedTotal=0}),i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr").each(function(){var i=t(this),a=i.hasClass("checked"),o=i.children("td");a&&n++,s&&t.each(s,function(t){var i=o.eq(t),n=i.data("statistic-val");n===e&&(n=i.text());var r=parseFloat(n);isNaN(r)&&(r=parseFloat(n.replace(/[^0-9\.]/gi,""))),isNaN(r)&&(r=0),s[t].total+=r,a&&(s[t].checkedTotal+=r)})});var r=[];if(n)r.push(i.lang.selectedItems.format(n));else if(i.defaultStatistic)return void a.html(i.defaultStatistic);s&&t.each(s,function(t){var e=s[t],a=e[n?"checkedTotal":"total"];e.format&&(a=e.format.format(a)),r.push(i.lang.attrTotal.format(e.name,a))}),a.html(r.join(", "))}},o.prototype.updateFixUI=function(e){var i=this,a=(new Date).getTime();if(!e&&(i.lastUpdateCall&&clearTimeout(i.lastUpdateCall),!i.lastUpdateTime||a-i.lastUpdateTime<100))return void(i.lastUpdateCall=setTimeout(function(){i.updateFixUI(!0)},200));if(i.lastUpdateTime=a,i.lastUpdateCall&&(clearTimeout(i.lastUpdateCall),i.lastUpdateCall=null),s){var o=i.getTable();if(o.parent().is(".table-responsive")){var n=o.find("thead"),r=0;n.find("th").each(function(){r+=t(this).outerWidth()}),o.css("min-width",r)}}i.options.fixHeader&&!i.isDataTable&&i.fixHeader(),i.options.fixFooter&&i.fixFooter()},o.prototype.fixHeader=function(){var e=this,i=e.getTable(),a=i.find("thead"),s=a[0].getBoundingClientRect(),o=e.options.fixHeader,n=t.isFunction(o)?o(s,a):s.top<("number"==typeof o?o:e.pageHeaderHeight||-5),r=e.$.find(".fix-table-copy-wrapper"),l=i.parent(),d=l.is(".table-responsive");if(n){if(r.length||(r=t('<div class="fix-table-copy-wrapper" style="overflow: hidden; position:fixed; z-index: 3; top: 0;"></div>').append(t('<table class="fixed-header-copy"></table>').addClass(i.attr("class")).append(a.clone())).insertAfter(i)),d){var h=l[0].getBoundingClientRect();r.css({top:e.pageHeaderHeight||0,left:h.left,width:l.width()}),r.find(".fixed-header-copy").css({left:s.left-h.left,position:"relative",minWidth:i.width()}),l.data("fixHeaderScroll")||(l.data("fixHeaderScroll",1),i.width()>l.width()&&l.on("scroll",function(){e.fixHeader()}))}else r.css({top:e.pageHeaderHeight||0,left:s.left,width:s.width});var c=r.find("th");a.find("th").each(function(e){c.eq(e).css("width",t(this).outerWidth())})}else r.remove()},o.prototype.fixFooter=function(){var e,i=this,a=i.getTable(),s=i.$.find(".table-footer");if(i.isDataTable)e=a[0].getBoundingClientRect();else{var o=a.find("tbody");if(!o.length)return;e=o[0].getBoundingClientRect(),e=o[0].getBoundingClientRect()}var n=i.options.fixFooter;s.toggleClass("fixed-footer",!!r);var r=t.isFunction(n)?n(e,s):e.bottom>window.innerHeight-("number"==typeof n?n:i.pageFooterHeight||5);s.toggleClass("fixed-footer",!!r),a.toggleClass("with-footer-fixed",!!r),a.trigger("fixFooter",r);var l=t("body"),d=l.hasClass("body-modal");if(r){var h=a.parent(),c=h.is(".table-responsive");s.css({bottom:i.pageFooterHeight||0,left:c?h[0].getBoundingClientRect().left:e.left,width:c?h.width():e.width}),d&&l.css("padding-bottom",40),i.$.css("margin-bottom",s.outerHeight())}else s.css({width:"",left:0,bottom:0}),d&&l.css("padding-bottom",0),i.$.css("margin-bottom","")},o.prototype.checkAll=function(e){var i=this,a=i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr");a.each(function(){var a=t(this);a.parent().closest("tr").length||i.checkRow(t(this),e,!0)}),i.updateCheckUI()},o.prototype.checkRow=function(t,i,a){var s=this;s.isDataTable&&!t.is(".datatable-row-left")&&(t=s.getTable().find('.datatable-row-left[data-index="'+t.data("index")+'"]'));var o=t.find('input[type="checkbox"]');o.length&&(i===e&&(i=!o.is(":checked")),s.isDataTable?s.getTable().find('.datatable-row[data-index="'+t.data("index")+'"]').toggleClass("checked",i):t.toggleClass("checked",i),this.checkItems[t.data("id")]=i,o.prop("checked",i).trigger("change"),a||s.updateCheckUI())},o.prototype.updateCheckUI=function(){var e=this,i=e.getTable(),a=i.find(e.isDataTable?".fixed-left tbody>tr":"tbody>tr").filter(function(){var e=t(this);return!e.hasClass("group-summary")&&e.find('input[type="checkbox"]').length&&!e.parent().closest("tr").length}),s=!1,o=null,n=0,r=!1,l=a.length;a.each(function(a){var d=t(this),h=d.find('input[type="checkbox"]');r=h.is(":checked");var c=e.isDataTable?i.find('.datatable-row[data-index="'+d.data("index")+'"]'):d;c.toggleClass("checked",r),c.toggleClass("row-check-begin",r&&!s),o&&o.toggleClass("row-check-end",!r&&s),r&&(n+=1),o=c,s=r,l===a+1&&c.toggleClass("row-check-end",r)}),e.$.toggleClass("has-row-checked",n>0).find(".check-all").toggleClass("checked",!(!l||n!==l)),e.updateStatistic(),e.options.onCheckChange&&e.options.onCheckChange()},o.DEFAULTS={checkable:"auto",ajaxForm:!1,selectable:!0,fixHeader:!0,fixFooter:!0,iframeWidth:900,replaceId:"self",hot:!1,iframeModalTrigger:'.iframe,[data-toggle="modal"][data-type="iframe"]'},t.fn.table=function(e){return this.each(function(){var a=t(this),s=a.data(i),n="object"==typeof e&&e;s||a.data(i,s=new o(this,n)),"string"==typeof e&&s[e]()})},o.NAME=i,t.fn.table.Constructor=o,t(function(){t('[data-ride="table"]').table()})}(jQuery,void 0),function(t){"use strict";var e="zui.searchList",i=function(t,e){if(t&&t.length)for(var i=0;i<t.length;++i)if(e.indexOf(t[i])<0)return!1;return!0},a=function(i,s){var o=this;o.name=e;var n=o.$=t(i);s=o.options=t.extend({},a.DEFAULTS,this.$.data(),s);var r=n.find(s.searchBox);r.length&&(r.searchBox({onSearchChange:function(t){o.search(t)},onKeyDown:function(t){var e=t.which;if(13===e){var i=o.getActiveItem();i.length&&(s.onSelectItem?s.onSelectItem(i):window.location.href=i.attr("href")),t.preventDefault()}else if(38===e){var i=o.getActiveItem();i.removeClass("active");for(var a=i.prev();a.length&&!a.is(".search-list-item:not(.hidden)");)a=a.prev();a.length||(a=o.getItems().not(".hidden").last()),o.scrollTo(a.addClass("active")),t.preventDefault()}else if(40===e){var i=o.getActiveItem();i.removeClass("active");for(var n=i.next();n.length&&!n.is(".search-list-item:not(.hidden)");)n=n.next();n.length||(n=o.getItems().not(".hidden").first()),o.scrollTo(n.addClass("active")),t.preventDefault()}},onFocus:function(){n.addClass("searchbox-focus")},onBlur:function(){n.removeClass("searchbox-focus")}}),o.searchBox=r.data("zui.searchBox"),o.search(o.searchBox.getSearch()));var l=o.$menu=n.closest(".dropdown-menu");if(l.length){o.isDropdown=!0,n.on("click",function(e){t(e.target).closest(s.selector+",[data-toggle]").length||e.stopPropagation()});var d=l.parent();d.on(d.hasClass("dropdown-hover")?"mouseenter":"shown.zui.dropdown",function(){o.tryLoadRemote(function(){setTimeout(function(){o.searchBox&&o.searchBox.focus()},50)})})}n.on("mouseenter",s.selector,function(){n.find(o.options.selector).not(".hidden").removeClass("active"),t(this).addClass("active")})};a.prototype.tryLoadRemote=function(t){var e=this,i=e.options;i.url||i.ajax?e.isLoaded?t():e.loadRemote(t):t()},a.prototype.loadRemote=function(e){var i=this,a=i.options;i.$menu.addClass("load-indicator loading").find(".list-group").remove(),i.isLoaded=!1,t.ajax(t.extend({url:a.url,type:"GET",dataType:"html",success:function(a,s,o){var n=t(a);n.hasClass("list-group")||(n=t('<div class="list-group"></div>').append(n)),i.$menu.append(n),i.$menu.removeClass("loading"),i.isLoaded=!0,e&&e(!0)},error:function(){i.$menu.removeClass("loading").append('<div class="list-group"><div class="text-error has-padding">'+(a.errorText||window.lang&&window.lang.timeout)+"</div></div>"),e&&e(!1)}},a.ajax))},a.prototype.scrollTo=function(t){t.length&&t[0].scrollIntoViewIfNeeded&&t[0].scrollIntoViewIfNeeded({behavior:"smooth"})},a.prototype.getItems=function(){return this.$.find(this.options.selector).addClass("search-list-item")},a.prototype.getActiveItem=function(){return this.getItems().filter(".active:first")},a.prototype.search=function(e){var a=this,s=void 0===e||null===e||""===e;a.$.toggleClass("has-search-text",!s);var o=a.getItems().removeClass("active");if(s)o.removeClass("hidden");else{var n=t.trim(e).split(" ");o.each(function(){var e=t(this),a=e.text()+" "+(e.data("key")||e.data("filter"));e.toggleClass("hidden",!i(n,a))})}a.scrollTo(o.not(".hidden").first().addClass("active"))},a.DEFAULTS={selector:".list-group a:not(.not-list-item)",searchBox:".search-box",onSelectItem:null},t.fn.searchList=function(i){return this.each(function(){var s=t(this),o=s.data(e),n="object"==typeof i&&i;o||s.data(e,o=new a(this,n)),"string"==typeof i&&o[i]()})},a.NAME=e,t.fn.searchList.Constructor=a,t(function(){t('[data-ride="searchList"]').searchList()})}(jQuery),function(t){window.config||(window.config={}),window.createLink||(t.createLink=window.createLink=function(t,e,a,s,o){if(s||(s=config.defaultView),o||(o=!1),a)for(a=a.split("&"),i=0;i<a.length;i++){var n=a[i].split("=");a[i]=[n.shift(),n.join("=")]}var r;if("GET"!=config.requestType){if("PATH_INFO"==config.requestType&&(r=config.webRoot+t+config.requestFix+e),"PATH_INFO2"==config.requestType&&(r=config.webRoot+"index.php/"+t+config.requestFix+e),a)for(i=0;i<a.length;i++)r+=config.requestFix+a[i][1];r+="."+s}else if(r=config.router+"?"+config.moduleVar+"="+t+"&"+config.methodVar+"="+e+"&"+config.viewVar+"="+s,a)for(i=0;i<a.length;i++)r+="&"+a[i][0]+"="+a[i][1];if(void 0!==config.onlybody&&"yes"==config.onlybody||o){var l="GET"!=config.requestType?"?onlybody=yes":"&onlybody=yes";r+=l}return r}),t(function(){var e=t("#main,#mainContent,#mainRow,.auto-fade-in");e.length&&e.hasClass("fade")&&setTimeout(function(){e.addClass("in")},e.data("fadeTime")||200)});var e=function(t){var e=0;if(t){var i=t.split(":");e+=60*parseInt(i[0]),e+=parseInt(i[1])}return e},a=function(t){t%=1440;var e=Math.floor(t/60),i=t%60;return e<10&&(e="0"+e),i<10&&(i="0"+i),e+":"+i},s=function(t){if("string"==typeof t&&(t=e(t)),"number"==typeof t)if(t<1e5){var i=new Date;i.setHours(Math.floor(t/60)%24),i.setMinutes(t%60),t=i}else t=new Date(t);return t},o=function(t,i){for(var o=i?s(i):new Date,n=o.getHours(),r=10*Math.floor(o.getMinutes()/10)+10,l=0;l<24;++l){var d=(l+n)%24;if(!(d<5))for(var h=0;h<6;++h){var c=a(60*d+10*h+r);t.append('<option value="'+c+'">'+c+"</option>")}}t.val()||(time=e(o.format("hh:mm")),time=time-time%10+10,t.val(a(time)))};t.fn.timeSpanControl=function(i){return this.each(function(){var n=t(this),r=t.extend({},i,n.data()),l=n.find('[name="begin"],.control-time-begin'),d=n.find('[name="end"],.control-time-end'),h=function(){var t=l.val();if(n.find(".hide-empty-begin").toggleClass("hide",!t),t){var i=a(e(t)+30);d.find('option[value="'+i+'"]').length&&d.val(i),r.onChange&&r.onChange(d,i)}};if(n.data("timeSpanControlInit")){if(r.begin){var c=s(r.begin).format("hh:mm");l.find('option[value="'+c+'"]').length&&l.val(c),r.onChange&&r.onChange(l,c)}if(r.end){var u=s(r.end).format("hh:mm");d.find('option[value="'+u+'"]').length&&d.val(u),r.onChange&&r.onChange(d,u)}}else l.on("change",h),o(l,r.begin),o(d,r.end),n.data("timeSpanControlInit",!0);r.end||h()})},t.timeSpanControl={convertTimeToNum:e,convertNumToTime:a,initTimeSelect:o,createTime:s},t.removeAnchor=window.removeAnchor=function(t){var e=t.lastIndexOf("#");return e>-1?t.substr(0,e):t},t.refreshPage=function(){location.href=removeAnchor(location.href)},t.extend(t.fn.table.Constructor.DEFAULTS,{fixFooter:36}),t.chosenDefaultOptions={middle_highlight:!0,disable_search_threshold:1,compact_search:!0,allow_single_deselect:!0,placeholder_text_single:" ",placeholder_text_multiple:" ",max_drop_width:400,search_contains:!0,drop_direction:function(){var e=t(this.container).closest(".table-responsive:not(.scroll-none)");if(e.length){if(this.drop_directionFixed)return this.drop_directionFixed;var i="down",a=this.container.find(".chosen-drop"),s=this.container.position(),o=a.outerHeight();return s.top>=o&&s.top+o<e.outerHeight()&&(i="up"),this.drop_directionFixed=i,i}return"auto"}},t.chosenSimpleOptions=t.extend({},t.chosenDefaultOptions,{disable_search_threshold:6}),t.fn._chosen=t.fn.chosen,t.fn.chosen=function(e){return"string"==typeof e?this._chosen(e):this.each(function(){var i=t(this).addClass("chosen-controled");return i._chosen(t.extend({},i.hasClass("chosen-simple")?t.chosenSimpleOptions:t.chosenDefaultOptions,i.data(),e))})};var n=function(e){e.each(function(){var e=t(this);e.closest(".template").length||e.chosen()})};t.extend(t.fn.pager.Constructor.DEFAULTS,{maxNavCount:8,prevIcon:"icon-angle-left",nextIcon:"icon-angle-right",firstIcon:"icon-first-page",lastIcon:"icon-last-page",navEllipsisItem:"…",menuDirection:"dropup",pageSizeOptions:[5,10,15,20,25,30,35,40,45,50,100,200,500,1e3,2e3],elements:["total_text","size_menu","first_icon","prev_icon",'<div class="pager-label"><strong>{page}</strong>/<strong>{totalPage}</strong></div>',"next_icon","last_icon"],onPageChange:function(e,i){e.recPerPage!==i.recPerPage&&t.cookie(this.options.pageCookie,e.recPerPage,{expires:config.cookieLife,path:config.webRoot}),e.recPerPage!==i.recPerPage&&(window.location.href=this.createLink())}}),t.extend(t.zui.Messager.DEFAULTS,{cssClass:"messagger-rz",icons:{success:"check-sign",info:"info",warning:"bell",danger:"alert"}}),t.fn.reverseOrder=function(){return this.each(function(){var e=t(this);e.prependTo(e.parent())})};var r=function(e,i){var a=t(e);if(!a.data("historiesInited")){a.data("historiesInited",1);var s=a.find(".histories-list").first();i=t.extend({},a.data(),i);var o=!0,n=!1;if(a.on("click",".btn-reverse",function(){s.children("li").reverseOrder(),o=!o,t(this).find(".icon").toggleClass("icon-arrow-up",o).toggleClass("icon-arrow-down",!o),t.cookie&&t.cookie("historyOrder",o?"log-asc":"log-desc",{path:v.webRoot});var e="#lastComment",i=t(e);i.length&&window.KindEditor&&t.fn.kindeditor&&(window.KindEditor.remove(e),i.kindeditor())}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");n=!n,e.toggleClass("icon-plus",!n).toggleClass("icon-minus",n),s.children("li").toggleClass("show-changes",n)}).on("click",".btn-expand",function(){t(this).closest("li").toggleClass("show-changes")}).on("click",".btn-strip",function(){var e=t(this),a=e.find(".icon"),s=a.hasClass("icon-code");a.toggleClass("icon-code",!s).toggleClass("icon-text",s),e.attr("title",s?i.original:i.textdiff),e.closest("li").toggleClass("show-original",s)}),s.find(".btn-strip").attr("title",i.original),t.cookie){var r=t.cookie("historyOrder");"log-desc"===r&&a.find(".btn-reverse").click()}var l=a.find(".modal-comment").modal({show:!1}).on("shown.zui.modal",function(){var t=l.find("#comment");t.length&&(t.focus(),window.editor&&window.editor.comment&&window.editor.comment.focus())}).on("show.zui.modal",function(){var e=l.find("#comment");e.length&&!e.data("keditor")&&t.fn.kindeditor&&e.kindeditor()});a.on("click",".btn-comment",function(t){l.modal("toggle"),t.preventDefault()}).on("click",".btn-edit-comment,.btn-hide-form",function(){t(this).closest("li").toggleClass("show-form")});var d=a.find(".comment-edit-form");d.ajaxForm({success:function(t,e,i,a){setTimeout(function(){d.closest("li").removeClass("show-form")},2e3)}})}};t.fn.histories=function(t){return this.each(function(){r(this,t)})},t.fn.colorPicker&&t.extend(t.fn.colorPicker.Constructor.DEFAULTS,{colors:["#3DA7F5","#75C941","#2DBDB2","#797EC9","#FFAF38","#FF4E3E"]}),t.extend(t.fn.modal.bs.Constructor.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:100,onSetScrollbar:function(e){t("#mainNavbar,#menu").css("padding-right",e)}});var l={scrollInside:!0,backdrop:"static",headerHeight:40,name:"ajaxModal",delay:200,handleLinkInIframe:".loadInModal,.load-in-modal"};t.extend(t.zui.ModalTrigger.DEFAULTS,l),t.extend(t.zui.modalTrigger.options,l),t.fixedTableHead=window.fixedTableHead=function(e,i){var a=t(e);if(a.is("table")||(a=a.find("table")),a.length){var s=t(i||window),o=null,n=function(){var e=a.children("thead"),i=e[0].getBoundingClientRect(),s=a.next(".fixed-head-table");if(i.top<0){var n=e.width();if(s.length){if(o!==n){o=n;var r=s.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var s=t("<table class='table fixed-head-table' style='position:fixed; top: 0;'></table>").addClass(a.attr("class")),l=e.clone(),r=l.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())}),s.append(l).insertAfter(a)}s.css({left:i.left,width:i.width}).show()}else s.hide()};s.on("scroll",n).on("resize",n),n()}},t(document).on("click","tr[data-url]",function(e){if(!t(e.target).is("a")){var i=t(this),a=i.data("href")||i.data("url");a&&(window.location.href=a)}}),"yes"===config.onlybody&&self===parent&&(window.location.href=window.location.href.replace("?onlybody=yes","").replace("&onlybody=yes","")),t.fn.tree.Constructor.DEFAULTS.initialState="preserve",t.closeModal=function(e,i,a){t.zui.closeModal(a,e,i)};var d=1,h=function(e){var i,a,s=t(e),o=s.children(".input-group-addon,.form-control:not(.chosen-controled),.chosen-container,.btn,.input-control,.input-group-btn,.datepicker-wrapper,.picker").not(".hidden,:hidden"),n=1===o.length;o.each(function(e){var s=t(this),r=s.is(".input-group-addon")?"addon":s.is(".chosen-container")?"chosen":s.is(".btn")?"btn":s.is(".input-control,.datepicker-wrapper")?"insideInput":s.is(".input-group-btn")?"insideBtn":s.is(".picker")?"picker":"input",l={};if(n)l.borderTopLeftRadius=d,l.borderBottomLeftRadius=d,l.borderTopRightRadius=d,l.borderBottomRightRadius=d;else{var h=!i,c=e===o.length-1;l.borderTopLeftRadius=0,l.borderBottomLeftRadius=0,l.borderTopRightRadius=0,l.borderBottomRightRadius=0,h&&("addon"===r&&(l.borderLeftWidth=1),l.borderTopLeftRadius=d,l.borderBottomLeftRadius=d),c&&("addon"===r&&(l.borderRightWidth=1),l.borderTopRightRadius=d,l.borderBottomRightRadius=d),a?"chosen"!==a&&"picker"!==a&&"input"!==a&&"btn"!==a&&"insideInput"!==a&&"insideBtn"!==a||"chosen"!==r&&"picker"!==r&&"input"!==r&&"btn"!==r&&"insideInput"!==r&&"insideBtn"!==r?"addon"===a&&"addon"===r&&(l.borderLeftWidth=1):l.borderLeftColor="transparent":l.borderLeftColor=""}("insideBtn"===r?s.children(".btn"):"insideInput"===r?s.find(".form-control"):"chosen"===r?s.find(".chosen-single,.chosen-choices"):"picker"===r?s.find(".picker-selections"):s).css(l),i=s,a=r})};t.fn.fixInputGroup=function(){return this.each(function(){var e=t(this);e.is(".input-group,.btn-group")||(e=e.find(".input-group,.btn-group"),e.length&&e.fixInputGroup()),h(this)})};var c=function(){var e=t(".main-actions>.btn-toolbar");if(e.length){var i,a,s=!1,o=null,n=e.children(),r=n.length;for(n.each(function(e){i=t(this),a=i.is(".divider"),a&&!o&&i.hide(),s||a||(s=!0),o=a?null:i,!a||e!==r-1&&0!==e||i.hide()});i.length&&i.is(".divider");)i=i.hide().prev();s||e.hide()}},u=function(){for(var e=t("#mainContent>.main-row>.main-col,#mainContent>.main-col"),i=e.children(".main-actions"),a=i.prev();a.length&&a.is(":hidden");)a=a.prev();if(i.length&&a.length){t('<div class="main-actions-holder"></div>').css("height",i.outerHeight()).insertAfter(i);var s=function(){var e=a[0].getBoundingClientRect(),s=e.top+e.height+120>t(window).height();t("body").toggleClass("main-actions-fixed",s),s&&i.width(a.width())};t.resetToolbarPosition=s,s(),t(window).on("resize scroll",s)}},p=t.appAvatarTones=["#56c6ed","#787bff","#edcb45","#ff7940"],f=t.namedAppIcons={superadmin:{color:"#787bff",icon:"config-outline"},home:{color:"#56c6ed",icon:"home"},c:{color:"#787bff",icon:"crm"},o:{color:"#edcb45",icon:"oa"},t:{color:"#ff7940",icon:"team"},p:{color:"#56c6ed",icon:"proj"},d:{color:"#787bff",icon:"doc"
},g:{color:"#56c6ed",icon:"g"},$:{color:"#edcb45",icon:"cash"},h:{color:"#ff7940",icon:"hr"},i:{color:"#56c6ed",icon:"psi"},f:{color:"#787bff",icon:"flow"},a:{color:"#edcb45",icon:"ameba"},z:{color:"#56c6ed",icon:"zentao"},k:{color:"#ff7940",icon:"k"},edu:{color:"#787bff",icon:"e"},todo:{color:"#00da88",icon:"check-circle"},action:{color:"#16a8f8",icon:"file-text"}};f.dashboard=f.home,f.crm=f.c,f.oa=f.o,f.team=f.t,f.proj=f.p,f.doc=f.d,f.cash=f.$,f.hr=f.h,f.psi=f.i,f.flow=f.f,f.ameba=f.a,f.zentao=f.z,f.knowledge=f.k,f.train=f.k,f.gantt=f.g,t.fn.renderAvatar=function(){return this.each(function(){var e=t(this);if(e.hasClass("avatar-app")){var i=""+e.data("code");if(e.find("img,.text,.icon").length&&(!f[i]||e.find(".icon").length))return void(e.data("tone")||e.attr("data-tone",p[(e.data("id")||0)%4]));if(f[i])e.attr("data-tone",f[i].color).html('<i class="icon icon-'+f[i].icon+'" style="color: '+f[i].color+'"></i>');else{var a=e.data("id"),s=""+e.data("name"),o=e.hasClass("avatar-user")?1:s.length,n=p[a%4];e.attr("data-tone",n).addClass("with-text").css("color",n),o>1&&e.addClass("with-double-chars"),e.html('<div class="text-icon" style="border-color:'+n+'"><span class="text"><span>'+(o>0?s.slice(0,1).toUpperCase():"")+'</span><span class="text-extra">'+(o>1?s.slice(1,2).toUpperCase():"")+"</span></span></div>")}}else{if(e.find("img").length)return;var a=e.data("id"),s=""+e.data("name"),r=new t.zui.Color({h:13*t.zui.strCode(a)%360,s:.8,l:.63}),n=r.toCssStr(),l=r.contrast().toCssStr();if(e.css({backgroundColor:n,color:l}),!e.find(".text,.icon").length)if(s){var o=e.hasClass("avatar-user")?1:s.length;e.attr("data-tone",n).addClass("with-text").css("color",n),o>1&&e.addClass("with-double-chars"),e.html('<div class="text-icon" style="border:none;color:'+l+'"><span class="text"><span>'+(o>0?s.slice(0,1).toUpperCase():"")+'</span><span class="text-extra">'+(o>1?s.slice(1,2).toUpperCase():"")+"</span></span></div>")}else e.append('<i class="icon icon-user"></i>')}})},t.showAppNotification=function(e){if(e.app&&t.namedAppIcons[e.app]){var i=t('<div class="avatar avatar-app avatar-inverse"></div>').attr({"data-code":e.app,"data-id":e.app,"data-name":e.appName||e.title}).addClass(e.avatarClass||"avatar-lg"),a=i.renderAvatar()[0].outerHTML;e=t.extend(e,{icon:{html:a}})}return t.zui.showNotification(e)};var g=t.zui.initPage=function(e){var i=t(e||"body");i.find(".histories").histories(),n(i.find(".chosen,.chosen-simple")),t.fn.datepickerAll&&i.datepickerAll(),i.find(".input-group,.btn-group").fixInputGroup(),i.find(".avatar-app,.avatar-user").renderAvatar(),i.find('[data-provide="fileInputList"]').fileInputList()};t(function(){t("body").addClass("m-{currentModule}-{currentMethod} app-{appName}".format(config)),t("#menuActions").appendTo("#menu>.container"),g(),c(),u(),t(document).on("loaded.zui.modal",function(e,i){setTimeout(function(){g(i&&"iframe"===i.modalType?i.jQuery("body"):t(e.target))},100)})})}(jQuery);