").append(d.clone()).html()),g()):(h.html(d),g());else if(o.url){var v=function(){var t=l.callComEvent(r,"broken");t&&(h.html(t),g())};if(l.attr("ref",o.url),"iframe"===o.type){l.addClass("modal-iframe"),this.firstLoad=!0;var _="iframe-"+o.name;u.detach(),h.detach(),p.empty().append(u).append(h),h.css("padding",0).html('
'),o.waittime>0&&(r.waitTimeout=g(o.waittime,v));var y=document.getElementById(_);y.onload=y.onreadystatechange=function(){if(r.firstLoad&&l.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){r.firstLoad=!1,o.waittime>0&&clearTimeout(r.waitTimeout);try{l.attr("ref",y.contentWindow.location.href);var t=e.frames[_].$;if(t&&"auto"===o.height&&"fullscreen"!=o.size){var i=t("body").addClass("body-modal");o.iframeBodyClass&&i.addClass(o.iframeBodyClass);var a=function(t){l.removeClass("fade");var e=i.outerHeight();t===!0&&o.onlyIncreaseHeight&&(e=Math.max(e,h.data("minModalHeight")||0),h.data("minModalHeight",e)),h.css("height",e),o.fade&&l.addClass("fade"),g()};l.callComEvent(r,"loaded",{modalType:"iframe",jQuery:t}),setTimeout(a,100),i.off("resize."+n).on("resize."+n,f)}else g();t.extend({closeModal:e.closeModal})}catch(s){g()}}}}else t.ajax(t.extend({url:o.url,success:function(i){try{var n=t(i);n.filter(".modal-dialog").length?c.replaceWith(n):n.filter(".modal-content").length?c.find(".modal-content").replaceWith(n):h.wrapInner(n)}catch(o){e.console&&e.console.warn&&console.warn("ZUI: Cannot recogernize remote content.",{error:o,data:i}),l.html(i)}l.callComEvent(r,"loaded",{modalType:a}),g()},error:v},o.ajaxOptions))}l.modal({show:"show",backdrop:o.backdrop,moveable:o.moveable,rememberPos:o.rememberPos,keyboard:o.keyboard})},r.prototype.close=function(i,n){(i||n)&&this.$modal.on("hidden"+o,function(){t.isFunction(i)&&i(),typeof n===s&&("this"===n?e.location.reload():e.location=n)}),this.$modal.modal("hide")},r.prototype.toggle=function(t){this.isShown?this.close():this.show(t)},r.prototype.ajustPosition=function(e){e=e===i?this.options.position:e,t.isFunction(e)&&(e=e(this)),this.$modal.modal("ajustPosition",e)},t.zui({ModalTrigger:r,modalTrigger:new r}),t.fn.modalTrigger=function(e,i){return t(this).each(function(){var a=t(this),o=a.data(n),l=t.extend({title:a.attr("title")||a.text(),url:a.attr("href"),type:a.hasClass("iframe")?"iframe":""},a.data(),t.isPlainObject(e)&&e);o||a.data(n,o=new r(l,a)),typeof e==s?o[e](i):l.show&&o.show(i),a.on((l.trigger||"click")+".toggle."+n,function(t){o.toggle(l),a.is("a")&&t.preventDefault()})})};var l=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var n=t(this);n.hasClass("modal")?l.call(n,e,i):n.modalTrigger(e,i)})};var c=function(e){var i=typeof e;return"undefined"===i?e=t(".modal.modal-trigger"):i===s&&(e=t(e)),e&&e instanceof t?e:null},d=function(e,i,a){if(t.isFunction(e)){var o=a;a=i,i=e,e=o}e=c(e),e&&e.length&&e.each(function(){t(this).data(n).close(i,a)})},h=function(t,e){e=c(e),e&&e.length&&e.modal("ajustPosition",t)};t.zui({closeModal:d,ajustModalPosition:h}),t(document).on("click."+n+".data-api",'[data-toggle="modal"]',function(e){var i=t(this),a=i.attr("href"),o=null;try{o=t(i.attr("data-target")||a&&a.replace(/.*(?=#[^\s]+$)/,""))}catch(s){}o&&o.length||(i.data(n)?i.trigger(".toggle."+n):i.modalTrigger({show:!0})),i.is("a")&&e.preventDefault()})}(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:'
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,n){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(n);for(var a=this.options.trigger.split(" "),o=a.length;o--;){var s=a[o];if("click"==s)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=s){var r="hover"==s?"mouseenter":"focus",l="hover"==s?"mouseleave":"blur";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,n){i[t]!=n&&(e[t]=n)}),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 n=this;if(n.$element.trigger(i),i.isDefaultPrevented())return;var a=n.tip();n.setContent(e),n.options.animation&&a.addClass("fade");var o="function"==typeof n.options.placement?n.options.placement.call(n,a[0],n.$element[0]):n.options.placement,s=/\s?auto?\s?/i,r=s.test(o);r&&(o=o.replace(s,"")||"top"),a.detach().css({top:0,left:0,display:"block"}).addClass(o),n.options.container?a.appendTo(n.options.container):a.insertAfter(n.$element);var l=n.getPosition(),c=a[0].offsetWidth,d=a[0].offsetHeight;if(r){var h=n.$element.parent(),u=o,p=document.documentElement.scrollTop||document.body.scrollTop,f="body"==n.options.container?window.innerWidth:h.outerWidth(),g="body"==n.options.container?window.innerHeight:h.outerHeight(),m="body"==n.options.container?0:h.offset().left;o="bottom"==o&&l.top+l.height+d-p>g?"top":"top"==o&&l.top-p-d<0?"bottom":"right"==o&&l.right+c>f?"left":"left"==o&&l.left-c
'}),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(),n=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](n),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,n=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return!!n&&("$next"==n?e.next(".popover"):t(n))},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 n=t(this),a=n.data("zui.popover"),o="object"==typeof i&&i;
-=======
-function(t,e,i){"$:nomunge";function n(){a=e[r](function(){o.each(function(){var e=t(this),i=e.width(),n=e.height(),a=t.data(this,c);i===a.w&&n===a.h||e.trigger(l,[a.w=i,a.h=n])}),n()},s[d])}var a,o=t([]),s=t.resize=t.extend(t.resize,{}),r="setTimeout",l="resize",c=l+"-special-event",d="delay",h="throttleWindow";s[d]=250,s[h]=!0,t.event.special[l]={setup:function(){if(!s[h]&&this[r])return!1;var e=t(this);o=o.add(e),t.data(this,c,{w:e.width(),h:e.height()}),1===o.length&&n()},teardown:function(){if(!s[h]&&this[r])return!1;var e=t(this);o=o.not(e),e.removeData(c),o.length||clearTimeout(a)},add:function(e){function n(e,n,o){var s=t(this),r=t.data(this,c)||{};r.w=n!==i?n:s.width(),r.h=o!==i?o:s.height(),a.apply(this,arguments)}if(!s[h]&&this[r])return!1;var a;return t.isFunction(e)?(a=e,n):(a=e.handler,void(e.handler=n))}}}(jQuery,this),function(t,e){"use strict";var i,n,a="localStorage",o="page_"+t.location.pathname+t.location.search,s=function(){this.slience=!0;try{a in t&&t[a]&&t[a].setItem&&(this.enable=!0,i=t[a])}catch(s){}this.enable||(n={},i={getLength:function(){var t=0;return e.each(n,function(){t++}),t},key:function(t){var i,a=0;return e.each(n,function(e){return a===t?(i=e,!1):void a++}),i},removeItem:function(t){delete n[t]},getItem:function(t){return n[t]},setItem:function(t,e){n[t]=e},clear:function(){n={}}}),this.storage=i,this.page=this.get(o,{})};s.prototype.pageSave=function(){if(e.isEmptyObject(this.page))this.remove(o);else{var t,i=[];for(t in this.page){var n=this.page[t];null===n&&i.push(t)}for(t=i.length-1;t>=0;t--)delete this.page[i[t]];this.set(o,this.page)}},s.prototype.pageRemove=function(t){"undefined"!=typeof this.page[t]&&(this.page[t]=null,this.pageSave())},s.prototype.pageClear=function(){this.page={},this.pageSave()},s.prototype.pageGet=function(t,e){var i=this.page[t];return void 0===e||null!==i&&void 0!==i?i:e},s.prototype.pageSet=function(t,i){e.isPlainObject(t)?e.extend(!0,this.page,t):this.page[this.serialize(t)]=i,this.pageSave()},s.prototype.check=function(){if(!this.enable&&!this.slience)throw new Error("Browser not support localStorage or enable status been set true.");return this.enable},s.prototype.length=function(){return this.check()?i.getLength?i.getLength():i.length:0},s.prototype.removeItem=function(t){return i.removeItem(t),this},s.prototype.remove=function(t){return this.removeItem(t)},s.prototype.getItem=function(t){return i.getItem(t)},s.prototype.get=function(t,e){var i=this.deserialize(this.getItem(t));return"undefined"!=typeof i&&null!==i||"undefined"==typeof e?i:e},s.prototype.key=function(t){return i.key(t)},s.prototype.setItem=function(t,e){return i.setItem(t,e),this},s.prototype.set=function(t,e){return void 0===e?this.remove(t):(this.setItem(t,this.serialize(e)),this)},s.prototype.clear=function(){return i.clear(),this},s.prototype.forEach=function(t){for(var e=this.length(),n=e-1;n>=0;n--){var a=i.key(n);t(a,this.get(a))}return this},s.prototype.getAll=function(){var t={};return this.forEach(function(e,i){t[e]=i}),t},s.prototype.serialize=function(t){return"string"==typeof t?t:JSON.stringify(t)},s.prototype.deserialize=function(t){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return t||void 0}},e.zui({store:new s})}(window,jQuery),function(t){"use strict";var e="zui.searchBox",i=function(e,n){var a=this;a.name=name,a.$=t(e),a.options=n=t.extend({},i.DEFAULTS,a.$.data(),n);var o=a.$.is(n.inputSelector)?a.$:a.$.find(n.inputSelector);if(o.length){var s=function(){a.changeTimer&&(clearTimeout(a.changeTimer),a.changeTimer=null)},r=function(){s();var t=a.getSearch();if(t!==a.lastValue){var e=""===t;o.toggleClass("empty",e),a.$.callComEvent(a,"onSearchChange",[t,e]),a.lastValue=t}};a.$input=o=o.first(),a.lastValue=a.getSearch(),o.on(n.listenEvent,function(t){a.changeTimer=setTimeout(function(){r()},n.changeDelay)}).on("focus",function(t){o.addClass("focus"),a.$.callComEvent(a,"onFocus",[t])}).on("blur",function(t){o.removeClass("focus"),a.$.callComEvent(a,"onBlur",[t])}).on("keydown",function(t){var e=0,i=t.which;27===i&&n.escToClear?(this.setSearch("",!0),r(),e=1):13===i&&n.onPressEnter&&(r(),a.$.callComEvent(a,"onPressEnter",[t]));var o=a.$.callComEvent(a,"onKeyDown",[t]);o===!1&&(e=1),e&&t.preventDefault()}),a.$.on("click",".search-clear-btn",function(t){a.setSearch("",!0),r(),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(n){return this.each(function(){var a=t(this),o=a.data(e),s="object"==typeof n&&n;o||a.data(e,o=new i(this,s)),"string"==typeof n&&o[n]()})},i.NAME=e,t.fn.searchBox.Constructor=i}(jQuery),function(t,e){"use strict";var i="zui.draggable",n={container:"body",move:!0},a=0,o=function(e,i){var o=this;o.$=t(e),o.id=a++,o.options=t.extend({},n,o.$.data(),i),o.init()};o.DEFAULTS=n,o.NAME=i,o.prototype.init=function(){var n,a,o,s,r,l=this,c=l.$,d="before",h="drag",u="finish",p="."+i+"."+l.id,f="mousedown"+p,g="mouseup"+p,m="mousemove"+p,v=l.options,_=v.selector,y=v.handle,b=c,w=t.isFunction(v.move),k=function(t){var e=t.pageX,i=t.pageY;r=!0;var a={left:e-o.x,top:i-o.y};b.removeClass("drag-ready").addClass("dragging"),v.move&&(w?v.move(a,b):b.css(a)),v[h]&&v[h]({event:t,element:b,startOffset:o,pos:a,offset:{x:e-n.x,y:i-n.y},smallOffset:{x:e-s.x,y:i-s.y}}),s.x=e,s.y=i,v.stopPropagation&&t.stopPropagation()},x=function(i){if(t(e).off(p),!r)return void b.removeClass("drag-ready");var a={left:i.pageX-o.x,top:i.pageY-o.y};b.removeClass("drag-ready dragging"),v.move&&(w?v.move(a,b):b.css(a)),v[u]&&v[u]({event:i,element:b,startOffset:o,pos:a,offset:{x:i.pageX-n.x,y:i.pageY-n.y},smallOffset:{x:i.pageX-s.x,y:i.pageY-s.y}}),i.preventDefault(),v.stopPropagation&&i.stopPropagation()},C=function(i){var l=t.zui.getMouseButtonCode(v.mouseButton);if(!(l>-1&&i.button!==l)){var c=t(this);if(_&&(b=y?c.closest(_):c),v[d]){var h=v[d]({event:i,element:b});if(h===!1)return}var u=t(v.container),p=b.offset();a=u.offset(),n={x:i.pageX,y:i.pageY},o={x:i.pageX-p.left+a.left,y:i.pageY-p.top+a.top},s=t.extend({},n),r=!1,b.addClass("drag-ready"),i.preventDefault(),v.stopPropagation&&i.stopPropagation(),t(e).on(m,k).on(g,x)}};y?c.on(f,y,C):_?c.on(f,_,C):c.on(f,C)},o.prototype.destroy=function(){var n="."+i+"."+this.id;this.$.off(n),t(e).off(n),this.$.data(i,null)},t.fn.draggable=function(e){return this.each(function(){var n=t(this),a=n.data(i),s="object"==typeof e&&e;a||n.data(i,a=new o(this,s)),"string"==typeof e&&a[e]()})},t.fn.draggable.Constructor=o}(jQuery,document),function(t,e,i){"use strict";var n="zui.droppable",a={target:".droppable-target",deviation:5,sensorOffsetX:0,sensorOffsetY:0},o=0,s=function(e,i){var n=this;n.id=o++,n.$=t(e),n.options=t.extend({},a,n.$.data(),i),n.init()};s.DEFAULTS=a,s.NAME=n,s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},s.prototype.init=function(){var a,o,s,r,l,c,d,h,u,p,f,g,m,v=this,_=v.$,y=v.options,b=y.deviation,w="."+n+"."+v.id,k="mousedown"+w,x="mouseup"+w,C="mousemove"+w,T=y.selector,S=y.handle,E=y.flex,D=y.container,M=y.canMoveHere,F=_,P=!1,A=D?t(y.container).first():T?_:t("body"),U=function(e){if(P&&(f={left:e.pageX,top:e.pageY},!(i.abs(f.left-h.left)