(function(a){"use strict";var o=function(t,e){this.options=a.extend({},a.fn.editableform.defaults,e);this.$div=a(t);if(!this.options.scope){this.options.scope=this}};o.prototype={constructor:o,initInput:function(){this.input=this.options.input;this.value=this.input.str2value(this.options.value);this.input.prerender()},initTemplate:function(){this.$form=a(a.fn.editableform.template)},initButtons:function(){var t=this.$form.find(".editable-buttons");t.append(a.fn.editableform.buttons);if(this.options.showbuttons==="bottom"){t.addClass("editable-buttons-bottom")}},render:function(){this.$loading=a(a.fn.editableform.loading);this.$div.empty().append(this.$loading);this.initTemplate();if(this.options.showbuttons){this.initButtons()}else{this.$form.find(".editable-buttons").remove()}this.showLoading();this.isSaving=false;this.$div.triggerHandler("rendering");this.initInput();this.$form.find("div.editable-input").append(this.input.$tpl);this.$div.append(this.$form);a.when(this.input.render()).then(a.proxy(function(){if(!this.options.showbuttons){this.input.autosubmit()}this.$form.find(".editable-cancel").click(a.proxy(this.cancel,this));if(this.input.error){this.error(this.input.error);this.$form.find(".editable-submit").attr("disabled",true);this.input.$input.attr("disabled",true);this.$form.submit(function(t){t.preventDefault()})}else{this.error(false);this.input.$input.removeAttr("disabled");this.$form.find(".editable-submit").removeAttr("disabled");var t=this.value===null||this.value===undefined||this.value===""?this.options.defaultValue:this.value;this.input.value2input(t);this.$form.submit(a.proxy(this.submit,this))}this.$div.triggerHandler("rendered");this.showForm();if(this.input.postrender){this.input.postrender()}},this))},cancel:function(){this.$div.triggerHandler("cancel")},showLoading:function(){var t,e;if(this.$form){t=this.$form.outerWidth();e=this.$form.outerHeight();if(t){this.$loading.width(t)}if(e){this.$loading.height(e)}this.$form.hide()}else{t=this.$loading.parent().width();if(t){this.$loading.width(t)}}this.$loading.show()},showForm:function(t){this.$loading.hide();this.$form.show();if(t!==false){this.input.activate()}this.$div.triggerHandler("show")},error:function(t){var e=this.$form.find(".control-group"),i=this.$form.find(".editable-error-block"),s;if(t===false){e.removeClass(a.fn.editableform.errorGroupClass);i.removeClass(a.fn.editableform.errorBlockClass).empty().hide()}else{if(t){s=(""+t).split("\n");for(var n=0;n<s.length;n++){s[n]=a("<div>").text(s[n]).html()}t=s.join("<br>")}e.addClass(a.fn.editableform.errorGroupClass);i.addClass(a.fn.editableform.errorBlockClass).html(t).show()}},submit:function(t){t.stopPropagation();t.preventDefault();var i=this.input.input2value();var e=this.validate(i);if(a.type(e)==="object"&&e.newValue!==undefined){i=e.newValue;this.input.value2input(i);if(typeof e.msg==="string"){this.error(e.msg);this.showForm();return}}else if(e){this.error(e);this.showForm();return}if(!this.options.savenochange&&this.input.value2str(i)==this.input.value2str(this.value)){this.$div.triggerHandler("nochange");return}var s=this.input.value2submit(i);this.isSaving=true;a.when(this.save(s)).done(a.proxy(function(t){this.isSaving=false;var e=typeof this.options.success==="function"?this.options.success.call(this.options.scope,t,i):null;if(e===false){this.error(false);this.showForm(false);return}if(typeof e==="string"){this.error(e);this.showForm();return}if(e&&typeof e==="object"&&e.hasOwnProperty("newValue")){i=e.newValue}this.error(false);this.value=i;this.$div.triggerHandler("save",{newValue:i,submitValue:s,response:t})},this)).fail(a.proxy(function(t){this.isSaving=false;var e;if(typeof this.options.error==="function"){e=this.options.error.call(this.options.scope,t,i)}else{e=typeof t==="string"?t:t.responseText||t.statusText||"Unknown error!"}this.error(e);this.showForm()},this))},save:function(t){this.options.pk=a.fn.editableutils.tryParseJson(this.options.pk,true);var e=typeof this.options.pk==="function"?this.options.pk.call(this.options.scope):this.options.pk,i=!!(typeof this.options.url==="function"||this.options.url&&(this.options.send==="always"||this.options.send==="auto"&&e!==null&&e!==undefined)),s;if(i){this.showLoading();s={name:this.options.name||"",value:t,pk:e};if(typeof this.options.params==="function"){s=this.options.params.call(this.options.scope,s)}else{this.options.params=a.fn.editableutils.tryParseJson(this.options.params,true);a.extend(s,this.options.params)}if(typeof this.options.url==="function"){return this.options.url.call(this.options.scope,s)}else{return a.ajax(a.extend({url:this.options.url,data:s,type:"POST"},this.options.ajaxOptions))}}},validate:function(t){if(t===undefined){t=this.value}if(typeof this.options.validate==="function"){return this.options.validate.call(this.options.scope,t)}},option:function(t,e){if(t in this.options){this.options[t]=e}if(t==="value"){this.setValue(e)}},setValue:function(t,e){if(e){this.value=this.input.str2value(t)}else{this.value=t}if(this.$form&&this.$form.is(":visible")){this.input.value2input(this.value)}}};a.fn.editableform=function(s){var n=arguments;return this.each(function(){var t=a(this),e=t.data("editableform"),i=typeof s==="object"&&s;if(!e){t.data("editableform",e=new o(this,i))}if(typeof s==="string"){e[s].apply(e,Array.prototype.slice.call(n,1))}})};a.fn.editableform.Constructor=o;a.fn.editableform.defaults={type:"text",url:null,params:null,name:null,pk:null,value:null,defaultValue:null,send:"auto",validate:null,success:null,error:null,ajaxOptions:null,showbuttons:true,scope:null,savenochange:false};a.fn.editableform.template='<form class="form-inline editableform">'+'<div class="control-group">'+'<div><div class="editable-input"></div><div class="editable-buttons"></div></div>'+'<div class="editable-error-block"></div>'+"</div>"+"</form>";a.fn.editableform.loading='<div class="editableform-loading"></div>';a.fn.editableform.buttons='<button type="submit" class="editable-submit">ok</button>'+'<button type="button" class="editable-cancel">cancel</button>';a.fn.editableform.errorGroupClass=null;a.fn.editableform.errorBlockClass="editable-error";a.fn.editableform.engine="jquery"})(window.jQuery);(function(l){"use strict";l.fn.editableutils={inherit:function(t,e){var i=function(){};i.prototype=e.prototype;t.prototype=new i;t.prototype.constructor=t;t.superclass=e.prototype},setCursorPosition:function(t,e){if(t.setSelectionRange){t.setSelectionRange(e,e)}else if(t.createTextRange){var i=t.createTextRange();i.collapse(true);i.moveEnd("character",e);i.moveStart("character",e);i.select()}},tryParseJson:function(t,e){if(typeof t==="string"&&t.length&&t.match(/^[\{\[].*[\}\]]$/)){if(e){try{t=new Function("return "+t)()}catch(t){}finally{return t}}else{t=new Function("return "+t)()}}return t},sliceObj:function(t,e,i){var s,n,a={};if(!l.isArray(e)||!e.length){return a}for(var o=0;o<e.length;o++){s=e[o];if(t.hasOwnProperty(s)){a[s]=t[s]}if(i===true){continue}n=s.toLowerCase();if(t.hasOwnProperty(n)){a[s]=t[n]}}return a},getConfigData:function(t){var i={};l.each(t.data(),function(t,e){if(typeof e!=="object"||e&&typeof e==="object"&&(e.constructor===Object||e.constructor===Array)){i[t]=e}});return i},objectKeys:function(t){if(Object.keys){return Object.keys(t)}else{if(t!==Object(t)){throw new TypeError("Object.keys called on a non-object")}var e=[],i;for(i in t){if(Object.prototype.hasOwnProperty.call(t,i)){e.push(i)}}return e}},escape:function(t){return l("<div>").text(t).html()},itemsByValue:function(s,t,n){if(!t||s===null){return[]}if(typeof n!=="function"){var e=n||"value";n=function(t){return t[e]}}var a=l.isArray(s),o=[],r=this;l.each(t,function(t,e){if(e.children){o=o.concat(r.itemsByValue(s,e.children,n))}else{if(a){if(l.grep(s,function(t){return t==(e&&typeof e==="object"?n(e):e)}).length){o.push(e)}}else{var i=e&&typeof e==="object"?n(e):e;if(s==i){o.push(e)}}}});return o},createInput:function(t){var e,i,s,n=t.type;if(n==="date"){if(t.mode==="inline"){if(l.fn.editabletypes.datefield){n="datefield"}else if(l.fn.editabletypes.dateuifield){n="dateuifield"}}else{if(l.fn.editabletypes.date){n="date"}else if(l.fn.editabletypes.dateui){n="dateui"}}if(n==="date"&&!l.fn.editabletypes.date){n="combodate"}}if(n==="datetime"&&t.mode==="inline"){n="datetimefield"}if(n==="wysihtml5"&&!l.fn.editabletypes[n]){n="textarea"}if(typeof l.fn.editabletypes[n]==="function"){e=l.fn.editabletypes[n];i=this.sliceObj(t,this.objectKeys(e.defaults));s=new e(i);return s}else{l.error("Unknown type: "+n);return false}},supportsTransitions:function(){var t=document.body||document.documentElement,e=t.style,i="transition",s=["Moz","Webkit","Khtml","O","ms"];if(typeof e[i]==="string"){return true}i=i.charAt(0).toUpperCase()+i.substr(1);for(var n=0;n<s.length;n++){if(typeof e[s[n]+i]==="string"){return true}}return false}}})(window.jQuery);(function(r){"use strict";var l=function(t,e){this.init(t,e)};var h=function(t,e){this.init(t,e)};l.prototype={containerName:null,containerDataName:null,innerCss:null,containerClass:"editable-container editable-popup",defaults:{},init:function(t,e){this.$element=r(t);this.options=r.extend({},r.fn.editableContainer.defaults,e);this.splitOptions();this.formOptions.scope=this.$element[0];this.initContainer();this.delayedHide=false;this.$element.on("destroyed",r.proxy(function(){this.destroy()},this));if(!r(document).data("editable-handlers-attached")){r(document).on("keyup.editable",function(t){if(t.which===27){r(".editable-open").editableContainer("hide")}});r(document).on("click.editable",function(t){var e=r(t.target),i,s=[".editable-container",".ui-datepicker-header",".datepicker",".modal-backdrop",".bootstrap-wysihtml5-insert-image-modal",".bootstrap-wysihtml5-insert-link-modal"];if(!r.contains(document.documentElement,t.target)){return}if(e.is(document)){return}for(i=0;i<s.length;i++){if(e.is(s[i])||e.parents(s[i]).length){return}}l.prototype.closeOthers(t.target)});r(document).data("editable-handlers-attached",true)}},splitOptions:function(){this.containerOptions={};this.formOptions={};if(!r.fn[this.containerName]){throw new Error(this.containerName+" not found. Have you included corresponding js file?")}for(var t in this.options){if(t in this.defaults){this.containerOptions[t]=this.options[t]}else{this.formOptions[t]=this.options[t]}}},tip:function(){return this.container()?this.container().$tip:null},container:function(){var t;if(this.containerDataName){if(t=this.$element.data(this.containerDataName)){return t}}t=this.$element.data(this.containerName);return t},call:function(){this.$element[this.containerName].apply(this.$element,arguments)},initContainer:function(){this.call(this.containerOptions)},renderForm:function(){this.$form.editableform(this.formOptions).on({save:r.proxy(this.save,this),nochange:r.proxy(function(){this.hide("nochange")},this),cancel:r.proxy(function(){this.hide("cancel")},this),show:r.proxy(function(){if(this.delayedHide){this.hide(this.delayedHide.reason);this.delayedHide=false}else{this.setPosition()}},this),rendering:r.proxy(this.setPosition,this),resize:r.proxy(this.setPosition,this),rendered:r.proxy(function(){this.$element.triggerHandler("shown",r(this.options.scope).data("editable"))},this)}).editableform("render")},show:function(t){this.$element.addClass("editable-open");if(t!==false){this.closeOthers(this.$element[0])}this.innerShow();this.tip().addClass(this.containerClass);if(this.$form){}this.$form=r("<div>");if(this.tip().is(this.innerCss)){this.tip().append(this.$form)}else{this.tip().find(this.innerCss).append(this.$form)}this.renderForm()},hide:function(t){if(!this.tip()||!this.tip().is(":visible")||!this.$element.hasClass("editable-open")){return}if(this.$form.data("editableform").isSaving){this.delayedHide={reason:t};return}else{this.delayedHide=false}this.$element.removeClass("editable-open");this.innerHide();this.$element.triggerHandler("hidden",t||"manual")},innerShow:function(){},innerHide:function(){},toggle:function(t){if(this.container()&&this.tip()&&this.tip().is(":visible")){this.hide()}else{this.show(t)}},setPosition:function(){},save:function(t,e){this.$element.triggerHandler("save",e);this.hide("save")},option:function(t,e){this.options[t]=e;if(t in this.containerOptions){this.containerOptions[t]=e;this.setContainerOption(t,e)}else{this.formOptions[t]=e;if(this.$form){this.$form.editableform("option",t,e)}}},setContainerOption:function(t,e){this.call("option",t,e)},destroy:function(){this.hide();this.innerDestroy();this.$element.off("destroyed");this.$element.removeData("editableContainer")},innerDestroy:function(){},closeOthers:function(n){r(".editable-open").each(function(t,e){if(e===n||r(e).find(n).length){return}var i=r(e),s=i.data("editableContainer");if(!s){return}if(s.options.onblur==="cancel"){i.data("editableContainer").hide("onblur")}else if(s.options.onblur==="submit"){i.data("editableContainer").tip().find("form").submit()}})},activate:function(){if(this.tip&&this.tip().is(":visible")&&this.$form){this.$form.data("editableform").input.activate()}}};r.fn.editableContainer=function(a){var o=arguments;return this.each(function(){var t=r(this),e="editableContainer",i=t.data(e),s=typeof a==="object"&&a,n=s.mode==="inline"?h:l;if(!i){t.data(e,i=new n(this,s))}if(typeof a==="string"){i[a].apply(i,Array.prototype.slice.call(o,1))}})};r.fn.editableContainer.Popup=l;r.fn.editableContainer.Inline=h;r.fn.editableContainer.defaults={value:null,placement:"top",autohide:true,onblur:"cancel",anim:false,mode:"popup"};jQuery.event.special.destroyed={remove:function(t){if(t.handler){t.handler()}}}})(window.jQuery);(function(t){"use strict";t.extend(t.fn.editableContainer.Inline.prototype,t.fn.editableContainer.Popup.prototype,{containerName:"editableform",innerCss:".editable-inline",containerClass:"editable-container editable-inline",initContainer:function(){this.$tip=t("<span></span>");if(!this.options.anim){this.options.anim=0}},splitOptions:function(){this.containerOptions={};this.formOptions=this.options},tip:function(){return this.$tip},innerShow:function(){this.$element.hide();this.tip().insertAfter(this.$element).show()},innerHide:function(){this.$tip.hide(this.options.anim,t.proxy(function(){this.$element.show();this.innerDestroy()},this))},innerDestroy:function(){if(this.tip()){this.tip().empty().remove()}}})})(window.jQuery);(function(p){"use strict";var f=function(t,e){this.$element=p(t);this.options=p.extend({},p.fn.editable.defaults,e,p.fn.editableutils.getConfigData(this.$element));if(this.options.selector){this.initLive()}else{this.init()}if(this.options.highlight&&!p.fn.editableutils.supportsTransitions()){this.options.highlight=false}};f.prototype={constructor:f,init:function(){var t=false,e,i;this.options.name=this.options.name||this.$element.attr("id");this.options.scope=this.$element[0];this.input=p.fn.editableutils.createInput(this.options);if(!this.input){return}if(this.options.value===undefined||this.options.value===null){this.value=this.input.html2value(p.trim(this.$element.html()));t=true}else{this.options.value=p.fn.editableutils.tryParseJson(this.options.value,true);if(typeof this.options.value==="string"){this.value=this.input.str2value(this.options.value)}else{this.value=this.options.value}}this.$element.addClass("editable");if(this.input.type==="textarea"){this.$element.addClass("editable-pre-wrapped")}if(this.options.toggle!=="manual"){this.$element.addClass("editable-click");this.$element.on(this.options.toggle+".editable",p.proxy(function(t){if(!this.options.disabled){t.preventDefault()}if(this.options.toggle==="mouseenter"){this.show()}else{var e=this.options.toggle!=="click";this.toggle(e)}},this))}else{this.$element.attr("tabindex",-1)}if(typeof this.options.display==="function"){this.options.autotext="always"}switch(this.options.autotext){case"always":e=true;break;case"auto":e=!p.trim(this.$element.text()).length&&this.value!==null&&this.value!==undefined&&!t;break;default:e=false}p.when(e?this.render():true).then(p.proxy(function(){if(this.options.disabled){this.disable()}else{this.enable()}this.$element.triggerHandler("init",this)},this))},initLive:function(){var t=this.options.selector;this.options.selector=false;this.options.autotext="never";this.$element.on(this.options.toggle+".editable",t,p.proxy(function(t){var e=p(t.target);if(!e.data("editable")){if(e.hasClass(this.options.emptyclass)){e.empty()}e.editable(this.options).trigger(t)}},this))},render:function(t){if(this.options.display===false){return}if(this.input.value2htmlFinal){return this.input.value2html(this.value,this.$element[0],this.options.display,t)}else if(typeof this.options.display==="function"){return this.options.display.call(this.$element[0],this.value,t)}else{return this.input.value2html(this.value,this.$element[0])}},enable:function(){this.options.disabled=false;this.$element.removeClass("editable-disabled");this.handleEmpty(this.isEmpty);if(this.options.toggle!=="manual"){if(this.$element.attr("tabindex")==="-1"){this.$element.removeAttr("tabindex")}}},disable:function(){this.options.disabled=true;this.hide();this.$element.addClass("editable-disabled");this.handleEmpty(this.isEmpty);this.$element.attr("tabindex",-1)},toggleDisabled:function(){if(this.options.disabled){this.enable()}else{this.disable()}},option:function(t,e){if(t&&typeof t==="object"){p.each(t,p.proxy(function(t,e){this.option(p.trim(t),e)},this));return}this.options[t]=e;if(t==="disabled"){return e?this.disable():this.enable()}if(t==="value"){this.setValue(e)}if(this.container){this.container.option(t,e)}if(this.input.option){this.input.option(t,e)}},handleEmpty:function(t){if(this.options.display===false){return}if(t!==undefined){this.isEmpty=t}else{if(typeof this.input.isEmpty==="function"){this.isEmpty=this.input.isEmpty(this.$element)}else{this.isEmpty=p.trim(this.$element.html())===""}}if(!this.options.disabled){if(this.isEmpty){if(typeof this.options.emptytext==="function"){this.$element.html(this.options.emptytext.call(this))}else{this.$element.html(this.options.emptytext)}if(this.options.emptyclass){this.$element.addClass(this.options.emptyclass)}}else if(this.options.emptyclass){this.$element.removeClass(this.options.emptyclass)}}else{if(this.isEmpty){this.$element.empty();if(this.options.emptyclass){this.$element.removeClass(this.options.emptyclass)}}}},show:function(t){if(this.options.disabled){return}if(!this.container){var e=p.extend({},this.options,{value:this.value,input:this.input});this.$element.editableContainer(e);this.$element.on("save.internal",p.proxy(this.save,this));this.container=this.$element.data("editableContainer")}else if(this.container.tip().is(":visible")){return}this.container.show(t)},hide:function(){if(this.container){this.container.hide()}},toggle:function(t){if(this.container&&this.container.tip().is(":visible")){this.hide()}else{this.show(t)}},save:function(t,e){if(this.options.unsavedclass){var i=false;i=i||typeof this.options.url==="function";i=i||this.options.display===false;i=i||e.response!==undefined;i=i||this.options.savenochange&&this.input.value2str(this.value)!==this.input.value2str(e.newValue);if(i){this.$element.removeClass(this.options.unsavedclass)}else{this.$element.addClass(this.options.unsavedclass)}}if(this.options.highlight){var s=this.$element,n=s.css("background-color");s.css("background-color",this.options.highlight);setTimeout(function(){if(n==="transparent"){n=""}s.css("background-color",n);s.addClass("editable-bg-transition");setTimeout(function(){s.removeClass("editable-bg-transition")},1700)},10)}this.setValue(e.newValue,false,e.response)},validate:function(){if(typeof this.options.validate==="function"){return this.options.validate.call(this,this.value)}},setValue:function(t,e,i){if(e){this.value=this.input.str2value(t)}else{this.value=t}if(this.container){this.container.option("value",this.value)}p.when(this.render(i)).then(p.proxy(function(){this.handleEmpty()},this))},activate:function(){if(this.container){this.container.activate()}},destroy:function(){this.disable();if(this.container){this.container.destroy()}this.input.destroy();if(this.options.toggle!=="manual"){this.$element.removeClass("editable-click");this.$element.off(this.options.toggle+".editable")}this.$element.off("save.internal");this.$element.removeClass("editable editable-open editable-disabled");this.$element.removeData("editable")}};p.fn.editable=function(s){var n={},a=arguments,o="editable";switch(s){case"validate":this.each(function(){var t=p(this),e=t.data(o),i;if(e&&(i=e.validate())){n[e.options.name]=i}});return n;case"getValue":if(arguments.length===2&&arguments[1]===true){n=this.eq(0).data(o).value}else{this.each(function(){var t=p(this),e=t.data(o);if(e&&e.value!==undefined&&e.value!==null){n[e.options.name]=e.input.value2submit(e.value)}})}return n;case"submit":var e=arguments[1]||{},i=this,t=this.editable("validate");if(p.isEmptyObject(t)){var r={};if(i.length===1){var l=i.data("editable");var h={name:l.options.name||"",value:l.input.value2submit(l.value),pk:typeof l.options.pk==="function"?l.options.pk.call(l.options.scope):l.options.pk};if(typeof l.options.params==="function"){h=l.options.params.call(l.options.scope,h)}else{l.options.params=p.fn.editableutils.tryParseJson(l.options.params,true);p.extend(h,l.options.params)}r={url:l.options.url,data:h,type:"POST"};e.success=e.success||l.options.success;e.error=e.error||l.options.error}else{var u=this.editable("getValue");r={url:e.url,data:u,type:"POST"}}r.success=typeof e.success==="function"?function(t){e.success.call(i,t,e)}:p.noop;r.error=typeof e.error==="function"?function(){e.error.apply(i,arguments)}:p.noop;if(e.ajaxOptions){p.extend(r,e.ajaxOptions)}if(e.data){p.extend(r.data,e.data)}p.ajax(r)}else{if(typeof e.error==="function"){e.error.call(i,t)}}return this}return this.each(function(){var t=p(this),e=t.data(o),i=typeof s==="object"&&s;if(i&&i.selector){e=new f(this,i);return}if(!e){t.data(o,e=new f(this,i))}if(typeof s==="string"){e[s].apply(e,Array.prototype.slice.call(a,1))}})};p.fn.editable.defaults={type:"text",disabled:false,toggle:"click",emptytext:"Empty",autotext:"auto",value:null,display:null,emptyclass:"editable-empty",unsavedclass:"editable-unsaved",selector:null,highlight:"#FFFF80"}})(window.jQuery);(function(s){"use strict";s.fn.editabletypes={};var t=function(){};t.prototype={init:function(t,e,i){this.type=t;this.options=s.extend({},i,e)},prerender:function(){this.$tpl=s(this.options.tpl);this.$input=this.$tpl;this.$clear=null;this.error=null},render:function(){},value2html:function(t,e){s(e)[this.options.escape?"text":"html"](s.trim(t))},html2value:function(t){return s("<div>").html(t).text()},value2str:function(t){return t},str2value:function(t){return t},value2submit:function(t){return t},value2input:function(t){this.$input.val(t)},input2value:function(){return this.$input.val()},activate:function(){if(this.$input.is(":visible")){this.$input.focus()}},clear:function(){this.$input.val(null)},escape:function(t){return s("<div>").text(t).html()},autosubmit:function(){},destroy:function(){},setClass:function(){if(this.options.inputclass){this.$input.addClass(this.options.inputclass)}},setAttr:function(t){if(this.options[t]!==undefined&&this.options[t]!==null){this.$input.attr(t,this.options[t])}},option:function(t,e){this.options[t]=e}};t.defaults={tpl:"",inputclass:null,escape:true,scope:null,showbuttons:true};s.extend(s.fn.editabletypes,{abstractinput:t})})(window.jQuery);(function(r){"use strict";var t=function(t){};r.fn.editableutils.inherit(t,r.fn.editabletypes.abstractinput);r.extend(t.prototype,{render:function(){var t=r.Deferred();this.error=null;this.onSourceReady(function(){this.renderList();t.resolve()},function(){this.error=this.options.sourceError;t.resolve()});return t.promise()},html2value:function(t){return null},value2html:function(t,e,i,s){var n=r.Deferred(),a=function(){if(typeof i==="function"){i.call(e,t,this.sourceData,s)}else{this.value2htmlFinal(t,e)}n.resolve()};if(t===null){a.call(this)}else{this.onSourceReady(a,function(){n.resolve()})}return n.promise()},onSourceReady:function(e,i){var t;if(r.isFunction(this.options.source)){t=this.options.source.call(this.options.scope);this.sourceData=null}else{t=this.options.source}if(this.options.sourceCache&&r.isArray(this.sourceData)){e.call(this);return}try{t=r.fn.editableutils.tryParseJson(t,false)}catch(t){i.call(this);return}if(typeof t==="string"){if(this.options.sourceCache){var s=t,n;if(!r(document).data(s)){r(document).data(s,{})}n=r(document).data(s);if(n.loading===false&&n.sourceData){this.sourceData=n.sourceData;this.doPrepend();e.call(this);return}else if(n.loading===true){n.callbacks.push(r.proxy(function(){this.sourceData=n.sourceData;this.doPrepend();e.call(this)},this));n.err_callbacks.push(r.proxy(i,this));return}else{n.loading=true;n.callbacks=[];n.err_callbacks=[]}}var a=r.extend({url:t,type:"get",cache:false,dataType:"json",success:r.proxy(function(t){if(n){n.loading=false}this.sourceData=this.makeArray(t);if(r.isArray(this.sourceData)){if(n){n.sourceData=this.sourceData;r.each(n.callbacks,function(){this.call()})}this.doPrepend();e.call(this)}else{i.call(this);if(n){r.each(n.err_callbacks,function(){this.call()})}}},this),error:r.proxy(function(){i.call(this);if(n){n.loading=false;r.each(n.err_callbacks,function(){this.call()})}},this)},this.options.sourceOptions);r.ajax(a)}else{this.sourceData=this.makeArray(t);if(r.isArray(this.sourceData)){this.doPrepend();e.call(this)}else{i.call(this)}}},doPrepend:function(){if(this.options.prepend===null||this.options.prepend===undefined){return}if(!r.isArray(this.prependData)){if(r.isFunction(this.options.prepend)){this.options.prepend=this.options.prepend.call(this.options.scope)}this.options.prepend=r.fn.editableutils.tryParseJson(this.options.prepend,true);if(typeof this.options.prepend==="string"){this.options.prepend={"":this.options.prepend}}this.prependData=this.makeArray(this.options.prepend)}if(r.isArray(this.prependData)&&r.isArray(this.sourceData)){this.sourceData=this.prependData.concat(this.sourceData)}},renderList:function(){},value2htmlFinal:function(t,e){},makeArray:function(t){var i,s,n=[],e,a;if(!t||typeof t==="string"){return null}if(r.isArray(t)){a=function(t,e){s={value:t,text:e};if(i++>=2){return false}};for(var o=0;o<t.length;o++){e=t[o];if(typeof e==="object"){i=0;r.each(e,a);if(i===1){n.push(s)}else if(i>1){if(e.children){e.children=this.makeArray(e.children)}n.push(e)}}else{n.push({value:e,text:e})}}}else{r.each(t,function(t,e){n.push({value:t,text:e})})}return n},option:function(t,e){this.options[t]=e;if(t==="source"){this.sourceData=null}if(t==="prepend"){this.prependData=null}}});t.defaults=r.extend({},r.fn.editabletypes.abstractinput.defaults,{source:null,prepend:false,sourceError:"Error when loading list",sourceCache:true,sourceOptions:null});r.fn.editabletypes.list=t})(window.jQuery);(function(i){"use strict";var e=function(t){this.init("text",t,e.defaults)};i.fn.editableutils.inherit(e,i.fn.editabletypes.abstractinput);i.extend(e.prototype,{render:function(){this.renderClear();this.setClass();this.setAttr("placeholder")},activate:function(){if(this.$input.is(":visible")){this.$input.focus();i.fn.editableutils.setCursorPosition(this.$input.get(0),this.$input.val().length);if(this.toggleClear){this.toggleClear()}}},renderClear:function(){if(this.options.clear){this.$clear=i('<span class="editable-clear-x"></span>');this.$input.after(this.$clear).css("padding-right",24).keyup(i.proxy(function(t){if(~i.inArray(t.keyCode,[40,38,9,13,27])){return}clearTimeout(this.t);var e=this;this.t=setTimeout(function(){e.toggleClear(t)},100)},this)).parent().css("position","relative");this.$clear.click(i.proxy(this.clear,this))}},postrender:function(){},toggleClear:function(t){if(!this.$clear){return}var e=this.$input.val().length,i=this.$clear.is(":visible");if(e&&!i){this.$clear.show()}if(!e&&i){this.$clear.hide()}},clear:function(){this.$clear.hide();this.$input.val("").focus()}});e.defaults=i.extend({},i.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="text">',placeholder:null,clear:true});i.fn.editabletypes.text=e})(window.jQuery);(function(e){"use strict";var i=function(t){this.init("textarea",t,i.defaults)};e.fn.editableutils.inherit(i,e.fn.editabletypes.abstractinput);e.extend(i.prototype,{render:function(){this.setClass();this.setAttr("placeholder");this.setAttr("rows");this.$input.keydown(function(t){if(t.ctrlKey&&t.which===13){e(this).closest("form").submit()}})},activate:function(){e.fn.editabletypes.text.prototype.activate.call(this)}});i.defaults=e.extend({},e.fn.editabletypes.abstractinput.defaults,{tpl:"<textarea></textarea>",inputclass:"input-large",placeholder:null,rows:7});e.fn.editabletypes.textarea=i})(window.jQuery);(function(a){"use strict";var e=function(t){this.init("select",t,e.defaults)};a.fn.editableutils.inherit(e,a.fn.editabletypes.list);a.extend(e.prototype,{renderList:function(){this.$input.empty();var n=function(t,e){var i;if(a.isArray(e)){for(var s=0;s<e.length;s++){i={};if(e[s].children){i.label=e[s].text;t.append(n(a("<optgroup>",i),e[s].children))}else{i.value=e[s].value;if(e[s].disabled){i.disabled=true}t.append(a("<option>",i).text(e[s].text))}}}return t};n(this.$input,this.sourceData);this.setClass();this.$input.on("keydown.editable",function(t){if(t.which===13){a(this).closest("form").submit()}})},value2htmlFinal:function(t,e){var i="",s=a.fn.editableutils.itemsByValue(t,this.sourceData);if(s.length){i=s[0].text}a.fn.editabletypes.abstractinput.prototype.value2html.call(this,i,e)},autosubmit:function(){this.$input.off("keydown.editable").on("change.editable",function(){a(this).closest("form").submit()})}});e.defaults=a.extend({},a.fn.editabletypes.list.defaults,{tpl:"<select></select>"});a.fn.editabletypes.select=e})(window.jQuery);(function(a){"use strict";var e=function(t){this.init("checklist",t,e.defaults)};a.fn.editableutils.inherit(e,a.fn.editabletypes.list);a.extend(e.prototype,{renderList:function(){var t,e;this.$tpl.empty();if(!a.isArray(this.sourceData)){return}for(var i=0;i<this.sourceData.length;i++){t=a("<label>").append(a("<input>",{type:"checkbox",value:this.sourceData[i].value})).append(a("<span>").text(" "+this.sourceData[i].text));a("<div>").append(t).appendTo(this.$tpl)}this.$input=this.$tpl.find('input[type="checkbox"]');this.setClass()},value2str:function(t){return a.isArray(t)?t.sort().join(a.trim(this.options.separator)):""},str2value:function(t){var e,i=null;if(typeof t==="string"&&t.length){e=new RegExp("\\s*"+a.trim(this.options.separator)+"\\s*");i=t.split(e)}else if(a.isArray(t)){i=t}else{i=[t]}return i},value2input:function(s){this.$input.prop("checked",false);if(a.isArray(s)&&s.length){this.$input.each(function(t,e){var i=a(e);a.each(s,function(t,e){if(i.val()==e){i.prop("checked",true)}})})}},input2value:function(){var i=[];this.$input.filter(":checked").each(function(t,e){i.push(a(e).val())});return i},value2htmlFinal:function(t,e){var s=[],i=a.fn.editableutils.itemsByValue(t,this.sourceData),n=this.options.escape;if(i.length){a.each(i,function(t,e){var i=n?a.fn.editableutils.escape(e.text):e.text;s.push(i)});a(e).html(s.join("<br>"))}else{a(e).empty()}},activate:function(){this.$input.first().focus()},autosubmit:function(){this.$input.on("keydown",function(t){if(t.which===13){a(this).closest("form").submit()}})}});e.defaults=a.extend({},a.fn.editabletypes.list.defaults,{tpl:'<div class="editable-checklist"></div>',inputclass:null,separator:","});a.fn.editabletypes.checklist=e})(window.jQuery);(function(i){"use strict";var e=function(t){this.init("password",t,e.defaults)};i.fn.editableutils.inherit(e,i.fn.editabletypes.text);i.extend(e.prototype,{value2html:function(t,e){if(t){i(e).text("[hidden]")}else{i(e).empty()}},html2value:function(t){return null}});e.defaults=i.extend({},i.fn.editabletypes.text.defaults,{tpl:'<input type="password">'});i.fn.editabletypes.password=e})(window.jQuery);(function(t){"use strict";var e=function(t){this.init("email",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.text);e.defaults=t.extend({},t.fn.editabletypes.text.defaults,{tpl:'<input type="email">'});t.fn.editabletypes.email=e})(window.jQuery);(function(t){"use strict";var e=function(t){this.init("url",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.text);e.defaults=t.extend({},t.fn.editabletypes.text.defaults,{tpl:'<input type="url">'});t.fn.editabletypes.url=e})(window.jQuery);(function(t){"use strict";var e=function(t){this.init("tel",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.text);e.defaults=t.extend({},t.fn.editabletypes.text.defaults,{tpl:'<input type="tel">'});t.fn.editabletypes.tel=e})(window.jQuery);(function(t){"use strict";var e=function(t){this.init("number",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.text);t.extend(e.prototype,{render:function(){e.superclass.render.call(this);this.setAttr("min");this.setAttr("max");this.setAttr("step")},postrender:function(){if(this.$clear){this.$clear.css({right:24})}}});e.defaults=t.extend({},t.fn.editabletypes.text.defaults,{tpl:'<input type="number">',inputclass:"input-mini",min:null,max:null,step:null});t.fn.editabletypes.number=e})(window.jQuery);(function(t){"use strict";var e=function(t){this.init("range",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.number);t.extend(e.prototype,{render:function(){this.$input=this.$tpl.filter("input");this.setClass();this.setAttr("min");this.setAttr("max");this.setAttr("step");this.$input.on("input",function(){t(this).siblings("output").text(t(this).val())})},activate:function(){this.$input.focus()}});e.defaults=t.extend({},t.fn.editabletypes.number.defaults,{tpl:'<input type="range"><output style="width: 30px; display: inline-block"></output>',inputclass:"input-medium"});t.fn.editabletypes.range=e})(window.jQuery);(function(t){"use strict";var e=function(t){this.init("time",t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.abstractinput);t.extend(e.prototype,{render:function(){this.setClass()}});e.defaults=t.extend({},t.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="time">'});t.fn.editabletypes.time=e})(window.jQuery);(function(a){"use strict";var o=function(t){this.init("select2",t,o.defaults);t.select2=t.select2||{};this.sourceData=null;if(t.placeholder){t.select2.placeholder=t.placeholder}if(!t.select2.tags&&t.source){var e=t.source;if(a.isFunction(t.source)){e=t.source.call(t.scope)}if(typeof e==="string"){t.select2.ajax=t.select2.ajax||{};if(!t.select2.ajax.data){t.select2.ajax.data=function(t){return{query:t}}}if(!t.select2.ajax.results){t.select2.ajax.results=function(t){return{results:t}}}t.select2.ajax.url=e}else{this.sourceData=this.convertSource(e);t.select2.data=this.sourceData}}this.options.select2=a.extend({},o.defaults.select2,t.select2);this.isMultiple=this.options.select2.tags||this.options.select2.multiple;this.isRemote="ajax"in this.options.select2;this.idFunc=this.options.select2.id;if(typeof this.idFunc!=="function"){var i=this.idFunc||"id";this.idFunc=function(t){return t[i]}}this.formatSelection=this.options.select2.formatSelection;if(typeof this.formatSelection!=="function"){this.formatSelection=function(t){return t.text}}};a.fn.editableutils.inherit(o,a.fn.editabletypes.abstractinput);a.extend(o.prototype,{render:function(){this.setClass();if(this.isRemote){this.$input.on("select2-loaded",a.proxy(function(t){this.sourceData=t.items.results},this))}if(this.isMultiple){this.$input.on("change",function(){a(this).closest("form").parent().triggerHandler("resize")})}},value2html:function(t,e){var i="",s,n=this;if(this.options.select2.tags){s=t}else if(this.sourceData){s=a.fn.editableutils.itemsByValue(t,this.sourceData,this.idFunc)}else{}if(a.isArray(s)){i=[];a.each(s,function(t,e){i.push(e&&typeof e==="object"?n.formatSelection(e):e)})}else if(s){i=n.formatSelection(s)}i=a.isArray(i)?i.join(this.options.viewseparator):i;o.superclass.value2html.call(this,i,e)},html2value:function(t){return this.options.select2.tags?this.str2value(t,this.options.viewseparator):null},value2input:function(t){if(a.isArray(t)){t=t.join(this.getSeparator())}if(!this.$input.data("select2")){this.$input.val(t);this.$input.select2(this.options.select2)}else{this.$input.val(t).trigger("change",true)}if(this.isRemote&&!this.isMultiple&&!this.options.select2.initSelection){var e=this.options.select2.id,i=this.options.select2.formatSelection;if(!e&&!i){var s=a(this.options.scope);if(!s.data("editable").isEmpty){var n={id:t,text:s.text()};this.$input.select2("data",n)}}}},input2value:function(){return this.$input.select2("val")},str2value:function(t,e){if(typeof t!=="string"||!this.isMultiple){return t}e=e||this.getSeparator();var i,s,n;if(t===null||t.length<1){return null}i=t.split(e);for(s=0,n=i.length;s<n;s=s+1){i[s]=a.trim(i[s])}return i},autosubmit:function(){this.$input.on("change",function(t,e){if(!e){a(this).closest("form").submit()}})},getSeparator:function(){return this.options.select2.separator||a.fn.select2.defaults.separator},convertSource:function(t){if(a.isArray(t)&&t.length&&t[0].value!==undefined){for(var e=0;e<t.length;e++){if(t[e].value!==undefined){t[e].id=t[e].value;delete t[e].value}}}return t},destroy:function(){if(this.$input.data("select2")){this.$input.select2("destroy")}}});o.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="hidden">',select2:null,placeholder:null,source:null,viewseparator:", "});a.fn.editabletypes.select2=o})(window.jQuery);(function(o){var a=function(t,e){this.$element=o(t);if(!this.$element.is("input")){o.error("Combodate should be applied to INPUT element");return}this.options=o.extend({},o.fn.combodate.defaults,e,this.$element.data());this.init()};a.prototype={constructor:a,init:function(){this.map={day:["D","date"],month:["M","month"],year:["Y","year"],hour:["[Hh]","hours"],minute:["m","minutes"],second:["s","seconds"],ampm:["[Aa]",""]};this.$widget=o('<span class="combodate"></span>').html(this.getTemplate());this.initCombos();this.$widget.on("change","select",o.proxy(function(t){this.$element.val(this.getValue()).change();if(this.options.smartDays){if(o(t.target).is(".month")||o(t.target).is(".year")){this.fillCombo("day")}}},this));this.$widget.find("select").css("width","auto");this.$element.hide().after(this.$widget);this.setValue(this.$element.val()||this.options.value)},getTemplate:function(){var n=this.options.template;o.each(this.map,function(t,e){e=e[0];var i=new RegExp(e+"+"),s=e.length>1?e.substring(1,2):e;n=n.replace(i,"{"+s+"}")});n=n.replace(/ /g,"&nbsp;");o.each(this.map,function(t,e){e=e[0];var i=e.length>1?e.substring(1,2):e;n=n.replace("{"+i+"}",'<select class="'+t+'"></select>')});return n},initCombos:function(){for(var t in this.map){var e=this.$widget.find("."+t);this["$"+t]=e.length?e:null;this.fillCombo(t)}},fillCombo:function(t){var e=this["$"+t];if(!e){return}var i="fill"+t.charAt(0).toUpperCase()+t.slice(1);var s=this[i]();var n=e.val();e.empty();for(var a=0;a<s.length;a++){e.append('<option value="'+s[a][0]+'">'+s[a][1]+"</option>")}e.val(n)},fillCommon:function(t){var e=[],i;if(this.options.firstItem==="name"){i=moment.relativeTime||moment.langData()._relativeTime;var s=typeof i[t]==="function"?i[t](1,true,t,false):i[t];s=s.split(" ").reverse()[0];e.push(["",s])}else if(this.options.firstItem==="empty"){e.push(["",""])}return e},fillDay:function(){var t=this.fillCommon("d"),e,i,s=this.options.template.indexOf("DD")!==-1,n=31;if(this.options.smartDays&&this.$month&&this.$year){var a=parseInt(this.$month.val(),10);var o=parseInt(this.$year.val(),10);if(!isNaN(a)&&!isNaN(o)){n=moment([o,a]).daysInMonth()}}for(i=1;i<=n;i++){e=s?this.leadZero(i):i;t.push([i,e])}return t},fillMonth:function(){var t=this.fillCommon("M"),e,i,s=this.options.template.indexOf("MMMM")!==-1,n=this.options.template.indexOf("MMM")!==-1,a=this.options.template.indexOf("MM")!==-1;for(i=0;i<=11;i++){if(s){e=moment().date(1).month(i).format("MMMM")}else if(n){e=moment().date(1).month(i).format("MMM")}else if(a){e=this.leadZero(i+1)}else{e=i+1}t.push([i,e])}return t},fillYear:function(){var t=[],e,i,s=this.options.template.indexOf("YYYY")!==-1;for(i=this.options.maxYear;i>=this.options.minYear;i--){e=s?i:(i+"").substring(2);t[this.options.yearDescending?"push":"unshift"]([i,e])}t=this.fillCommon("y").concat(t);return t},fillHour:function(){var t=this.fillCommon("h"),e,i,s=this.options.template.indexOf("h")!==-1,n=this.options.template.indexOf("H")!==-1,a=this.options.template.toLowerCase().indexOf("hh")!==-1,o=s?1:0,r=s?12:23;for(i=o;i<=r;i++){e=a?this.leadZero(i):i;t.push([i,e])}return t},fillMinute:function(){var t=this.fillCommon("m"),e,i,s=this.options.template.indexOf("mm")!==-1;for(i=0;i<=59;i+=this.options.minuteStep){e=s?this.leadZero(i):i;t.push([i,e])}return t},fillSecond:function(){var t=this.fillCommon("s"),e,i,s=this.options.template.indexOf("ss")!==-1;for(i=0;i<=59;i+=this.options.secondStep){e=s?this.leadZero(i):i;t.push([i,e])}return t},fillAmpm:function(){var t=this.options.template.indexOf("a")!==-1,e=this.options.template.indexOf("A")!==-1,i=[["am",t?"am":"AM"],["pm",t?"pm":"PM"]];return i},getValue:function(t){var e,s={},n=this,a=false;o.each(this.map,function(t,e){if(t==="ampm"){return}var i=t==="day"?1:0;s[t]=n["$"+t]?parseInt(n["$"+t].val(),10):i;if(isNaN(s[t])){a=true;return false}});if(a){return""}if(this.$ampm){if(s.hour===12){s.hour=this.$ampm.val()==="am"?0:12}else{s.hour=this.$ampm.val()==="am"?s.hour:s.hour+12}}e=moment([s.year,s.month,s.day,s.hour,s.minute,s.second]);this.highlight(e);t=t===undefined?this.options.format:t;if(t===null){return e.isValid()?e:null}else{return e.isValid()?e.format(t):""}},setValue:function(t){if(!t){return}var i=typeof t==="string"?moment(t,this.options.format):moment(t),s=this,n={};function a(t,n){var a={};t.children("option").each(function(t,e){var i=o(e).attr("value"),s;if(i==="")return;s=Math.abs(i-n);if(typeof a.distance==="undefined"||s<a.distance){a={value:i,distance:s}}});return a.value}if(i.isValid()){o.each(this.map,function(t,e){if(t==="ampm"){return}n[t]=i[e[1]]()});if(this.$ampm){if(n.hour>=12){n.ampm="pm";if(n.hour>12){n.hour-=12}}else{n.ampm="am";if(n.hour===0){n.hour=12}}}o.each(n,function(t,e){if(s["$"+t]){if(t==="minute"&&s.options.minuteStep>1&&s.options.roundTime){e=a(s["$"+t],e)}if(t==="second"&&s.options.secondStep>1&&s.options.roundTime){e=a(s["$"+t],e)}s["$"+t].val(e)}});if(this.options.smartDays){this.fillCombo("day")}this.$element.val(i.format(this.options.format)).change()}},highlight:function(t){if(!t.isValid()){if(this.options.errorClass){this.$widget.addClass(this.options.errorClass)}else{if(!this.borderColor){this.borderColor=this.$widget.find("select").css("border-color")}this.$widget.find("select").css("border-color","red")}}else{if(this.options.errorClass){this.$widget.removeClass(this.options.errorClass)}else{this.$widget.find("select").css("border-color",this.borderColor)}}},leadZero:function(t){return t<=9?"0"+t:t},destroy:function(){this.$widget.remove();this.$element.removeData("combodate").show()}};o.fn.combodate=function(s){var t,n=Array.apply(null,arguments);n.shift();if(s==="getValue"&&this.length&&(t=this.eq(0).data("combodate"))){return t.getValue.apply(t,n)}return this.each(function(){var t=o(this),e=t.data("combodate"),i=typeof s=="object"&&s;if(!e){t.data("combodate",e=new a(this,i))}if(typeof s=="string"&&typeof e[s]=="function"){e[s].apply(e,n)}})};o.fn.combodate.defaults={format:"DD-MM-YYYY HH:mm",template:"D / MMM / YYYY   H : mm",value:null,minYear:1970,maxYear:(new Date).getFullYear(),yearDescending:true,minuteStep:5,secondStep:1,firstItem:"empty",errorClass:null,roundTime:true,smartDays:false}})(window.jQuery);(function(e){"use strict";var s=function(t){this.init("combodate",t,s.defaults);if(!this.options.viewformat){this.options.viewformat=this.options.format}t.combodate=e.fn.editableutils.tryParseJson(t.combodate,true);this.options.combodate=e.extend({},s.defaults.combodate,t.combodate,{format:this.options.format,template:this.options.template})};e.fn.editableutils.inherit(s,e.fn.editabletypes.abstractinput);e.extend(s.prototype,{render:function(){this.$input.combodate(this.options.combodate);if(e.fn.editableform.engine==="bs3"){this.$input.siblings().find("select").addClass("form-control")}if(this.options.inputclass){this.$input.siblings().find("select").addClass(this.options.inputclass)}},value2html:function(t,e){var i=t?t.format(this.options.viewformat):"";s.superclass.value2html.call(this,i,e)},html2value:function(t){return t?moment(t,this.options.viewformat):null},value2str:function(t){return t?t.format(this.options.format):""},str2value:function(t){return t?moment(t,this.options.format):null},value2submit:function(t){return this.value2str(t)},value2input:function(t){this.$input.combodate("setValue",t)},input2value:function(){return this.$input.combodate("getValue",null)},activate:function(){this.$input.siblings(".combodate").find("select").eq(0).focus()},autosubmit:function(){}});s.defaults=e.extend({},e.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="text">',inputclass:null,format:"YYYY-MM-DD",viewformat:null,template:"D / MMM / YYYY",combodate:null});e.fn.editabletypes.combodate=s})(window.jQuery);(function(o){"use strict";var r=o.fn.editableform.Constructor.prototype.initInput;o.extend(o.fn.editableform.Constructor.prototype,{initTemplate:function(){this.$form=o(o.fn.editableform.template);this.$form.find(".control-group").addClass("form-group");this.$form.find(".editable-error-block").addClass("help-block")},initInput:function(){r.apply(this);var t=this.input.options.inputclass===null||this.input.options.inputclass===false;var e="input-sm";var i="text,select,textarea,password,email,url,tel,number,range,time,typeaheadjs".split(",");if(~o.inArray(this.input.type,i)){this.input.$input.addClass("form-control");if(t){this.input.options.inputclass=e;this.input.$input.addClass(e)}}var s=this.$form.find(".editable-buttons");var n=t?[e]:this.input.options.inputclass.split(" ");for(var a=0;a<n.length;a++){if(n[a].toLowerCase()==="input-lg"){s.find("button").removeClass("btn-sm").addClass("btn-lg")}}}});o.fn.editableform.buttons='<button type="submit" class="btn btn-primary btn-sm editable-submit">'+'<i class="glyphicon glyphicon-ok"></i>'+"</button>"+'<button type="button" class="btn btn-default btn-sm editable-cancel">'+'<i class="glyphicon glyphicon-remove"></i>'+"</button>";o.fn.editableform.errorGroupClass="has-error";o.fn.editableform.errorBlockClass=null;o.fn.editableform.engine="bs3"})(window.jQuery);(function(e){"use strict";e.extend(e.fn.editableContainer.Popup.prototype,{containerName:"popover",containerDataName:"bs.popover",innerCss:".popover-content",defaults:e.fn.popover.Constructor.DEFAULTS,initContainer:function(){e.extend(this.containerOptions,{trigger:"manual",selector:false,content:" ",template:this.defaults.template});var t;if(this.$element.data("template")){t=this.$element.data("template");this.$element.removeData("template")}this.call(this.containerOptions);if(t){this.$element.data("template",t)}},innerShow:function(){this.call("show")},innerHide:function(){this.call("hide")},innerDestroy:function(){this.call("destroy")},setContainerOption:function(t,e){this.container().options[t]=e},setPosition:function(){(function(){var t=this.tip();var e=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement;var i=/\s?auto?\s?/i;var s=i.test(e);if(s){e=e.replace(i,"")||"top"}var n=this.getPosition();var a=t[0].offsetWidth;var o=t[0].offsetHeight;if(s){var r=this.$element.parent();var l=e;var h=document.documentElement.scrollTop||document.body.scrollTop;var u=this.options.container=="body"?window.innerWidth:r.outerWidth();var p=this.options.container=="body"?window.innerHeight:r.outerHeight();var f=this.options.container=="body"?0:r.offset().left;e=e=="bottom"&&n.top+n.height+o-h>p?"top":e=="top"&&n.top-h-o<0?"bottom":e=="right"&&n.right+a>u?"left":e=="left"&&n.left-a<f?"right":e;t.removeClass(l).addClass(e)}var d=this.getCalculatedOffset(e,n,a,o);this.applyPlacement(d,e)}).call(this.container())}})})(window.jQuery);(function($){function C(){return new Date(Date.UTC.apply(Date,arguments))}function t(){var t=new Date;return C(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}var v=function(t,e){var i=this;this._process_options(e);this.element=$(t);this.isInline=false;this.isInput=this.element.is("input");this.component=this.element.is(".date")?this.element.find(".add-on, .btn"):false;this.hasInput=this.component&&this.element.find("input").length;if(this.component&&this.component.length===0)this.component=false;this.picker=$(T.template);this._buildEvents();this._attachEvents();if(this.isInline){this.picker.addClass("datepicker-inline").appendTo(this.element)}else{this.picker.addClass("datepicker-dropdown dropdown-menu")}if(this.o.rtl){this.picker.addClass("datepicker-rtl");this.picker.find(".prev i, .next i").toggleClass("icon-arrow-left icon-arrow-right")}this.viewMode=this.o.startView;if(this.o.calendarWeeks)this.picker.find("tfoot th.today").attr("colspan",function(t,e){return parseInt(e)+1});this._allow_update=false;this.setStartDate(this.o.startDate);this.setEndDate(this.o.endDate);this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);this.fillDow();this.fillMonths();this._allow_update=true;this.update();this.showMode();if(this.isInline){this.show()}};v.prototype={constructor:v,_process_options:function(t){this._o=$.extend({},this._o,t);var e=this.o=$.extend({},this._o);var i=e.language;if(!x[i]){i=i.split("-")[0];if(!x[i])i=c.language}e.language=i;switch(e.startView){case 2:case"decade":e.startView=2;break;case 1:case"year":e.startView=1;break;default:e.startView=0}switch(e.minViewMode){case 1:case"months":e.minViewMode=1;break;case 2:case"years":e.minViewMode=2;break;default:e.minViewMode=0}e.startView=Math.max(e.startView,e.minViewMode);e.weekStart%=7;e.weekEnd=(e.weekStart+6)%7;var s=T.parseFormat(e.format);if(e.startDate!==-Infinity){e.startDate=T.parseDate(e.startDate,s,e.language)}if(e.endDate!==Infinity){e.endDate=T.parseDate(e.endDate,s,e.language)}e.daysOfWeekDisabled=e.daysOfWeekDisabled||[];if(!$.isArray(e.daysOfWeekDisabled))e.daysOfWeekDisabled=e.daysOfWeekDisabled.split(/[,\s]*/);e.daysOfWeekDisabled=$.map(e.daysOfWeekDisabled,function(t){return parseInt(t,10)})},_events:[],_secondaryEvents:[],_applyEvents:function(t){for(var e=0,i,s;e<t.length;e++){i=t[e][0];s=t[e][1];i.on(s)}},_unapplyEvents:function(t){for(var e=0,i,s;e<t.length;e++){i=t[e][0];s=t[e][1];i.off(s)}},_buildEvents:function(){if(this.isInput){this._events=[[this.element,{focus:$.proxy(this.show,this),keyup:$.proxy(this.update,this),keydown:$.proxy(this.keydown,this)}]]}else if(this.component&&this.hasInput){this._events=[[this.element.find("input"),{focus:$.proxy(this.show,this),keyup:$.proxy(this.update,this),keydown:$.proxy(this.keydown,this)}],[this.component,{click:$.proxy(this.show,this)}]]}else if(this.element.is("div")){this.isInline=true}else{this._events=[[this.element,{click:$.proxy(this.show,this)}]]}this._secondaryEvents=[[this.picker,{click:$.proxy(this.click,this)}],[$(window),{resize:$.proxy(this.place,this)}],[$(document),{mousedown:$.proxy(function(t){if(!(this.element.is(t.target)||this.element.find(t.target).size()||this.picker.is(t.target)||this.picker.find(t.target).size())){this.hide()}},this)}]]},_attachEvents:function(){this._detachEvents();this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents();this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,e){var i=e||this.date,s=new Date(i.getTime()+i.getTimezoneOffset()*6e4);this.element.trigger({type:t,date:s,format:$.proxy(function(t){var e=t||this.o.format;return T.formatDate(i,e,this.o.language)},this)})},show:function(t){if(!this.isInline)this.picker.appendTo("body");this.picker.show();this.height=this.component?this.component.outerHeight():this.element.outerHeight();this.place();this._attachSecondaryEvents();if(t){t.preventDefault()}this._trigger("show")},hide:function(t){if(this.isInline)return;if(!this.picker.is(":visible"))return;this.picker.hide().detach();this._detachSecondaryEvents();this.viewMode=this.o.startView;this.showMode();if(this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val()))this.setValue();this._trigger("hide")},remove:function(){this.hide();this._detachEvents();this._detachSecondaryEvents();this.picker.remove();delete this.element.data().datepicker;if(!this.isInput){delete this.element.data().date}},getDate:function(){var t=this.getUTCDate();return new Date(t.getTime()+t.getTimezoneOffset()*6e4)},getUTCDate:function(){return this.date},setDate:function(t){this.setUTCDate(new Date(t.getTime()-t.getTimezoneOffset()*6e4))},setUTCDate:function(t){this.date=t;this.setValue()},setValue:function(){var t=this.getFormattedDate();if(!this.isInput){if(this.component){this.element.find("input").val(t)}}else{this.element.val(t)}},getFormattedDate:function(t){if(t===undefined)t=this.o.format;return T.formatDate(this.date,t,this.o.language)},setStartDate:function(t){this._process_options({startDate:t});this.update();this.updateNavArrows()},setEndDate:function(t){this._process_options({endDate:t});this.update();this.updateNavArrows()},setDaysOfWeekDisabled:function(t){this._process_options({daysOfWeekDisabled:t});this.update();this.updateNavArrows()},place:function(){if(this.isInline)return;var t=parseInt(this.element.parents().filter(function(){return $(this).css("z-index")!="auto"}).first().css("z-index"))+10;var e=this.component?this.component.parent().offset():this.element.offset();var i=this.component?this.component.outerHeight(true):this.element.outerHeight(true);this.picker.css({top:e.top+i,left:e.left,zIndex:t})},_allow_update:true,update:function(){if(!this._allow_update)return;var t,e=false;if(arguments&&arguments.length&&(typeof arguments[0]==="string"||arguments[0]instanceof Date)){t=arguments[0];e=true}else{t=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val();delete this.element.data().date}this.date=T.parseDate(t,this.o.format,this.o.language);if(e)this.setValue();if(this.date<this.o.startDate){this.viewDate=new Date(this.o.startDate)}else if(this.date>this.o.endDate){this.viewDate=new Date(this.o.endDate)}else{this.viewDate=new Date(this.date)}this.fill()},fillDow:function(){var t=this.o.weekStart,e="<tr>";if(this.o.calendarWeeks){var i='<th class="cw">&nbsp;</th>';e+=i;this.picker.find(".datepicker-days thead tr:first-child").prepend(i)}while(t<this.o.weekStart+7){e+='<th class="dow">'+x[this.o.language].daysMin[t++%7]+"</th>"}e+="</tr>";this.picker.find(".datepicker-days thead").append(e)},fillMonths:function(){var t="",e=0;while(e<12){t+='<span class="month">'+x[this.o.language].monthsShort[e++]+"</span>"}this.picker.find(".datepicker-months td").html(t)},setRange:function(t){if(!t||!t.length)delete this.range;else this.range=$.map(t,function(t){return t.valueOf()});this.fill()},getClassNames:function(t){var e=[],i=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),n=this.date.valueOf(),a=new Date;if(t.getUTCFullYear()<i||t.getUTCFullYear()==i&&t.getUTCMonth()<s){e.push("old")}else if(t.getUTCFullYear()>i||t.getUTCFullYear()==i&&t.getUTCMonth()>s){e.push("new")}if(this.o.todayHighlight&&t.getUTCFullYear()==a.getFullYear()&&t.getUTCMonth()==a.getMonth()&&t.getUTCDate()==a.getDate()){e.push("today")}if(n&&t.valueOf()==n){e.push("active")}if(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||$.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1){e.push("disabled")}if(this.range){if(t>this.range[0]&&t<this.range[this.range.length-1]){e.push("range")}if($.inArray(t.valueOf(),this.range)!=-1){e.push("selected")}}return e},fill:function(){var t=new Date(this.viewDate),e=t.getUTCFullYear(),i=t.getUTCMonth(),s=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,n=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,a=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,o=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,r=this.date&&this.date.valueOf(),l;this.picker.find(".datepicker-days thead th.datepicker-switch").text(x[this.o.language].months[i]+" "+e);this.picker.find("tfoot th.today").text(x[this.o.language].today).toggle(this.o.todayBtn!==false);this.picker.find("tfoot th.clear").text(x[this.o.language].clear).toggle(this.o.clearBtn!==false);this.updateNavArrows();this.fillMonths();var h=C(e,i-1,28,0,0,0,0),u=T.getDaysInMonth(h.getUTCFullYear(),h.getUTCMonth());h.setUTCDate(u);h.setUTCDate(u-(h.getUTCDay()-this.o.weekStart+7)%7);var p=new Date(h);p.setUTCDate(p.getUTCDate()+42);p=p.valueOf();var f=[];var d;while(h.valueOf()<p){if(h.getUTCDay()==this.o.weekStart){f.push("<tr>");if(this.o.calendarWeeks){var c=new Date(+h+(this.o.weekStart-h.getUTCDay()-7)%7*864e5),m=new Date(+c+(7+4-c.getUTCDay())%7*864e5),v=new Date(+(v=C(m.getUTCFullYear(),0,1))+(7+4-v.getUTCDay())%7*864e5),y=(m-v)/864e5/7+1;f.push('<td class="cw">'+y+"</td>")}}d=this.getClassNames(h);d.push("day");var b=this.o.beforeShowDay(h);if(b===undefined)b={};else if(typeof b==="boolean")b={enabled:b};else if(typeof b==="string")b={classes:b};if(b.enabled===false)d.push("disabled");if(b.classes)d=d.concat(b.classes.split(/\s+/));if(b.tooltip)l=b.tooltip;d=$.unique(d);f.push('<td class="'+d.join(" ")+'"'+(l?' title="'+l+'"':"")+">"+h.getUTCDate()+"</td>");if(h.getUTCDay()==this.o.weekEnd){f.push("</tr>")}h.setUTCDate(h.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(f.join(""));var g=this.date&&this.date.getUTCFullYear();var w=this.picker.find(".datepicker-months").find("th:eq(1)").text(e).end().find("span").removeClass("active");if(g&&g==e){w.eq(this.date.getUTCMonth()).addClass("active")}if(e<s||e>a){w.addClass("disabled")}if(e==s){w.slice(0,n).addClass("disabled")}if(e==a){w.slice(o+1).addClass("disabled")}f="";e=parseInt(e/10,10)*10;var D=this.picker.find(".datepicker-years").find("th:eq(1)").text(e+"-"+(e+9)).end().find("td");e-=1;for(var k=-1;k<11;k++){f+='<span class="year'+(k==-1?" old":k==10?" new":"")+(g==e?" active":"")+(e<s||e>a?" disabled":"")+'">'+e+"</span>";e+=1}D.html(f)},updateNavArrows:function(){if(!this._allow_update)return;var t=new Date(this.viewDate),e=t.getUTCFullYear(),i=t.getUTCMonth();switch(this.viewMode){case 0:if(this.o.startDate!==-Infinity&&e<=this.o.startDate.getUTCFullYear()&&i<=this.o.startDate.getUTCMonth()){this.picker.find(".prev").css({visibility:"hidden"})}else{this.picker.find(".prev").css({visibility:"visible"})}if(this.o.endDate!==Infinity&&e>=this.o.endDate.getUTCFullYear()&&i>=this.o.endDate.getUTCMonth()){this.picker.find(".next").css({visibility:"hidden"})}else{this.picker.find(".next").css({visibility:"visible"})}break;case 1:case 2:if(this.o.startDate!==-Infinity&&e<=this.o.startDate.getUTCFullYear()){this.picker.find(".prev").css({visibility:"hidden"})}else{this.picker.find(".prev").css({visibility:"visible"})}if(this.o.endDate!==Infinity&&e>=this.o.endDate.getUTCFullYear()){this.picker.find(".next").css({visibility:"hidden"})}else{this.picker.find(".next").css({visibility:"visible"})}break}},click:function(t){t.preventDefault();var e=$(t.target).closest("span, td, th");if(e.length==1){switch(e[0].nodeName.toLowerCase()){case"th":switch(e[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var i=T.modes[this.viewMode].navStep*(e[0].className=="prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,i);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,i);break}this.fill();break;case"today":var s=new Date;s=C(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0);this.showMode(-2);var n=this.o.todayBtn=="linked"?null:"view";this._setDate(s,n);break;case"clear":var a;if(this.isInput)a=this.element;else if(this.component)a=this.element.find("input");if(a)a.val("").change();this._trigger("changeDate");this.update();if(this.o.autoclose)this.hide();break}break;case"span":if(!e.is(".disabled")){this.viewDate.setUTCDate(1);if(e.is(".month")){var o=1;var r=e.parent().find("span").index(e);var l=this.viewDate.getUTCFullYear();this.viewDate.setUTCMonth(r);this._trigger("changeMonth",this.viewDate);if(this.o.minViewMode===1){this._setDate(C(l,r,o,0,0,0,0))}}else{var l=parseInt(e.text(),10)||0;var o=1;var r=0;this.viewDate.setUTCFullYear(l);this._trigger("changeYear",this.viewDate);if(this.o.minViewMode===2){this._setDate(C(l,r,o,0,0,0,0))}}this.showMode(-1);this.fill()}break;case"td":if(e.is(".day")&&!e.is(".disabled")){var o=parseInt(e.text(),10)||1;var l=this.viewDate.getUTCFullYear(),r=this.viewDate.getUTCMonth();if(e.is(".old")){if(r===0){r=11;l-=1}else{r-=1}}else if(e.is(".new")){if(r==11){r=0;l+=1}else{r+=1}}this._setDate(C(l,r,o,0,0,0,0))}break}}},_setDate:function(t,e){if(!e||e=="date")this.date=new Date(t);if(!e||e=="view")this.viewDate=new Date(t);this.fill();this.setValue();this._trigger("changeDate");var i;if(this.isInput){i=this.element}else if(this.component){i=this.element.find("input")}if(i){i.change();if(this.o.autoclose&&(!e||e=="date")){this.hide()}}},moveMonth:function(t,e){if(!e)return t;var i=new Date(t.valueOf()),s=i.getUTCDate(),n=i.getUTCMonth(),a=Math.abs(e),o,r;e=e>0?1:-1;if(a==1){r=e==-1?function(){return i.getUTCMonth()==n}:function(){return i.getUTCMonth()!=o};o=n+e;i.setUTCMonth(o);if(o<0||o>11)o=(o+12)%12}else{for(var l=0;l<a;l++)i=this.moveMonth(i,e);o=i.getUTCMonth();i.setUTCDate(s);r=function(){return o!=i.getUTCMonth()}}while(r()){i.setUTCDate(--s);i.setUTCMonth(o)}return i},moveYear:function(t,e){return this.moveMonth(t,e*12)},dateWithinRange:function(t){return t>=this.o.startDate&&t<=this.o.endDate},keydown:function(t){if(this.picker.is(":not(:visible)")){if(t.keyCode==27)this.show();return}var e=false,i,s,n,a,o;switch(t.keyCode){case 27:this.hide();t.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;i=t.keyCode==37?-1:1;if(t.ctrlKey){a=this.moveYear(this.date,i);o=this.moveYear(this.viewDate,i)}else if(t.shiftKey){a=this.moveMonth(this.date,i);o=this.moveMonth(this.viewDate,i)}else{a=new Date(this.date);a.setUTCDate(this.date.getUTCDate()+i);o=new Date(this.viewDate);o.setUTCDate(this.viewDate.getUTCDate()+i)}if(this.dateWithinRange(a)){this.date=a;this.viewDate=o;this.setValue();this.update();t.preventDefault();e=true}break;case 38:case 40:if(!this.o.keyboardNavigation)break;i=t.keyCode==38?-1:1;if(t.ctrlKey){a=this.moveYear(this.date,i);o=this.moveYear(this.viewDate,i)}else if(t.shiftKey){a=this.moveMonth(this.date,i);o=this.moveMonth(this.viewDate,i)}else{a=new Date(this.date);a.setUTCDate(this.date.getUTCDate()+i*7);o=new Date(this.viewDate);o.setUTCDate(this.viewDate.getUTCDate()+i*7)}if(this.dateWithinRange(a)){this.date=a;this.viewDate=o;this.setValue();this.update();t.preventDefault();e=true}break;case 13:this.hide();t.preventDefault();break;case 9:this.hide();break}if(e){this._trigger("changeDate");var r;if(this.isInput){r=this.element}else if(this.component){r=this.element.find("input")}if(r){r.change()}}},showMode:function(t){if(t){this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+t))}this.picker.find(">div").hide().filter(".datepicker-"+T.modes[this.viewMode].clsName).css("display","block");this.updateNavArrows()}};var p=function(t,e){this.element=$(t);this.inputs=$.map(e.inputs,function(t){return t.jquery?t[0]:t});delete e.inputs;$(this.inputs).datepicker(e).bind("changeDate",$.proxy(this.dateUpdated,this));this.pickers=$.map(this.inputs,function(t){return $(t).data("datepicker")});this.updateDates()};p.prototype={updateDates:function(){this.dates=$.map(this.pickers,function(t){return t.date});this.updateRanges()},updateRanges:function(){var i=$.map(this.dates,function(t){return t.valueOf()});$.each(this.pickers,function(t,e){e.setRange(i)})},dateUpdated:function(t){var e=$(t.target).data("datepicker"),i=e.getUTCDate(),s=$.inArray(t.target,this.inputs),n=this.inputs.length;if(s==-1)return;if(i<this.dates[s]){while(s>=0&&i<this.dates[s]){this.pickers[s--].setUTCDate(i)}}else if(i>this.dates[s]){while(s<n&&i>this.dates[s]){this.pickers[s++].setUTCDate(i)}}this.updateDates()},remove:function(){$.map(this.pickers,function(t){t.remove()});delete this.element.data().datepicker}};function f(t,e){var i=$(t).data(),s={},n,a=new RegExp("^"+e.toLowerCase()+"([A-Z])"),e=new RegExp("^"+e.toLowerCase());for(var o in i)if(e.test(o)){n=o.replace(a,function(t,e){return e.toLowerCase()});s[n]=i[o]}return s}function d(t){var i={};if(!x[t]){t=t.split("-")[0];if(!x[t])return}var s=x[t];$.each(n,function(t,e){if(e in s)i[e]=s[e]});return i}var e=$.fn.datepicker;var i=$.fn.datepicker=function(l){var h=Array.apply(null,arguments);h.shift();var u,t;this.each(function(){var t=$(this),e=t.data("datepicker"),i=typeof l=="object"&&l;if(!e){var s=f(this,"date"),n=$.extend({},c,s,i),a=d(n.language),o=$.extend({},c,a,s,i);if(t.is(".input-daterange")||o.inputs){var r={inputs:o.inputs||t.find("input").toArray()};t.data("datepicker",e=new p(this,$.extend(o,r)))}else{t.data("datepicker",e=new v(this,o))}}if(typeof l=="string"&&typeof e[l]=="function"){u=e[l].apply(e,h);if(u!==undefined)return false}});if(u!==undefined)return u;else return this};var c=$.fn.datepicker.defaults={autoclose:false,beforeShowDay:$.noop,calendarWeeks:false,clearBtn:false,daysOfWeekDisabled:[],endDate:Infinity,forceParse:true,format:"mm/dd/yyyy",keyboardNavigation:true,language:"en",minViewMode:0,rtl:false,startDate:-Infinity,startView:0,todayBtn:false,todayHighlight:false,weekStart:0};var n=$.fn.datepicker.locale_opts=["format","rtl","weekStart"];$.fn.datepicker.Constructor=v;var x=$.fn.datepicker.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"],today:"Today",clear:"Clear"}};var T={modes:[{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,T.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(t){var e=t.replace(this.validParts,"\0").split("\0"),i=t.match(this.validParts);if(!e||!e.length||!i||i.length===0){throw new Error("Invalid date format.")}return{separators:e,parts:i}},parseDate:function(t,e,i){if(t instanceof Date)return t;if(typeof e==="string")e=T.parseFormat(e);if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(t)){var s=/([\-+]\d+)([dmwy])/,n=t.match(/([\-+]\d+)([dmwy])/g),a,o;t=new Date;for(var r=0;r<n.length;r++){a=s.exec(n[r]);o=parseInt(a[1]);switch(a[2]){case"d":t.setUTCDate(t.getUTCDate()+o);break;case"m":t=v.prototype.moveMonth.call(v.prototype,t,o);break;case"w":t.setUTCDate(t.getUTCDate()+o*7);break;case"y":t=v.prototype.moveYear.call(v.prototype,t,o);break}}return C(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),0,0,0)}var n=t&&t.match(this.nonpunctuation)||[],t=new Date,l={},h=["yyyy","yy","M","MM","m","mm","d","dd"],u={yyyy:function(t,e){return t.setUTCFullYear(e)},yy:function(t,e){return t.setUTCFullYear(2e3+e)},m:function(t,e){e-=1;while(e<0)e+=12;e%=12;t.setUTCMonth(e);while(t.getUTCMonth()!=e)t.setUTCDate(t.getUTCDate()-1);return t},d:function(t,e){return t.setUTCDate(e)}},p,f,a;u["M"]=u["MM"]=u["mm"]=u["m"];u["dd"]=u["d"];t=C(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);var d=e.parts.slice();if(n.length!=d.length){d=$(d).filter(function(t,e){return $.inArray(e,h)!==-1}).toArray()}if(n.length==d.length){for(var r=0,c=d.length;r<c;r++){p=parseInt(n[r],10);a=d[r];if(isNaN(p)){switch(a){case"MM":f=$(x[i].months).filter(function(){var t=this.slice(0,n[r].length),e=n[r].slice(0,t.length);return t==e});p=$.inArray(f[0],x[i].months)+1;break;case"M":f=$(x[i].monthsShort).filter(function(){var t=this.slice(0,n[r].length),e=n[r].slice(0,t.length);return t==e});p=$.inArray(f[0],x[i].monthsShort)+1;break}}l[a]=p}for(var r=0,m;r<h.length;r++){m=h[r];if(m in l&&!isNaN(l[m]))u[m](t,l[m])}}return t},formatDate:function(t,e,i){if(typeof e==="string")e=T.parseFormat(e);var s={d:t.getUTCDate(),D:x[i].daysShort[t.getUTCDay()],DD:x[i].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:x[i].monthsShort[t.getUTCMonth()],MM:x[i].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};s.dd=(s.d<10?"0":"")+s.d;s.mm=(s.m<10?"0":"")+s.m;var t=[],n=$.extend([],e.separators);for(var a=0,o=e.parts.length;a<=o;a++){if(n.length)t.push(n.shift());t.push(s[e.parts[a]])}return t.join("")},headTemplate:"<thead>"+"<tr>"+'<th class="prev"><i class="icon-arrow-left"/></th>'+'<th colspan="5" class="datepicker-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><tr><th colspan="7" class="clear"></th></tr></tfoot>'};T.template='<div class="datepicker">'+'<div class="datepicker-days">'+'<table class=" table-condensed">'+T.headTemplate+"<tbody></tbody>"+T.footTemplate+"</table>"+"</div>"+'<div class="datepicker-months">'+'<table class="table-condensed">'+T.headTemplate+T.contTemplate+T.footTemplate+"</table>"+"</div>"+'<div class="datepicker-years">'+'<table class="table-condensed">'+T.headTemplate+T.contTemplate+T.footTemplate+"</table>"+"</div>"+"</div>";$.fn.datepicker.DPGlobal=T;$.fn.datepicker.noConflict=function(){$.fn.datepicker=e;return this};$(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var e=$(this);if(e.data("datepicker"))return;t.preventDefault();i.call(e,"show")});$(function(){i.call($('[data-provide="datepicker-inline"]'))})})(window.jQuery);(function(i){"use strict";i.fn.bdatepicker=i.fn.datepicker.noConflict();if(!i.fn.datepicker){i.fn.datepicker=i.fn.bdatepicker}var s=function(t){this.init("date",t,s.defaults);this.initPicker(t,s.defaults)};i.fn.editableutils.inherit(s,i.fn.editabletypes.abstractinput);i.extend(s.prototype,{initPicker:function(t,e){if(!this.options.viewformat){this.options.viewformat=this.options.format}t.datepicker=i.fn.editableutils.tryParseJson(t.datepicker,true);this.options.datepicker=i.extend({},e.datepicker,t.datepicker,{format:this.options.viewformat});this.options.datepicker.language=this.options.datepicker.language||"en";this.dpg=i.fn.bdatepicker.DPGlobal;this.parsedFormat=this.dpg.parseFormat(this.options.format);this.parsedViewFormat=this.dpg.parseFormat(this.options.viewformat)},render:function(){this.$input.bdatepicker(this.options.datepicker);if(this.options.clear){this.$clear=i('<a href="#"></a>').html(this.options.clear).click(i.proxy(function(t){t.preventDefault();t.stopPropagation();this.clear()},this));this.$tpl.parent().append(i('<div class="editable-clear">').append(this.$clear))}},value2html:function(t,e){var i=t?this.dpg.formatDate(t,this.parsedViewFormat,this.options.datepicker.language):"";s.superclass.value2html.call(this,i,e)},html2value:function(t){return this.parseDate(t,this.parsedViewFormat)},value2str:function(t){return t?this.dpg.formatDate(t,this.parsedFormat,this.options.datepicker.language):""},str2value:function(t){return this.parseDate(t,this.parsedFormat)},value2submit:function(t){return this.value2str(t)},value2input:function(t){this.$input.bdatepicker("update",t)},input2value:function(){return this.$input.data("datepicker").date},activate:function(){},clear:function(){this.$input.data("datepicker").date=null;this.$input.find(".active").removeClass("active");if(!this.options.showbuttons){this.$input.closest("form").submit()}},autosubmit:function(){this.$input.on("mouseup",".day",function(t){if(i(t.currentTarget).is(".old")||i(t.currentTarget).is(".new")){return}var e=i(this).closest("form");setTimeout(function(){e.submit()},200)})},parseDate:function(t,e){var i=null,s;if(t){i=this.dpg.parseDate(t,e,this.options.datepicker.language);if(typeof t==="string"){s=this.dpg.formatDate(i,e,this.options.datepicker.language);if(t!==s){i=null}}}return i}});s.defaults=i.extend({},i.fn.editabletypes.abstractinput.defaults,{tpl:'<div class="editable-date well"></div>',inputclass:null,format:"yyyy-mm-dd",viewformat:null,datepicker:{weekStart:0,startView:0,minViewMode:0,autoclose:false},clear:"&times; clear"});i.fn.editabletypes.date=s})(window.jQuery);(function(t){"use strict";var e=function(t){this.init("datefield",t,e.defaults);this.initPicker(t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.date);t.extend(e.prototype,{render:function(){this.$input=this.$tpl.find("input");this.setClass();this.setAttr("placeholder");this.$tpl.bdatepicker(this.options.datepicker);this.$input.off("focus keydown");this.$input.keyup(t.proxy(function(){this.$tpl.removeData("date");this.$tpl.bdatepicker("update")},this))},value2input:function(t){this.$input.val(t?this.dpg.formatDate(t,this.parsedViewFormat,this.options.datepicker.language):"");this.$tpl.bdatepicker("update")},input2value:function(){return this.html2value(this.$input.val())},activate:function(){t.fn.editabletypes.text.prototype.activate.call(this)},autosubmit:function(){}});e.defaults=t.extend({},t.fn.editabletypes.date.defaults,{tpl:'<div class="input-append date"><input type="text"/><span class="add-on"><i class="icon-th"></i></span></div>',inputclass:"input-small",datepicker:{weekStart:0,startView:0,minViewMode:0,autoclose:true}});t.fn.editabletypes.datefield=e})(window.jQuery);(function(i){"use strict";var s=function(t){this.init("datetime",t,s.defaults);this.initPicker(t,s.defaults)};i.fn.editableutils.inherit(s,i.fn.editabletypes.abstractinput);i.extend(s.prototype,{initPicker:function(t,e){if(!this.options.viewformat){this.options.viewformat=this.options.format}t.datetimepicker=i.fn.editableutils.tryParseJson(t.datetimepicker,true);this.options.datetimepicker=i.extend({},e.datetimepicker,t.datetimepicker,{format:this.options.viewformat});this.options.datetimepicker.language=this.options.datetimepicker.language||"en";this.dpg=i.fn.datetimepicker.DPGlobal;this.parsedFormat=this.dpg.parseFormat(this.options.format,this.options.formatType);this.parsedViewFormat=this.dpg.parseFormat(this.options.viewformat,this.options.formatType)},render:function(){this.$input.datetimepicker(this.options.datetimepicker);this.$input.on("changeMode",function(t){var e=i(this).closest("form").parent();setTimeout(function(){e.triggerHandler("resize")},0)});if(this.options.clear){this.$clear=i('<a href="#"></a>').html(this.options.clear).click(i.proxy(function(t){t.preventDefault();t.stopPropagation();this.clear()},this));this.$tpl.parent().append(i('<div class="editable-clear">').append(this.$clear))}},value2html:function(t,e){var i=t?this.dpg.formatDate(this.toUTC(t),this.parsedViewFormat,this.options.datetimepicker.language,this.options.formatType):"";if(e){s.superclass.value2html.call(this,i,e)}else{return i}},html2value:function(t){var e=this.parseDate(t,this.parsedViewFormat);return e?this.fromUTC(e):null},value2str:function(t){return t?this.dpg.formatDate(this.toUTC(t),this.parsedFormat,this.options.datetimepicker.language,this.options.formatType):""},str2value:function(t){var e=this.parseDate(t,this.parsedFormat);return e?this.fromUTC(e):null},value2submit:function(t){return this.value2str(t)},value2input:function(t){if(t){this.$input.data("datetimepicker").setDate(t)}},input2value:function(){var t=this.$input.data("datetimepicker");return t.date?t.getDate():null},activate:function(){},clear:function(){this.$input.data("datetimepicker").date=null;this.$input.find(".active").removeClass("active");if(!this.options.showbuttons){this.$input.closest("form").submit()}},autosubmit:function(){this.$input.on("mouseup",".minute",function(t){var e=i(this).closest("form");setTimeout(function(){e.submit()},200)})},toUTC:function(t){return t?new Date(t.valueOf()-t.getTimezoneOffset()*6e4):t},fromUTC:function(t){return t?new Date(t.valueOf()+t.getTimezoneOffset()*6e4):t},parseDate:function(t,e){var i=null,s;if(t){i=this.dpg.parseDate(t,e,this.options.datetimepicker.language,this.options.formatType);if(typeof t==="string"){s=this.dpg.formatDate(i,e,this.options.datetimepicker.language,this.options.formatType);if(t!==s){i=null}}}return i}});s.defaults=i.extend({},i.fn.editabletypes.abstractinput.defaults,{tpl:'<div class="editable-date well"></div>',inputclass:null,format:"yyyy-mm-dd hh:ii",formatType:"standard",viewformat:null,datetimepicker:{todayHighlight:false,autoclose:false},clear:"&times; clear"});i.fn.editabletypes.datetime=s})(window.jQuery);(function(t){"use strict";var e=function(t){this.init("datetimefield",t,e.defaults);this.initPicker(t,e.defaults)};t.fn.editableutils.inherit(e,t.fn.editabletypes.datetime);t.extend(e.prototype,{render:function(){this.$input=this.$tpl.find("input");this.setClass();this.setAttr("placeholder");this.$tpl.datetimepicker(this.options.datetimepicker);this.$input.off("focus keydown");this.$input.keyup(t.proxy(function(){this.$tpl.removeData("date");this.$tpl.datetimepicker("update")},this))},value2input:function(t){this.$input.val(this.value2html(t));this.$tpl.datetimepicker("update")},input2value:function(){return this.html2value(this.$input.val())},activate:function(){t.fn.editabletypes.text.prototype.activate.call(this)},autosubmit:function(){}});e.defaults=t.extend({},t.fn.editabletypes.datetime.defaults,{tpl:'<div class="input-append date"><input type="text"/><span class="add-on"><i class="icon-th"></i></span></div>',inputclass:"input-medium",datetimepicker:{todayHighlight:false,autoclose:true}});t.fn.editabletypes.datetimefield=e})(window.jQuery);