").append(c.clone()).html()),g()):(d.html(c),g());else if(o.url){var v=function(){var t=l.callComEvent(r,"broken");t&&(d.html(t),g())};if(l.attr("ref",o.url),"iframe"===o.type){l.addClass("modal-iframe"),this.firstLoad=!0;var y="iframe-"+o.name;u.detach(),d.detach(),p.empty().append(u).append(d),d.css("padding",0).html('
'),o.waittime>0&&(r.waitTimeout=g(o.waittime,v));var b=document.getElementById(y);b.onload=b.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",b.contentWindow.location.href);var t=e.frames[y].$;if(t&&"auto"===o.height&&"fullscreen"!=o.size){var i=t("body").addClass("body-modal");o.iframeBodyClass&&i.addClass(o.iframeBodyClass);var n=function(t){l.removeClass("fade"),console.log("$framebody.outerHeight()",i.outerHeight());var e=i.outerHeight();t===!0&&o.onlyIncreaseHeight&&(e=Math.max(e,d.data("minModalHeight")||0),d.data("minModalHeight",e)),d.css("height",e),o.fade&&l.addClass("fade"),g()};l.callComEvent(r,"loaded",{modalType:"iframe",jQuery:t}),setTimeout(n,100),i.off("resize."+s).on("resize."+s,f)}else g()}catch(a){g()}}}}else t.ajax(t.extend({url:o.url,success:function(i){try{var s=t(i);s.filter(".modal-dialog").length?h.replaceWith(s):s.filter(".modal-content").length?h.find(".modal-content").replaceWith(s):d.wrapInner(s)}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:n}),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,s){(i||s)&&this.$modal.on("hidden"+o,function(){t.isFunction(i)&&i(),typeof s===a&&("this"===s?e.location.reload():e.location=s)}),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 n=t(this),o=n.data(s),l=t.extend({title:n.attr("title")||n.text(),url:n.attr("href"),type:n.hasClass("iframe")?"iframe":""},n.data(),t.isPlainObject(e)&&e);o||n.data(s,o=new r(l,n)),typeof e==a?o[e](i):l.show&&o.show(i),n.on((l.trigger||"click")+".toggle."+s,function(t){o.toggle(l),n.is("a")&&t.preventDefault()})})};var l=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var s=t(this);s.hasClass("modal")?l.call(s,e,i):s.modalTrigger(e,i)})};var h=function(e){var i=typeof e;return"undefined"===i?e=t(".modal.modal-trigger"):i===a&&(e=t(e)),e&&e instanceof t?e:null},c=function(i,n,o){var a=i;if(t.isFunction(i)){var r=o;o=n,n=i,i=r}i=h(i),i&&i.length?i.each(function(){t(this).data(s).close(n,o)}):t("body").hasClass("body-modal")&&e.parent.$.zui.closeModal(a,n,o)},d=function(t,e){e=h(e),e&&e.length&&e.modal("ajustPosition",t)};t.zui({closeModal:c,ajustModalPosition:d}),t(document).on("click."+s+".data-api",'[data-toggle="modal"]',function(e){var i=t(this),n=i.attr("href"),o=null;try{o=t(i.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,""))}catch(a){}o&&o.length||(i.data(s)?i.trigger(".toggle."+s):i.modalTrigger({show:!0})),i.is("a")&&e.preventDefault()}).on("click."+s+".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:'
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,s){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(s);for(var n=this.options.trigger.split(" "),o=n.length;o--;){var a=n[o];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var r="hover"==a?"mouseenter":"focus",l="hover"==a?"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,s){i[t]!=s&&(e[t]=s)}),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 s=this;if(s.$element.trigger(i),i.isDefaultPrevented())return;var n=s.tip();s.setContent(e),s.options.animation&&n.addClass("fade");var o="function"==typeof s.options.placement?s.options.placement.call(s,n[0],s.$element[0]):s.options.placement,a=/\s?auto?\s?/i,r=a.test(o);r&&(o=o.replace(a,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass(o),s.options.container?n.appendTo(s.options.container):n.insertAfter(s.$element);var l=s.getPosition(),h=n[0].offsetWidth,c=n[0].offsetHeight;if(r){var d=s.$element.parent(),u=o,p=document.documentElement.scrollTop||document.body.scrollTop,f="body"==s.options.container?window.innerWidth:d.outerWidth(),g="body"==s.options.container?window.innerHeight:d.outerHeight(),m="body"==s.options.container?0:d.offset().left;o="bottom"==o&&l.top+l.height+c-p>g?"top":"top"==o&&l.top-p-c<0?"bottom":"right"==o&&l.right+h>f?"left":"left"==o&&l.left-h
'}),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(),s=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](s),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,s=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return!!s&&("$next"==s?e.next(".popover"):t(s))},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 s=t(this),n=s.data("zui.popover"),o="object"==typeof i&&i;n||s.data("zui.popover",n=new e(this,o)),"string"==typeof i&&n[i]()})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(window.jQuery),+function(t){"use strict";function e(){t(n).remove(),t(o).each(function(e){var n=i(t(this));n.hasClass("open")&&(n.trigger(e=t.Event("hide."+s)),e.isDefaultPrevented()||n.removeClass("open").trigger("hidden."+s))})}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var s;try{s=i&&t(i)}catch(n){}return s&&s.length?s:e.parent()}var s="zui.dropdown",n=".dropdown-backdrop",o="[data-toggle=dropdown]",a=function(e){t(e).on("click."+s,this.toggle)};a.prototype.toggle=function(n){var o=t(this);if(!o.is(".disabled, :disabled")){var a=i(o),r=a.hasClass("open");if(e(),!r){if("ontouchstart"in document.documentElement&&!a.closest(".navbar-nav").length&&t('