text: function uiCodemirrorDirective(a,b){function c(a,c,h,i){var j=angular.extend({value:c.text()},b.codemirror||{},a.$eval(h.uiCodemirror),a.$eval(h.uiCodemirrorOpts)),k=d(c,j);e(k,h.uiCodemirror||h.uiCodemirrorOpts,a),f(k,i,a),g(k,h.uiRefresh,a),a.$on("CodeMirror",function(a,b){if(!angular.isFunction(b))throw new Error("the CodeMirror event requires a callback function");b(k)}),angular.isFunction(j.onLoad)&&j.onLoad(k)}function d(a,b){var c;return"TEXTAREA"===a[0].tagName?c=window.CodeMirror.fromTextArea(a[0],b):(a.html(""),c=new window.CodeMirror(function(b){a.append(b)},b)),c}function e(a,b,c){function d(b,c){angular.isObject(b)&&e.forEach(function(d){if(b.hasOwnProperty(d)){if(c&&b[d]===c[d])return;a.setOption(d,b[d])}})}if(b){var e=Object.keys(window.CodeMirror.defaults);c.$watch(b,d,!0)}}function f(a,b,c){b&&(b.$formatters.push(function(a){if(angular.isUndefined(a)||null===a)return"";if(angular.isObject(a)||angular.isArray(a))throw new Error("ui-codemirror cannot use an object or an array as a model");return a}),b.$render=function(){var c=b.$viewValue||"";a.setValue(c)},a.on("change",function(a){var d=a.getValue();d!==b.$viewValue&&c.$evalAsync(function(){b.$setViewValue(d)})}))}function g(b,c,d){c&&d.$watch(c,function(c,d){c!==d&&a(function(){b.refresh()})})}return{restrict:"EA",require:"?ngModel",compile:function(){if(angular.isUndefined(window.CodeMirror))throw new Error("ui-codemirror needs CodeMirror to work... (o rly?)");return c}}}!function(a,b){"use strict";"undefined"!=typeof module&&module.exports?module.exports=b(require("angular")):"function"==typeof define&&define.amd?define(["angular"],b):b(a.angular)}(window,function(a){"use strict";a.module("angucomplete-alt",[]).directive("angucompleteAlt",["$q","$parse","$http","$sce","$timeout","$templateCache","$interpolate",function(a,b,c,d,e,f,g){function h(b,f,g,h){function w(a,c){a&&("object"==typeof a?(b.searchStr=C(a),z({originalObject:a})):"string"==typeof a&&a.length>0?b.searchStr=a:console&&console.error&&console.error("Tried to set "+(c?"initial":"")+" value of angucomplete to",a,"which is an invalid value"),F(!0))}function x(a){oa=null,b.hideResults(a),document.body.removeEventListener("click",x)}function y(a){return a.which?a.which:a.keyCode}function z(a){if(b.listSelectedObject){A(),b.objects.push(a.originalObject);for(var c=0;c<b.localData.length;c++)if(b.localData[c][b.titleField]==a.originalObject.code){ha.push(b.localData[c]),b.localData.splice(c,1);break}}"function"==typeof b.selectedObject?b.selectedObject(a,b.selectedObjectData):b.selectedObject=a,F(a?!0:!1)}function A(){for(var a=0;a<b.objects.length;a++)for(var c=0;c<b.defaultSetObject.length;c++)b.objects[a][b.titleField]==b.defaultSetObject[c][b.titleField]&&b.objects.splice(a,1)}function B(a){z({originalObject:a}),b.clearSelected&&(b.searchStr=null),U()}function C(a){return b.titleField.split(",").map(function(b){return D(a,b)}).join(" ")}function D(a,b){var c,d;if(b){c=b.split("."),d=a;for(var e=0;e<c.length;e++)d=d[c[e]]}else d=a;return d}function E(a,c){var e,f,g;if(g=new RegExp(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),a)return a.match&&a.replace||(a=a.toString()),f=a.match(g),e=f?a.replace(g,'<span class="'+b.matchClass+'">'+f[0]+"</span>"):a,d.trustAsHtml(e)}function F(a){b.notEmpty=a,ja=b.searchStr,b.fieldRequired&&h&&b.inputName&&h[b.inputName].$setValidity(ia,a)}function G(a){var c=y(a);if(c!==l&&c!==j)if(c===k||c===n)a.preventDefault();else if(c===i)a.preventDefault(),!b.showDropdown&&b.searchStr&&b.searchStr.length>=fa&&(V(),b.searching=!0,Y(b.searchStr));else if(c===m)U(),b.$apply(function(){ea.val(b.searchStr)});else{if(0===fa&&!b.searchStr)return;b.searchStr&&""!==b.searchStr?b.searchStr.length>=fa&&(V(),ga&&e.cancel(ga),b.searching=!0,ga=e(function(){Y(b.searchStr)},b.pause)):b.showDropdown=!1,ja&&ja!==b.searchStr&&!b.clearSelected&&b.$apply(function(){z()})}}function H(a){!b.overrideSuggestions||b.selectedObject&&b.selectedObject.originalObject===b.searchStr||(a&&a.preventDefault(),e.cancel(ga),R(),B(b.searchStr))}function I(a){var b=getComputedStyle(a);return a.offsetHeight+parseInt(b.marginTop,10)+parseInt(b.marginBottom,10)}function J(){return ma.getBoundingClientRect().top+parseInt(getComputedStyle(ma).maxHeight,10)}function K(){return f[0].querySelectorAll(".angucomplete-row")[b.currentIndex]}function L(){return K().getBoundingClientRect().top-(ma.getBoundingClientRect().top+parseInt(getComputedStyle(ma).paddingTop,10))}function M(a){ma.scrollTop=ma.scrollTop+a}function N(){var a=b.results[b.currentIndex];b.matchClass?ea.val(C(a.originalObject)):ea.val(a.title)}function O(a){var c=y(a),d=null,e=null;c===n&&b.results?(b.currentIndex>=0&&b.currentIndex<b.results.length?(a.preventDefault(),b.selectResult(b.results[b.currentIndex])):(H(a),U()),b.$apply()):c===i&&b.results?(a.preventDefault(),b.currentIndex+1<b.results.length&&b.showDropdown&&(b.$apply(function(){b.currentIndex++,N()}),na&&(d=K(),J()<d.getBoundingClientRect().bottom&&M(I(d))))):c===k&&b.results?(a.preventDefault(),b.currentIndex>=1?(b.$apply(function(){b.currentIndex--,N()}),na&&(e=L())<0&&M(e-1)):0===b.currentIndex&&b.$apply(function(){b.currentIndex=-1,ea.val(b.searchStr)})):c===o?b.results&&b.results.length>0&&b.showDropdown?-1===b.currentIndex&&b.overrideSuggestions?H():(-1===b.currentIndex&&(b.currentIndex=0),b.selectResult(b.results[b.currentIndex]),b.$digest()):b.searchStr&&b.searchStr.length>0&&H():c===m&&a.preventDefault()}function P(a){return function(c,d,e,f){d||e||f||!c.data||(c=c.data),b.searching=!1,Z(D(aa(c),b.remoteUrlDataField),a)}}function Q(a,c,d,e){b.searching=la,c||d||e||(c=a.status),0!==c&&-1!==c&&(b.remoteUrlErrorCallback?b.remoteUrlErrorCallback(a,c,d,e):console&&console.error&&console.error("http error"))}function R(){ka&&ka.resolve()}function S(d){var e={},f=b.remoteUrl+encodeURIComponent(d);b.remoteUrlRequestFormatter&&(e={params:b.remoteUrlRequestFormatter(d)},f=b.remoteUrl),b.remoteUrlRequestWithCredentials&&(e.withCredentials=!0),R(),ka=a.defer(),e.timeout=ka.promise,la=!0,c.get(f,e).then(P(d)).catch(Q).finally(function(){la=!1})}function T(c){R(),ka=a.defer(),b.remoteApiHandler(c,ka.promise).then(P(c)).catch(Q)}function U(){b.showDropdown=!1,b.results=[],ma&&(ma.scrollTop=0)}function V(){b.showDropdown=ca,b.currentIndex=b.focusFirst?0:-1,b.results=[]}function W(a){var c,d,e,f,g=b.searchFields.split(","),h=[];for(void 0!==b.parseInput()&&(a=b.parseInput()(a)),c=0;c<b.localData.length;c++){for(d=!1,e=0;e<g.length;e++)f=D(b.localData[c],g[e])||"",d=d||f.toString().toLowerCase().indexOf(a.toString().toLowerCase())>=0;d&&(h[h.length]=b.localData[c])}return h}function X(a,c,d){if(!d)return!1;for(var e in c)if(c[e].toLowerCase()===d.toLowerCase())return b.selectResult(a),!0;return!1}function Y(a){!a||a.length<fa||(b.localData?b.$apply(function(){var c;c=void 0!==b.localSearch()?b.localSearch()(a,b.localData):W(a),b.searching=!1,Z(c,a)}):b.remoteApiHandler?T(a):S(a))}function Z(a,c){var d,e,f,g,h,i;if(a&&a.length>0)for(b.results=[],d=0;d<a.length;d++)b.titleField&&""!==b.titleField&&(g=h=C(a[d])),e="",b.descriptionField&&(e=i=D(a[d],b.descriptionField)),f="",b.imageField&&(f=D(a[d],b.imageField)),b.matchClass&&(h=E(g,c),i=E(e,c)),b.results[b.results.length]={title:h,description:i,image:f,originalObject:a[d]};else b.results=[];b.autoMatch&&1===b.results.length&&X(b.results[0],{title:g,desc:e||""},b.searchStr)?b.showDropdown=!1:0!==b.results.length||da?b.showDropdown=!0:b.showDropdown=!1}function $(){b.localData?(b.searching=!1,Z(b.localData,"")):b.remoteApiHandler?(b.searching=!0,T("")):(b.searching=!0,S(""))}var _,aa,ba,ca,da,ea=f.find("input"),fa=p,ga=null,ha=[],ia=t,ja=null,ka=null,la=!1,ma=f[0].querySelector(".angucomplete-dropdown"),na=!1,oa=null;f.on("mousedown",function(a){a.target.id?(oa=a.target.id)===b.id+"_dropdown"&&document.body.addEventListener("click",x):oa=a.target.className}),b.currentIndex=b.focusFirst?0:null,b.searching=!1,ba=b.$watch("initialValue",function(a){a&&(ba(),w(a,!0))}),b.$watch("fieldRequired",function(a,c){a!==c&&(a?F(ja&&-1!==b.currentIndex?!0:!1):h[b.inputName].$setValidity(ia,!0))}),b.$on("angucomplete-alt:clearInput",function(a,c){c&&c!==b.id||(b.searchStr=null,z(),F(!1),U())}),b.$on("angucomplete-alt:changeInput",function(a,c,d){c&&c===b.id&&w(d)}),b.$on("angucomplete-alt:setData",function(a,c,d){b.localData=d}),b.$on("angucomplete-alt:getSetObjects",function(a,c){return b}),b.$on("angucomplete-alt:setSelectedObjects",function(a,c,d){for(var e=0;e<d.length;e++)for(var f=0;f<b.localData.length;f++)if(b.localData[f][b.titleField]==d[e][b.titleField]){ha.push(b.localData[f]),b.localData.splice(f,1);break}b.objects=JSON.parse(JSON.stringify(ha)),0==ha.length?b.objects=JSON.parse(JSON.stringify(b.defaultSetObject)):b.objects=JSON.parse(JSON.stringify(ha))}),b.$on("angucomplete-alt:addObjectToList",function(a,c,d){Array.isArray(d)||(d=[d]);for(var e=0;e<ha.length;e++)for(var f=0;f<d.length;f++)if(ha[e][b.titleField]==d[f][b.titleField]){b.localData.push(ha[e]),ha.splice(e,1);for(var g=0;g<b.objects.length;g++)for(var h=0;h<d.length;h++)b.objects[g][b.titleField]==d[h][b.titleField]&&b.objects.splice(e,1)}}),b.onFocusHandler=function(){b.focusIn&&b.focusIn(),0===fa&&(b.currentIndex=b.focusFirst?0:b.currentIndex,b.showDropdown=!0,$())},b.hideResults=function(){oa&&(oa===b.id+"_dropdown"||oa.indexOf("angucomplete")>=0)?oa=null:(_=e(function(){U(),b.$apply(function(){b.searchStr&&b.searchStr.length>0&&ea.val(b.searchStr)})},s),R(),b.focusOut&&b.focusOut(),b.overrideSuggestions&&b.searchStr&&b.searchStr.length>0&&-1===b.currentIndex&&H())},b.resetHideResults=function(){_&&e.cancel(_)},b.hoverRow=function(a){b.currentIndex=a},b.selectResult=function(a){b.matchClass&&(a.title=C(a.originalObject),a.description=D(a.originalObject,b.descriptionField)),b.clearSelected?b.searchStr=null:b.searchStr=a.title,z(a),U()},b.inputChangeHandler=function(a){return a.length<fa?(R(),U()):0===a.length&&0===fa&&$(),b.inputChanged&&(a=b.inputChanged(a)),a},b.fieldRequiredClass&&""!==b.fieldRequiredClass&&(ia=b.fieldRequiredClass),b.minlength&&""!==b.minlength&&(fa=parseInt(b.minlength,10)),b.pause||(b.pause=r),b.clearSelected||(b.clearSelected=!1),b.overrideSuggestions||(b.overrideSuggestions=!1),b.fieldRequired&&h&&F(b.initialValue?!0:!1),b.inputType=g.type?g.type:"text",b.textSearching=g.textSearching?g.textSearching:u,b.textNoResults=g.textNoResults?g.textNoResults:v,ca="false"!==b.textSearching,da="false"!==b.textNoResults,b.maxlength=g.maxlength?g.maxlength:q,ea.on("keydown",O),ea.on("keyup compositionend",G),aa=function(a){return function(c){return b[a]?b[a](c):c}}("remoteUrlResponseFormatter"),e(function(){var a=getComputedStyle(ma);na=a.maxHeight&&"auto"===a.overflowY})}var i=40,j=39,k=38,l=37,m=27,n=13,o=9,p=3,q=524288,r=500,s=200,t="autocomplete-required",u="Searching...",v="No results found";return f.put("/angucomplete-alt/index.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}">  <input id="{{id}}_value" name="{{inputName}}" tabindex="{{fieldTabindex}}" ng-class="{\'angucomplete-input-not-empty\': notEmpty}" ng-model="searchStr" ng-disabled="disableInput" type="{{inputType}}" placeholder="{{placeholder}}" maxlength="{{maxlength}}" ng-focus="onFocusHandler()" class="{{inputClass}}" ng-focus="resetHideResults()" ng-blur="hideResults($event)" autocapitalize="off" autocorrect="off" autocomplete="off" ng-change="inputChangeHandler(searchStr)"/>  <div id="{{id}}_dropdown" class="angucomplete-dropdown" ng-show="showDropdown">    <div class="angucomplete-searching" ng-show="searching" ng-bind="textSearching"></div>    <div class="angucomplete-searching" ng-show="!searching && (!results || results.length == 0)" ng-bind="textNoResults"></div>    <div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseenter="hoverRow($index)" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}">      <div ng-if="imageField" class="angucomplete-image-holder">        <img ng-if="result.image && result.image != \'\'" ng-src="{{result.image}}" class="angucomplete-image"/>        <div ng-if="!result.image && result.image != \'\'" class="angucomplete-image-default"></div>      </div>      <div class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title"></div>      <div class="angucomplete-title" ng-if="!matchClass">{{ result.title }}</div>      <div ng-if="matchClass && result.description && result.description != \'\'" class="angucomplete-description" ng-bind-html="result.description"></div>      <div ng-if="!matchClass && result.description && result.description != \'\'" class="angucomplete-description">{{result.description}}</div>    </div>  </div></div>'),{restrict:"EA",require:"^?form",scope:{selectedObject:"=",listSelectedObject:"=",hideObjects:"=",objects:"=",defaultSetObject:"<?",selectedObjectData:"=",disableInput:"=",initialValue:"=",localData:"=",localSearch:"&",remoteUrlRequestFormatter:"=",remoteUrlRequestWithCredentials:"@",remoteUrlResponseFormatter:"=",remoteUrlErrorCallback:"=",remoteApiHandler:"=",id:"@",type:"@",placeholder:"@",textSearching:"@",textNoResults:"@",remoteUrl:"@",remoteUrlDataField:"@",titleField:"@",descriptionField:"@",imageField:"@",inputClass:"@",pause:"@",searchFields:"@",minlength:"@",matchClass:"@",clearSelected:"@",overrideSuggestions:"@",fieldRequired:"=",fieldRequiredClass:"@",inputChanged:"=",autoMatch:"@",focusOut:"&",focusIn:"&",fieldTabindex:"@",inputName:"@",focusFirst:"@",parseInput:"&"},templateUrl:function(a,b){return b.templateUrl||"/angucomplete-alt/index.html"},compile:function(a){var b=g.startSymbol(),c=g.endSymbol();if("{{"!==b||"}}"!==c){var d=a.html().replace(/\{\{/g,b).replace(/\}\}/g,c);a.html(d)}return h}}}])}),angular.module("toggle-switch",["ng"]).directive("toggleSwitch",["$compile",function(a){return{restrict:"EA",replace:!0,require:"ngModel",scope:{isDisabled:"=",onLabel:"@",offLabel:"@",knobLabel:"@",html:"=",onChange:"&"},template:'<div class="ats-switch" ng-click="toggle()" ng-keypress="onKeyPress($event)" ng-class="{ \'disabled\': isDisabled }" role="switch" aria-checked="{{!!model}}"><div class="switch-animate" ng-class="{\'switch-off\': !model, \'switch-on\': model}"><span class="switch-left"></span><span class="knob"></span><span class="switch-right"></span></div></div>',compile:function(b,c){return angular.isUndefined(c.onLabel)&&(c.onLabel="On"),angular.isUndefined(c.offLabel)&&(c.offLabel="Off"),angular.isUndefined(c.knobLabel)&&(c.knobLabel=" "),angular.isUndefined(c.isDisabled)&&(c.isDisabled=!1),angular.isUndefined(c.html)&&(c.html=!1),angular.isUndefined(c.tabindex)&&(c.tabindex=0),function(b,d,e,f){d.attr("tabindex",c.tabindex),b.toggle=function(){b.isDisabled||(b.model=!b.model,f.$setViewValue(b.model),b.onChange())};b.onKeyPress=function(a){32!=a.charCode||a.altKey||a.ctrlKey||a.metaKey||(b.toggle(),a.preventDefault())},f.$formatters.push(function(a){return a}),f.$parsers.push(function(a){return a}),f.$viewChangeListeners.push(function(){b.$eval(c.ngChange)}),f.$render=function(){b.model=f.$viewValue};var g=function(c,d){c=angular.element(c);var e=!0===d?"ng-bind-html":"ng-bind";c.removeAttr("ng-bind-html"),c.removeAttr("ng-bind"),angular.element(c).hasClass("switch-left")&&c.attr(e,"onLabel"),c.hasClass("knob")&&c.attr(e,"knobLabel"),c.hasClass("switch-right")&&c.attr(e,"offLabel"),a(c)(b,function(a,b){c.replaceWith(a)})},h=function(a,b){angular.forEach(a[0].children[0].children,function(a,c){g(a,b)})};b.$watch("html",function(a){h(d,a)})}}}}]),function(a,b){"use strict";if("function"==typeof define&&define.amd)define(["angular"],b);else if("object"==typeof module&&module.exports){var c=angular||require("angular");c&&c.module||"undefined"==typeof angular||(c=angular),module.exports=b(c)}else b(a.angular)}(this,function(a){"use strict";var b=a.module("rzModule",[]).factory("RzSliderOptions",function(){var b={floor:0,ceil:null,step:1,precision:0,minRange:null,maxRange:null,pushRange:!1,minLimit:null,maxLimit:null,id:null,translate:null,getLegend:null,stepsArray:null,bindIndexForStepsArray:!1,draggableRange:!1,draggableRangeOnly:!1,showSelectionBar:!1,showSelectionBarEnd:!1,showSelectionBarFromValue:null,hidePointerLabels:!1,hideLimitLabels:!1,autoHideLimitLabels:!0,readOnly:!1,disabled:!1,interval:350,showTicks:!1,showTicksValues:!1,ticksArray:null,ticksTooltip:null,ticksValuesTooltip:null,vertical:!1,getSelectionBarColor:null,getTickColor:null,getPointerColor:null,keyboardSupport:!0,scale:1,enforceStep:!0,enforceRange:!1,noSwitching:!1,onlyBindHandles:!1,onStart:null,onChange:null,onEnd:null,rightToLeft:!1,boundPointerLabels:!0,mergeRangeLabelsIfSame:!1,customTemplateScope:null,logScale:!1,customValueToPosition:null,customPositionToValue:null,selectionBarGradient:null,ariaLabel:null,ariaLabelledBy:null,ariaLabelHigh:null,ariaLabelledByHigh:null},c={},d={};return d.options=function(b){a.extend(c,b)},d.getOptions=function(d){return a.extend({},b,c,d)},d}).factory("rzThrottle",["$timeout",function(a){return function(b,c,d){var e,f,g,h=Date.now||function(){return(new Date).getTime()},i=null,j=0;d=d||{};var k=function(){j=h(),i=null,g=b.apply(e,f),e=f=null};return function(){var l=h(),m=c-(l-j);return e=this,f=arguments,0>=m?(a.cancel(i),i=null,j=l,g=b.apply(e,f),e=f=null):i||!1===d.trailing||(i=a(k,m)),g}}}]).factory("RzSlider",["$timeout","$document","$window","$compile","RzSliderOptions","rzThrottle",function(b,c,d,e,f,g){var h=function(a,b){this.scope=a,this.lowValue=0,this.highValue=0,this.sliderElem=b,this.range=void 0!==this.scope.rzSliderModel&&void 0!==this.scope.rzSliderHigh,this.dragging={active:!1,value:0,difference:0,position:0,lowLimit:0,highLimit:0},this.positionProperty="left",this.dimensionProperty="width",this.handleHalfDim=0,this.maxPos=0,this.precision=0,this.step=1,this.tracking="",this.minValue=0,this.maxValue=0,this.valueRange=0,this.intermediateTicks=!1,this.initHasRun=!1,this.firstKeyDown=!1,this.internalChange=!1,this.cmbLabelShown=!1,this.currentFocusElement=null,this.fullBar=null,this.selBar=null,this.minH=null,this.maxH=null,this.flrLab=null,this.ceilLab=null,this.minLab=null,this.maxLab=null,this.cmbLab=null,this.ticks=null,this.init()};return h.prototype={init:function(){var b,c,e=this,f=function(){e.calcViewDimensions()};this.applyOptions(),this.syncLowValue(),this.range&&this.syncHighValue(),this.initElemHandles(),this.manageElementsStyle(),this.setDisabledState(),this.calcViewDimensions(),this.setMinAndMax(),this.addAccessibility(),this.updateCeilLab(),this.updateFloorLab(),this.initHandles(),this.manageEventsBindings(),this.scope.$on("reCalcViewDimensions",f),a.element(d).on("resize",f),this.initHasRun=!0,b=g(function(){e.onLowHandleChange()},e.options.interval),c=g(function(){e.onHighHandleChange()},e.options.interval),this.scope.$on("rzSliderForceRender",function(){e.resetLabelsValue(),b(),e.range&&c(),e.resetSlider()}),this.scope.$watch("rzSliderOptions()",function(a,b){a!==b&&(e.applyOptions(),e.syncLowValue(),e.range&&e.syncHighValue(),e.resetSlider())},!0),this.scope.$watch("rzSliderModel",function(a,c){e.internalChange||a!==c&&b()}),this.scope.$watch("rzSliderHigh",function(a,b){e.internalChange||a!==b&&(null!=a&&c(),(e.range&&null==a||!e.range&&null!=a)&&(e.applyOptions(),e.resetSlider()))}),this.scope.$on("$destroy",function(){e.unbindEvents(),a.element(d).off("resize",f),e.currentFocusElement=null})},findStepIndex:function(b){for(var c=0,d=0;d<this.options.stepsArray.length;d++){var e=this.options.stepsArray[d];if(e===b){c=d;break}if(a.isDate(e)){if(e.getTime()===b.getTime()){c=d;break}}else if(a.isObject(e)&&(a.isDate(e.value)&&e.value.getTime()===b.getTime()||e.value===b)){c=d;break}}return c},syncLowValue:function(){this.options.stepsArray?this.options.bindIndexForStepsArray?this.lowValue=this.scope.rzSliderModel:this.lowValue=this.findStepIndex(this.scope.rzSliderModel):this.lowValue=this.scope.rzSliderModel},syncHighValue:function(){this.options.stepsArray?this.options.bindIndexForStepsArray?this.highValue=this.scope.rzSliderHigh:this.highValue=this.findStepIndex(this.scope.rzSliderHigh):this.highValue=this.scope.rzSliderHigh},getStepValue:function(b){var c=this.options.stepsArray[b];return a.isDate(c)?c:a.isObject(c)?c.value:c},applyLowValue:function(){this.options.stepsArray?this.options.bindIndexForStepsArray?this.scope.rzSliderModel=this.lowValue:this.scope.rzSliderModel=this.getStepValue(this.lowValue):this.scope.rzSliderModel=this.lowValue},applyHighValue:function(){this.options.stepsArray?this.options.bindIndexForStepsArray?this.scope.rzSliderHigh=this.highValue:this.scope.rzSliderHigh=this.getStepValue(this.highValue):this.scope.rzSliderHigh=this.highValue},onLowHandleChange:function(){this.syncLowValue(),this.range&&this.syncHighValue(),this.setMinAndMax(),this.updateLowHandle(this.valueToPosition(this.lowValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateAriaAttributes(),this.range&&this.updateCmbLabel()},onHighHandleChange:function(){this.syncLowValue(),this.syncHighValue(),this.setMinAndMax(),this.updateHighHandle(this.valueToPosition(this.highValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateCmbLabel(),this.updateAriaAttributes()},applyOptions:function(){var b;b=this.scope.rzSliderOptions?this.scope.rzSliderOptions():{},this.options=f.getOptions(b),this.options.step<=0&&(this.options.step=1),this.range=void 0!==this.scope.rzSliderModel&&void 0!==this.scope.rzSliderHigh,this.options.draggableRange=this.range&&this.options.draggableRange,this.options.draggableRangeOnly=this.range&&this.options.draggableRangeOnly,this.options.draggableRangeOnly&&(this.options.draggableRange=!0),this.options.showTicks=this.options.showTicks||this.options.showTicksValues||!!this.options.ticksArray,this.scope.showTicks=this.options.showTicks,(a.isNumber(this.options.showTicks)||this.options.ticksArray)&&(this.intermediateTicks=!0),this.options.showSelectionBar=this.options.showSelectionBar||this.options.showSelectionBarEnd||null!==this.options.showSelectionBarFromValue,this.options.stepsArray?this.parseStepsArray():(this.options.translate?this.customTrFn=this.options.translate:this.customTrFn=function(a){return String(a)},this.getLegend=this.options.getLegend),this.options.vertical&&(this.positionProperty="bottom",this.dimensionProperty="height"),this.options.customTemplateScope&&(this.scope.custom=this.options.customTemplateScope)},parseStepsArray:function(){this.options.floor=0,this.options.ceil=this.options.stepsArray.length-1,this.options.step=1,this.options.translate?this.customTrFn=this.options.translate:this.customTrFn=function(a){return this.options.bindIndexForStepsArray?this.getStepValue(a):a},this.getLegend=function(b){var c=this.options.stepsArray[b];return a.isObject(c)?c.legend:null}},resetSlider:function(){this.manageElementsStyle(),this.addAccessibility(),this.setMinAndMax(),this.updateCeilLab(),this.updateFloorLab(),this.unbindEvents(),this.manageEventsBindings(),this.setDisabledState(),this.calcViewDimensions(),this.refocusPointerIfNeeded()},refocusPointerIfNeeded:function(){this.currentFocusElement&&(this.onPointerFocus(this.currentFocusElement.pointer,this.currentFocusElement.ref),this.focusElement(this.currentFocusElement.pointer))},initElemHandles:function(){a.forEach(this.sliderElem.children(),function(b,c){var d=a.element(b);switch(c){case 0:this.fullBar=d;break;case 1:this.selBar=d;break;case 2:this.minH=d;break;case 3:this.maxH=d;break;case 4:this.flrLab=d;break;case 5:this.ceilLab=d;break;case 6:this.minLab=d;break;case 7:this.maxLab=d;break;case 8:this.cmbLab=d;break;case 9:this.ticks=d}},this),this.selBar.rzsp=0,this.minH.rzsp=0,this.maxH.rzsp=0,this.flrLab.rzsp=0,this.ceilLab.rzsp=0,this.minLab.rzsp=0,this.maxLab.rzsp=0,this.cmbLab.rzsp=0},manageElementsStyle:function(){this.range?this.maxH.css("display",""):this.maxH.css("display","none"),this.alwaysHide(this.flrLab,this.options.showTicksValues||this.options.hideLimitLabels),this.alwaysHide(this.ceilLab,this.options.showTicksValues||this.options.hideLimitLabels);var a=this.options.showTicksValues&&!this.intermediateTicks;this.alwaysHide(this.minLab,a||this.options.hidePointerLabels),this.alwaysHide(this.maxLab,a||!this.range||this.options.hidePointerLabels),this.alwaysHide(this.cmbLab,a||!this.range||this.options.hidePointerLabels),this.alwaysHide(this.selBar,!this.range&&!this.options.showSelectionBar),this.options.vertical&&this.sliderElem.addClass("rz-vertical"),this.options.draggableRange?this.selBar.addClass("rz-draggable"):this.selBar.removeClass("rz-draggable"),this.intermediateTicks&&this.options.showTicksValues&&this.ticks.addClass("rz-ticks-values-under")},alwaysHide:function(a,b){a.rzAlwaysHide=b,b?this.hideEl(a):this.showEl(a)},manageEventsBindings:function(){this.options.disabled||this.options.readOnly?this.unbindEvents():this.bindEvents()},setDisabledState:function(){this.options.disabled?this.sliderElem.attr("disabled","disabled"):this.sliderElem.attr("disabled",null)},resetLabelsValue:function(){this.minLab.rzsv=void 0,this.maxLab.rzsv=void 0},initHandles:function(){this.updateLowHandle(this.valueToPosition(this.lowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.highValue)),this.updateSelectionBar(),this.range&&this.updateCmbLabel(),this.updateTicksScale()},translateFn:function(a,b,c,d){d=void 0===d||d;var e="",f=!1,g=b.hasClass("no-label-injection");d?(this.options.stepsArray&&!this.options.bindIndexForStepsArray&&(a=this.getStepValue(a)),e=String(this.customTrFn(a,this.options.id,c))):e=String(a),(void 0===b.rzsv||b.rzsv.length!==e.length||b.rzsv.length>0&&0===b.rzsd)&&(f=!0,b.rzsv=e),g||b.html(e),this.scope[c+"Label"]=e,f&&this.getDimension(b)},setMinAndMax:function(){if(this.step=+this.options.step,this.precision=+this.options.precision,this.minValue=this.options.floor,this.options.logScale&&0===this.minValue)throw Error("Can't use floor=0 with logarithmic scale");this.options.enforceStep&&(this.lowValue=this.roundStep(this.lowValue),this.range&&(this.highValue=this.roundStep(this.highValue))),null!=this.options.ceil?this.maxValue=this.options.ceil:this.maxValue=this.options.ceil=this.range?this.highValue:this.lowValue,this.options.enforceRange&&(this.lowValue=this.sanitizeValue(this.lowValue),this.range&&(this.highValue=this.sanitizeValue(this.highValue))),this.applyLowValue(),this.range&&this.applyHighValue(),this.valueRange=this.maxValue-this.minValue},addAccessibility:function(){this.minH.attr("role","slider"),this.updateAriaAttributes(),!this.options.keyboardSupport||this.options.readOnly||this.options.disabled?this.minH.attr("tabindex",""):this.minH.attr("tabindex","0"),this.options.vertical&&this.minH.attr("aria-orientation","vertical"),this.options.ariaLabel?this.minH.attr("aria-label",this.options.ariaLabel):this.options.ariaLabelledBy&&this.minH.attr("aria-labelledby",this.options.ariaLabelledBy),this.range&&(this.maxH.attr("role","slider"),!this.options.keyboardSupport||this.options.readOnly||this.options.disabled?this.maxH.attr("tabindex",""):this.maxH.attr("tabindex","0"),this.options.vertical&&this.maxH.attr("aria-orientation","vertical"),this.options.ariaLabelHigh?this.maxH.attr("aria-label",this.options.ariaLabelHigh):this.options.ariaLabelledByHigh&&this.maxH.attr("aria-labelledby",this.options.ariaLabelledByHigh))},updateAriaAttributes:function(){this.minH.attr({"aria-valuenow":this.scope.rzSliderModel,"aria-valuetext":this.customTrFn(this.scope.rzSliderModel,this.options.id,"model"),"aria-valuemin":this.minValue,"aria-valuemax":this.maxValue}),this.range&&this.maxH.attr({"aria-valuenow":this.scope.rzSliderHigh,"aria-valuetext":this.customTrFn(this.scope.rzSliderHigh,this.options.id,"high"),"aria-valuemin":this.minValue,"aria-valuemax":this.maxValue})},calcViewDimensions:function(){var a=this.getDimension(this.minH);if(this.handleHalfDim=a/2,this.barDimension=this.getDimension(this.fullBar),this.maxPos=this.barDimension-a,this.getDimension(this.sliderElem),this.sliderElem.rzsp=this.sliderElem[0].getBoundingClientRect()[this.positionProperty],this.initHasRun){this.updateFloorLab(),this.updateCeilLab(),this.initHandles();var c=this;b(function(){c.updateTicksScale()})}},updateTicksScale:function(){if(this.options.showTicks){var a=this.options.ticksArray||this.getTicksArray(),b=this.options.vertical?"translateY":"translateX",c=this;this.options.rightToLeft&&a.reverse(),this.scope.ticks=a.map(function(a){var d=c.valueToPosition(a);c.options.vertical&&(d=c.maxPos-d);var e=b+"("+Math.round(d)+"px)",f={selected:c.isTickSelected(a),style:{"-webkit-transform":e,"-moz-transform":e,"-o-transform":e,"-ms-transform":e,transform:e}};if(f.selected&&c.options.getSelectionBarColor&&(f.style["background-color"]=c.getSelectionBarColor()),!f.selected&&c.options.getTickColor&&(f.style["background-color"]=c.getTickColor(a)),c.options.ticksTooltip&&(f.tooltip=c.options.ticksTooltip(a),f.tooltipPlacement=c.options.vertical?"right":"top"),c.options.showTicksValues&&(f.value=c.getDisplayValue(a,"tick-value"),c.options.ticksValuesTooltip&&(f.valueTooltip=c.options.ticksValuesTooltip(a),f.valueTooltipPlacement=c.options.vertical?"right":"top")),c.getLegend){var g=c.getLegend(a,c.options.id);g&&(f.legend=g)}return f})}},getTicksArray:function(){var a=this.step,b=[];this.intermediateTicks&&(a=this.options.showTicks);for(var c=this.minValue;c<=this.maxValue;c+=a)b.push(c);return b},isTickSelected:function(a){if(!this.range)if(null!==this.options.showSelectionBarFromValue){var b=this.options.showSelectionBarFromValue;if(this.lowValue>b&&a>=b&&a<=this.lowValue)return!0;if(this.lowValue<b&&b>=a&&a>=this.lowValue)return!0}else if(this.options.showSelectionBarEnd){if(a>=this.lowValue)return!0}else if(this.options.showSelectionBar&&a<=this.lowValue)return!0;return!!(this.range&&a>=this.lowValue&&a<=this.highValue)},updateFloorLab:function(){this.translateFn(this.minValue,this.flrLab,"floor"),this.getDimension(this.flrLab);var a=this.options.rightToLeft?this.barDimension-this.flrLab.rzsd:0;this.setPosition(this.flrLab,a)},updateCeilLab:function(){this.translateFn(this.maxValue,this.ceilLab,"ceil"),this.getDimension(this.ceilLab);var a=this.options.rightToLeft?0:this.barDimension-this.ceilLab.rzsd;this.setPosition(this.ceilLab,a)},updateHandles:function(a,b){"lowValue"===a?this.updateLowHandle(b):this.updateHighHandle(b),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCmbLabel()},getHandleLabelPos:function(a,b){var c=this[a].rzsd,d=b-c/2+this.handleHalfDim,e=this.barDimension-c;return this.options.boundPointerLabels?this.options.rightToLeft&&"minLab"===a||!this.options.rightToLeft&&"maxLab"===a?Math.min(d,e):Math.min(Math.max(d,0),e):d},updateLowHandle:function(a){if(this.setPosition(this.minH,a),this.translateFn(this.lowValue,this.minLab,"model"),this.setPosition(this.minLab,this.getHandleLabelPos("minLab",a)),this.options.getPointerColor){var b=this.getPointerColor("min");this.scope.minPointerStyle={backgroundColor:b}}this.options.autoHideLimitLabels&&this.shFloorCeil()},updateHighHandle:function(a){if(this.setPosition(this.maxH,a),this.translateFn(this.highValue,this.maxLab,"high"),this.setPosition(this.maxLab,this.getHandleLabelPos("maxLab",a)),this.options.getPointerColor){var b=this.getPointerColor("max");this.scope.maxPointerStyle={backgroundColor:b}}this.options.autoHideLimitLabels&&this.shFloorCeil()},shFloorCeil:function(){if(!this.options.hidePointerLabels){var a=!1,b=!1,c=this.isLabelBelowFloorLab(this.minLab),d=this.isLabelAboveCeilLab(this.minLab),e=this.isLabelAboveCeilLab(this.maxLab),f=this.isLabelBelowFloorLab(this.cmbLab),g=this.isLabelAboveCeilLab(this.cmbLab);if(c?(a=!0,this.hideEl(this.flrLab)):(a=!1,this.showEl(this.flrLab)),d?(b=!0,this.hideEl(this.ceilLab)):(b=!1,this.showEl(this.ceilLab)),this.range){var h=this.cmbLabelShown?g:e,i=this.cmbLabelShown?f:c;h?this.hideEl(this.ceilLab):b||this.showEl(this.ceilLab),
  i?this.hideEl(this.flrLab):a||this.showEl(this.flrLab)}}},isLabelBelowFloorLab:function(a){var b=this.options.rightToLeft,c=a.rzsp,d=a.rzsd,e=this.flrLab.rzsp,f=this.flrLab.rzsd;return b?c+d>=e-2:e+f+2>=c},isLabelAboveCeilLab:function(a){var b=this.options.rightToLeft,c=a.rzsp,d=a.rzsd,e=this.ceilLab.rzsp,f=this.ceilLab.rzsd;return b?e+f+2>=c:c+d>=e-2},updateSelectionBar:function(){var a=0,b=0,c=this.options.rightToLeft?!this.options.showSelectionBarEnd:this.options.showSelectionBarEnd,d=this.options.rightToLeft?this.maxH.rzsp+this.handleHalfDim:this.minH.rzsp+this.handleHalfDim;if(this.range)b=Math.abs(this.maxH.rzsp-this.minH.rzsp),a=d;else if(null!==this.options.showSelectionBarFromValue){var e=this.options.showSelectionBarFromValue,f=this.valueToPosition(e),g=this.options.rightToLeft?this.lowValue<=e:this.lowValue>e;g?(b=this.minH.rzsp-f,a=f+this.handleHalfDim):(b=f-this.minH.rzsp,a=this.minH.rzsp+this.handleHalfDim)}else c?(b=Math.abs(this.maxPos-this.minH.rzsp)+this.handleHalfDim,a=this.minH.rzsp+this.handleHalfDim):(b=this.minH.rzsp+this.handleHalfDim,a=0);if(this.setDimension(this.selBar,b),this.setPosition(this.selBar,a),this.options.getSelectionBarColor){var h=this.getSelectionBarColor();this.scope.barStyle={backgroundColor:h}}else if(this.options.selectionBarGradient){var i=null!==this.options.showSelectionBarFromValue?this.valueToPosition(this.options.showSelectionBarFromValue):0,j=i-a>0^c,k=this.options.vertical?j?"bottom":"top":j?"left":"right";this.scope.barStyle={backgroundImage:"linear-gradient(to "+k+", "+this.options.selectionBarGradient.from+" 0%,"+this.options.selectionBarGradient.to+" 100%)"},this.options.vertical?(this.scope.barStyle.backgroundPosition="center "+(i+b+a+(j?-this.handleHalfDim:0))+"px",this.scope.barStyle.backgroundSize="100% "+(this.barDimension-this.handleHalfDim)+"px"):(this.scope.barStyle.backgroundPosition=i-a+(j?this.handleHalfDim:0)+"px center",this.scope.barStyle.backgroundSize=this.barDimension-this.handleHalfDim+"px 100%")}},getSelectionBarColor:function(){return this.range?this.options.getSelectionBarColor(this.scope.rzSliderModel,this.scope.rzSliderHigh):this.options.getSelectionBarColor(this.scope.rzSliderModel)},getPointerColor:function(a){return"max"===a?this.options.getPointerColor(this.scope.rzSliderHigh,a):this.options.getPointerColor(this.scope.rzSliderModel,a)},getTickColor:function(a){return this.options.getTickColor(a)},updateCmbLabel:function(){if(this.options.rightToLeft?this.minLab.rzsp-this.minLab.rzsd-10<=this.maxLab.rzsp:this.minLab.rzsp+this.minLab.rzsd+10>=this.maxLab.rzsp){var a=this.getDisplayValue(this.lowValue,"model"),b=this.getDisplayValue(this.highValue,"high"),c="";c=this.options.mergeRangeLabelsIfSame&&a===b?a:this.options.rightToLeft?b+" - "+a:a+" - "+b,this.translateFn(c,this.cmbLab,"cmb",!1);var d=this.options.boundPointerLabels?Math.min(Math.max(this.selBar.rzsp+this.selBar.rzsd/2-this.cmbLab.rzsd/2,0),this.barDimension-this.cmbLab.rzsd):this.selBar.rzsp+this.selBar.rzsd/2-this.cmbLab.rzsd/2;this.setPosition(this.cmbLab,d),this.cmbLabelShown=!0,this.hideEl(this.minLab),this.hideEl(this.maxLab),this.showEl(this.cmbLab)}else this.cmbLabelShown=!1,this.updateHighHandle(this.valueToPosition(this.highValue)),this.updateLowHandle(this.valueToPosition(this.lowValue)),this.showEl(this.maxLab),this.showEl(this.minLab),this.hideEl(this.cmbLab);this.options.autoHideLimitLabels&&this.shFloorCeil()},getDisplayValue:function(a,b){return this.options.stepsArray&&!this.options.bindIndexForStepsArray&&(a=this.getStepValue(a)),this.customTrFn(a,this.options.id,b)},roundStep:function(a,b){var c=b||this.step,d=parseFloat((a-this.minValue)/c).toPrecision(12);return d=Math.round(+d)*c,+(this.minValue+d).toFixed(this.precision)},hideEl:function(a){return a.css({visibility:"hidden"})},showEl:function(a){return a.rzAlwaysHide?a:a.css({visibility:"visible"})},setPosition:function(a,b){a.rzsp=b;var c={};return c[this.positionProperty]=Math.round(b)+"px",a.css(c),b},getDimension:function(a){var b=a[0].getBoundingClientRect();return this.options.vertical?a.rzsd=(b.bottom-b.top)*this.options.scale:a.rzsd=(b.right-b.left)*this.options.scale,a.rzsd},setDimension:function(a,b){a.rzsd=b;var c={};return c[this.dimensionProperty]=Math.round(b)+"px",a.css(c),b},sanitizeValue:function(a){return Math.min(Math.max(a,this.minValue),this.maxValue)},valueToPosition:function(a){var b=this.linearValueToPosition;this.options.customValueToPosition?b=this.options.customValueToPosition:this.options.logScale&&(b=this.logValueToPosition),a=this.sanitizeValue(a);var c=b(a,this.minValue,this.maxValue)||0;return this.options.rightToLeft&&(c=1-c),c*this.maxPos},linearValueToPosition:function(a,b,c){return(a-b)/(c-b)},logValueToPosition:function(a,b,c){return a=Math.log(a),b=Math.log(b),c=Math.log(c),(a-b)/(c-b)},positionToValue:function(a){var b=a/this.maxPos;this.options.rightToLeft&&(b=1-b);var c=this.linearPositionToValue;return this.options.customPositionToValue?c=this.options.customPositionToValue:this.options.logScale&&(c=this.logPositionToValue),c(b,this.minValue,this.maxValue)||0},linearPositionToValue:function(a,b,c){return a*(c-b)+b},logPositionToValue:function(a,b,c){b=Math.log(b),c=Math.log(c);var d=a*(c-b)+b;return Math.exp(d)},getEventAttr:function(a,b){return void 0===a.originalEvent?a[b]:a.originalEvent[b]},getEventXY:function(a,b){var c=this.options.vertical?"clientY":"clientX";if(void 0!==a[c])return a[c];var d=this.getEventAttr(a,"touches");if(void 0!==b)for(var e=0;e<d.length;e++)if(d[e].identifier===b)return d[e][c];return d[0][c]},getEventPosition:function(a,b){var c=this.sliderElem.rzsp;return(this.options.vertical?-this.getEventXY(a,b)+c:this.getEventXY(a,b)-c)*this.options.scale-this.handleHalfDim},getEventNames:function(a){var b={moveEvent:"",endEvent:""};return this.getEventAttr(a,"touches")?(b.moveEvent="touchmove",b.endEvent="touchend"):(b.moveEvent="mousemove",b.endEvent="mouseup"),b},getNearestHandle:function(a){if(!this.range)return this.minH;var b=this.getEventPosition(a),c=Math.abs(b-this.minH.rzsp),d=Math.abs(b-this.maxH.rzsp);return d>c?this.minH:c>d?this.maxH:this.options.rightToLeft?b>this.minH.rzsp?this.minH:this.maxH:b<this.minH.rzsp?this.minH:this.maxH},focusElement:function(a){a[0].focus()},bindEvents:function(){var b,c,d;this.options.draggableRange?(b="rzSliderDrag",c=this.onDragStart,d=this.onDragMove):(b="lowValue",c=this.onStart,d=this.onMove),this.options.onlyBindHandles||(this.selBar.on("mousedown",a.bind(this,c,null,b)),this.selBar.on("mousedown",a.bind(this,d,this.selBar))),this.options.draggableRangeOnly?(this.minH.on("mousedown",a.bind(this,c,null,b)),this.maxH.on("mousedown",a.bind(this,c,null,b))):(this.minH.on("mousedown",a.bind(this,this.onStart,this.minH,"lowValue")),this.range&&this.maxH.on("mousedown",a.bind(this,this.onStart,this.maxH,"highValue")),this.options.onlyBindHandles||(this.fullBar.on("mousedown",a.bind(this,this.onStart,null,null)),this.fullBar.on("mousedown",a.bind(this,this.onMove,this.fullBar)),this.ticks.on("mousedown",a.bind(this,this.onStart,null,null)),this.ticks.on("mousedown",a.bind(this,this.onTickClick,this.ticks)))),this.options.onlyBindHandles||(this.selBar.on("touchstart",a.bind(this,c,null,b)),this.selBar.on("touchstart",a.bind(this,d,this.selBar))),this.options.draggableRangeOnly?(this.minH.on("touchstart",a.bind(this,c,null,b)),this.maxH.on("touchstart",a.bind(this,c,null,b))):(this.minH.on("touchstart",a.bind(this,this.onStart,this.minH,"lowValue")),this.range&&this.maxH.on("touchstart",a.bind(this,this.onStart,this.maxH,"highValue")),this.options.onlyBindHandles||(this.fullBar.on("touchstart",a.bind(this,this.onStart,null,null)),this.fullBar.on("touchstart",a.bind(this,this.onMove,this.fullBar)),this.ticks.on("touchstart",a.bind(this,this.onStart,null,null)),this.ticks.on("touchstart",a.bind(this,this.onTickClick,this.ticks)))),this.options.keyboardSupport&&(this.minH.on("focus",a.bind(this,this.onPointerFocus,this.minH,"lowValue")),this.range&&this.maxH.on("focus",a.bind(this,this.onPointerFocus,this.maxH,"highValue")))},unbindEvents:function(){this.minH.off(),this.maxH.off(),this.fullBar.off(),this.selBar.off(),this.ticks.off()},onStart:function(b,d,e){var f,g,h=this.getEventNames(e);e.stopPropagation(),e.preventDefault(),this.calcViewDimensions(),b?this.tracking=d:(b=this.getNearestHandle(e),this.tracking=b===this.minH?"lowValue":"highValue"),b.addClass("rz-active"),this.options.keyboardSupport&&this.focusElement(b),f=a.bind(this,this.dragging.active?this.onDragMove:this.onMove,b),g=a.bind(this,this.onEnd,f),c.on(h.moveEvent,f),c.on(h.endEvent,g),this.endHandlerToBeRemovedOnEnd=g,this.callOnStart();var i=this.getEventAttr(e,"changedTouches");i&&(this.touchId||(this.isDragging=!0,this.touchId=i[0].identifier))},onMove:function(b,c,d){var e,f=this.getEventAttr(c,"changedTouches");if(f)for(var g=0;g<f.length;g++)if(f[g].identifier===this.touchId){e=f[g];break}if(!f||e){var h,i=this.getEventPosition(c,e?e.identifier:void 0),j=this.options.rightToLeft?this.minValue:this.maxValue,k=this.options.rightToLeft?this.maxValue:this.minValue;0>=i?h=k:i>=this.maxPos?h=j:(h=this.positionToValue(i),h=d&&a.isNumber(this.options.showTicks)?this.roundStep(h,this.options.showTicks):this.roundStep(h)),this.positionTrackingHandle(h)}},onEnd:function(a,b){var d=this.getEventAttr(b,"changedTouches");if(!d||d[0].identifier===this.touchId){this.isDragging=!1,this.touchId=null,this.options.keyboardSupport||(this.minH.removeClass("rz-active"),this.maxH.removeClass("rz-active"),this.tracking=""),this.dragging.active=!1;var e=this.getEventNames(b);c.off(e.moveEvent,a),c.off(e.endEvent,this.endHandlerToBeRemovedOnEnd),this.endHandlerToBeRemovedOnEnd=null,this.callOnEnd()}},onTickClick:function(a,b){this.onMove(a,b,!0)},onPointerFocus:function(b,c){this.tracking=c,b.one("blur",a.bind(this,this.onPointerBlur,b)),b.on("keydown",a.bind(this,this.onKeyboardEvent)),b.on("keyup",a.bind(this,this.onKeyUp)),this.firstKeyDown=!0,b.addClass("rz-active"),this.currentFocusElement={pointer:b,ref:c}},onKeyUp:function(){this.firstKeyDown=!0,this.callOnEnd()},onPointerBlur:function(a){a.off("keydown"),a.off("keyup"),a.removeClass("rz-active"),this.isDragging||(this.tracking="",this.currentFocusElement=null)},getKeyActions:function(a){var b=a+this.step,c=a-this.step,d=a+this.valueRange/10,e=a-this.valueRange/10,f={UP:b,DOWN:c,LEFT:c,RIGHT:b,PAGEUP:d,PAGEDOWN:e,HOME:this.minValue,END:this.maxValue};return this.options.rightToLeft&&(f.LEFT=b,f.RIGHT=c,this.options.vertical&&(f.UP=c,f.DOWN=b)),f},onKeyboardEvent:function(a){var c=this[this.tracking],d=a.keyCode||a.which,e={38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END"},f=this.getKeyActions(c),g=e[d],h=f[g];if(null!=h&&""!==this.tracking){a.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.callOnStart());var i=this;b(function(){var a=i.roundStep(i.sanitizeValue(h));if(i.options.draggableRangeOnly){var b,c,d=i.highValue-i.lowValue;"lowValue"===i.tracking?(b=a,(c=a+d)>i.maxValue&&(c=i.maxValue,b=c-d)):(c=a,(b=a-d)<i.minValue&&(b=i.minValue,c=b+d)),i.positionTrackingBar(b,c)}else i.positionTrackingHandle(a)})}},onDragStart:function(a,b,c){var d=this.getEventPosition(c);this.dragging={active:!0,value:this.positionToValue(d),difference:this.highValue-this.lowValue,lowLimit:this.options.rightToLeft?this.minH.rzsp-d:d-this.minH.rzsp,highLimit:this.options.rightToLeft?d-this.maxH.rzsp:this.maxH.rzsp-d},this.onStart(a,b,c)},getValue:function(a,b,c,d){var e=this.options.rightToLeft,f=null;return f="min"===a?c?d?e?this.minValue:this.maxValue-this.dragging.difference:e?this.maxValue-this.dragging.difference:this.minValue:e?this.positionToValue(b+this.dragging.lowLimit):this.positionToValue(b-this.dragging.lowLimit):c?d?e?this.minValue+this.dragging.difference:this.maxValue:e?this.maxValue:this.minValue+this.dragging.difference:e?this.positionToValue(b+this.dragging.lowLimit)+this.dragging.difference:this.positionToValue(b-this.dragging.lowLimit)+this.dragging.difference,this.roundStep(f)},onDragMove:function(a,b){var c,d,e,f,g,h,i,j,k=this.getEventPosition(b);if(this.options.rightToLeft?(e=this.dragging.lowLimit,f=this.dragging.highLimit,i=this.maxH,j=this.minH):(e=this.dragging.highLimit,f=this.dragging.lowLimit,i=this.minH,j=this.maxH),g=f>=k,h=k>=this.maxPos-e,g){if(0===i.rzsp)return;c=this.getValue("min",k,!0,!1),d=this.getValue("max",k,!0,!1)}else if(h){if(j.rzsp===this.maxPos)return;d=this.getValue("max",k,!0,!0),c=this.getValue("min",k,!0,!0)}else c=this.getValue("min",k,!1),d=this.getValue("max",k,!1);this.positionTrackingBar(c,d)},positionTrackingBar:function(a,b){null!=this.options.minLimit&&a<this.options.minLimit&&(a=this.options.minLimit,b=a+this.dragging.difference),null!=this.options.maxLimit&&b>this.options.maxLimit&&(b=this.options.maxLimit,a=b-this.dragging.difference),this.lowValue=a,this.highValue=b,this.applyLowValue(),this.range&&this.applyHighValue(),this.applyModel(!0),this.updateHandles("lowValue",this.valueToPosition(a)),this.updateHandles("highValue",this.valueToPosition(b))},positionTrackingHandle:function(a){var b=!1;a=this.applyMinMaxLimit(a),this.range&&(this.options.pushRange?(a=this.applyPushRange(a),b=!0):(this.options.noSwitching&&("lowValue"===this.tracking&&a>this.highValue?a=this.applyMinMaxRange(this.highValue):"highValue"===this.tracking&&a<this.lowValue&&(a=this.applyMinMaxRange(this.lowValue))),a=this.applyMinMaxRange(a),"lowValue"===this.tracking&&a>this.highValue?(this.lowValue=this.highValue,this.applyLowValue(),this.applyModel(),this.updateHandles(this.tracking,this.maxH.rzsp),this.updateAriaAttributes(),this.tracking="highValue",this.minH.removeClass("rz-active"),this.maxH.addClass("rz-active"),this.options.keyboardSupport&&this.focusElement(this.maxH),b=!0):"highValue"===this.tracking&&a<this.lowValue&&(this.highValue=this.lowValue,this.applyHighValue(),this.applyModel(),this.updateHandles(this.tracking,this.minH.rzsp),this.updateAriaAttributes(),this.tracking="lowValue",this.maxH.removeClass("rz-active"),this.minH.addClass("rz-active"),this.options.keyboardSupport&&this.focusElement(this.minH),b=!0))),this[this.tracking]!==a&&(this[this.tracking]=a,"lowValue"===this.tracking?this.applyLowValue():this.applyHighValue(),this.applyModel(),this.updateHandles(this.tracking,this.valueToPosition(a)),this.updateAriaAttributes(),b=!0),b&&this.applyModel(!0)},applyMinMaxLimit:function(a){return null!=this.options.minLimit&&a<this.options.minLimit?this.options.minLimit:null!=this.options.maxLimit&&a>this.options.maxLimit?this.options.maxLimit:a},applyMinMaxRange:function(a){var b="lowValue"===this.tracking?this.highValue:this.lowValue,c=Math.abs(a-b);return null!=this.options.minRange&&c<this.options.minRange?"lowValue"===this.tracking?this.highValue-this.options.minRange:this.lowValue+this.options.minRange:null!=this.options.maxRange&&c>this.options.maxRange?"lowValue"===this.tracking?this.highValue-this.options.maxRange:this.lowValue+this.options.maxRange:a},applyPushRange:function(a){var b="lowValue"===this.tracking?this.highValue-a:a-this.lowValue,c=null!==this.options.minRange?this.options.minRange:this.options.step,d=this.options.maxRange;return c>b?("lowValue"===this.tracking?(this.highValue=Math.min(a+c,this.maxValue),a=this.highValue-c,this.applyHighValue(),this.updateHandles("highValue",this.valueToPosition(this.highValue))):(this.lowValue=Math.max(a-c,this.minValue),a=this.lowValue+c,this.applyLowValue(),this.updateHandles("lowValue",this.valueToPosition(this.lowValue))),this.updateAriaAttributes()):null!==d&&b>d&&("lowValue"===this.tracking?(this.highValue=a+d,this.applyHighValue(),this.updateHandles("highValue",this.valueToPosition(this.highValue))):(this.lowValue=a-d,this.applyLowValue(),this.updateHandles("lowValue",this.valueToPosition(this.lowValue))),this.updateAriaAttributes()),a},applyModel:function(a){this.internalChange=!0,this.scope.$apply(),a&&this.callOnChange(),this.internalChange=!1},callOnStart:function(){if(this.options.onStart){var a=this,b="lowValue"===this.tracking?"min":"max";this.scope.$evalAsync(function(){a.options.onStart(a.options.id,a.scope.rzSliderModel,a.scope.rzSliderHigh,b)})}},callOnChange:function(){if(this.options.onChange){var a=this,b="lowValue"===this.tracking?"min":"max";this.scope.$evalAsync(function(){a.options.onChange(a.options.id,a.scope.rzSliderModel,a.scope.rzSliderHigh,b)})}},callOnEnd:function(){if(this.options.onEnd){var a=this,b="lowValue"===this.tracking?"min":"max";this.scope.$evalAsync(function(){a.options.onEnd(a.options.id,a.scope.rzSliderModel,a.scope.rzSliderHigh,b)})}this.scope.$emit("slideEnded")}},h}]).directive("rzslider",["RzSlider",function(a){return{restrict:"AE",replace:!0,scope:{rzSliderModel:"=?",rzSliderHigh:"=?",rzSliderOptions:"&?",rzSliderTplUrl:"@"},templateUrl:function(a,b){return b.rzSliderTplUrl||"rzSliderTpl.html"},link:function(b,c){b.slider=new a(b,c)}}}]);return b.run(["$templateCache",function(a){a.put("rzSliderTpl.html",'<div class=rzslider><span class=rz-bar-wrapper><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class="rz-bar rz-selection" ng-style=barStyle></span></span> <span class="rz-pointer rz-pointer-min" ng-style=minPointerStyle></span> <span class="rz-pointer rz-pointer-max" ng-style=maxPointerStyle></span> <span class="rz-bubble rz-limit rz-floor"></span> <span class="rz-bubble rz-limit rz-ceil"></span> <span class=rz-bubble></span> <span class=rz-bubble></span> <span class=rz-bubble></span><ul ng-show=showTicks class=rz-ticks><li ng-repeat="t in ticks track by $index" class=rz-tick ng-class="{\'rz-selected\': t.selected}" ng-style=t.style ng-attr-uib-tooltip="{{ t.tooltip }}" ng-attr-tooltip-placement={{t.tooltipPlacement}} ng-attr-tooltip-append-to-body="{{ t.tooltip ? true : undefined}}"><span ng-if="t.value != null" class=rz-tick-value ng-attr-uib-tooltip="{{ t.valueTooltip }}" ng-attr-tooltip-placement={{t.valueTooltipPlacement}}>{{ t.value }}</span> <span ng-if="t.legend != null" class=rz-tick-legend>{{ t.legend }}</span></li></ul></div>')}]),b.name}),angular.module("angularPromiseButtons",[]),angular.module("angularPromiseButtons").directive("promiseBtn",["angularPromiseButtons","$parse","$timeout","$compile",function(a,b,c,d){"use strict";return{restrict:"EA",priority:a.config.priority,scope:{promiseBtn:"=",promiseBtnOptions:"=?"},link:function(e,f,g){function h(a){s.btnLoadingClass&&!s.addClassToCurrentBtnOnly&&a.addClass(s.btnLoadingClass),s.disableBtn&&!s.disableCurrentBtnOnly&&a.attr("disabled","disabled")}function i(a){s.minDuration&&!q||!r||(s.btnLoadingClass&&a.removeClass(s.btnLoadingClass),s.disableBtn&&a.removeAttr("disabled"))}function j(a,b){e.$watch(a,function(a){q=!1,r=!1,s.minDuration&&(p=c(function(){q=!0,i(b)},s.minDuration)),a&&a.then?(h(b),a.finally(function(){r=!0,i(b)})):a&&a.$promise&&(h(b),a.$promise.finally(function(){r=!0,i(b)}))})}function k(a){return a.split(";").map(function(a){return b(a)})}function l(a){a.append(d(s.spinnerTpl)(e))}function m(a){s.addClassToCurrentBtnOnly&&a.on(s.CLICK_EVENT,function(){a.addClass(s.btnLoadingClass)}),s.disableCurrentBtnOnly&&a.on(s.CLICK_EVENT,function(){a.attr("disabled","disabled")})}function n(a,b,c){e.$evalAsync(function(){var d=k(g[b]);f.unbind(a),f.bind(a,function(a){e.$apply(function(){d.forEach(function(b){var d=b(e.$parent,{$event:a});o||(o=j(function(){return d},c))})})})})}var o,p,q,r,s=a.config;if(g.promiseBtn)l(f),m(f),j(function(){return e.promiseBtn},f);else if(g.hasOwnProperty(s.CLICK_ATTR))l(f),m(f),n(s.CLICK_EVENT,s.CLICK_ATTR,f);else if(g.hasOwnProperty(s.SUBMIT_ATTR)){var t=function(b){for(var c=[],d=b.find(a.config.BTN_SELECTOR),e=0;e<d.length;e++){var f=d[e];"submit"===angular.element(f).attr("type")&&c.push(f)}return angular.element(c)}(f);l(t),m(t),n(s.SUBMIT_EVENT,s.SUBMIT_ATTR,t)}e.$watch("promiseBtnOptions",function(a){angular.isObject(a)&&(s=angular.extend({},s,a))},!0),e.$on("$destroy",function(){c.cancel(p)})}}}]),angular.module("angularPromiseButtons").provider("angularPromiseButtons",function(){"use strict";var a={spinnerTpl:'<span class="btn-spinner"></span>',priority:0,disableBtn:!0,btnLoadingClass:"is-loading",addClassToCurrentBtnOnly:!1,disableCurrentBtnOnly:!1,minDuration:!1,CLICK_EVENT:"click",CLICK_ATTR:"ngClick",SUBMIT_EVENT:"submit",SUBMIT_ATTR:"ngSubmit",BTN_SELECTOR:"button"};return{extendConfig:function(b){a=angular.extend(a,b)},$get:function(){return{config:a}}}}),angular.module("xeditable",[]).value("editableOptions",{theme:"default",icon_set:"default",buttons:"right",blurElem:"cancel",blurForm:"ignore",activate:"focus",isDisabled:!1,activationEvent:"click",submitButtonTitle:"Submit",submitButtonAriaLabel:"Submit",cancelButtonTitle:"Cancel",cancelButtonAriaLabel:"Cancel",clearButtonTitle:"Clear",clearButtonAriaLabel:"Clear",displayClearButton:!1}),angular.module("xeditable").directive("editableBsdate",["editableDirectiveFactory","$injector","$parse",function(a,b,c){uibDatepickerConfig=b.get("uibDatepickerConfig"),uibDatepickerPopupConfig=b.get("uibDatepickerPopupConfig");var d=[["eIsOpen","is-open"],["eDateDisabled","date-disabled"],["eDatepickerPopup","uib-datepicker-popup"],["eShowButtonBar","show-button-bar"],["eCurrentText","current-text"],["eClearText","clear-text"],["eCloseText","close-text"],["eCloseOnDateSelection","close-on-date-selection"],["eDatepickerAppendToBody","datepicker-append-to-body"],["eOnOpenFocus","on-open-focus"],["eName","name"],["eDateDisabled","date-disabled"],["eAltInputFormats","alt-input-formats"]],e=[["eFormatDay","formatDay"],["eFormatMonth","formatMonth"],["eFormatYear","formatYear"],["eFormatDayHeader","formatDayHeader"],["eFormatDayTitle","formatDayTitle"],["eFormatMonthTitle","formatMonthTitle"],["eMaxMode","maxMode"],["eMinMode","minMode"],["eDatepickerMode","datepickerMode"]];return a({directiveName:"editableBsdate",inputTpl:"<div></div>",render:function(){this.parent.render.call(this);var a=this.attrs,b=this.scope,f=angular.element('<input type="text" class="form-control" ng-model="$parent.$data"/>');f.attr("uib-datepicker-popup",a.eDatepickerPopupXEditable||uibDatepickerPopupConfig.datepickerPopup),f.attr("year-range",a.eYearRange||20),f.attr("ng-readonly",a.eReadonly||!1);for(var g=d.length-1;g>=0;g--){var h=a[d[g][0]];void 0!==h&&f.attr(d[g][1],h)}a.eNgChange&&(f.attr("ng-change",a.eNgChange),this.inputEl.removeAttr("ng-change")),a.eStyle&&(f.attr("style",a.eStyle),this.inputEl.removeAttr("style"));var i={maxDate:b.$eval(a.eMaxDate)||uibDatepickerConfig.maxDate,minDate:b.$eval(a.eMinDate)||uibDatepickerConfig.minDate,showWeeks:a.eShowWeeks?"true"===a.eShowWeeks.toLowerCase():uibDatepickerConfig.showWeeks,startingDay:a.eStartingDay||0,initDate:b.$eval(a.eInitDate)||new Date};if(a.eDatepickerOptions){var j=c(a.eDatepickerOptions)(b);angular.extend(i,j)}for(var k=e.length-1;k>=0;k--){var l=a[e[k][0]];void 0!==l&&(i[e[k][1]]=l)}if(b.dateOptions=i,"true"===(angular.isDefined(a.eShowCalendarButton)?a.eShowCalendarButton:"true")){var m=angular.element('<button type="button" class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>'),n=angular.element('<span class="input-group-btn"></span>');m.attr("ng-click",a.eNgClick),n.append(m),this.inputEl.append(n)}else f.attr("ng-click",a.eNgClick);f.attr("datepicker-options","dateOptions"),this.inputEl.prepend(f),this.inputEl.removeAttr("class"),this.inputEl.removeAttr("ng-click"),this.inputEl.removeAttr("is-open"),this.inputEl.removeAttr("init-date"),this.inputEl.removeAttr("datepicker-popup"),this.inputEl.removeAttr("required"),this.inputEl.removeAttr("ng-model"),this.inputEl.removeAttr("date-picker-append-to-body"),this.inputEl.removeAttr("name"),this.inputEl.attr("class","input-group")}})}]),angular.module("xeditable").directive("editableBstime",["editableDirectiveFactory",function(a){return a({directiveName:"editableBstime",inputTpl:"<div uib-timepicker></div>",render:function(){this.parent.render.call(this);var a=angular.element('<div class="well well-small" style="display:inline-block;"></div>');a.attr("ng-model",this.inputEl.attr("ng-model")),this.inputEl.removeAttr("ng-model"),this.attrs.eNgChange&&(a.attr("ng-change",this.inputEl.attr("ng-change")),this.inputEl.removeAttr("ng-change")),this.inputEl.wrap(a)}})}]),angular.module("xeditable").directive("editableCheckbox",["editableDirectiveFactory",function(a){return a({directiveName:"editableCheckbox",inputTpl:'<input type="checkbox">',render:function(){this.parent.render.call(this),this.inputEl.wrap("<label></label>"),this.attrs.eTitle&&this.inputEl.parent().append("<span>"+this.attrs.eTitle+"</span>")},autosubmit:function(){var a=this;a.inputEl.bind("change",function(){setTimeout(function(){a.scope.$apply(function(){a.scope.$form.$submit()})},500)})}})}]),angular.module("xeditable").directive("editableChecklist",["editableDirectiveFactory","editableNgOptionsParser",function(a,b){return a({directiveName:"editableChecklist",inputTpl:"<span></span>",useCopy:!0,render:function(){this.parent.render.call(this);var a=b(this.attrs.eNgOptions),c="",d="";this.attrs.eNgChange&&(c=' ng-change="'+this.attrs.eNgChange+'"'),this.attrs.eChecklistComparator&&(d=' checklist-comparator="'+this.attrs.eChecklistComparator+'"');var e='<label ng-repeat="'+a.ngRepeat+'"><input type="checkbox" checklist-model="$parent.$parent.$data" checklist-value="'+a.locals.valueFn+'"'+c+d+'><span ng-bind="'+a.locals.displayFn+'"></span></label>';this.inputEl.removeAttr("ng-model"),this.inputEl.removeAttr("ng-options"),this.inputEl.removeAttr("ng-change"),this.inputEl.removeAttr("checklist-comparator"),this.inputEl.html(e)}})}]),angular.module("xeditable").directive("editableCombodate",["editableDirectiveFactory","editableCombodate",function(a,b){return a({directiveName:"editableCombodate",inputTpl:'<input type="text">',render:function(){this.parent.render.call(this);var a={value:new Date(this.scope.$data)},c=this;angular.forEach(["format","template","minYear","maxYear","yearDescending","minuteStep","secondStep","firstItem","errorClass","customClass","roundTime","smartDays"],function(b){var d="e"+b.charAt(0).toUpperCase()+b.slice(1);d in c.attrs&&(a[b]="minYear"==b||"maxYear"==b||"minuteStep"==b||"secondStep"==b?parseInt(c.attrs[d],10):c.attrs[d])});var d=b.getInstance(this.inputEl,a);d.$widget.find("select").bind("change",function(a){c.scope.$data=d.getValue()?new Date(d.getValue().replace(/-/g,"/")).toISOString():null})}})}]),function(){var a=function(a){return a.toLowerCase().replace(/-(.)/g,function(a,b){return b.toUpperCase()})},b="text|password|email|tel|number|url|search|color|date|datetime|datetime-local|time|month|week|file".split("|");angular.forEach(b,function(b){var c=a("editable-"+b);angular.module("xeditable").directive(c,["editableDirectiveFactory",function(a){return a({directiveName:c,inputTpl:'<input type="'+b+'">',render:function(){if(this.parent.render.call(this),this.attrs.eInputgroupleft||this.attrs.eInputgroupright){if(this.inputEl.wrap('<div class="input-group"></div>'),this.attrs.eInputgroupleft){var a=angular.element('<span class="input-group-addon">'+this.attrs.eInputgroupleft+"</span>");this.inputEl.parent().prepend(a)}if(this.attrs.eInputgroupright){var b=angular.element('<span class="input-group-addon">'+this.attrs.eInputgroupright+"</span>");this.inputEl.parent().append(b)}}if(this.attrs.eLabel){var c=angular.element("<label>"+this.attrs.eLabel+"</label>");this.attrs.eInputgroupleft||this.attrs.eInputgroupright?this.inputEl.parent().parent().prepend(c):this.inputEl.parent().prepend(c)}this.attrs.eFormclass&&this.editorEl.addClass(this.attrs.eFormclass)},autosubmit:function(){var a=this;a.inputEl.bind("keydown",function(b){9===b.keyCode&&"submit"===a.editorEl.attr("blur")&&a.scope.$apply(function(){a.scope.$form.$submit()})})}})}])}),angular.module("xeditable").directive("editableRange",["editableDirectiveFactory","$interpolate",function(a,b){return a({directiveName:"editableRange",inputTpl:'<input type="range" id="range" name="range">',render:function(){this.parent.render.call(this),this.inputEl.after("<output>"+b.startSymbol()+"$data"+b.endSymbol()+"</output>")}})}])}(),angular.module("xeditable").directive("editableTagsInput",["editableDirectiveFactory","editableUtils",function(a,b){var c=a({directiveName:"editableTagsInput",inputTpl:"<tags-input></tags-input>",useCopy:!0,render:function(){this.parent.render.call(this),this.inputEl.append(b.rename("auto-complete",this.attrs.$autoCompleteElement)),this.inputEl.removeAttr("ng-model"),this.inputEl.attr("ng-model","$parent.$data")}}),d=c.link;return c.link=function(a,b,c,e){var f=b.find("editable-tags-input-auto-complete");return c.$autoCompleteElement=f.clone(),f.remove(),d(a,b,c,e)},c}]),angular.module("xeditable").directive("editableRadiolist",["editableDirectiveFactory","editableNgOptionsParser","$interpolate",function(a,b,c){return a({directiveName:"editableRadiolist",inputTpl:"<span></span>",render:function(){this.parent.render.call(this);var a=b(this.attrs.eNgOptions),d="",e="";this.attrs.eNgChange&&(d=' ng-change="'+this.attrs.eNgChange+'"'),this.attrs.eName&&(e=' name="'+this.attrs.eName+'"');var f='<label data-ng-repeat="'+a.ngRepeat+'"><input type="radio" data-ng-disabled="::'+this.attrs.eNgDisabled+'" data-ng-model="$parent.$parent.$data" data-ng-value="'+c.startSymbol()+"::"+a.locals.valueFn+c.endSymbol()+'"'+d+e+'><span data-ng-bind="::'+a.locals.displayFn+'"></span></label>';this.inputEl.removeAttr("ng-model"),this.inputEl.removeAttr("ng-options"),this.inputEl.removeAttr("ng-change"),this.inputEl.html(f)},autosubmit:function(){var a=this;a.inputEl.bind("change",function(){setTimeout(function(){a.scope.$apply(function(){a.scope.$form.$submit()})},500)})}})}]),angular.module("xeditable").directive("editableSelect",["editableDirectiveFactory",function(a){return a({directiveName:"editableSelect",inputTpl:"<select></select>",render:function(){if(this.parent.render.call(this),this.attrs.ePlaceholder){var a=angular.element('<option value="">'+this.attrs.ePlaceholder+"</option>");this.inputEl.append(a)}},autosubmit:function(){var a=this;a.attrs.hasOwnProperty("eMultiple")||a.inputEl.bind("change",function(){a.scope.$apply(function(){a.scope.$form.$submit()})})}})}]),angular.module("xeditable").directive("editableTextarea",["editableDirectiveFactory",function(a){return a({directiveName:"editableTextarea",inputTpl:"<textarea></textarea>",addListeners:function(){var a=this;a.parent.addListeners.call(a),a.single&&"no"!==a.buttons&&a.autosubmit()},autosubmit:function(){var a=this;a.inputEl.bind("keydown",function(b){a.attrs.submitOnEnter?13!==b.keyCode||b.shiftKey||a.scope.$apply(function(){a.scope.$form.$submit()}):((b.ctrlKey||b.metaKey)&&13===b.keyCode||9===b.keyCode&&"submit"===a.editorEl.attr("blur"))&&a.scope.$apply(function(){a.scope.$form.$submit()})})}})}]),angular.module("xeditable").directive("editableUidate",["editableDirectiveFactory",function(a){return a({directiveName:"editableUidate",inputTpl:'<input class="form-control" />',render:function(){this.parent.render.call(this),this.inputEl.attr("ui-date",this.attrs.eUiDate),this.inputEl.attr("placeholder",this.attrs.ePlaceholder)}})}]),angular.module("xeditable").directive("editableUiSelect",["editableDirectiveFactory","editableUtils",function(a,b){var c=a({directiveName:"editableUiSelect",inputTpl:"<ui-select></ui-select>",render:function(){this.parent.render.call(this),this.inputEl.append(b.rename("ui-select-match",this.attrs.$matchElement)),this.inputEl.append(b.rename("ui-select-choices",this.attrs.$choicesElement)),this.inputEl.removeAttr("ng-model"),this.inputEl.attr("ng-model","$parent.$parent.$data")}}),d=c.link;return c.link=function(a,b,c,e){var f=b.find("editable-ui-select-match"),g=b.find("editable-ui-select-choices");return c.$matchElement=f.clone(),c.$choicesElement=g.clone(),f.remove(),g.remove(),d(a,b,c,e)},c}]),
  angular.module("xeditable").factory("editableController",["$q","editableUtils",function(a,b){function c(a,c,d,e,f,g,h,i,j,k,l){var m,n,o=this;o.scope=a,o.elem=d,o.attrs=c,o.inputEl=null,o.editorEl=null,o.single=!0,o.error="",o.theme=f[c.editableTheme]||f[h.theme]||f.default,o.parent={};var p=c.editableTheme||h.theme||"default",q=c.editableIconSet||h.icon_set;o.icon_set="default"===q?g.default[p]:g.external[q],o.inputTpl="",o.directiveName="",o.useCopy=!1,o.single=null,o.buttons="right",o.init=function(b){if(o.single=b,o.name=c.eName||c[o.directiveName],!c[o.directiveName])throw"You should provide value for `"+o.directiveName+"` in editable element!";m=e(c[o.directiveName]),o.single?o.buttons=o.attrs.buttons||h.buttons:o.buttons="no",c.eName&&o.scope.$watch("$data",function(a){o.scope.$form.$data[c.eName]=a}),c.onshow&&(o.onshow=function(){return o.catchError(e(c.onshow)(a))}),c.onhide&&(o.onhide=function(){return e(c.onhide)(a)}),c.oncancel&&(o.oncancel=function(){return e(c.oncancel)(a)}),c.onbeforesave&&(o.onbeforesave=function(){return o.catchError(e(c.onbeforesave)(a))}),c.onaftersave&&(o.onaftersave=function(){return o.catchError(e(c.onaftersave)(a))}),a.$parent.$watch(c[o.directiveName],function(a,b){o.setLocalValue(),o.handleEmpty()})},o.render=function(){var a=o.theme;o.inputEl=angular.element(o.inputTpl),o.controlsEl=angular.element(a.controlsTpl),o.controlsEl.append(o.inputEl),"no"!==o.buttons&&(o.buttonsEl=angular.element(a.buttonsTpl),o.submitEl=angular.element(a.submitTpl),o.resetEl=angular.element(a.resetTpl),o.cancelEl=angular.element(a.cancelTpl),o.submitEl.attr("title",h.submitButtonTitle),o.submitEl.attr("aria-label",h.submitButtonAriaLabel),o.cancelEl.attr("title",h.cancelButtonTitle),o.cancelEl.attr("aria-label",h.cancelButtonAriaLabel),o.resetEl.attr("title",h.clearButtonTitle),o.resetEl.attr("aria-label",h.clearButtonAriaLabel),o.icon_set&&(o.submitEl.find("span").addClass(o.icon_set.ok),o.cancelEl.find("span").addClass(o.icon_set.cancel),o.resetEl.find("span").addClass(o.icon_set.clear)),o.buttonsEl.append(o.submitEl).append(o.cancelEl),h.displayClearButton&&o.buttonsEl.append(o.resetEl),o.controlsEl.append(o.buttonsEl),o.inputEl.addClass("editable-has-buttons")),o.errorEl=angular.element(a.errorTpl),o.controlsEl.append(o.errorEl),o.editorEl=angular.element(o.single?a.formTpl:a.noformTpl),o.editorEl.append(o.controlsEl);for(var d in c.$attr)if(!(d.length<=1)){var e=!1,f=d.substring(1,2);if("e"===d.substring(0,1)&&f===f.toUpperCase()&&"Form"!==(e=d.substring(1))&&"NgSubmit"!==e){var g=e.substring(0,1),i=e.substring(1,2);e=i===i.toUpperCase()&&g===g.toUpperCase()?g.toLowerCase()+"-"+b.camelToDash(e.substring(1)):g.toLowerCase()+b.camelToDash(e.substring(1));var j="value"!==e&&""===c[d]?e:c[d];o.inputEl.attr(e,j)}}o.inputEl.addClass("editable-input"),o.inputEl.attr("ng-model","$parent.$data"),o.editorEl.addClass(b.camelToDash(o.directiveName)),o.single&&(o.editorEl.attr("editable-form","$form"),o.editorEl.attr("blur",o.attrs.blur||("no"===o.buttons?"cancel":h.blurElem))),angular.isFunction(a.postrender)&&a.postrender.call(o)},o.setLocalValue=function(){o.scope.$data=o.useCopy?angular.copy(m(a.$parent)):m(a.$parent)};var r=null;o.show=function(){return o.setLocalValue(),o.render(),d.after(o.editorEl),r=a.$new(),j(o.editorEl)(r),o.addListeners(),d.addClass("editable-hide"),o.onshow()},o.hide=function(){return r.$destroy(),o.controlsEl.remove(),o.editorEl.remove(),d.removeClass("editable-hide"),o.onhide()},o.cancel=function(){o.oncancel()},o.addListeners=function(){o.inputEl.bind("keyup",function(a){if(o.single)switch(a.keyCode){case 27:o.scope.$apply(function(){o.scope.$form.$cancel()})}}),o.single&&"no"===o.buttons&&o.autosubmit(),o.editorEl.bind("click",function(a){a.which&&1!==a.which||o.scope.$form.$visible&&(o.scope.$form._clicked=!0)})},o.setWaiting=function(a){a?(n=!o.inputEl.attr("disabled")&&!o.inputEl.attr("ng-disabled")&&!o.inputEl.attr("ng-enabled"))&&(o.inputEl.attr("disabled","disabled"),o.buttonsEl&&o.buttonsEl.find("button").attr("disabled","disabled")):n&&(o.inputEl.removeAttr("disabled"),o.buttonsEl&&o.buttonsEl.find("button").removeAttr("disabled"))},o.activate=function(a,b){setTimeout(function(){var c=o.inputEl[0];"focus"===h.activate&&c.focus?(void 0!==a&&""!==a&&c.setSelectionRange&&(b=b||a,c.onfocus=function(){setTimeout(function(){try{this.setSelectionRange(a,b)}catch(a){}}.bind(this))}),"editableRadiolist"==o.directiveName||"editableChecklist"==o.directiveName||"editableBsdate"==o.directiveName||"editableTagsInput"==o.directiveName?c.querySelector(".ng-pristine").focus():c.focus()):"select"===h.activate&&(c.select?c.select():c.focus&&c.focus())},0)},o.setError=function(b){angular.isObject(b)||(a.$error=l.trustAsHtml(b),o.error=b)},o.catchError=function(a,b){return angular.isObject(a)&&!0!==b?k.when(a).then(angular.bind(this,function(a){this.catchError(a,!0)}),angular.bind(this,function(a){this.catchError(a,!0)})):b&&angular.isObject(a)&&a.status&&200!==a.status&&a.data&&angular.isString(a.data)?(this.setError(a.data),a=a.data):angular.isString(a)&&this.setError(a),a},o.save=function(){m.assign(a.$parent,o.useCopy?angular.copy(o.scope.$data):o.scope.$data)},o.handleEmpty=function(){var b=m(a.$parent),c=null===b||void 0===b||""===b||angular.isArray(b)&&0===b.length;d.toggleClass("editable-empty",c)},o.autosubmit=angular.noop,o.onshow=angular.noop,o.onhide=angular.noop,o.oncancel=angular.noop,o.onbeforesave=angular.noop,o.onaftersave=angular.noop}return c.$inject=["$scope","$attrs","$element","$parse","editableThemes","editableIcons","editableOptions","$rootScope","$compile","$q","$sce"],c}]),angular.module("xeditable").factory("editableDirectiveFactory",["$parse","$compile","editableThemes","$rootScope","$document","editableController","editableFormController","editableOptions",function(a,b,c,d,e,f,g,h){return function(b){return{restrict:"A",scope:!0,require:[b.directiveName,"?^form"],controller:f,link:function(c,f,i,j){var k,l=j[0],m=!1;if(j[1])k=j[1],m=void 0===i.eSingle;else if(i.eForm){var n=a(i.eForm)(c);if(n)k=n,m=!0;else if(f&&"function"==typeof f.parents&&f.parents().last().find("form[name="+i.eForm+"]").length)k=null,m=!0;else for(var o=0;o<e[0].forms.length;o++)if(e[0].forms[o].name===i.eForm){k=null,m=!0;break}}angular.forEach(b,function(a,b){void 0!==l[b]&&(l.parent[b]=l[b])}),angular.extend(l,b);var p=function(){return angular.isDefined(i.editDisabled)?c.$eval(i.editDisabled):h.isDisabled};if(l.init(!m),c.$editable=l,f.addClass("editable"),m)if(k){if(c.$form=k,!c.$form.$addEditable)throw"Form with editable elements should have `editable-form` attribute.";c.$form.$addEditable(l)}else d.$$editableBuffer=d.$$editableBuffer||{},d.$$editableBuffer[i.eForm]=d.$$editableBuffer[i.eForm]||[],d.$$editableBuffer[i.eForm].push(l),c.$form=null;else c.$form=g(),c.$form.$addEditable(l),i.eForm&&(a(i.eForm).assign||angular.noop)(c.$parent,c.$form),i.eForm&&!i.eClickable||(f.addClass("editable-click"),f.bind(h.activationEvent,function(a){a.preventDefault(),a.editable=l,p()||c.$apply(function(){c.$form.$show()})}))}}}}]),angular.module("xeditable").factory("editableFormController",["$parse","$document","$rootScope","editablePromiseCollection","editableUtils",function(a,b,c,d,e){var f=[],g=function(a,b){if(b==a)return!0;for(var c=b.parentNode;null!==c;){if(c==a)return!0;c=c.parentNode}return!1},h=function(a,b){var c=!0,d=a.$editables;return angular.forEach(d,function(a){var d=a.editorEl[0];g(d,b.target)&&(c=!1)}),c};b.bind("click",function(a){if(!a.which||1===a.which){for(var b=[],d=[],e=0;e<f.length;e++)f[e]._clicked?f[e]._clicked=!1:f[e].$waiting||("cancel"===f[e]._blur&&h(f[e],a)&&b.push(f[e]),"submit"===f[e]._blur&&h(f[e],a)&&d.push(f[e]));(b.length||d.length)&&c.$apply(function(){angular.forEach(b,function(a){a.$cancel()}),angular.forEach(d,function(a){a.$submit()})})}}),c.$on("closeEdit",function(){for(var a=0;a<f.length;a++)f[a].$hide()});var i={$addEditable:function(a){this.$editables.push(a),a.elem.bind("$destroy",angular.bind(this,this.$removeEditable,a)),a.scope.$form||(a.scope.$form=this),this.$visible&&a.catchError(a.show()),a.catchError(a.setWaiting(this.$waiting))},$removeEditable:function(a){for(var b=0;b<this.$editables.length;b++)if(this.$editables[b]===a)return void this.$editables.splice(b,1)},$show:function(){if(!this.$visible){this.$visible=!0;var a=d();a.when(this.$onshow()),this.$setError(null,""),angular.forEach(this.$editables,function(b){a.when(b.show())}),a.then({onWait:angular.bind(this,this.$setWaiting),onTrue:angular.bind(this,this.$activate),onFalse:angular.bind(this,this.$activate),onString:angular.bind(this,this.$activate)}),setTimeout(angular.bind(this,function(){this._clicked=!1,-1===e.indexOf(f,this)&&f.push(this)}),0)}},$activate:function(a){var b,c,d;if(this.$editables.length){if(angular.isString(a))for(b=0;b<this.$editables.length;b++)if(this.$editables[b].name===a)return void this.$editables[b].activate();for(b=0;b<this.$editables.length;b++)if(this.$editables[b].error)return void this.$editables[b].activate();c=this.$editables[0].elem[0].selectionStart?this.$editables[0].elem[0].selectionStart:this.$editables[0].elem[0].text?this.$editables[0].elem[0].text.length:this.$editables[0].elem[0].innerHTML?this.$editables[0].elem[0].innerHTML.length:0,d=this.$editables[0].elem[0].selectionEnd?this.$editables[0].elem[0].selectionEnd:this.$editables[0].elem[0].text?this.$editables[0].elem[0].text.length:this.$editables[0].elem[0].innerHTML?this.$editables[0].elem[0].innerHTML.length:0,this.$editables[0].activate(c,d)}},$hide:function(){this.$visible&&(this.$visible=!1,this.$onhide(),angular.forEach(this.$editables,function(a){a.hide()}),e.arrayRemove(f,this))},$cancel:function(){this.$visible&&(this.$oncancel(),angular.forEach(this.$editables,function(a){a.cancel()}),this.$hide())},$setWaiting:function(a){this.$waiting=!!a,angular.forEach(this.$editables,function(b){b.setWaiting(!!a)})},$setError:function(a,b){angular.forEach(this.$editables,function(c){a&&c.name!==a||c.setError(b)})},$submit:function(){function a(a){var b=d();b.when(this.$onbeforesave()),b.then({onWait:angular.bind(this,this.$setWaiting),onTrue:a?angular.bind(this,this.$save):angular.bind(this,this.$hide),onFalse:angular.bind(this,this.$hide),onString:angular.bind(this,this.$activate)})}if(!this.$waiting){this.$setError(null,"");var b=d();angular.forEach(this.$editables,function(a){b.when(a.onbeforesave())}),b.then({onWait:angular.bind(this,this.$setWaiting),onTrue:angular.bind(this,a,!0),onFalse:angular.bind(this,a,!1),onString:angular.bind(this,this.$activate)})}},$save:function(){angular.forEach(this.$editables,function(a){a.save()});var a=d();a.when(this.$onaftersave()),angular.forEach(this.$editables,function(b){a.when(b.onaftersave())}),a.then({onWait:angular.bind(this,this.$setWaiting),onTrue:angular.bind(this,this.$hide),onFalse:angular.bind(this,this.$hide),onString:angular.bind(this,this.$activate)})},$onshow:angular.noop,$oncancel:angular.noop,$onhide:angular.noop,$onbeforesave:angular.noop,$onaftersave:angular.noop};return function(){return angular.extend({$editables:[],$visible:!1,$waiting:!1,$data:{},_clicked:!1,_blur:null},i)}}]),angular.module("xeditable").directive("editableForm",["$rootScope","$parse","editableFormController","editableOptions",function(a,b,c,d){return{restrict:"A",require:["form"],compile:function(){return{pre:function(b,d,e,f){var g,h=f[0];e.editableForm?b[e.editableForm]&&b[e.editableForm].$show?(g=b[e.editableForm],angular.extend(h,g)):(g=c(),b[e.editableForm]=g,angular.extend(g,h)):(g=c(),angular.extend(h,g));var i=a.$$editableBuffer,j=h.$name;j&&i&&i[j]&&(angular.forEach(i[j],function(a){g.$addEditable(a)}),delete i[j])},post:function(a,c,e,f){var g;g=e.editableForm&&a[e.editableForm]&&a[e.editableForm].$show?a[e.editableForm]:f[0],e.onshow&&(g.$onshow=angular.bind(g,b(e.onshow),a)),e.onhide&&(g.$onhide=angular.bind(g,b(e.onhide),a)),e.oncancel&&(g.$oncancel=angular.bind(g,b(e.oncancel),a)),e.shown&&b(e.shown)(a)&&g.$show(),g._blur=e.blur||d.blurForm,e.ngSubmit||e.submit||(e.onbeforesave&&(g.$onbeforesave=function(){return b(e.onbeforesave)(a,{$data:g.$data})}),e.onaftersave&&(g.$onaftersave=function(){return b(e.onaftersave)(a,{$data:g.$data})}),c.bind("submit",function(b){b.preventDefault(),a.$apply(function(){g.$submit()})})),c.bind("click",function(a){a.which&&1!==a.which||g.$visible&&(g._clicked=!0)})}}}}}]),angular.module("xeditable").factory("editablePromiseCollection",["$q",function(a){function b(){return{promises:[],hasFalse:!1,hasString:!1,when:function(b,c){if(!1===b)this.hasFalse=!0;else if(!c&&angular.isObject(b))this.promises.push(a.when(b));else{if(!angular.isString(b))return;this.hasString=!0}},then:function(b){function c(){h.hasString||h.hasFalse?!h.hasString&&h.hasFalse?e():f():d()}b=b||{};var d=b.onTrue||angular.noop,e=b.onFalse||angular.noop,f=b.onString||angular.noop,g=b.onWait||angular.noop,h=this;this.promises.length?(g(!0),a.all(this.promises).then(function(a){g(!1),angular.forEach(a,function(a){h.when(a,!0)}),c()},function(a){g(!1),f()})):c()}}}return b}]),angular.module("xeditable").factory("editableUtils",[function(){return{indexOf:function(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0;c<a.length;c++)if(b===a[c])return c;return-1},arrayRemove:function(a,b){var c=this.indexOf(a,b);return c>=0&&a.splice(c,1),b},camelToDash:function(a){var b=/[A-Z]/g;return a.replace(b,function(a,b){return(b?"-":"")+a.toLowerCase()})},dashToCamel:function(a){var b=/([\:\-\_]+(.))/g,c=/^moz([A-Z])/;return a.replace(b,function(a,b,c,d){return d?c.toUpperCase():c}).replace(c,"Moz$1")},rename:function(a,b){if(b[0]&&b[0].attributes){var c=angular.element("<"+a+"/>");c.html(b.html());for(var d=b[0].attributes,e=0;e<d.length;++e)c.attr(d.item(e).nodeName,d.item(e).value);return c}}}}]),angular.module("xeditable").factory("editableNgOptionsParser",[function(){function a(a){var c;if(!(c=a.match(b)))throw"ng-options parse error";var d,e=c[2]||c[1],f=c[4]||c[6],g=c[5],h=(c[3],c[2]?c[1]:f),i=c[7],j=c[8],k=j?c[8]:null;return void 0===g?(d=f+" in "+i,void 0!==j&&(d+=" track by "+k)):d="("+g+", "+f+") in "+i,{ngRepeat:d,locals:{valueName:f,keyName:g,valueFn:h,displayFn:e}}}var b=/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/;return a}]),angular.module("xeditable").factory("editableCombodate",[function(){function a(a,b){if(this.$element=angular.element(a),"INPUT"!=this.$element[0].nodeName)throw"Combodate should be applied to INPUT element";var c=(new Date).getFullYear();this.defaults={format:"YYYY-MM-DD HH:mm",template:"D / MMM / YYYY   H : mm",value:null,minYear:1970,maxYear:c,yearDescending:!0,minuteStep:5,secondStep:1,firstItem:"empty",errorClass:null,customClass:"",roundTime:!0,smartDays:!0},this.options=angular.extend({},this.defaults,b),this.init()}return a.prototype={constructor:a,init:function(){if(this.map={day:["D","date"],month:["M","month"],year:["Y","year"],hour:["[Hh]","hours"],minute:["m","minutes"],second:["s","seconds"],ampm:["[Aa]",""]},this.$widget=angular.element('<span class="combodate"></span>').html(this.getTemplate()),this.initCombos(),this.options.smartDays){var a=this;this.$widget.find("select").bind("change",function(b){(angular.element(b.target).hasClass("month")||angular.element(b.target).hasClass("year"))&&a.fillCombo("day")})}this.$widget.find("select").css("width","auto"),this.$element.css("display","none").after(this.$widget),this.setValue(this.$element.val()||this.options.value)},getTemplate:function(){var a=this.options.template,b=this.options.customClass;return angular.forEach(this.map,function(b,c){b=b[0];var d=new RegExp(b+"+"),e=b.length>1?b.substring(1,2):b;a=a.replace(d,"{"+e+"}")}),a=a.replace(/ /g,"&nbsp;"),angular.forEach(this.map,function(c,d){c=c[0];var e=c.length>1?c.substring(1,2):c;a=a.replace("{"+e+"}",'<select class="'+d+" "+b+'"></select>')}),a},initCombos:function(){for(var a in this.map){var b=this.$widget[0].querySelectorAll("."+a);this["$"+a]=b.length?angular.element(b):null,this.fillCombo(a)}},fillCombo:function(a){var b=this["$"+a];if(b){var c="fill"+a.charAt(0).toUpperCase()+a.slice(1),d=this[c](),e=b.val();b.html("");for(var f=0;f<d.length;f++)b.append('<option value="'+d[f][0]+'">'+d[f][1]+"</option>");b.val(e)}},fillCommon:function(a){var b,c=[];if("name"===this.options.firstItem){b=moment.relativeTime||moment.langData()._relativeTime;var d="function"==typeof b[a]?b[a](1,!0,a,!1):b[a];d=d.split(" ").reverse()[0],c.push(["",d])}else"empty"===this.options.firstItem&&c.push(["",""]);return c},fillDay:function(){var a,b,c=this.fillCommon("d"),d=-1!==this.options.template.indexOf("DD"),e=31;if(this.options.smartDays&&this.$month&&this.$year){var f=parseInt(this.$month.val(),10),g=parseInt(this.$year.val(),10);isNaN(f)||isNaN(g)||(e=moment([g,f]).daysInMonth())}for(b=1;b<=e;b++)a=d?this.leadZero(b):b,c.push([b,a]);return c},fillMonth:function(){var a,b,c=this.fillCommon("M"),d=-1!==this.options.template.indexOf("MMMM"),e=-1!==this.options.template.indexOf("MMM"),f=-1!==this.options.template.indexOf("MM");for(b=0;b<=11;b++)a=d?moment().date(1).month(b).format("MMMM"):e?moment().date(1).month(b).format("MMM"):f?this.leadZero(b+1):b+1,c.push([b,a]);return c},fillYear:function(){var a,b,c=[],d=-1!==this.options.template.indexOf("YYYY");for(b=this.options.maxYear;b>=this.options.minYear;b--)a=d?b:(b+"").substring(2),c[this.options.yearDescending?"push":"unshift"]([b,a]);return c=this.fillCommon("y").concat(c)},fillHour:function(){var a,b,c=this.fillCommon("h"),d=-1!==this.options.template.indexOf("h"),e=(this.options.template.indexOf("H"),-1!==this.options.template.toLowerCase().indexOf("hh")),f=d?1:0,g=d?12:23;for(b=f;b<=g;b++)a=e?this.leadZero(b):b,c.push([b,a]);return c},fillMinute:function(){var a,b,c=this.fillCommon("m"),d=-1!==this.options.template.indexOf("mm");for(b=0;b<=59;b+=this.options.minuteStep)a=d?this.leadZero(b):b,c.push([b,a]);return c},fillSecond:function(){var a,b,c=this.fillCommon("s"),d=-1!==this.options.template.indexOf("ss");for(b=0;b<=59;b+=this.options.secondStep)a=d?this.leadZero(b):b,c.push([b,a]);return c},fillAmpm:function(){var a=-1!==this.options.template.indexOf("a");this.options.template.indexOf("A");return[["am",a?"am":"AM"],["pm",a?"pm":"PM"]]},getValue:function(a){var b,c={},d=this,e=!1;return angular.forEach(this.map,function(a,b){if("ampm"!==b){var f="day"===b?1:0;return c[b]=d["$"+b]?parseInt(d["$"+b].val(),10):f,isNaN(c[b])?(e=!0,!1):void 0}}),e?"":(this.$ampm&&(12===c.hour?c.hour="am"===this.$ampm.val()?0:12:c.hour="am"===this.$ampm.val()?c.hour:c.hour+12),b=moment([c.year,c.month,c.day,c.hour,c.minute,c.second]),this.highlight(b),a=void 0===a?this.options.format:a,null===a?b.isValid()?b:null:b.isValid()?b.format(a):"")},setValue:function(a){function b(a,b){var c={};return angular.forEach(a.children("option"),function(a,d){var e=angular.element(a).attr("value");if(""!==e){var f=Math.abs(e-b);(void 0===c.distance||f<c.distance)&&(c={value:e,distance:f})}}),c.value}if(a){var c="string"==typeof a?moment(a,this.options.format,!0):moment(a),d=this,e={};c.isValid()&&(angular.forEach(this.map,function(a,b){"ampm"!==b&&(e[b]=c[a[1]]())}),this.$ampm&&(e.hour>=12?(e.ampm="pm",e.hour>12&&(e.hour-=12)):(e.ampm="am",0===e.hour&&(e.hour=12))),angular.forEach(e,function(a,c){d["$"+c]&&("minute"===c&&d.options.minuteStep>1&&d.options.roundTime&&(a=b(d["$"+c],a)),"second"===c&&d.options.secondStep>1&&d.options.roundTime&&(a=b(d["$"+c],a)),d["$"+c].val(a))}),this.options.smartDays&&this.fillCombo("day"),this.$element.val(c.format(this.options.format)).triggerHandler("change"))}},highlight:function(a){a.isValid()?this.options.errorClass?this.$widget.removeClass(this.options.errorClass):this.$widget.find("select").css("border-color",this.borderColor):this.options.errorClass?this.$widget.addClass(this.options.errorClass):(this.borderColor||(this.borderColor=this.$widget.find("select").css("border-color")),this.$widget.find("select").css("border-color","red"))},leadZero:function(a){return a<=9?"0"+a:a},destroy:function(){this.$widget.remove(),this.$element.removeData("combodate").show()}},{getInstance:function(b,c){return new a(b,c)}}}]),angular.module("xeditable").factory("editableIcons",function(){return{default:{bs2:{ok:"icon-ok icon-white",cancel:"icon-remove",clear:"icon-trash"},bs3:{ok:"glyphicon glyphicon-ok",cancel:"glyphicon glyphicon-remove",clear:"glyphicon glyphicon-trash"}},external:{"font-awesome":{ok:"fa fa-check",cancel:"fa fa-times",clear:"fa fa-trash"}}}}),angular.module("xeditable").factory("editableThemes",function(){return{default:{formTpl:'<form class="editable-wrap"></form>',noformTpl:'<span class="editable-wrap"></span>',controlsTpl:'<span class="editable-controls"></span>',inputTpl:"",errorTpl:'<div class="editable-error" data-ng-if="$error" data-ng-bind-html="$error"></div>',buttonsTpl:'<span class="editable-buttons"></span>',submitTpl:'<button type="submit">save</button>',cancelTpl:'<button type="button" ng-click="$form.$cancel()">cancel</button>',resetTpl:'<button type="reset">clear</button>'},bs2:{formTpl:'<form class="form-inline editable-wrap" role="form"></form>',noformTpl:'<span class="editable-wrap"></span>',controlsTpl:'<div class="editable-controls controls control-group" ng-class="{\'error\': $error}"></div>',inputTpl:"",errorTpl:'<div class="editable-error help-block" data-ng-if="$error" data-ng-bind-html="$error"></div>',buttonsTpl:'<span class="editable-buttons"></span>',submitTpl:'<button type="submit" class="btn btn-primary"><span></span></button>',cancelTpl:'<button type="button" class="btn" ng-click="$form.$cancel()"><span></span></button>',resetTpl:'<button type="reset" class="btn btn-danger">clear</button>'},bs3:{formTpl:'<form class="form-inline editable-wrap" role="form"></form>',noformTpl:'<span class="editable-wrap"></span>',controlsTpl:'<div class="editable-controls form-group" ng-class="{\'has-error\': $error}"></div>',inputTpl:"",errorTpl:'<div class="editable-error help-block" data-ng-if="$error" data-ng-bind-html="$error"></div>',buttonsTpl:'<span class="editable-buttons"></span>',submitTpl:'<button type="submit" class="btn btn-primary"><span></span></button>',cancelTpl:'<button type="button" class="btn btn-default" ng-click="$form.$cancel()"><span></span></button>',resetTpl:'<button type="reset" class="btn btn-danger">clear</button>',buttonsClass:"",inputClass:"",postrender:function(){switch(this.directiveName){case"editableText":case"editableSelect":case"editableTextarea":case"editableEmail":case"editableTel":case"editableNumber":case"editableUrl":case"editableSearch":case"editableDate":case"editableDatetime":case"editableBsdate":case"editableTime":case"editableMonth":case"editableWeek":case"editablePassword":case"editableDatetimeLocal":if(this.inputEl.addClass("form-control"),this.theme.inputClass){if(this.inputEl.attr("multiple")&&("input-sm"===this.theme.inputClass||"input-lg"===this.theme.inputClass))break;this.inputEl.addClass(this.theme.inputClass)}break;case"editableCheckbox":this.editorEl.addClass("checkbox")}this.buttonsEl&&this.theme.buttonsClass&&this.buttonsEl.find("button").addClass(this.theme.buttonsClass)}},semantic:{formTpl:'<form class="editable-wrap ui form" ng-class="{\'error\': $error}" role="form"></form>',noformTpl:'<span class="editable-wrap"></span>',controlsTpl:'<div class="editable-controls ui fluid input" ng-class="{\'error\': $error}"></div>',inputTpl:"",errorTpl:'<div class="editable-error ui error message" data-ng-if="$error" data-ng-bind-html="$error"></div>',buttonsTpl:'<span class="mini ui buttons"></span>',submitTpl:'<button type="submit" class="ui primary button"><i class="ui check icon"></i></button>',cancelTpl:'<button type="button" class="ui button" ng-click="$form.$cancel()"><i class="ui cancel icon"></i></button>',resetTpl:'<button type="reset" class="ui button">clear</button>'}}}),function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports&&"object"==typeof module?module.exports=a:a(jQuery)}(function(a,b){"use strict";function c(b,c,d,e){for(var f=[],g=0;g<b.length;g++){var h=b[g];if(h){var i=tinycolor(h),j=i.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";j+=tinycolor.equals(c,h)?" sp-thumb-active":"";var k=i.toString(e.preferredFormat||"rgb"),l=q?"background-color:"+i.toRgbString():"filter:"+i.toFilter();f.push('<span title="'+k+'" data-color="'+i.toRgbString()+'" class="'+j+'"><span class="sp-thumb-inner" style="'+l+';" /></span>')}else{f.push(a("<div />").append(a('<span data-color="" style="background-color:transparent;" class="sp-clear-display"></span>').attr("title",e.noColorSelectedText)).html())}}return"<div class='sp-cf "+d+"'>"+f.join("")+"</div>"}function d(){for(var a=0;a<o.length;a++)o[a]&&o[a].hide()}function e(b,c){var d=a.extend({},n,b);return d.callbacks={move:j(d.move,c),change:j(d.change,c),show:j(d.show,c),hide:j(d.hide,c),beforeShow:j(d.beforeShow,c)},d}function f(f,h){function j(){if(T.showPaletteOnly&&(T.showPalette=!0),La.text(T.showPaletteOnly?T.togglePaletteMoreText:T.togglePaletteLessText),T.palette){ma=T.palette.slice(0),na=a.isArray(ma[0])?ma:[ma],oa={};for(var b=0;b<na.length;b++)for(var c=0;c<na[b].length;c++){var d=tinycolor(na[b][c]).toRgbString();oa[d]=!0}}wa.toggleClass("sp-flat",U),wa.toggleClass("sp-input-disabled",!T.showInput),wa.toggleClass("sp-alpha-enabled",T.showAlpha),wa.toggleClass("sp-clear-enabled",Ya),wa.toggleClass("sp-buttons-disabled",!T.showButtons),wa.toggleClass("sp-palette-buttons-disabled",!T.togglePaletteOnly),wa.toggleClass("sp-palette-disabled",!T.showPalette),wa.toggleClass("sp-palette-only",T.showPaletteOnly),wa.toggleClass("sp-initial-disabled",!T.showInitial),wa.addClass(T.className).addClass(T.containerClassName),N()}function n(){if(W&&window.localStorage){try{var b=window.localStorage[W].split(",#");b.length>1&&(delete window.localStorage[W],a.each(b,function(a,b){t(b)}))}catch(a){}try{pa=window.localStorage[W].split(";")}catch(a){}}}function t(b){if(V){var c=tinycolor(b).toRgbString();if(!oa[c]&&-1===a.inArray(c,pa))for(pa.push(c);pa.length>qa;)pa.shift();if(W&&window.localStorage)try{window.localStorage[W]=pa.join(";")}catch(a){}}}function u(){var a=[];if(T.showPalette)for(var b=0;b<pa.length;b++){var c=tinycolor(pa[b]).toRgbString();oa[c]||a.push(pa[b])}return a.reverse().slice(0,T.maxSelectionSize)}function v(){var b=H(),d=a.map(na,function(a,d){return c(a,b,"sp-palette-row sp-palette-row-"+d,T)});n(),pa&&d.push(c(u(),b,"sp-palette-row sp-palette-row-selection",T)),Ga.html(d.join(""))}function w(){if(T.showInitial){var a=Ta,b=H();Ha.html(c([a,b],b,"sp-palette-row-initial",T))}}function x(){(ba<=0||aa<=0||da<=0)&&N(),_=!0,wa.addClass(ra),sa=null,ua.trigger("dragstart.spectrum",[H()])}function y(){_=!1,wa.removeClass(ra),ua.trigger("dragstop.spectrum",[H()])}function z(){var a=Fa.val();if(null!==a&&""!==a||!Ya){var b=tinycolor(a);b.isValid()?(G(b),M(!0)):Fa.addClass("sp-validation-error")}else G(null),M(!0)}function A(){$?E():B()}function B(){var b=a.Event("beforeShow.spectrum");if($)return void N();ua.trigger(b,[H()]),!1===Y.beforeShow(H())||b.isDefaultPrevented()||(d(),$=!0,a(ta).bind("keydown.spectrum",C),a(ta).bind("click.spectrum",D),a(window).bind("resize.spectrum",Z),Pa.addClass("sp-active"),wa.removeClass("sp-hidden"),N(),K(),Ta=H(),w(),Y.show(Ta),ua.trigger("show.spectrum",[Ta]))}function C(a){27===a.keyCode&&E()}function D(a){2!=a.button&&(_||(Wa?M(!0):F(),E()))}function E(){$&&!U&&($=!1,a(ta).unbind("keydown.spectrum",C),a(ta).unbind("click.spectrum",D),a(window).unbind("resize.spectrum",Z),Pa.removeClass("sp-active"),wa.addClass("sp-hidden"),Y.hide(H()),ua.trigger("hide.spectrum",[H()]))}function F(){G(Ta,!0)}function G(a,b){if(tinycolor.equals(a,H()))return void K();var c,d;!a&&Ya?Xa=!0:(Xa=!1,c=tinycolor(a),d=c.toHsv(),ia=d.h%360/360,ja=d.s,ka=d.v,la=d.a),K(),c&&c.isValid()&&!b&&(Va=Ua||c.getFormat())}function H(a){return a=a||{},Ya&&Xa?null:tinycolor.fromRatio({h:ia,s:ja,v:ka,a:Math.round(100*la)/100},{format:a.format||Va})}function I(){return!Fa.hasClass("sp-validation-error")}function J(){K(),Y.move(H()),ua.trigger("move.spectrum",[H()])}function K(){Fa.removeClass("sp-validation-error"),L();var a=tinycolor.fromRatio({h:ia,s:1,v:1});ya.css("background-color",a.toHexString());var b=Va;la<1&&(0!==la||"name"!==b)&&("hex"!==b&&"hex3"!==b&&"hex6"!==b&&"name"!==b||(b="rgb"));var c=H({format:b}),d="";if(Ra.removeClass("sp-clear-display"),Ra.css("background-color","transparent"),!c&&Ya)Ra.addClass("sp-clear-display");else{var e=c.toHexString(),f=c.toRgbString();if(q||1===c.alpha?Ra.css("background-color",f):(Ra.css("background-color","transparent"),Ra.css("filter",c.toFilter())),T.showAlpha){var g=c.toRgb();g.a=0;var h=tinycolor(g).toRgbString(),i="linear-gradient(left, "+h+", "+e+")";p?Ca.css("filter",tinycolor(h).toFilter({gradientType:1},e)):(Ca.css("background","-webkit-"+i),Ca.css("background","-moz-"+i),Ca.css("background","-ms-"+i),Ca.css("background","linear-gradient(to right, "+h+", "+e+")"))}d=c.toString(b)}T.showInput&&Fa.val(d),T.showPalette&&v(),w()}function L(){var a=ja,b=ka;if(Ya&&Xa)Ea.hide(),Ba.hide(),za.hide();else{Ea.show(),Ba.show(),za.show();var c=a*aa,d=ba-b*ba;c=Math.max(-ca,Math.min(aa-ca,c-ca)),d=Math.max(-ca,Math.min(ba-ca,d-ca)),za.css({top:d+"px",left:c+"px"});var e=la*fa;Ea.css({left:e-ga/2+"px"});var f=ia*da;Ba.css({top:f-ha+"px"})}}function M(a){var b=H(),c="",d=!tinycolor.equals(b,Ta);b&&(c=b.toString(Va),t(b)),Ma&&ua.val(c),a&&d&&(Y.change(b),ua.trigger("change",[b]))}function N(){aa=ya.width(),ba=ya.height(),ca=za.height(),ea=Aa.width(),da=Aa.height(),ha=Ba.height(),fa=Da.width(),ga=Ea.width(),U||(wa.css("position","absolute"),T.offset?wa.offset(T.offset):wa.offset(g(wa,Qa))),L(),T.showPalette&&v(),ua.trigger("reflow.spectrum")}function O(){ua.show(),Qa.unbind("click.spectrum touchstart.spectrum"),wa.remove(),Pa.remove(),o[Za.id]=null}function P(c,d){return c===b?a.extend({},T):d===b?T[c]:(T[c]=d,void j())}function Q(){va=!1,ua.attr("disabled",!1),Qa.removeClass("sp-disabled")}function R(){E(),va=!0,ua.attr("disabled",!0),Qa.addClass("sp-disabled")}function S(a){T.offset=a,N()}var T=e(h,f),U=T.flat,V=T.showSelectionPalette,W=T.localStorageKey,X=T.theme,Y=T.callbacks,Z=l(N,10),$=!1,_=!1,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=1,ma=[],na=[],oa={},pa=T.selectionPalette.slice(0),qa=T.maxSelectionSize,ra="sp-dragging",sa=null,ta=f.ownerDocument,ua=(ta.body,a(f)),va=!1,wa=a(s,ta).addClass(X),xa=wa.find(".sp-picker-container"),ya=wa.find(".sp-color"),za=wa.find(".sp-dragger"),Aa=wa.find(".sp-hue"),Ba=wa.find(".sp-slider"),Ca=wa.find(".sp-alpha-inner"),Da=wa.find(".sp-alpha"),Ea=wa.find(".sp-alpha-handle"),Fa=wa.find(".sp-input"),Ga=wa.find(".sp-palette"),Ha=wa.find(".sp-initial"),Ia=wa.find(".sp-cancel"),Ja=wa.find(".sp-clear"),Ka=wa.find(".sp-choose"),La=wa.find(".sp-palette-toggle"),Ma=ua.is("input"),Na=Ma&&"color"===ua.attr("type")&&m(),Oa=Ma&&!U,Pa=Oa?a(r).addClass(X).addClass(T.className).addClass(T.replacerClassName):a([]),Qa=Oa?Pa:ua,Ra=Pa.find(".sp-preview-inner"),Sa=T.color||Ma&&ua.val(),Ta=!1,Ua=T.preferredFormat,Va=Ua,Wa=!T.showButtons||T.clickoutFiresChange,Xa=!Sa,Ya=T.allowEmpty&&!Na;!function(){function b(b){return b.data&&b.data.ignore?(G(a(b.target).closest(".sp-thumb-el").data("color")),J()):(G(a(b.target).closest(".sp-thumb-el").data("color")),J(),M(!0),T.hideAfterPaletteSelect&&E()),!1}if(p&&wa.find("*:not(input)").attr("unselectable","on"),j(),Oa&&ua.after(Pa).hide(),Ya||Ja.hide(),U)ua.after(wa).hide();else{var c="parent"===T.appendTo?ua.parent():a(T.appendTo);1!==c.length&&(c=a("body")),c.append(wa)}n(),Qa.bind("click.spectrum touchstart.spectrum",function(b){va||A(),b.stopPropagation(),a(b.target).is("input")||b.preventDefault()}),(ua.is(":disabled")||!0===T.disabled)&&R(),wa.click(i),Fa.change(z),
  Fa.bind("paste",function(){setTimeout(z,1)}),Fa.keydown(function(a){13==a.keyCode&&z()}),Ia.text(T.cancelText),Ia.bind("click.spectrum",function(a){a.stopPropagation(),a.preventDefault(),F(),E()}),Ja.attr("title",T.clearText),Ja.bind("click.spectrum",function(a){a.stopPropagation(),a.preventDefault(),Xa=!0,J(),U&&M(!0)}),Ka.text(T.chooseText),Ka.bind("click.spectrum",function(a){a.stopPropagation(),a.preventDefault(),p&&Fa.is(":focus")&&Fa.trigger("change"),I()&&(M(!0),E())}),La.text(T.showPaletteOnly?T.togglePaletteMoreText:T.togglePaletteLessText),La.bind("click.spectrum",function(a){a.stopPropagation(),a.preventDefault(),T.showPaletteOnly=!T.showPaletteOnly,T.showPaletteOnly||U||wa.css("left","-="+(xa.outerWidth(!0)+5)),j()}),k(Da,function(a,b,c){la=a/fa,Xa=!1,c.shiftKey&&(la=Math.round(10*la)/10),J()},x,y),k(Aa,function(a,b){ia=parseFloat(b/da),Xa=!1,T.showAlpha||(la=1),J()},x,y),k(ya,function(a,b,c){if(c.shiftKey){if(!sa){var d=ja*aa,e=ba-ka*ba,f=Math.abs(a-d)>Math.abs(b-e);sa=f?"x":"y"}}else sa=null;var g=!sa||"x"===sa,h=!sa||"y"===sa;g&&(ja=parseFloat(a/aa)),h&&(ka=parseFloat((ba-b)/ba)),Xa=!1,T.showAlpha||(la=1),J()},x,y),Sa?(G(Sa),K(),Va=Ua||tinycolor(Sa).format,t(Sa)):K(),U&&B();var d=p?"mousedown.spectrum":"click.spectrum touchstart.spectrum";Ga.delegate(".sp-thumb-el",d,b),Ha.delegate(".sp-thumb-el:nth-child(1)",d,{ignore:!0},b)}();var Za={show:B,hide:E,toggle:A,reflow:N,option:P,enable:Q,disable:R,offset:S,set:function(a){G(a),M()},get:H,destroy:O,container:wa};return Za.id=o.push(Za)-1,Za}function g(b,c){var d=b.outerWidth(),e=b.outerHeight(),f=c.outerHeight(),g=b[0].ownerDocument,h=g.documentElement,i=h.clientWidth+a(g).scrollLeft(),j=h.clientHeight+a(g).scrollTop(),k=c.offset();return k.top+=f,k.left-=Math.min(k.left,k.left+d>i&&i>d?Math.abs(k.left+d-i):0),k.top-=Math.min(k.top,k.top+e>j&&j>e?Math.abs(e+f-0):0),k}function h(){}function i(a){a.stopPropagation()}function j(a,b){var c=Array.prototype.slice,d=c.call(arguments,2);return function(){return a.apply(b,d.concat(c.call(arguments)))}}function k(b,c,d,e){function f(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),a.returnValue=!1}function g(a){if(k){if(p&&j.documentMode<9&&!a.button)return i();var d=a.originalEvent&&a.originalEvent.touches&&a.originalEvent.touches[0],e=d&&d.pageX||a.pageX,g=d&&d.pageY||a.pageY,h=Math.max(0,Math.min(e-l.left,n)),q=Math.max(0,Math.min(g-l.top,m));o&&f(a),c.apply(b,[h,q,a])}}function h(c){(c.which?3==c.which:2==c.button)||k||!1!==d.apply(b,arguments)&&(k=!0,m=a(b).height(),n=a(b).width(),l=a(b).offset(),a(j).bind(q),a(j.body).addClass("sp-dragging"),g(c),f(c))}function i(){k&&(a(j).unbind(q),a(j.body).removeClass("sp-dragging"),setTimeout(function(){e.apply(b,arguments)},0)),k=!1}c=c||function(){},d=d||function(){},e=e||function(){};var j=document,k=!1,l={},m=0,n=0,o="ontouchstart"in window,q={};q.selectstart=f,q.dragstart=f,q["touchmove mousemove"]=g,q["touchend mouseup"]=i,a(b).bind("touchstart mousedown",h)}function l(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d),!c&&d||(d=setTimeout(g,b))}}function m(){return a.fn.spectrum.inputTypeColorSupport()}var n={beforeShow:h,move:h,change:h,show:h,hide:h,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!0,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:!1,className:"",containerClassName:"",replacerClassName:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1,offset:null},o=[],p=!!/msie/i.exec(window.navigator.userAgent),q=function(){function a(a,b){return!!~(""+a).indexOf(b)}var b=document.createElement("div"),c=b.style;return c.cssText="background-color:rgba(0,0,0,.5)",a(c.backgroundColor,"rgba")||a(c.backgroundColor,"hsla")}(),r=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'></div>","</div>"].join(""),s=function(){var a="";if(p)for(var b=1;b<=6;b++)a+="<div class='sp-"+b+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",a,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false'  />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("")}();a.fn.spectrum=function(b,c){if("string"==typeof b){var d=this,e=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=o[a(this).data("spectrum.id")];if(c){var f=c[b];if(!f)throw new Error("Spectrum: no such method: '"+b+"'");"get"==b?d=c.get():"container"==b?d=c.container:"option"==b?d=c.option.apply(c,e):"destroy"==b?(c.destroy(),a(this).removeData("spectrum.id")):f.apply(c,e)}}),d}return this.spectrum("destroy").each(function(){var c=a.extend({},b,a(this).data()),d=f(this,c);a(this).data("spectrum.id",d.id)})},a.fn.spectrum.load=!0,a.fn.spectrum.loadOpts={},a.fn.spectrum.draggable=k,a.fn.spectrum.defaults=n,a.fn.spectrum.inputTypeColorSupport=function b(){if(void 0===b._cachedResult){var c=a("<input type='color' value='!' />")[0];b._cachedResult="color"===c.type&&"!"!==c.value}return b._cachedResult},a.spectrum={},a.spectrum.localization={},a.spectrum.palettes={},a.fn.spectrum.processNativeColorInputs=function(){var b=a("input[type=color]");b.length&&!m()&&b.spectrum({preferredFormat:"hex6"})},function(){function a(a){var c={r:0,g:0,b:0},e=1,g=!1,h=!1;return"string"==typeof a&&(a=F(a)),"object"==typeof a&&(a.hasOwnProperty("r")&&a.hasOwnProperty("g")&&a.hasOwnProperty("b")?(c=b(a.r,a.g,a.b),g=!0,h="%"===String(a.r).substr(-1)?"prgb":"rgb"):a.hasOwnProperty("h")&&a.hasOwnProperty("s")&&a.hasOwnProperty("v")?(a.s=C(a.s),a.v=C(a.v),c=f(a.h,a.s,a.v),g=!0,h="hsv"):a.hasOwnProperty("h")&&a.hasOwnProperty("s")&&a.hasOwnProperty("l")&&(a.s=C(a.s),a.l=C(a.l),c=d(a.h,a.s,a.l),g=!0,h="hsl"),a.hasOwnProperty("a")&&(e=a.a)),e=v(e),{ok:g,format:a.format||h,r:L(255,M(c.r,0)),g:L(255,M(c.g,0)),b:L(255,M(c.b,0)),a:e}}function b(a,b,c){return{r:255*w(a,255),g:255*w(b,255),b:255*w(c,255)}}function c(a,b,c){a=w(a,255),b=w(b,255),c=w(c,255);var d,e,f=M(a,b,c),g=L(a,b,c),h=(f+g)/2;if(f==g)d=e=0;else{var i=f-g;switch(e=h>.5?i/(2-f-g):i/(f+g),f){case a:d=(b-c)/i+(b<c?6:0);break;case b:d=(c-a)/i+2;break;case c:d=(a-b)/i+4}d/=6}return{h:d,s:e,l:h}}function d(a,b,c){function d(a,b,c){return c<0&&(c+=1),c>1&&(c-=1),c<1/6?a+6*(b-a)*c:c<.5?b:c<2/3?a+(b-a)*(2/3-c)*6:a}var e,f,g;if(a=w(a,360),b=w(b,100),c=w(c,100),0===b)e=f=g=c;else{var h=c<.5?c*(1+b):c+b-c*b,i=2*c-h;e=d(i,h,a+1/3),f=d(i,h,a),g=d(i,h,a-1/3)}return{r:255*e,g:255*f,b:255*g}}function e(a,b,c){a=w(a,255),b=w(b,255),c=w(c,255);var d,e,f=M(a,b,c),g=L(a,b,c),h=f,i=f-g;if(e=0===f?0:i/f,f==g)d=0;else{switch(f){case a:d=(b-c)/i+(b<c?6:0);break;case b:d=(c-a)/i+2;break;case c:d=(a-b)/i+4}d/=6}return{h:d,s:e,v:h}}function f(a,b,c){a=6*w(a,360),b=w(b,100),c=w(c,100);var d=J.floor(a),e=a-d,f=c*(1-b),g=c*(1-e*b),h=c*(1-(1-e)*b),i=d%6;return{r:255*[c,g,f,f,h,c][i],g:255*[h,c,c,g,f,f][i],b:255*[f,f,h,c,c,g][i]}}function g(a,b,c,d){var e=[B(K(a).toString(16)),B(K(b).toString(16)),B(K(c).toString(16))];return d&&e[0].charAt(0)==e[0].charAt(1)&&e[1].charAt(0)==e[1].charAt(1)&&e[2].charAt(0)==e[2].charAt(1)?e[0].charAt(0)+e[1].charAt(0)+e[2].charAt(0):e.join("")}function h(a,b,c,d){return[B(D(d)),B(K(a).toString(16)),B(K(b).toString(16)),B(K(c).toString(16))].join("")}function i(a,b){b=0===b?0:b||10;var c=O(a).toHsl();return c.s-=b/100,c.s=x(c.s),O(c)}function j(a,b){b=0===b?0:b||10;var c=O(a).toHsl();return c.s+=b/100,c.s=x(c.s),O(c)}function k(a){return O(a).desaturate(100)}function l(a,b){b=0===b?0:b||10;var c=O(a).toHsl();return c.l+=b/100,c.l=x(c.l),O(c)}function m(a,b){b=0===b?0:b||10;var c=O(a).toRgb();return c.r=M(0,L(255,c.r-K(-b/100*255))),c.g=M(0,L(255,c.g-K(-b/100*255))),c.b=M(0,L(255,c.b-K(-b/100*255))),O(c)}function n(a,b){b=0===b?0:b||10;var c=O(a).toHsl();return c.l-=b/100,c.l=x(c.l),O(c)}function o(a,b){var c=O(a).toHsl(),d=(K(c.h)+b)%360;return c.h=d<0?360+d:d,O(c)}function p(a){var b=O(a).toHsl();return b.h=(b.h+180)%360,O(b)}function q(a){var b=O(a).toHsl(),c=b.h;return[O(a),O({h:(c+120)%360,s:b.s,l:b.l}),O({h:(c+240)%360,s:b.s,l:b.l})]}function r(a){var b=O(a).toHsl(),c=b.h;return[O(a),O({h:(c+90)%360,s:b.s,l:b.l}),O({h:(c+180)%360,s:b.s,l:b.l}),O({h:(c+270)%360,s:b.s,l:b.l})]}function s(a){var b=O(a).toHsl(),c=b.h;return[O(a),O({h:(c+72)%360,s:b.s,l:b.l}),O({h:(c+216)%360,s:b.s,l:b.l})]}function t(a,b,c){b=b||6,c=c||30;var d=O(a).toHsl(),e=360/c,f=[O(a)];for(d.h=(d.h-(e*b>>1)+720)%360;--b;)d.h=(d.h+e)%360,f.push(O(d));return f}function u(a,b){b=b||6;for(var c=O(a).toHsv(),d=c.h,e=c.s,f=c.v,g=[],h=1/b;b--;)g.push(O({h:d,s:e,v:f})),f=(f+h)%1;return g}function v(a){return a=parseFloat(a),(isNaN(a)||a<0||a>1)&&(a=1),a}function w(a,b){z(a)&&(a="100%");var c=A(a);return a=L(b,M(0,parseFloat(a))),c&&(a=parseInt(a*b,10)/100),J.abs(a-b)<1e-6?1:a%b/parseFloat(b)}function x(a){return L(1,M(0,a))}function y(a){return parseInt(a,16)}function z(a){return"string"==typeof a&&-1!=a.indexOf(".")&&1===parseFloat(a)}function A(a){return"string"==typeof a&&-1!=a.indexOf("%")}function B(a){return 1==a.length?"0"+a:""+a}function C(a){return a<=1&&(a=100*a+"%"),a}function D(a){return Math.round(255*parseFloat(a)).toString(16)}function E(a){return y(a)/255}function F(a){a=a.replace(G,"").replace(H,"").toLowerCase();var b=!1;if(P[a])a=P[a],b=!0;else if("transparent"==a)return{r:0,g:0,b:0,a:0,format:"name"};var c;return(c=R.rgb.exec(a))?{r:c[1],g:c[2],b:c[3]}:(c=R.rgba.exec(a))?{r:c[1],g:c[2],b:c[3],a:c[4]}:(c=R.hsl.exec(a))?{h:c[1],s:c[2],l:c[3]}:(c=R.hsla.exec(a))?{h:c[1],s:c[2],l:c[3],a:c[4]}:(c=R.hsv.exec(a))?{h:c[1],s:c[2],v:c[3]}:(c=R.hsva.exec(a))?{h:c[1],s:c[2],v:c[3],a:c[4]}:(c=R.hex8.exec(a))?{a:E(c[1]),r:y(c[2]),g:y(c[3]),b:y(c[4]),format:b?"name":"hex8"}:(c=R.hex6.exec(a))?{r:y(c[1]),g:y(c[2]),b:y(c[3]),format:b?"name":"hex"}:!!(c=R.hex3.exec(a))&&{r:y(c[1]+""+c[1]),g:y(c[2]+""+c[2]),b:y(c[3]+""+c[3]),format:b?"name":"hex"}}var G=/^[\s,#]+/,H=/\s+$/,I=0,J=Math,K=J.round,L=J.min,M=J.max,N=J.random,O=function(b,c){if(b=b||"",c=c||{},b instanceof O)return b;if(!(this instanceof O))return new O(b,c);var d=a(b);this._originalInput=b,this._r=d.r,this._g=d.g,this._b=d.b,this._a=d.a,this._roundA=K(100*this._a)/100,this._format=c.format||d.format,this._gradientType=c.gradientType,this._r<1&&(this._r=K(this._r)),this._g<1&&(this._g=K(this._g)),this._b<1&&(this._b=K(this._b)),this._ok=d.ok,this._tc_id=I++};O.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var a=this.toRgb();return(299*a.r+587*a.g+114*a.b)/1e3},setAlpha:function(a){return this._a=v(a),this._roundA=K(100*this._a)/100,this},toHsv:function(){var a=e(this._r,this._g,this._b);return{h:360*a.h,s:a.s,v:a.v,a:this._a}},toHsvString:function(){var a=e(this._r,this._g,this._b),b=K(360*a.h),c=K(100*a.s),d=K(100*a.v);return 1==this._a?"hsv("+b+", "+c+"%, "+d+"%)":"hsva("+b+", "+c+"%, "+d+"%, "+this._roundA+")"},toHsl:function(){var a=c(this._r,this._g,this._b);return{h:360*a.h,s:a.s,l:a.l,a:this._a}},toHslString:function(){var a=c(this._r,this._g,this._b),b=K(360*a.h),d=K(100*a.s),e=K(100*a.l);return 1==this._a?"hsl("+b+", "+d+"%, "+e+"%)":"hsla("+b+", "+d+"%, "+e+"%, "+this._roundA+")"},toHex:function(a){return g(this._r,this._g,this._b,a)},toHexString:function(a){return"#"+this.toHex(a)},toHex8:function(){return h(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:K(this._r),g:K(this._g),b:K(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+K(this._r)+", "+K(this._g)+", "+K(this._b)+")":"rgba("+K(this._r)+", "+K(this._g)+", "+K(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:K(100*w(this._r,255))+"%",g:K(100*w(this._g,255))+"%",b:K(100*w(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+K(100*w(this._r,255))+"%, "+K(100*w(this._g,255))+"%, "+K(100*w(this._b,255))+"%)":"rgba("+K(100*w(this._r,255))+"%, "+K(100*w(this._g,255))+"%, "+K(100*w(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Q[g(this._r,this._g,this._b,!0)]||!1)},toFilter:function(a){var b="#"+h(this._r,this._g,this._b,this._a),c=b,d=this._gradientType?"GradientType = 1, ":"";if(a){c=O(a).toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+d+"startColorstr="+b+",endColorstr="+c+")"},toString:function(a){var b=!!a;a=a||this._format;var c=!1,d=this._a<1&&this._a>=0;return b||!d||"hex"!==a&&"hex6"!==a&&"hex3"!==a&&"name"!==a?("rgb"===a&&(c=this.toRgbString()),"prgb"===a&&(c=this.toPercentageRgbString()),"hex"!==a&&"hex6"!==a||(c=this.toHexString()),"hex3"===a&&(c=this.toHexString(!0)),"hex8"===a&&(c=this.toHex8String()),"name"===a&&(c=this.toName()),"hsl"===a&&(c=this.toHslString()),"hsv"===a&&(c=this.toHsvString()),c||this.toHexString()):"name"===a&&0===this._a?this.toName():this.toRgbString()},_applyModification:function(a,b){var c=a.apply(null,[this].concat([].slice.call(b)));return this._r=c._r,this._g=c._g,this._b=c._b,this.setAlpha(c._a),this},lighten:function(){return this._applyModification(l,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(n,arguments)},desaturate:function(){return this._applyModification(i,arguments)},saturate:function(){return this._applyModification(j,arguments)},greyscale:function(){return this._applyModification(k,arguments)},spin:function(){return this._applyModification(o,arguments)},_applyCombination:function(a,b){return a.apply(null,[this].concat([].slice.call(b)))},analogous:function(){return this._applyCombination(t,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(u,arguments)},splitcomplement:function(){return this._applyCombination(s,arguments)},triad:function(){return this._applyCombination(q,arguments)},tetrad:function(){return this._applyCombination(r,arguments)}},O.fromRatio=function(a,b){if("object"==typeof a){var c={};for(var d in a)a.hasOwnProperty(d)&&(c[d]="a"===d?a[d]:C(a[d]));a=c}return O(a,b)},O.equals=function(a,b){return!(!a||!b)&&O(a).toRgbString()==O(b).toRgbString()},O.random=function(){return O.fromRatio({r:N(),g:N(),b:N()})},O.mix=function(a,b,c){c=0===c?0:c||50;var d,e=O(a).toRgb(),f=O(b).toRgb(),g=c/100,h=2*g-1,i=f.a-e.a;d=h*i==-1?h:(h+i)/(1+h*i),d=(d+1)/2;var j=1-d,k={r:f.r*d+e.r*j,g:f.g*d+e.g*j,b:f.b*d+e.b*j,a:f.a*g+e.a*(1-g)};return O(k)},O.readability=function(a,b){var c=O(a),d=O(b),e=c.toRgb(),f=d.toRgb(),g=c.getBrightness(),h=d.getBrightness(),i=Math.max(e.r,f.r)-Math.min(e.r,f.r)+Math.max(e.g,f.g)-Math.min(e.g,f.g)+Math.max(e.b,f.b)-Math.min(e.b,f.b);return{brightness:Math.abs(g-h),color:i}},O.isReadable=function(a,b){var c=O.readability(a,b);return c.brightness>125&&c.color>500},O.mostReadable=function(a,b){for(var c=null,d=0,e=!1,f=0;f<b.length;f++){var g=O.readability(a,b[f]),h=g.brightness>125&&g.color>500,i=g.brightness/125*3+g.color/500;(h&&!e||h&&e&&i>d||!h&&!e&&i>d)&&(e=h,d=i,c=O(b[f]))}return c};var P=O.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Q=O.hexNames=function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[a[c]]=c);return b}(P),R=function(){var a="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",b="[\\s|\\(]+("+a+")[,|\\s]+("+a+")[,|\\s]+("+a+")\\s*\\)?",c="[\\s|\\(]+("+a+")[,|\\s]+("+a+")[,|\\s]+("+a+")[,|\\s]+("+a+")\\s*\\)?";return{rgb:new RegExp("rgb"+b),rgba:new RegExp("rgba"+c),hsl:new RegExp("hsl"+b),hsla:new RegExp("hsla"+c),hsv:new RegExp("hsv"+b),hsva:new RegExp("hsva"+c),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();window.tinycolor=O}(),a(function(){a.fn.spectrum.load&&a.fn.spectrum.processNativeColorInputs()})}),function(a,b){"use strict";var c=a.module("angularSpectrumColorpicker",[]);!function(b){c.directive("spectrumColorpicker",function(){return{restrict:"EA",require:"ngModel",scope:{fallbackValue:"=",disabled:"=?",format:"=?",options:"=?",triggerId:"@?",palette:"=?",onChange:"&?",onShow:"&?",onHide:"&?",onMove:"&?",onBeforeShow:"&?",onChangeOptions:"=?",onShowOptions:"=?",onHideOptions:"=?",onMoveOptions:"=?"},replace:!0,templateUrl:"directive.html",link:function(b,c,d,e){function f(a){var c=a;return c&&(c=a.toString(b.format)),c}function g(c){a.isFunction(b.onChange)&&b.onChange({color:c})}function h(c){var d=b.fallbackValue;c?d=f(c):a.isUndefined(b.fallbackValue)&&(d=c),e.$setViewValue(d),g(d)}var i=c.find("input"),j=function(a){b.$evalAsync(function(){h(a)})},k=function(){return i.spectrum("toggle"),!1},l={color:e.$viewValue},m={};a.forEach({change:"onChange",move:"onMove",hide:"onHide",show:"onShow"},function(c,d){var e=b[c+"Options"];m[d]=function(d){return(!e||e.update)&&j(d),"change"!==c&&a.isFunction(b[c])?b[c]({color:f(d)}):null}}),a.isFunction(b.onBeforeShow)&&(m.beforeShow=function(a){return b.onBeforeShow({color:f(a)})}),b.palette&&(m.palette=b.palette);var n=a.extend({},l,b.options,m);b.triggerId&&a.element(document.body).on("click","#"+b.triggerId,k),e.$render=function(){i.spectrum("set",e.$viewValue||""),g(e.$viewValue)},n.color&&(i.spectrum("set",n.color||""),h(n.color)),i.spectrum(n),b.$on("$destroy",function(){b.triggerId&&a.element(document.body).off("click","#"+b.triggerId,k)}),c.on("$destroy",function(){i.spectrum("destroy")}),a.isDefined(n.disabled)&&(b.disabled=!!n.disabled),b.$watch("disabled",function(a){i.spectrum(a?"disable":"enable")}),b.$watch("palette",function(a){i.spectrum("option","palette",a)},!0)}}})}(),a.module("angularSpectrumColorpicker").run(["$templateCache",function(a){a.put("directive.html",'<span><input class="input-small"></span>')}])}(window.angular),function(a,b){"function"==typeof define&&define.amd?define([],b):"undefined"!=typeof module&&module.exports?module.exports=b():a.tv4=b()}(this,function(){function a(b,c){if(b===c)return!0;if("object"==typeof b&&"object"==typeof c){if(Array.isArray(b)!==Array.isArray(c))return!1;if(Array.isArray(b)){if(b.length!==c.length)return!1;for(var d=0;d<b.length;d++)if(!a(b[d],c[d]))return!1}else{var e;for(e in b)if(void 0===c[e]&&void 0!==b[e])return!1;for(e in c)if(void 0===b[e]&&void 0!==c[e])return!1;for(e in b)if(!a(b[e],c[e]))return!1}return!0}return!1}function b(a){var b=String(a).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return b?{href:b[0]||"",protocol:b[1]||"",authority:b[2]||"",host:b[3]||"",hostname:b[4]||"",port:b[5]||"",pathname:b[6]||"",search:b[7]||"",hash:b[8]||""}:null}function c(a,c){return c=b(c||""),a=b(a||""),c&&a?(c.protocol||a.protocol)+(c.protocol||c.authority?c.authority:a.authority)+function(a){var b=[];return a.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(a){"/.."===a?b.pop():b.push(a)}),b.join("").replace(/^\//,"/"===a.charAt(0)?"/":"")}(c.protocol||c.authority||"/"===c.pathname.charAt(0)?c.pathname:c.pathname?(a.authority&&!a.pathname?"/":"")+a.pathname.slice(0,a.pathname.lastIndexOf("/")+1)+c.pathname:a.pathname)+(c.protocol||c.authority||c.pathname?c.search:c.search||a.search)+c.hash:null}function d(a){return a.split("#")[0]}function e(a,b){if(a&&"object"==typeof a)if(void 0===b?b=a.id:"string"==typeof a.id&&(b=c(b,a.id),a.id=b),Array.isArray(a))for(var d=0;d<a.length;d++)e(a[d],b);else{"string"==typeof a.$ref&&(a.$ref=c(b,a.$ref));for(var f in a)"enum"!==f&&e(a[f],b)}}function f(a,b,c,d,e){if(Error.call(this),void 0===a)throw new Error("No code supplied for error: "+b);this.message=b,this.code=a,this.dataPath=c||"",this.schemaPath=d||"",this.subErrors=e||null;var f=new Error(this.message);if(this.stack=f.stack||f.stacktrace,!this.stack)try{throw f}catch(f){this.stack=f.stack||f.stacktrace}}function g(a,b){if(b.substring(0,a.length)===a){var c=b.substring(a.length);if(b.length>0&&"/"===b.charAt(a.length-1)||"#"===c.charAt(0)||"?"===c.charAt(0))return!0}return!1}function h(a){var b=new i,f=a||"en";return{addFormat:function(){b.addFormat.apply(b,arguments)},language:function(a){return a?(n[a]||(a=a.split("-")[0]),!!n[a]&&(f=a,a)):f},addLanguage:function(a,b){var c;for(c in j)b[c]&&!b[j[c]]&&(b[j[c]]=b[c]);var d=a.split("-")[0];if(n[d]){n[a]=Object.create(n[d]);for(c in b)void 0===n[d][c]&&(n[d][c]=b[c]),n[a][c]=b[c]}else n[a]=b,n[d]=b;return this},freshApi:function(a){var b=h();return a&&b.language(a),b},validate:function(a,c,d,e){var g=new i(b,!1,n[f],d,e);"string"==typeof c&&(c={$ref:c}),g.addSchema("",c);var h=g.validateAll(a,c,null,null,"");return!h&&e&&(h=g.banUnknownProperties()),this.error=h,this.missing=g.missing,this.valid=null===h,this.valid},validateResult:function(){var a={};return this.validate.apply(a,arguments),a},validateMultiple:function(a,c,d,e){var g=new i(b,!0,n[f],d,e);"string"==typeof c&&(c={$ref:c}),g.addSchema("",c),g.validateAll(a,c,null,null,""),e&&g.banUnknownProperties();var h={};return h.errors=g.errors,h.missing=g.missing,h.valid=0===h.errors.length,h},addSchema:function(){return b.addSchema.apply(b,arguments)},getSchema:function(){return b.getSchema.apply(b,arguments)},getSchemaMap:function(){return b.getSchemaMap.apply(b,arguments)},getSchemaUris:function(){return b.getSchemaUris.apply(b,arguments)},getMissingUris:function(){return b.getMissingUris.apply(b,arguments)},dropSchemas:function(){b.dropSchemas.apply(b,arguments)},defineKeyword:function(){b.defineKeyword.apply(b,arguments)},defineError:function(a,b,c){if("string"!=typeof a||!/^[A-Z]+(_[A-Z]+)*$/.test(a))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if("number"!=typeof b||b%1!=0||b<1e4)throw new Error("Code number must be an integer > 10000");if(void 0!==j[a])throw new Error("Error already defined: "+a+" as "+j[a]);if(void 0!==k[b])throw new Error("Error code already used: "+k[b]+" as "+b);j[a]=b,k[b]=a,m[a]=m[b]=c;for(var d in n){var e=n[d];e[a]&&(e[b]=e[b]||e[a])}},reset:function(){b.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:e,resolveUrl:c,getDocumentUri:d,errorCodes:j}}Object.keys||(Object.keys=function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=c.length;return function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on non-object");var f=[];for(var g in e)a.call(e,g)&&f.push(g);if(b)for(var h=0;h<d;h++)a.call(e,c[h])&&f.push(c[h]);return f}}()),Object.create||(Object.create=function(){function a(){}return function(b){if(1!==arguments.length)throw new Error("Object.create implementation only accepts one parameter.");return a.prototype=b,new a}}()),Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){if(null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&d!==1/0&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);e<c;e++)if(e in b&&b[e]===a)return e;return-1}),Object.isFrozen||(Object.isFrozen=function(a){for(var b="tv4_test_frozen_key";a.hasOwnProperty(b);)b+=Math.random();try{return a[b]=!0,delete a[b],!1}catch(a){return!0}});var i=function(a,b,c,d,e){if(this.missing=[],this.missingMap={},this.formatValidators=a?Object.create(a.formatValidators):{},this.schemas=a?Object.create(a.schemas):{},this.collectMultiple=b,this.errors=[],this.handleError=b?this.collectError:this.returnError,d&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),e&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorMessages=c,this.definedKeywords={},a)for(var f in a.definedKeywords)this.definedKeywords[f]=a.definedKeywords[f].slice(0)};i.prototype.defineKeyword=function(a,b){this.definedKeywords[a]=this.definedKeywords[a]||[],this.definedKeywords[a].push(b)},i.prototype.createError=function(a,b,c,d,e){var g=this.errorMessages[a]||m[a];return"string"!=typeof g?new f(a,"Unknown error code "+a+": "+JSON.stringify(b),c,d,e):new f(a,g.replace(/\{([^{}]*)\}/g,function(a,c){var d=b[c];return"string"==typeof d||"number"==typeof d?d:a}),c,d,e)},i.prototype.returnError=function(a){return a},i.prototype.collectError=function(a){return a&&this.errors.push(a),null},i.prototype.prefixErrors=function(a,b,c){for(var d=a;d<this.errors.length;d++)this.errors[d]=this.errors[d].prefixWith(b,c);return this},i.prototype.banUnknownProperties=function(){for(var a in this.unknownPropertyPaths){var b=this.createError(j.UNKNOWN_PROPERTY,{path:a},a,""),c=this.handleError(b);if(c)return c}return null},i.prototype.addFormat=function(a,b){if("object"==typeof a){for(var c in a)this.addFormat(c,a[c]);return this}this.formatValidators[a]=b},i.prototype.resolveRefs=function(a,b){if(void 0!==a.$ref){if(b=b||{},b[a.$ref])return this.createError(j.CIRCULAR_REFERENCE,{urls:Object.keys(b).join(", ")},"","");b[a.$ref]=!0,a=this.getSchema(a.$ref,b)}return a},i.prototype.getSchema=function(a,b){var c;if(void 0!==this.schemas[a])return c=this.schemas[a],this.resolveRefs(c,b);var d=a,e="";if(-1!==a.indexOf("#")&&(e=a.substring(a.indexOf("#")+1),d=a.substring(0,a.indexOf("#"))),"object"==typeof this.schemas[d]){c=this.schemas[d];var f=decodeURIComponent(e);if(""===f)return this.resolveRefs(c,b);if("/"!==f.charAt(0))return;for(var g=f.split("/").slice(1),h=0;h<g.length;h++){var i=g[h].replace(/~1/g,"/").replace(/~0/g,"~");if(void 0===c[i]){c=void 0;break}c=c[i]}if(void 0!==c)return this.resolveRefs(c,b)}void 0===this.missing[d]&&(this.missing.push(d),this.missing[d]=d,this.missingMap[d]=d)},i.prototype.searchSchemas=function(a,b){if(a&&"object"==typeof a){"string"==typeof a.id&&g(b,a.id)&&void 0===this.schemas[a.id]&&(this.schemas[a.id]=a);for(var c in a)if("enum"!==c)if("object"==typeof a[c])this.searchSchemas(a[c],b);else if("$ref"===c){var e=d(a[c]);e&&void 0===this.schemas[e]&&void 0===this.missingMap[e]&&(this.missingMap[e]=e)}}},i.prototype.addSchema=function(a,b){if("string"!=typeof a||void 0===b){if("object"!=typeof a||"string"!=typeof a.id)return;b=a,a=b.id}(a=d(a)+"#")&&(a=d(a)),this.schemas[a]=b,delete this.missingMap[a],e(b,a),this.searchSchemas(b,a)},i.prototype.getSchemaMap=function(){var a={};for(var b in this.schemas)a[b]=this.schemas[b];return a},i.prototype.getSchemaUris=function(a){var b=[];for(var c in this.schemas)a&&!a.test(c)||b.push(c);return b},i.prototype.getMissingUris=function(a){var b=[];for(var c in this.missingMap)a&&!a.test(c)||b.push(c);return b},i.prototype.dropSchemas=function(){this.schemas={},this.reset()},i.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},i.prototype.validateAll=function(a,b,c,d,e){var g;if(!(b=this.resolveRefs(b)))return null;if(b instanceof f)return this.errors.push(b),b;var h,i=this.errors.length,j=null,k=null;if(this.checkRecursive&&a&&"object"==typeof a){if(g=!this.scanned.length,a[this.validatedSchemasKey]){var l=a[this.validatedSchemasKey].indexOf(b);if(-1!==l)return this.errors=this.errors.concat(a[this.validationErrorsKey][l]),null}if(Object.isFrozen(a)&&-1!==(h=this.scannedFrozen.indexOf(a))){var m=this.scannedFrozenSchemas[h].indexOf(b);if(-1!==m)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[h][m]),null}
  if(this.scanned.push(a),Object.isFrozen(a))-1===h&&(h=this.scannedFrozen.length,this.scannedFrozen.push(a),this.scannedFrozenSchemas.push([])),j=this.scannedFrozenSchemas[h].length,this.scannedFrozenSchemas[h][j]=b,this.scannedFrozenValidationErrors[h][j]=[];else{if(!a[this.validatedSchemasKey])try{Object.defineProperty(a,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(a,this.validationErrorsKey,{value:[],configurable:!0})}catch(b){a[this.validatedSchemasKey]=[],a[this.validationErrorsKey]=[]}k=a[this.validatedSchemasKey].length,a[this.validatedSchemasKey][k]=b,a[this.validationErrorsKey][k]=[]}}var n=this.errors.length,o=this.validateBasic(a,b,e)||this.validateNumeric(a,b,e)||this.validateString(a,b,e)||this.validateArray(a,b,e)||this.validateObject(a,b,e)||this.validateCombinations(a,b,e)||this.validateFormat(a,b,e)||this.validateDefinedKeywords(a,b,e)||null;if(g){for(;this.scanned.length;){delete this.scanned.pop()[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(o||n!==this.errors.length)for(;c&&c.length||d&&d.length;){var p=c&&c.length?""+c.pop():null,q=d&&d.length?""+d.pop():null;o&&(o=o.prefixWith(p,q)),this.prefixErrors(n,p,q)}return null!==j?this.scannedFrozenValidationErrors[h][j]=this.errors.slice(i):null!==k&&(a[this.validationErrorsKey][k]=this.errors.slice(i)),this.handleError(o)},i.prototype.validateFormat=function(a,b){if("string"!=typeof b.format||!this.formatValidators[b.format])return null;var c=this.formatValidators[b.format].call(null,a,b);return"string"==typeof c||"number"==typeof c?this.createError(j.FORMAT_CUSTOM,{message:c}).prefixWith(null,"format"):c&&"object"==typeof c?this.createError(j.FORMAT_CUSTOM,{message:c.message||"?"},c.dataPath||null,c.schemaPath||"/format"):null},i.prototype.validateDefinedKeywords=function(a,b){for(var c in this.definedKeywords)for(var d=this.definedKeywords[c],e=0;e<d.length;e++){var f=d[e],g=f(a,b[c],b);if("string"==typeof g||"number"==typeof g)return this.createError(j.KEYWORD_CUSTOM,{key:c,message:g}).prefixWith(null,"format");if(g&&"object"==typeof g){var h=g.code||j.KEYWORD_CUSTOM;if("string"==typeof h){if(!j[h])throw new Error("Undefined error code (use defineError): "+h);h=j[h]}var i="object"==typeof g.message?g.message:{key:c,message:g.message||"?"},k=g.schemaPath||"/"+c.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(h,i,g.dataPath||null,k)}}return null},i.prototype.validateBasic=function(a,b,c){var d;return(d=this.validateType(a,b,c))?d.prefixWith(null,"type"):(d=this.validateEnum(a,b,c))?d.prefixWith(null,"type"):null},i.prototype.validateType=function(a,b){if(void 0===b.type)return null;var c=typeof a;null===a?c="null":Array.isArray(a)&&(c="array");var d=b.type;"object"!=typeof d&&(d=[d]);for(var e=0;e<d.length;e++){var f=d[e];if(f===c||"integer"===f&&"number"===c&&a%1==0)return null}return this.createError(j.INVALID_TYPE,{type:c,expected:d.join("/")})},i.prototype.validateEnum=function(b,c){if(void 0===c.enum)return null;for(var d=0;d<c.enum.length;d++){if(a(b,c.enum[d]))return null}return this.createError(j.ENUM_MISMATCH,{value:"undefined"!=typeof JSON?JSON.stringify(b):b})},i.prototype.validateNumeric=function(a,b,c){return this.validateMultipleOf(a,b,c)||this.validateMinMax(a,b,c)||null},i.prototype.validateMultipleOf=function(a,b){var c=b.multipleOf||b.divisibleBy;return void 0===c?null:"number"==typeof a&&a%c!=0?this.createError(j.NUMBER_MULTIPLE_OF,{value:a,multipleOf:c}):null},i.prototype.validateMinMax=function(a,b){if("number"!=typeof a)return null;if(void 0!==b.minimum){if(a<b.minimum)return this.createError(j.NUMBER_MINIMUM,{value:a,minimum:b.minimum}).prefixWith(null,"minimum");if(b.exclusiveMinimum&&a===b.minimum)return this.createError(j.NUMBER_MINIMUM_EXCLUSIVE,{value:a,minimum:b.minimum}).prefixWith(null,"exclusiveMinimum")}if(void 0!==b.maximum){if(a>b.maximum)return this.createError(j.NUMBER_MAXIMUM,{value:a,maximum:b.maximum}).prefixWith(null,"maximum");if(b.exclusiveMaximum&&a===b.maximum)return this.createError(j.NUMBER_MAXIMUM_EXCLUSIVE,{value:a,maximum:b.maximum}).prefixWith(null,"exclusiveMaximum")}return null},i.prototype.validateString=function(a,b,c){return this.validateStringLength(a,b,c)||this.validateStringPattern(a,b,c)||null},i.prototype.validateStringLength=function(a,b){return"string"!=typeof a?null:void 0!==b.minLength&&a.length<b.minLength?this.createError(j.STRING_LENGTH_SHORT,{length:a.length,minimum:b.minLength}).prefixWith(null,"minLength"):void 0!==b.maxLength&&a.length>b.maxLength?this.createError(j.STRING_LENGTH_LONG,{length:a.length,maximum:b.maxLength}).prefixWith(null,"maxLength"):null},i.prototype.validateStringPattern=function(a,b){return"string"!=typeof a||void 0===b.pattern?null:new RegExp(b.pattern).test(a)?null:this.createError(j.STRING_PATTERN,{pattern:b.pattern}).prefixWith(null,"pattern")},i.prototype.validateArray=function(a,b,c){return Array.isArray(a)?this.validateArrayLength(a,b,c)||this.validateArrayUniqueItems(a,b,c)||this.validateArrayItems(a,b,c)||null:null},i.prototype.validateArrayLength=function(a,b){var c;return void 0!==b.minItems&&a.length<b.minItems&&(c=this.createError(j.ARRAY_LENGTH_SHORT,{length:a.length,minimum:b.minItems}).prefixWith(null,"minItems"),this.handleError(c))?c:void 0!==b.maxItems&&a.length>b.maxItems&&(c=this.createError(j.ARRAY_LENGTH_LONG,{length:a.length,maximum:b.maxItems}).prefixWith(null,"maxItems"),this.handleError(c))?c:null},i.prototype.validateArrayUniqueItems=function(b,c){if(c.uniqueItems)for(var d=0;d<b.length;d++)for(var e=d+1;e<b.length;e++)if(a(b[d],b[e])){var f=this.createError(j.ARRAY_UNIQUE,{match1:d,match2:e}).prefixWith(null,"uniqueItems");if(this.handleError(f))return f}return null},i.prototype.validateArrayItems=function(a,b,c){if(void 0===b.items)return null;var d,e;if(Array.isArray(b.items)){for(e=0;e<a.length;e++)if(e<b.items.length){if(d=this.validateAll(a[e],b.items[e],[e],["items",e],c+"/"+e))return d}else if(void 0!==b.additionalItems)if("boolean"==typeof b.additionalItems){if(!b.additionalItems&&(d=this.createError(j.ARRAY_ADDITIONAL_ITEMS,{}).prefixWith(""+e,"additionalItems"),this.handleError(d)))return d}else if(d=this.validateAll(a[e],b.additionalItems,[e],["additionalItems"],c+"/"+e))return d}else for(e=0;e<a.length;e++)if(d=this.validateAll(a[e],b.items,[e],["items"],c+"/"+e))return d;return null},i.prototype.validateObject=function(a,b,c){return"object"!=typeof a||null===a||Array.isArray(a)?null:this.validateObjectMinMaxProperties(a,b,c)||this.validateObjectRequiredProperties(a,b,c)||this.validateObjectProperties(a,b,c)||this.validateObjectDependencies(a,b,c)||null},i.prototype.validateObjectMinMaxProperties=function(a,b){var c,d=Object.keys(a);return void 0!==b.minProperties&&d.length<b.minProperties&&(c=this.createError(j.OBJECT_PROPERTIES_MINIMUM,{propertyCount:d.length,minimum:b.minProperties}).prefixWith(null,"minProperties"),this.handleError(c))?c:void 0!==b.maxProperties&&d.length>b.maxProperties&&(c=this.createError(j.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:d.length,maximum:b.maxProperties}).prefixWith(null,"maxProperties"),this.handleError(c))?c:null},i.prototype.validateObjectRequiredProperties=function(a,b){if(void 0!==b.required)for(var c=0;c<b.required.length;c++){var d=b.required[c];if(void 0===a[d]){var e=this.createError(j.OBJECT_REQUIRED,{key:d}).prefixWith(null,""+c).prefixWith(null,"required");if(this.handleError(e))return e}}return null},i.prototype.validateObjectProperties=function(a,b,c){var d;for(var e in a){var f=c+"/"+e.replace(/~/g,"~0").replace(/\//g,"~1"),g=!1;if(void 0!==b.properties&&void 0!==b.properties[e]&&(g=!0,d=this.validateAll(a[e],b.properties[e],[e],["properties",e],f)))return d;if(void 0!==b.patternProperties)for(var h in b.patternProperties){var i=new RegExp(h);if(i.test(e)&&(g=!0,d=this.validateAll(a[e],b.patternProperties[h],[e],["patternProperties",h],f)))return d}if(g)this.trackUnknownProperties&&(this.knownPropertyPaths[f]=!0,delete this.unknownPropertyPaths[f]);else if(void 0!==b.additionalProperties){if(this.trackUnknownProperties&&(this.knownPropertyPaths[f]=!0,delete this.unknownPropertyPaths[f]),"boolean"==typeof b.additionalProperties){if(!b.additionalProperties&&(d=this.createError(j.OBJECT_ADDITIONAL_PROPERTIES,{}).prefixWith(e,"additionalProperties"),this.handleError(d)))return d}else if(d=this.validateAll(a[e],b.additionalProperties,[e],["additionalProperties"],f))return d}else this.trackUnknownProperties&&!this.knownPropertyPaths[f]&&(this.unknownPropertyPaths[f]=!0)}return null},i.prototype.validateObjectDependencies=function(a,b,c){var d;if(void 0!==b.dependencies)for(var e in b.dependencies)if(void 0!==a[e]){var f=b.dependencies[e];if("string"==typeof f){if(void 0===a[f]&&(d=this.createError(j.OBJECT_DEPENDENCY_KEY,{key:e,missing:f}).prefixWith(null,e).prefixWith(null,"dependencies"),this.handleError(d)))return d}else if(Array.isArray(f))for(var g=0;g<f.length;g++){var h=f[g];if(void 0===a[h]&&(d=this.createError(j.OBJECT_DEPENDENCY_KEY,{key:e,missing:h}).prefixWith(null,""+g).prefixWith(null,e).prefixWith(null,"dependencies"),this.handleError(d)))return d}else if(d=this.validateAll(a,f,[],["dependencies",e],c))return d}return null},i.prototype.validateCombinations=function(a,b,c){return this.validateAllOf(a,b,c)||this.validateAnyOf(a,b,c)||this.validateOneOf(a,b,c)||this.validateNot(a,b,c)||null},i.prototype.validateAllOf=function(a,b,c){if(void 0===b.allOf)return null;for(var d,e=0;e<b.allOf.length;e++){var f=b.allOf[e];if(d=this.validateAll(a,f,[],["allOf",e],c))return d}return null},i.prototype.validateAnyOf=function(a,b,c){if(void 0===b.anyOf)return null;var d,e,f=[],g=this.errors.length;this.trackUnknownProperties&&(d=this.unknownPropertyPaths,e=this.knownPropertyPaths);for(var h=!0,i=0;i<b.anyOf.length;i++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var k=b.anyOf[i],l=this.errors.length,m=this.validateAll(a,k,[],["anyOf",i],c);if(null===m&&l===this.errors.length){if(this.errors=this.errors.slice(0,g),this.trackUnknownProperties){for(var n in this.knownPropertyPaths)e[n]=!0,delete d[n];for(var o in this.unknownPropertyPaths)e[o]||(d[o]=!0);h=!1;continue}return null}m&&f.push(m.prefixWith(null,""+i).prefixWith(null,"anyOf"))}return this.trackUnknownProperties&&(this.unknownPropertyPaths=d,this.knownPropertyPaths=e),h?(f=f.concat(this.errors.slice(g)),this.errors=this.errors.slice(0,g),this.createError(j.ANY_OF_MISSING,{},"","/anyOf",f)):void 0},i.prototype.validateOneOf=function(a,b,c){if(void 0===b.oneOf)return null;var d,e,f=null,g=[],h=this.errors.length;this.trackUnknownProperties&&(d=this.unknownPropertyPaths,e=this.knownPropertyPaths);for(var i=0;i<b.oneOf.length;i++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var k=b.oneOf[i],l=this.errors.length,m=this.validateAll(a,k,[],["oneOf",i],c);if(null===m&&l===this.errors.length){if(null!==f)return this.errors=this.errors.slice(0,h),this.createError(j.ONE_OF_MULTIPLE,{index1:f,index2:i},"","/oneOf");if(f=i,this.trackUnknownProperties){for(var n in this.knownPropertyPaths)e[n]=!0,delete d[n];for(var o in this.unknownPropertyPaths)e[o]||(d[o]=!0)}}else m&&g.push(m.prefixWith(null,""+i).prefixWith(null,"oneOf"))}return this.trackUnknownProperties&&(this.unknownPropertyPaths=d,this.knownPropertyPaths=e),null===f?(g=g.concat(this.errors.slice(h)),this.errors=this.errors.slice(0,h),this.createError(j.ONE_OF_MISSING,{},"","/oneOf",g)):(this.errors=this.errors.slice(0,h),null)},i.prototype.validateNot=function(a,b,c){if(void 0===b.not)return null;var d,e,f=this.errors.length;this.trackUnknownProperties&&(d=this.unknownPropertyPaths,e=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var g=this.validateAll(a,b.not,null,null,c),h=this.errors.slice(f);return this.errors=this.errors.slice(0,f),this.trackUnknownProperties&&(this.unknownPropertyPaths=d,this.knownPropertyPaths=e),null===g&&0===h.length?this.createError(j.NOT_PASSED,{},"","/not"):null};var j={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},k={};for(var l in j)k[j[l]]=l;var m={INVALID_TYPE:"invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};f.prototype=Object.create(Error.prototype),f.prototype.constructor=f,f.prototype.name="ValidationError",f.prototype.prefixWith=function(a,b){if(null!==a&&(a=a.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+a+this.dataPath),null!==b&&(b=b.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+b+this.schemaPath),null!==this.subErrors)for(var c=0;c<this.subErrors.length;c++)this.subErrors[c].prefixWith(a,b);return this};var n={},o=h();return o.addLanguage("en-gb",m),o.tv4=o,o}),function(a){var b={parse:function(a){if("string"!=typeof a)throw new TypeError("ObjectPath.parse must be passed a string");for(var b,c,d,e,f=0,g=[];f<a.length;)if(b=a.indexOf(".",f),c=a.indexOf("[",f),-1===b&&-1===c)g.push(a.slice(f,a.length)),f=a.length;else if(-1===c||-1!==b&&b<c)g.push(a.slice(f,b)),f=b+1;else if(c>f&&(g.push(a.slice(f,c)),f=c),'"'!==(d=a.slice(c+1,c+2))&&"'"!==d)e=a.indexOf("]",c),-1===e&&(e=a.length),g.push(a.slice(f+1,e)),f="."===a.slice(e+1,e+2)?e+2:e+1;else{for(e=a.indexOf(d+"]",c),-1===e&&(e=a.length);"\\"===a.slice(e-1,e)&&c<a.length;)c++,e=a.indexOf(d+"]",c);g.push(a.slice(f+2,e).replace(new RegExp("\\"+d,"g"),d)),f="."===a.slice(e+2,e+3)?e+3:e+2}return g},stringify:function(a,b){return Array.isArray(a)||(a=[a.toString()]),b='"'===b?'"':"'",a.map(function(a){return"["+b+a.toString().replace(new RegExp(b,"g"),"\\"+b)+b+"]"}).join("")},normalize:function(a,c){return b.stringify(Array.isArray(a)?a:b.parse(a),c)},registerModule:function(a){a.module("ObjectPath",[]).provider("ObjectPath",function(){this.parse=b.parse,this.stringify=b.stringify,this.normalize=b.normalize,this.$get=function(){return b}})}};"function"==typeof define&&define.amd?define(function(){return b}):"object"==typeof exports?exports.ObjectPath=b:window.ObjectPath=b}(),uiCodemirrorDirective.$inject=["$timeout","uiCodemirrorConfig"],angular.module("ui.codemirror",[]).constant("uiCodemirrorConfig",{}).directive("uiCodemirror",uiCodemirrorDirective),function(a,b){"function"==typeof define&&define.amd?define(["angular","objectpath","tv4"],b):"object"==typeof exports?module.exports=b(require("angular"),require("objectpath"),require("tv4")):a.schemaForm=b(a.angular,a.objectpath,a.tv4)}(this,function(a,b,c){var d=[];try{a.module("ngSanitize"),d.push("ngSanitize")}catch(a){}try{a.module("ui.sortable"),d.push("ui.sortable")}catch(a){}try{a.module("angularSpectrumColorpicker"),d.push("angularSpectrumColorpicker")}catch(a){}var e=a.module("schemaForm",d);return a.module("schemaForm").provider("sfPath",[function(){var c=window.ObjectPath||b,d={parse:c.parse};1===a.version.major&&a.version.minor<3?d.stringify=function(a){return Array.isArray(a)?a.join("."):a.toString()}:d.stringify=c.stringify,d.normalize=function(a,b){return d.stringify(Array.isArray(a)?a:d.parse(a),b)},this.parse=d.parse,this.stringify=d.stringify,this.normalize=d.normalize,this.$get=function(){return d}}]),a.module("schemaForm").provider("sfBuilder",["sfPathProvider",function(b){var c=/[A-Z]/g,d=function(a,b){return b=b||"_",a.replace(c,function(a,c){return(c?b:"")+a.toLowerCase()})},e=0,f={sfField:function(a){a.fieldFrag.firstChild.setAttribute("sf-field",e),a.lookup["f"+e]=a.form,e++},ngModel:function(a){if(a.form.key){var c=a.form.key;a.state.keyRedaction&&(c=c.slice(a.state.keyRedaction));var d;if(a.state.modelValue)d=a.state.modelValue;else{var e=b.stringify(c).replace(/"/g,"&quot;");d=a.state.modelName||"model",e&&(d+=("["!==e[0]?".":"")+e)}for(var f=a.fieldFrag.querySelectorAll("[sf-field-model]"),g=0;g<f.length;g++){var h=f[g],i=h.getAttribute("sf-field-model");if(i&&""!==i)if("replaceAll"===i)for(var j=h.attributes,k=0;k<j.length;k++)j[k].value&&-1!==j[k].value.indexOf("$$value")&&(j[k].value=j[k].value.replace(/\$\$value\$\$/g,d));else{var l=h.getAttribute(i);l&&l.indexOf("$$value$$")?h.setAttribute(i,l.replace(/\$\$value\$\$/g,d)):h.setAttribute(i,d)}else h.setAttribute("ng-model",d)}}},simpleTransclusion:function(a){var b=a.build(a.form.items,a.path+".items",a.state);a.fieldFrag.firstChild.appendChild(b)},ngModelOptions:function(a){a.form.ngModelOptions&&Object.keys(a.form.ngModelOptions).length>0&&a.fieldFrag.firstChild.setAttribute("ng-model-options",JSON.stringify(a.form.ngModelOptions))},transclusion:function(a){var b=a.fieldFrag.querySelectorAll("[sf-field-transclude]");if(b.length)for(var c=0;c<b.length;c++){var d=b[c],e=d.getAttribute("sf-field-transclude")||"items",f=a.form[e];if(f){var g=a.build(f,a.path+"."+e,a.state);d.appendChild(g)}}},condition:function(a){if(a.form.condition){var c="evalExpr("+a.path+'.condition, { model: model, "arrayIndex": $index})';if(a.form.key){var d=b.stringify(a.form.key);c="evalExpr("+a.path+'.condition,{ model: model, "arrayIndex": $index, "modelValue": model'+("["===d[0]?"":".")+d+"})"}for(var e=a.fieldFrag.children||a.fieldFrag.childNodes,f=0;f<e.length;f++){var g=e[f],h=g.getAttribute("ng-if");g.setAttribute("ng-if",h?"("+h+") || ("+c+")":c)}}},array:function(c){var d=c.fieldFrag.querySelector("[schema-form-array-items]");if(d){if(state=a.copy(c.state),state.keyRedaction=state.keyRedaction||0,state.keyRedaction+=c.form.key.length+1,c.form.schema&&c.form.schema.items&&c.form.schema.items.type&&-1===c.form.schema.items.type.indexOf("object")&&-1===c.form.schema.items.type.indexOf("array")){b.stringify(c.form.key).replace(/"/g,"&quot;");state.modelValue="modelArray[$index]"}else state.modelName="item";state.arrayCompatFlag=!0;var e=c.build(c.form.items,c.path+".items",state);d.appendChild(e)}}};this.builders=f;var g=[f.sfField,f.ngModel,f.ngModelOptions,f.condition];this.stdBuilders=g,this.$get=["$templateCache","schemaFormDecorators","sfPath",function(a,b,c){var e=function(a,b){if(a.key){var d=b[c.stringify(a.key)];if(d){for(;d.firstChild;)d.removeChild(d.firstChild);return d}}},h=function(a,b,c,f,g,i,j){i=i||{},j=j||Object.create(null),g=g||"schemaForm.form";var k=document.createDocumentFragment();return a.reduce(function(a,k,l){if(!k.type)return a;var m=b[k.type]||b.default;if(m.replace){var n;i.arrayCompatFlag=!1;var o=document.createElement("div"),p=c(k,m)||c(k,b.default);for(o.innerHTML=p,n=document.createDocumentFragment();o.childNodes.length>0;)n.appendChild(o.childNodes[0]);var q={fieldFrag:n,form:k,lookup:j,state:i,path:g+"["+l+"]",build:function(a,d,e){return h(a,b,c,f,d,e,j)}},r=k.builder||m.builder;"function"==typeof r?r(q):r.forEach(function(a){a(q)}),(e(k,f)||a).appendChild(n)}else{var s=document.createElement(d(b.__name,"-"));i.arrayCompatFlag?s.setAttribute("form","copyWithIndex($index)"):s.setAttribute("form",g+"["+l+"]"),(e(k,f)||a).appendChild(s)}return a},k),k};return{build:function(b,c,d,e){return h(b,c,function(b,c){return"template"===b.type?b.template:a.get(c.template)},d,void 0,void 0,e)},builder:f,stdBuilders:g,internalBuild:h}}]}]),a.module("schemaForm").provider("schemaFormDecorators",["$compileProvider","sfPathProvider",function(b,c){var d="",e={},f=function(a,b){"sfDecorator"===a&&(a=d);var c=e[a];return c[b.type]?c[b.type].template:c.default.template},g=function(d){b.directive(d,["$parse","$compile","$http","$templateCache","$interpolate","$q","sfErrorMessage","sfPath","sfSelect",function(b,e,g,h,i,j,k,l,m){return{restrict:"AE",replace:!1,transclude:!1,scope:!0,require:"?^sfSchema",link:function(b,n,o,p){b.$on("schemaFormPropagateNgModelController",function(a,c){a.stopPropagation(),a.preventDefault(),b.ngModel=c}),b.showTitle=function(){return b.form&&!0!==b.form.notitle&&b.form.title},b.listToCheckboxValues=function(b){var c={};return a.forEach(b,function(a){c[a]=!0}),c},b.checkboxValuesToList=function(b){var c=[];return a.forEach(b,function(a,b){a&&c.push(b)}),c},b.buttonClick=function(c,d){a.isFunction(d.onClick)?d.onClick(c,d):a.isString(d.onClick)&&(p?p.evalInParentScope(d.onClick,{$event:c,form:d}):b.$eval(d.onClick,{$event:c,form:d}))},b.evalExpr=function(a,c){return p?p.evalInParentScope(a,c):b.$eval(a,c)},b.evalInScope=function(a,c){if(a)return b.$eval(a,c)},b.interp=function(a,b){return a&&i(a)(b)},b.hasSuccess=function(){return!!b.ngModel&&(b.ngModel.$valid&&(!b.ngModel.$pristine||!b.ngModel.$isEmpty(b.ngModel.$modelValue)))},b.hasError=function(){return!!b.ngModel&&(b.ngModel.$invalid&&!b.ngModel.$pristine)},b.errorMessage=function(a){return k.interpolate(a&&a.code+""||"default",b.ngModel&&b.ngModel.$modelValue||"",b.ngModel&&b.ngModel.$viewValue||"",b.form,b.options&&b.options.validationMessage)};var q=b.$watch(o.form,function(i){if(i){i.ngModelOptions=i.ngModelOptions||{},b.form=i;var k;if("template"===i.type&&i.template)k=j.when(i.template);else{var o="template"===i.type?i.templateUrl:f(d,i);k=g.get(o,{cache:h}).then(function(a){return a.data})}k.then(function(d){if(i.key){var f=i.key?c.stringify(i.key).replace(/"/g,"&quot;"):"";d=d.replace(/\$\$value\$\$/g,"model"+("["!==f[0]?".":"")+f)}if(n.html(d),i.condition){var g='evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex})';i.key&&(g='evalExpr(form.condition,{ model: model, "arrayIndex": arrayIndex, "modelValue": model'+l.stringify(i.key)+"})"),a.forEach(n.children(),function(a){var b=a.getAttribute("ng-if");a.setAttribute("ng-if",b?"("+b+") || ("+g+")":g)})}e(n.contents())(b)}),i.key&&(b.$on("schemaForm.error."+i.key.join("."),function(a,c,d,e){!0!==d&&!1!==d||(e=d,d=void 0),b.ngModel&&c&&(b.ngModel.$setDirty?b.ngModel.$setDirty():(b.ngModel.$dirty=!0,b.ngModel.$pristine=!1),d&&(i.validationMessage||(i.validationMessage={}),i.validationMessage[c]=d),b.ngModel.$setValidity(c,!0===e),!0===e&&(b.ngModel.$validate(),b.$broadcast("schemaFormValidate")))}),b.$on("$destroy",function(){if(!b.externalDestructionInProgress){var a=i.destroyStrategy||b.options&&b.options.destroyStrategy||"remove";if(i.key&&"retain"!==a){var c=b.model;if(i.key.length>1&&(c=m(i.key.slice(0,i.key.length-1),c)),void 0===c)return;var d=i.schema&&i.schema.type||"";"empty"===a&&-1!==d.indexOf("string")?c[i.key.slice(-1)]="":"empty"===a&&-1!==d.indexOf("object")?c[i.key.slice(-1)]={}:"empty"===a&&-1!==d.indexOf("array")?c[i.key.slice(-1)]=[]:"null"===a?c[i.key.slice(-1)]=null:delete c[i.key.slice(-1)]}}})),q()}})}}}])},h=function(c,d,e){e=!!a.isDefined(e)&&e,b.directive("sf"+a.uppercase(c[0])+c.substr(1),function(){return{restrict:"EAC",scope:!0,replace:!0,transclude:e,template:'<sf-decorator form="form"></sf-decorator>',link:function(b,d,e){var f={items:"c",titleMap:"c",schema:"c"},g={type:c},h=!0;a.forEach(e,function(c,d){if("$"!==d[0]&&0!==d.indexOf("ng")&&"sfField"!==d){var i=function(c){a.isDefined(c)&&c!==g[d]&&(g[d]=c,h&&g.type&&(g.key||a.isUndefined(e.key))&&(b.form=g,h=!1))};"model"===d?b.$watch(c,function(a){a&&b.model!==a&&(b.model=a)}):"c"===f[d]?b.$watchCollection(c,i):e.$observe(d,i)}})}}})};this.createDecorator=function(b,c){e[b]={__name:b},a.forEach(c,function(a,c){e[b][c]={template:a,replace:!1,builder:[]}}),e[d]||(d=b),g(b)},this.defineDecorator=function(b,c){e[b]={__name:b},a.forEach(c,function(c,d){c.builder=c.builder||[],c.replace=!a.isDefined(c.replace)||c.replace,e[b][d]=c}),e[d]||(d=b),g(b)},this.createDirective=h,this.createDirectives=function(b){a.forEach(b,function(a,b){h(b)})},this.decorator=function(a){return a=a||d,e[a]},this.addMapping=function(a,b,c,d,f){e[a]&&(e[a][b]={template:c,builder:d,replace:!!f})},this.defineAddOn=function(a,b,c,d){e[a]&&(e[a][b]={template:c,builder:d,replace:!0})},this.$get=function(){return{decorator:function(a){return e[a]||e[d]},defaultDecorator:d}},g("sfDecorator")}]),a.module("schemaForm").provider("sfErrorMessage",function(){var b={default:"Field does not validate",0:"Invalid type, expected {{schema.type}}",1:"No enum match for: {{viewValue}}",10:'Data does not match any schemas from "anyOf"',11:'Data does not match any schemas from "oneOf"',12:'Data is valid against more than one schema from "oneOf"',13:'Data matches schema from "not"',100:"Value is not a multiple of {{schema.multipleOf}}",101:"{{viewValue}} is less than the allowed minimum of {{schema.minimum}}",102:"{{viewValue}} is equal to the exclusive minimum {{schema.minimum}}",103:"{{viewValue}} is greater than the allowed maximum of {{schema.maximum}}",104:"{{viewValue}} is equal to the exclusive maximum {{schema.maximum}}",105:"Value is not a valid number",200:"String is too short ({{viewValue.length}} chars), minimum {{schema.minLength}}",201:"String is too long ({{viewValue.length}} chars), maximum {{schema.maxLength}}",202:"String does not match pattern: {{schema.pattern}}",300:"Too few properties defined, minimum {{schema.minProperties}}",301:"Too many properties defined, maximum {{schema.maxProperties}}",302:"Required",303:"Additional properties not allowed",304:"Dependency failed - key must exist",400:"Array is too short ({{value.length}}), minimum {{schema.minItems}}",401:"Array is too long ({{value.length}}), maximum {{schema.maxItems}}",402:"Array items are not unique",403:"Additional items not allowed",500:"Format validation failed",501:'Keyword failed: "{{title}}"',600:"Circular $refs",1e3:"Unknown property (not in schema)"};b.number=b[105],b.required=b[302],b.min=b[101],b.max=b[103],b.maxlength=b[201],b.minlength=b[200],b.pattern=b[202],this.setDefaultMessages=function(a){b=a},this.getDefaultMessages=function(){return b},this.setDefaultMessage=function(a,c){b[a]=c},this.$get=["$interpolate",function(c){var d={};return d.defaultMessages=b,d.interpolate=function(d,e,f,g,h){h=h||{};var i=g.validationMessage||{};0===d.indexOf("tv4-")&&(d=d.substring(4));var j=i.default||h.default||"";[i,h,b].some(function(b){return a.isString(b)||a.isFunction(b)?(j=b,!0):b&&b[d]?(j=b[d],!0):void 0});var k={error:d,value:e,viewValue:f,form:g,schema:g.schema,title:g.title||g.schema&&g.schema.title};return a.isFunction(j)?j(k):c(j)(k)},d}]}),a.module("schemaForm").provider("schemaForm",["sfPathProvider",function(b){var c=function(a){if(Array.isArray(a)&&2==a.length){if("null"===a[0])return a[1];if("null"===a[1])return a[0]}return a},d=function(a){var b=[];return a.forEach(function(a){b.push({name:a,value:a})}),b},e=function(b,c){if(!a.isArray(b)){var d=[];return c?a.forEach(c,function(a,c){d.push({name:b[a],value:a})}):a.forEach(b,function(a,b){d.push({name:a,value:b})}),d}return b},f=function(b,d,e){var f=p[c(d.type)];if(f)for(var g,h=0;h<f.length;h++)if(g=f[h](b,d,e))return g.schema["x-schema-form"]&&a.isObject(g.schema["x-schema-form"])&&(g=a.extend(g,g.schema["x-schema-form"])),g},g=function(b,c,d){d=d||{};var f=d.global&&d.global.formDefaults?a.copy(d.global.formDefaults):{};return d.global&&!0===d.global.supressPropertyTitles?f.title=c.title:f.title=c.title||b,c.description&&(f.description=c.description),!0!==d.required&&!0!==c.required||(f.required=!0),c.maxLength&&(f.maxlength=c.maxLength),c.minLength&&(f.minlength=c.minLength),(c.readOnly||c.readonly)&&(f.readonly=!0),c.minimum&&(f.minimum=c.minimum+(c.exclusiveMinimum?1:0)),c.maximum&&(f.maximum=c.maximum-(c.exclusiveMaximum?1:0)),c.validationMessage&&(f.validationMessage=c.validationMessage),c.enumNames&&(f.titleMap=e(c.enumNames,c.enum)),f.schema=c,f.ngModelOptions=f.ngModelOptions||{},f},h=function(a,d,e){if("string"===c(d.type)&&!d.enum){var f=g(a,d,e);return f.key=e.path,f.type="text",e.lookup[b.stringify(e.path)]=f,f}},i=function(a,d,e){if("number"===c(d.type)){var f=g(a,d,e);return f.key=e.path,f.type="number",e.lookup[b.stringify(e.path)]=f,f}},j=function(a,d,e){if("integer"===c(d.type)){var f=g(a,d,e);return f.key=e.path,f.type="number",e.lookup[b.stringify(e.path)]=f,f}},k=function(a,d,e){if("boolean"===c(d.type)){var f=g(a,d,e);return f.key=e.path,f.type="checkbox",e.lookup[b.stringify(e.path)]=f,f}},l=function(a,e,f){if("string"===c(e.type)&&e.enum){var h=g(a,e,f);return h.key=f.path,h.type="select",h.titleMap||(h.titleMap=d(e.enum)),f.lookup[b.stringify(f.path)]=h,h}},m=function(a,e,f){if("array"===c(e.type)&&e.items&&e.items.enum){var h=g(a,e,f);return h.key=f.path,h.type="checkboxes",h.titleMap||(h.titleMap=d(e.items.enum)),f.lookup[b.stringify(f.path)]=h,h}},n=function(d,e,h){if("object"===c(e.type)){var i=g(d,e,h);return i.type="fieldset",i.items=[],h.lookup[b.stringify(h.path)]=i,a.forEach(e.properties,function(a,c){var d=h.path.slice();if(d.push(c),!0!==h.ignore[b.stringify(d)]){var g=e.required&&-1!==e.required.indexOf(c),j=f(c,a,{path:d,required:g||!1,lookup:h.lookup,ignore:h.ignore,global:h.global});j&&i.items.push(j)}}),i}},o=function(a,d,e){if("array"===c(d.type)){var h=g(a,d,e);h.type="array",h.key=e.path,e.lookup[b.stringify(e.path)]=h;var i=d.required&&-1!==d.required.indexOf(e.path[e.path.length-1]),j=e.path.slice();return j.push(""),h.items=[f(a,d.items,{path:j,required:i||!1,lookup:e.lookup,ignore:e.ignore,global:e.global})],h}},p={string:[l,h],object:[n],number:[i],integer:[j],boolean:[k],array:[m,o]},q=function(a){return a};this.defaults=p,this.stdFormObj=g,this.defaultFormDefinition=f,this.postProcess=function(a){q=a},this.appendRule=function(a,b){p[a]||(p[a]=[]),p[a].push(b)},this.prependRule=function(a,b){p[a]||(p[a]=[]),p[a].unshift(b)},this.createStandardForm=g,this.$get=function(){var d={};return d.merge=function(c,f,g,h,i,j){f=f||["*"],h=h||{},i=i||c.readonly||c.readOnly;var k=d.defaults(c,g,h),l=f.indexOf("*");-1!==l&&(f=f.slice(0,l).concat(k.form).concat(f.slice(l+1)));var m=k.lookup;return q(f.map(function(f){if("string"==typeof f&&(f={key:f}),f.key&&"string"==typeof f.key&&(f.key=b.parse(f.key)),f.titleMap&&(f.titleMap=e(f.titleMap)),f.itemForm){f.items=[];var k=b.stringify(f.key),l=m[k];a.forEach(l.items,function(b){var c=a.copy(f.itemForm);c.key=b.key,f.items.push(c)})}if(f.key){
  var n=b.stringify(f.key);if(m[n]){var o=m[n];a.forEach(o,function(a,b){void 0===f[b]&&(f[b]=o[b])})}}return!0===i&&(f.readonly=!0),f.items&&(f.items=d.merge(c,f.items,g,h,f.readonly,j)),f.tabs&&a.forEach(f.tabs,function(a){a.items=d.merge(c,a.items,g,h,f.readonly,j)}),"checkbox"===f.type&&a.isUndefined(f.schema.default)&&(f.schema.default=!1),j&&"template"===f.type&&!f.template&&f.templateUrl&&j.push(f),f}))},d.defaults=function(b,d,e){var g=[],h={};if(d=d||{},e=e||{},"object"!==c(b.type))throw new Error('Not implemented. Only type "object" allowed at root level of schema.');return a.forEach(b.properties,function(a,c){if(!0!==d[c]){var i=b.required&&-1!==b.required.indexOf(c),j=f(c,a,{path:[c],lookup:h,ignore:d,required:i,global:e});j&&g.push(j)}}),{form:g,lookup:h}},d.traverseSchema=function(b,c,d,e){e=!a.isDefined(e)||e,d=d||[];var f=function(b,c,d){if(c(b,d),a.forEach(b.properties,function(a,b){var e=d.slice();e.push(b),f(a,c,e)}),!e&&b.items){var g=d.slice();g.push(""),f(b.items,c,g)}};f(b,c,d||[])},d.traverseForm=function(b,c){c(b),a.forEach(b.items,function(a){d.traverseForm(a,c)}),b.tabs&&a.forEach(b.tabs,function(b){a.forEach(b.items,function(a){d.traverseForm(a,c)})})},d}}]),a.module("schemaForm").factory("sfSelect",["sfPath",function(a){var b=/^\d+$/;return function(c,d,e){d||(d=this);var f="string"==typeof c?a.parse(c):c;if(void 0!==e&&1===f.length)return d[f[0]]=e,d;void 0!==e&&void 0===d[f[0]]&&(d[f[0]]=f.length>2&&b.test(f[1])?[]:{});for(var g=d[f[0]],h=1;h<f.length;h++){if(""===f[h])return;if(void 0!==e){if(h===f.length-1)return g[f[h]]=e,e;var i=g[f[h]];void 0!==i&&null!==i||(i=b.test(f[h+1])?[]:{},g[f[h]]=i),g=i}else g&&(g=g[f[h]])}return g}}]),a.module("schemaForm").factory("sfValidator",[function(){var b={};return b.validate=function(b,d){if(!b)return{valid:!0};var e=b.schema;if(!e)return{valid:!0};""===d&&(d=void 0),"number"===b.type&&null===d&&(d=void 0);var f={type:"object",properties:{}},g=b.key[b.key.length-1];f.properties[g]=e,b.required&&(f.required=[g]);var h={};return a.isDefined(d)&&(h[g]=d),c.validateResult(h,f)},b}]),a.module("schemaForm").directive("sfArray",["sfSelect","schemaForm","sfValidator","sfPath",function(b,c,d,e){var f=function(a){return function(b){b.key&&(b.key[b.key.indexOf("")]=a)}};return{restrict:"A",scope:!0,require:"?ngModel",link:function(g,h,i,j){var k={};g.validateArray=a.noop,j&&g.$emit("schemaFormPropagateNgModelController",j);var l=g.$watch(i.sfArray,function(h){if(h){var i=function(){g.form&&g.form.onChange&&(a.isFunction(g.form.onChange)?g.form.onChange(g.modelArray,g.form,g.model):g.evalExpr(g.form.onChange,{modelValue:g.modelArray,form:g.form,model:g.model}))},m=b(h.key,g.model),n=e.normalize(h.key);if(g.$watch("model"+("["!==n[0]?".":"")+n,function(a){m=g.modelArray=a}),a.isUndefined(m)&&(m=[],b(h.key,g.model,m)),g.modelArray=m,h.items){var o=h.items[0];h.items.length>1&&(o={type:"section",items:h.items.map(function(b){return b.ngModelOptions=h.ngModelOptions,a.isUndefined(b.readonly)&&(b.readonly=h.readonly),b})})}if(g.copyWithIndex=function(b){if(!k[b]&&o){var d=a.copy(o);d.arrayIndex=b,c.traverseForm(d,f(b)),k[b]=d}return k[b]},g.appendToArray=function(){var d=m.length,e=g.copyWithIndex(d);if(c.traverseForm(e,function(c){if(c.key){var d;a.isDefined(c.default)&&(d=c.default),a.isDefined(c.schema)&&a.isDefined(c.schema.default)&&(d=c.schema.default),a.isDefined(d)&&b(c.key,g.model,d)}}),d===m.length){var f,j=b("schema.items.type",h);"object"===j?f={}:"array"===j&&(f=[]),m.push(f)}return g.validateArray(),i(),m},g.deleteFromArray=function(a){return m.splice(a,1),g.validateArray(),j&&j.$setDirty&&j.$setDirty(),i(),m},h.titleMap||!0===h.startEmpty||0!==m.length||g.appendToArray(),h.titleMap&&h.titleMap.length>0){g.titleMapValues=[];var p=function(a){g.titleMapValues=[],a=a||[],h.titleMap.forEach(function(b){g.titleMapValues.push(-1!==a.indexOf(b.value))})};p(g.modelArray),g.$watchCollection("modelArray",p),g.$watchCollection("titleMapValues",function(a,b){if(a&&a!==b){for(var c=g.modelArray;c.length>0;)c.pop();h.titleMap.forEach(function(b,d){a[d]&&c.push(b.value)}),g.validateArray()}})}if(j){var q;g.validateArray=function(){var a=d.validate(h,g.modelArray.length>0?g.modelArray:void 0);Object.keys(j.$error).filter(function(a){return 0===a.indexOf("tv4-")}).forEach(function(a){j.$setValidity(a,!0)}),!1!==a.valid||!a.error||""!==a.error.dataPath&&a.error.dataPath!=="/"+h.key[h.key.length-1]||(j.$setViewValue(g.modelArray),q=a.error,j.$setValidity("tv4-"+a.error.code,!1))},g.$on("schemaFormValidate",g.validateArray),g.hasSuccess=function(){return g.options&&g.options.pristine&&!1===g.options.pristine.success?j.$valid&&!j.$pristine&&!j.$isEmpty(j.$modelValue):j.$valid&&(!j.$pristine||!j.$isEmpty(j.$modelValue))},g.hasError=function(){return g.options&&g.options.pristine&&!1===g.options.pristine.errors?j.$invalid&&!j.$pristine:j.$invalid},g.schemaError=function(){return q}}l()}})}}}]),a.module("schemaForm").directive("sfChanged",function(){return{require:"ngModel",restrict:"AC",scope:!1,link:function(b,c,d,e){var f=b.$eval(d.sfChanged);f&&f.onChange&&e.$viewChangeListeners.push(function(){a.isFunction(f.onChange)?f.onChange(e.$modelValue,f,b.model,b):b.evalExpr(f.onChange,{modelValue:e.$modelValue,form:f,model:b.model,scope:b})})}}}),a.module("schemaForm").directive("sfField",["$parse","$compile","$http","$templateCache","$interpolate","$q","sfErrorMessage","sfPath","sfSelect",function(b,c,d,e,f,g,h,i,j){return{restrict:"AE",replace:!1,transclude:!1,scope:!0,require:"^sfSchema",link:{pre:function(a,b,c,d){a.$on("schemaFormPropagateNgModelController",function(b,c){b.stopPropagation(),b.preventDefault(),a.ngModel=c}),a.form=d.lookup["f"+c.sfField]},post:function(b,c,d,e){b.showTitle=function(){return b.form&&!0!==b.form.notitle&&b.form.title},b.listToCheckboxValues=function(b){var c={};return a.forEach(b,function(a){c[a]=!0}),c},b.checkboxValuesToList=function(b){var c=[];return a.forEach(b,function(a,b){a&&c.push(b)}),c},b.buttonClick=function(c,d){a.isFunction(d.onClick)?d.onClick(c,d):a.isString(d.onClick)&&(e?e.evalInParentScope(d.onClick,{$event:c,form:d}):b.$eval(d.onClick,{$event:c,form:d}))},b.evalExpr=function(a,c){return e?e.evalInParentScope(a,c):b.$eval(a,c)},b.evalInScope=function(a,c){if(a)return b.$eval(a,c)},b.interp=function(a,b){return a&&f(a)(b)},b.hasSuccess=function(){return!!b.ngModel&&(b.options&&b.options.pristine&&!1===b.options.pristine.success?b.ngModel.$valid&&!b.ngModel.$pristine&&!b.ngModel.$isEmpty(b.ngModel.$modelValue):b.ngModel.$valid&&(!b.ngModel.$pristine||!b.ngModel.$isEmpty(b.ngModel.$modelValue)))},b.hasError=function(){return!!b.ngModel&&(b.options&&b.options.pristine&&!1===b.options.pristine.errors?b.ngModel.$invalid&&!b.ngModel.$pristine:b.ngModel.$invalid)},b.errorMessage=function(a){return h.interpolate(a&&a.code+""||"default",b.ngModel&&b.ngModel.$modelValue||"",b.ngModel&&b.ngModel.$viewValue||"",b.form,b.options&&b.options.validationMessage)};var g=b.form;g.key&&(b.$on("schemaForm.error."+g.key.join("."),function(a,c,d,e){!0!==d&&!1!==d||(e=d,d=void 0),b.ngModel&&c&&(b.ngModel.$setDirty?b.ngModel.$setDirty():(b.ngModel.$dirty=!0,b.ngModel.$pristine=!1),d&&(g.validationMessage||(g.validationMessage={}),g.validationMessage[c]=d),b.ngModel.$setValidity(c,!0===e),!0===e&&(b.ngModel.$validate(),b.$broadcast("schemaFormValidate")))}),b.$on("$destroy",function(){if(!b.externalDestructionInProgress){var a=g.destroyStrategy||b.options&&b.options.destroyStrategy||"remove";if(g.key&&"retain"!==a){var c=b.model;if(g.key.length>1&&(c=j(g.key.slice(0,g.key.length-1),c)),void 0===c)return;var d=g.schema&&g.schema.type||"";"empty"===a&&-1!==d.indexOf("string")?c[g.key.slice(-1)]="":"empty"===a&&-1!==d.indexOf("object")?c[g.key.slice(-1)]={}:"empty"===a&&-1!==d.indexOf("array")?c[g.key.slice(-1)]=[]:"null"===a?c[g.key.slice(-1)]=null:delete c[g.key.slice(-1)]}}}))}}}}]),a.module("schemaForm").directive("sfMessage",["$injector","sfErrorMessage",function(b,c){var d=b.has("$sanitize")?b.get("$sanitize"):function(a){return a};return{scope:!1,restrict:"EA",link:function(b,e,f){var g="";f.sfMessage&&b.$watch(f.sfMessage,function(a){a&&(g=d(a),j(!!b.ngModel))});var h,i=function(a){a!==h&&(e.html(a),h=a)},j=function(d){if(d)if(b.hasError()){var e=[];a.forEach(b.ngModel&&b.ngModel.$error,function(a,b){a&&e.push(b)}),e=e.filter(function(a){return"schemaForm"!==a});var f=e[0];i(f?c.interpolate(f,b.ngModel.$modelValue,b.ngModel.$viewValue,b.form,b.options&&b.options.validationMessage):g)}else i(g);else i(g)};j();var k=b.$watch("ngModel",function(a){a&&(a.$parsers.push(function(a){return j(!0),a}),a.$formatters.push(function(a){return j(!0),a}),k())});b.$watchCollection("ngModel.$error",function(){j(!!b.ngModel)})}}}]),a.module("schemaForm").directive("sfNewArray",["sfSelect","sfPath","schemaForm",function(b,c,d){return{scope:!1,link:function(e,f,g){e.min=0,e.modelArray=e.$eval(g.sfNewArray);var h=function(){e.modelArray=e.$eval(g.sfNewArray),e.ngModel&&e.ngModel.$pristine&&e.firstDigest&&(!e.options||!0!==e.options.validateOnRender)||e.validateField&&e.validateField()},i=function(){e.form&&e.form.onChange&&(a.isFunction(e.form.onChange)?e.form.onChange(e.modelArray,e.form):e.evalExpr(e.form.onChange,{modelValue:e.modelArray,form:e.form}))},j=function(){var a=e.modelArray;if(!a){var d=c.parse(g.sfNewArray);a=[],b(d,e,a),e.modelArray=a}return a},k=e.$watch("form",function(a){if(a){if(a.titleMap||!0===a.startEmpty||e.modelArray&&0!==e.modelArray.length||e.appendToArray(),e.form&&e.form.schema&&!0===e.form.schema.uniqueItems?(e.$watch(g.sfNewArray,h,!0),e.$watch([g.sfNewArray,g.sfNewArray+".length"],i)):e.$watchGroup?e.$watchGroup([g.sfNewArray,g.sfNewArray+".length"],function(){h(),i()}):(e.$watch(g.sfNewArray,function(){h(),i()}),e.$watch(g.sfNewArray+".length",function(){h(),i()})),a.titleMap&&a.titleMap.length>0){e.titleMapValues=[];var b=function(b){e.titleMapValues=[],b=b||[],a.titleMap.forEach(function(a){e.titleMapValues.push(-1!==b.indexOf(a.value))})};b(e.modelArray),e.$watchCollection("modelArray",b),e.$watchCollection("titleMapValues",function(b,c){if(b&&b!==c){for(var d=j();d.length>0;)d.pop();a.titleMap.forEach(function(a,c){b[c]&&d.push(a.value)}),e.validateField&&e.validateField()}})}k()}});e.appendToArray=function(){var c,f=j();if(e.form&&e.form.schema&&e.form.schema.items){var g=e.form.schema.items;g.type&&-1!==g.type.indexOf("object")?(c={},e.options&&!1===e.options.setSchemaDefaults||(c=a.isDefined(g.default)?g.default:c)&&d.traverseSchema(g,function(d,e){a.isDefined(d.default)&&b(e,c,d.default)})):g.type&&-1!==g.type.indexOf("array")?(c=[],e.options&&!1===e.options.setSchemaDefaults||(c=g.default||c)):e.options&&!1===e.options.setSchemaDefaults||(c=g.default||c)}return f.push(c),f},e.deleteFromArray=function(a){var b=e.modelArray;return b&&b.splice(a,1),b};var l=function(a){return function(b){b.key&&(b.key[b.key.indexOf("")]=a)}},m={};e.copyWithIndex=function(b){var c=e.form;if(!m[b]){var f=c.items[0];if(c.items.length>1&&(f={type:"section",items:c.items.map(function(b){return b.ngModelOptions=c.ngModelOptions,a.isUndefined(b.readonly)&&(b.readonly=c.readonly),b})}),f){var g=a.copy(f);g.arrayIndex=b,d.traverseForm(g,l(b)),m[b]=g}}return m[b]}}}}]),a.module("schemaForm").directive("sfSchema",["$compile","$http","$templateCache","$q","schemaForm","schemaFormDecorators","sfSelect","sfPath","sfBuilder",function(b,c,d,e,f,g,h,i,j){return{scope:{schema:"=sfSchema",initialForm:"=sfForm",model:"=sfModel",options:"=sfOptions"},controller:["$scope",function(a){this.evalInParentScope=function(b,c){return a.$parent.$eval(b,c)};var b=this;a.lookup=function(a){return a&&(b.lookup=a),b.lookup}}],replace:!1,restrict:"A",transclude:!0,require:"?form",link:function(i,k,l,m,n){i.formCtrl=m;var o={};n(i,function(a){if(a.addClass("schema-form-ignore"),k.prepend(a),k[0].querySelectorAll){var b=k[0].querySelectorAll("[ng-model]");if(b)for(var c=0;c<b.length;c++){var d=b[c].getAttribute("ng-model");o[d.substring(d.indexOf(".")+1)]=!0}}});var p,q={},r=function(a,b){var g=[],h=f.merge(a,b,o,i.options,void 0,g);g.length>0?e.all(g.map(function(a){return c.get(a.templateUrl,{cache:d}).then(function(b){a.template=b.data})})).then(function(){s(a,b,h)}):s(a,b,h)},s=function(c,d,e){p&&(i.externalDestructionInProgress=!0,p.$destroy(),i.externalDestructionInProgress=!1),p=i.$new(),p.schemaForm={form:e,schema:c},k.children(":not(.schema-form-ignore)").remove();for(var m={},n=k[0].querySelectorAll("*[sf-insert-field]"),o=0;o<n.length;o++)m[n[o].getAttribute("sf-insert-field")]=n[o];var q=g.decorator(l.sfUseDecorator),r=Object.create(null);i.lookup(r),k[0].appendChild(j.build(e,q,m,r)),p.firstDigest=!0,setTimeout(function(){p.firstDigest=!1},0),b(k.children())(p),i.options&&!1===i.options.setSchemaDefaults||f.traverseSchema(c,function(b,c){if(a.isDefined(b.default)){var d=h(c,i.model);a.isUndefined(d)&&h(c,i.model,b.default)}}),i.$emit("sf-render-finished",k)},t=["*"];i.$watch(function(){var a=i.schema,b=i.initialForm||t;b&&a&&a.type&&(q.form!==b||q.schema!==a)&&Object.keys(a.properties).length>0&&(q.schema=a,q.form=b,r(a,b))}),i.$on("schemaFormRedraw",function(){var b=i.schema,c=i.initialForm?a.copy(i.initialForm):["*"];b&&r(b,c)}),i.$on("$destroy",function(){i.externalDestructionInProgress=!0}),i.evalExpr=function(a,b){return i.$parent.$eval(a,b)}}}}]),a.module("schemaForm").directive("schemaValidate",["sfValidator","$parse","sfSelect",function(b,c,d){return{restrict:"A",scope:!1,priority:500,require:"ngModel",link:function(c,e,f,g){c.$emit("schemaFormPropagateNgModelController",g);var h=null,i=c.$eval(f.schemaValidate);if(void 0!==c.form&&c.form.schema&&"boolean"===c.form.schema.type){var j=c.$eval(f.ngModel),k=!0===j||"true"===j||"1"===j||"yes"===j;c.ngModel.$setViewValue(k),c.ngModel.$render()}i.copyValueTo&&g.$viewChangeListeners.push(function(){var b=i.copyValueTo;a.forEach(b,function(a){d(a,c.model,g.$modelValue)})}),i.onFieldLoad&&(a.isFunction(i.onFieldLoad)?i.onFieldLoad(g.$modelValue,i,c.model):c.evalExpr(i.onFieldLoad,{modelValue:g.$modelValue,form:i,model:c.model}));var l=function(a){if(!i)return a;if(c.options&&!1===c.options.tv4Validation)return a;var d=b.validate(i,a);Object.keys(g.$error).filter(function(a){return 0===a.indexOf("tv4-")}).forEach(function(a){g.$setValidity(a,!0)});{if(d.valid||g.$pristine)return a;if(g.$setValidity("tv4-"+d.error.code,!1),h=d.error,g.$validators)return a}};"function"==typeof i.ngModel&&i.ngModel(g),["$parsers","$viewChangeListeners","$formatters"].forEach(function(b){i[b]&&g[b]&&a.forEach(i[b],function(a,d){g[b][d]=function(b,d){return a(b,d,c.model,i)}})}),["$validators","$asyncValidators"].forEach(function(b){i[b]&&g[b]&&a.forEach(i[b],function(a,d){g[b][d]=function(b,d){return a(b,d,c.model,i)}})}),g.$parsers.push(l),g.$validators&&(g.$validators.schemaForm=function(){return!Object.keys(g.$error).some(function(a){return"schemaForm"!==a})});var m=i.schema;c.validateField=function(a){void 0!=a&&g.$$parentForm.$name!==a||(m&&-1!==m.type.indexOf("array")&&l(g.$modelValue),g.$setDirty?(g.$setDirty(),g.$setViewValue(g.$viewValue),g.$commitViewValue(),i.required&&g.$isEmpty(g.$modelValue)&&g.$setValidity("tv4-302",!1)):g.$setViewValue(g.$viewValue))},g.$formatters.push(function(a){return!g.$pristine||!c.firstDigest||c.options&&!0===c.options.validateOnRender?(l(g.$modelValue),a):a}),c.$on("schemaFormValidate",function(a,b){c.validateField(b)}),c.schemaError=function(){return h}}}}]),e}),function(a,b){"function"==typeof define&&define.amd?define(["schemaForm"],b):"object"==typeof exports?module.exports=b(require("schemaForm")):a.bootstrapDecorator=b(a.schemaForm)}(this,function(a){return angular.module("schemaForm").run(["$templateCache",function(a){a.put("directives/decorators/bootstrap/actions-trcl.html",'<div class="btn-group schema-form-actions {{form.htmlClass}}" ng-transclude=""></div>'),a.put("directives/decorators/bootstrap/actions.html",'<div class="btn-group schema-form-actions {{form.htmlClass}}"><input ng-repeat-start="item in form.items" type="submit" class="btn {{ item.style || \'btn-default\' }} {{form.fieldHtmlClass}}" value="{{item.title}}" ng-if="item.type === \'submit\'"> <button ng-repeat-end="" class="btn {{ item.style || \'btn-default\' }} {{form.fieldHtmlClass}}" type="button" ng-disabled="form.readonly" ng-if="item.type !== \'submit\'" ng-click="buttonClick($event,item)"><span ng-if="item.icon" class="{{item.icon}}"></span>{{item.title}}</button></div>'),a.put("directives/decorators/bootstrap/array.html",'<div sf-array="form" class="schema-form-array {{form.htmlClass}}" ng-model="$$value$$" ng-model-options="form.ngModelOptions"><label class="control-label" ng-show="showTitle()">{{ form.title }}</label><ol class="list-group" ng-model="modelArray" ui-sortable=""><li class="list-group-item {{form.fieldHtmlClass}}" ng-repeat="item in modelArray track by $index"><button ng-hide="form.readonly || form.remove === null" ng-click="deleteFromArray($index)" style="position: relative; z-index: 20;" type="button" class="close pull-right"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button><sf-decorator ng-init="arrayIndex = $index" form="copyWithIndex($index)"></sf-decorator></li></ol><div class="clearfix" style="padding: 15px;"><button ng-hide="form.readonly || form.add === null" ng-click="appendToArray()" type="button" class="btn {{ form.style.add || \'btn-default\' }} pull-right"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</button></div><div class="help-block" ng-show="(hasError() && errorMessage(schemaError())) || form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div></div>'),a.put("directives/decorators/bootstrap/checkbox.html",'<div class="checkbox schema-form-checkbox {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><label class="{{form.labelHtmlClass}}"><input type="checkbox" sf-changed="form" ng-disabled="form.readonly" ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" class="{{form.fieldHtmlClass}}" name="{{form.key.slice(-1)[0]}}"> <span ng-bind-html="form.title"></span></label><div class="help-block" sf-message="form.description"></div></div>'),a.put("directives/decorators/bootstrap/checkboxes.html",'<div sf-array="form" ng-model="$$value$$" class="form-group schema-form-checkboxes {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label><div class="checkbox" ng-repeat="val in titleMapValues track by $index"><label><input type="checkbox" ng-disabled="form.readonly" sf-changed="form" class="{{form.fieldHtmlClass}}" ng-model="titleMapValues[$index]" name="{{form.key.slice(-1)[0]}}"> <span ng-bind-html="form.titleMap[$index].name"></span></label></div><div class="help-block" sf-message="form.description"></div></div>'),a.put("directives/decorators/bootstrap/default.html",'<div class="form-group schema-form-{{form.type}} {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess(), \'has-feedback\': form.feedback !== false }"><label class="control-label {{form.labelHtmlClass}}" ng-class="{\'sr-only\': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label> <input ng-if="!form.fieldAddonLeft && !form.fieldAddonRight" ng-show="form.key" type="{{form.type}}" step="{{form.step || \'any\'}}" sf-changed="form" placeholder="{{form.placeholder}}" class="form-control {{form.fieldHtmlClass}}" id="{{form.key.slice(-1)[0]}}" ng-model-options="form.ngModelOptions" ng-model="$$value$$" ng-disabled="form.readonly" schema-validate="form" name="{{form.key.slice(-1)[0]}}" aria-describedby="{{form.key.slice(-1)[0] + \'Status\'}}"><div ng-if="form.fieldAddonLeft || form.fieldAddonRight" ng-class="{\'input-group\': (form.fieldAddonLeft || form.fieldAddonRight)}"><span ng-if="form.fieldAddonLeft" class="input-group-addon" ng-bind-html="form.fieldAddonLeft"></span> <input ng-show="form.key" type="{{form.type}}" step="{{form.step}}" sf-changed="form" placeholder="{{form.placeholder}}" class="form-control {{form.fieldHtmlClass}}" id="{{form.key.slice(-1)[0]}}" ng-model-options="form.ngModelOptions" ng-model="$$value$$" ng-disabled="form.readonly" schema-validate="form" name="{{form.key.slice(-1)[0]}}" aria-describedby="{{form.key.slice(-1)[0] + \'Status\'}}"> <span ng-if="form.fieldAddonRight" class="input-group-addon" ng-bind-html="form.fieldAddonRight"></span></div><span ng-if="form.feedback !== false" class="form-control-feedback" ng-class="evalInScope(form.feedback) || {\'glyphicon\': true, \'glyphicon-ok\': hasSuccess(), \'glyphicon-remove\': hasError() }" aria-hidden="true"></span> <span ng-if="hasError() || hasSuccess()" id="{{form.key.slice(-1)[0] + \'Status\'}}" class="sr-only">{{ hasSuccess() ? \'(success)\' : \'(error)\' }}</span><div class="help-block" sf-message="form.description"></div></div>'),a.put("directives/decorators/bootstrap/fieldset-trcl.html",'<fieldset ng-disabled="form.readonly" class="schema-form-fieldset {{form.htmlClass}}"><legend ng-class="{\'sr-only\': !showTitle() }">{{ form.title }}</legend><div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div><div ng-transclude=""></div></fieldset>'),a.put("directives/decorators/bootstrap/fieldset.html",'<fieldset ng-disabled="form.readonly" class="schema-form-fieldset {{form.htmlClass}}"><legend ng-class="{\'sr-only\': !showTitle() }">{{ form.title }}</legend><div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div><sf-decorator ng-repeat="item in form.items" form="item"></sf-decorator></fieldset>'),a.put("directives/decorators/bootstrap/help.html",'<div class="helpvalue schema-form-helpvalue {{form.htmlClass}}" ng-bind-html="form.helpvalue"></div>'),a.put("directives/decorators/bootstrap/radio-buttons.html",'<div class="form-group schema-form-radiobuttons {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><div><label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label></div><div class="btn-group"><label class="btn {{ (item.value === $$value$$) ? form.style.selected || \'btn-default\' : form.style.unselected || \'btn-default\'; }}" ng-class="{ active: item.value === $$value$$ }" ng-repeat="item in form.titleMap"><input type="radio" class="{{form.fieldHtmlClass}}" sf-changed="form" style="display: none;" ng-disabled="form.readonly" ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" ng-value="item.value" name="{{form.key.join(\'.\')}}"> <span ng-bind-html="item.name"></span></label></div><div class="help-block" sf-message="form.description"></div></div>'),a.put("directives/decorators/bootstrap/radios-inline.html",'<div class="form-group schema-form-radios-inline {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><label ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label><div><label class="radio-inline" ng-repeat="item in form.titleMap"><input type="radio" class="{{form.fieldHtmlClass}}" sf-changed="form" ng-disabled="form.readonly" ng-model="$$value$$" ng-value="item.value" name="{{form.key.join(\'.\')}}"> <span ng-bind-html="item.name"></span></label></div><div class="help-block" sf-message="form.description"></div></div>'),a.put("directives/decorators/bootstrap/radios.html",'<div class="form-group schema-form-radios {{form.htmlClass}}" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><label ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label><div class="radio" ng-repeat="item in form.titleMap"><label><input type="radio" class="{{form.fieldHtmlClass}}" sf-changed="form" ng-disabled="form.readonly" ng-model="$$value$$" ng-value="item.value" name="{{form.key.join(\'.\')}}"> <span ng-bind-html="item.name"></span></label></div><div class="help-block" sf-message="form.description"></div></div>'),a.put("directives/decorators/bootstrap/section.html",'<div class="schema-form-section {{form.htmlClass}}"><sf-decorator ng-repeat="item in form.items" form="item"></sf-decorator></div>'),a.put("directives/decorators/bootstrap/select.html",'<div class="form-group {{form.htmlClass}} schema-form-select" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess(), \'has-feedback\': form.feedback !== false}"><label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label><select ng-model="$$value$$" ng-model-options="form.ngModelOptions" ng-disabled="form.readonly" sf-changed="form" class="form-control {{form.fieldHtmlClass}}" schema-validate="form" ng-options="item.value as item.name group by item.group for item in form.titleMap" name="{{form.key.slice(-1)[0]}}"></select><div class="help-block" sf-message="form.description"></div></div>'),a.put("directives/decorators/bootstrap/submit.html",'<div class="form-group schema-form-submit {{form.htmlClass}}"><input type="submit" class="btn {{ form.style || \'btn-primary\' }} {{form.fieldHtmlClass}}" value="{{form.title}}" ng-disabled="form.readonly" ng-if="form.type === \'submit\'"> <button class="btn {{ form.style || \'btn-default\' }}" type="button" ng-click="buttonClick($event,form)" ng-disabled="form.readonly" ng-if="form.type !== \'submit\'"><span ng-if="form.icon" class="{{form.icon}}"></span> {{form.title}}</button></div>'),a.put("directives/decorators/bootstrap/tabarray.html",'<div sf-array="form" ng-init="selected = { tab: 0 }" class="clearfix schema-form-tabarray schema-form-tabarray-{{form.tabType || \'left\'}} {{form.htmlClass}}"><div ng-if="!form.tabType || form.tabType !== \'right\'" ng-class="{\'col-xs-3\': !form.tabType || form.tabType === \'left\'}"><ul class="nav nav-tabs" ng-class="{ \'tabs-left\': !form.tabType || form.tabType === \'left\'}"><li ng-repeat="item in modelArray track by $index" ng-click="$event.preventDefault() || (selected.tab = $index)" ng-class="{active: selected.tab === $index}"><a href="#">{{interp(form.title,{\'$index\':$index, value: item}) || $index}}</a></li><li ng-hide="form.readonly" ng-click="$event.preventDefault() || (selected.tab = appendToArray().length - 1)"><a href="#"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</a></li></ul></div><div ng-class="{\'col-xs-9\': !form.tabType || form.tabType === \'left\' || form.tabType === \'right\'}"><div class="tab-content {{form.fieldHtmlClass}}"><div class="tab-pane clearfix" ng-repeat="item in modelArray track by $index" ng-show="selected.tab === $index" ng-class="{active: selected.tab === $index}"><sf-decorator ng-init="arrayIndex = $index" form="copyWithIndex($index)"></sf-decorator><button ng-hide="form.readonly" ng-click="selected.tab = deleteFromArray($index).length - 1" type="button" class="btn {{ form.style.remove || \'btn-default\' }} pull-right"><i class="glyphicon glyphicon-trash"></i> {{ form.remove || \'Remove\'}}</button></div></div></div><div ng-if="form.tabType === \'right\'" class="col-xs-3"><ul class="nav nav-tabs tabs-right"><li ng-repeat="item in modelArray track by $index" ng-click="$event.preventDefault() || (selected.tab = $index)" ng-class="{active: selected.tab === $index}"><a href="#">{{interp(form.title,{\'$index\':$index, value: item}) || $index}}</a></li><li ng-hide="form.readonly" ng-click="$event.preventDefault() || appendToArray()"><a href="#"><i class="glyphicon glyphicon-plus"></i> {{ form.add || \'Add\'}}</a></li></ul></div></div>'),a.put("directives/decorators/bootstrap/tabs.html",'<div ng-init="selected = { tab: form.selectedTabIndex }" class="schema-form-tabs {{form.htmlClass}}"><ul class="nav nav-tabs"><li ng-repeat="tab in form.tabs" ng-disabled="form.readonly" ng-show="tab.hidden !== true" ng-click="$event.preventDefault() || (selected.tab = $index)" ng-class="{active: selected.tab === $index}"><a href="#">{{ tab.title }}</a></li></ul><div class="tab-content {{form.fieldHtmlClass}}"><div class="tab-pane" ng-disabled="form.readonly" ng-repeat="tab in form.tabs" ng-show="selected.tab === $index" ng-class="{active: selected.tab === $index}"><bootstrap-decorator ng-repeat="item in tab.items" form="item"></bootstrap-decorator></div></div></div>'),a.put("directives/decorators/bootstrap/textarea.html",'<div class="form-group has-feedback {{form.htmlClass}} schema-form-textarea" ng-class="{\'has-error\': form.disableErrorState !== true && hasError(), \'has-success\': form.disableSuccessState !== true && hasSuccess()}"><label class="{{form.labelHtmlClass}}" ng-class="{\'sr-only\': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label> <textarea ng-if="!form.fieldAddonLeft && !form.fieldAddonRight" class="form-control {{form.fieldHtmlClass}}" id="{{form.key.slice(-1)[0]}}" sf-changed="form" placeholder="{{form.placeholder}}" ng-disabled="form.readonly" ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" name="{{form.key.slice(-1)[0]}}"></textarea><div ng-if="form.fieldAddonLeft || form.fieldAddonRight" ng-class="{\'input-group\': (form.fieldAddonLeft || form.fieldAddonRight)}"><span ng-if="form.fieldAddonLeft" class="input-group-addon" ng-bind-html="form.fieldAddonLeft"></span> <textarea class="form-control {{form.fieldHtmlClass}}" id="{{form.key.slice(-1)[0]}}" sf-changed="form" placeholder="{{form.placeholder}}" ng-disabled="form.readonly" ng-model="$$value$$" ng-model-options="form.ngModelOptions" schema-validate="form" name="{{form.key.slice(-1)[0]}}"></textarea> <span ng-if="form.fieldAddonRight" class="input-group-addon" ng-bind-html="form.fieldAddonRight"></span></div><span class="help-block" sf-message="form.description"></span></div>')}]),angular.module("schemaForm").config(["schemaFormDecoratorsProvider",function(a){var b="directives/decorators/bootstrap/";a.defineDecorator("bootstrapDecorator",{textarea:{template:b+"textarea.html",replace:!1},fieldset:{template:b+"fieldset.html",replace:!1},array:{template:b+"array.html",replace:!1},tabarray:{template:b+"tabarray.html",replace:!1},tabs:{template:b+"tabs.html",replace:!1},section:{template:b+"section.html",replace:!1},conditional:{template:b+"section.html",replace:!1},actions:{template:b+"actions.html",replace:!1},select:{template:b+"select.html",replace:!1},checkbox:{template:b+"checkbox.html",replace:!1},checkboxes:{template:b+"checkboxes.html",replace:!1},number:{template:b+"default.html",replace:!1},password:{template:b+"default.html",replace:!1},submit:{template:b+"submit.html",replace:!1},button:{template:b+"submit.html",replace:!1},radios:{template:b+"radios.html",replace:!1},"radios-inline":{template:b+"radios-inline.html",replace:!1},radiobuttons:{template:b+"radio-buttons.html",replace:!1},help:{template:b+"help.html",replace:!1},default:{template:b+"default.html",replace:!1}},[]),a.createDirectives({textarea:b+"textarea.html",select:b+"select.html",checkbox:b+"checkbox.html",checkboxes:b+"checkboxes.html",number:b+"default.html",submit:b+"submit.html",button:b+"submit.html",text:b+"default.html",date:b+"default.html",password:b+"default.html",datepicker:b+"datepicker.html",input:b+"default.html",
  radios:b+"radios.html","radios-inline":b+"radios-inline.html",radiobuttons:b+"radio-buttons.html"})}]).directive("sfFieldset",function(){return{transclude:!0,scope:!0,templateUrl:"directives/decorators/bootstrap/fieldset-trcl.html",link:function(a,b,c){a.title=a.$eval(c.title)}}}),a}),angular.module("schemaForm").run(["$templateCache",function(a){a.put("directives/decorators/bootstrap/colorpicker/colorpicker.html",'<div class="form-group {{form.htmlClass}}" ng-class="{\'has-error\': hasError()}">\n  <label class="control-label" ng-show="showTitle()">{{form.title}}</label>\n  <div ng-init="defaultSpectrumOptions = {\n                  showInput: true,\n                  showAlpha: true,\n                  allowEmpty: true,\n                  showPalette: true,\n                  preferredFormat: form.colorFormat || \'rgb\',\n                  palette: [[\'#fce94f\', \'#fcaf3e\', \'#e9b96e\'],\n                  [\'#8ae234\', \'#729fcf\', \'#ad7fa8\'],\n                  [\'#ef2929\', \'#888a85\', \'#deface\']]\n                }">\n    <spectrum-colorpicker\n      ng-model="$$value$$"\n      format="form.colorFormat || \'rgb\'"\n      style="background-color: white"\n      type="color"\n      schema-validate="form"\n      options="form.spectrumOptions || defaultSpectrumOptions" sf-changed="form"></spectrum-colorpicker>\n</div>\n  <span class="help-block" >{{ (hasError() && errorMessage(schemaError())) || form.description}}</span>\n</div>\n')}]),angular.module("schemaForm").config(["schemaFormProvider","schemaFormDecoratorsProvider","sfPathProvider",function(a,b,c){var d=function(b,d,e){if(("string"===d.type||"array"===d.type)&&"color"==d.format){var f=a.stdFormObj(b,d,e);return f.key=e.path,f.type="colorpicker",e.lookup[c.stringify(e.path)]=f,f}};a.defaults.string.unshift(d),b.addMapping("bootstrapDecorator","colorpicker","directives/decorators/bootstrap/colorpicker/colorpicker.html"),b.createDirective("colorpicker","directives/decorators/bootstrap/colorpicker/colorpicker.html")}]),angular.module("schemaForm").run(["$templateCache",function(a){a.put("directives/decorators/bootstrap/uiselect/multi.html",'<div class="form-group" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}" ng-init="form.select_models=(form.schema.items| whereMulti : \'value\' : ($$value$$||[]))"><label class="control-label" ng-show="showTitle()">{{form.title}}</label><div class="form-group" ng-controller="UiSelectController"><ui-select multiple="" sortable-options="{{form.sortableOptions}}" ng-if="!(form.options.tagging||false)" ng-model="form.select_models" theme="bootstrap" on-select="$$value$$.push($item.value)" on-remove="$$value$$.splice($$value$$.indexOf($item.value), 1)" class="{{form.options.uiClass}}"><ui-select-match placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}">{{$item.label}}</ui-select-match><ui-select-choices refresh="fetchResult(form.schema, form.options, $select.search)" refresh-delay="form.options.refreshDelay" group-by="form.options.groupBy" repeat="item in form.schema.items | propsFilter: {label: $select.search, description: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\') }"><div ng-bind-html="item.label | highlight: $select.search"></div><div ng-if="item.description"><span ng-bind-html="\'<small>\' + (\'\'+item.description | highlight: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\'))+ \'</small>\'"></span></div></ui-select-choices></ui-select><ui-select ng-controller="UiSelectController" multiple="" ng-if="(form.options.tagging||false) && !(form.options.groupBy || false)" tagging="form.options.tagging||false" tagging-label="form.options.taggingLabel" tagging-tokens="form.options.taggingTokens" sortable-options="{{form.sortableOptions}}" ng-model="form.select_models" theme="bootstrap" on-select="$$value$$.push($item.value)" on-remove="$$value$$.splice($$value$$.indexOf($item.value), 1)" class="{{form.options.uiClass}}"><ui-select-match placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}">{{$item.label}}&nbsp;<small>{{($item.isTag===true ? form.options.taggingLabel : \'\')}}</small></ui-select-match><ui-select-choices refresh-delay="form.options.refreshDelay" refresh="fetchResult(form.schema, form.options, $select.search)" repeat="item in form.schema.items | propsFilter: {label: $select.search, description: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\') }"><div ng-if="item.isTag" ng-bind-html="\'<div>\' + (item.label | highlight: $select.search) + \' \' + form.options.taggingLabel + \'</div><div class=&quot;divider&quot;></div>\'"></div><div ng-if="!item.isTag" ng-bind-html="item.label + item.isTag | highlight: $select.search"></div><div ng-if="item.description"><span ng-bind-html="\'<small>\' + (\'\'+item.description | highlight: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\')) + \'</small>\'"></span></div></ui-select-choices></ui-select><ui-select ng-controller="UiSelectController" multiple="" ng-if="(form.options.tagging||false) && (form.options.groupBy || false)" tagging="form.options.tagging||false" tagging-label="form.options.taggingLabel" tagging-tokens="form.options.taggingTokens" sortable-options="{{form.sortableOptions}}" ng-model="form.select_models" theme="bootstrap" on-select="$$value$$.push($item.value)" on-remove="$$value$$.splice($$value$$.indexOf($item.value), 1)" class="{{form.options.uiClass}}"><ui-select-match allow-clear="{{form.options.allowClear||false}}  placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}">{{$item.label}}&nbsp;<small>{{($item.isTag===true ? form.options.taggingLabel : \'\')}}</small></ui-select-match><ui-select-choices group-by="form.options.groupBy" refresh-delay="form.options.refreshDelay" refresh="fetchResult(form.schema, form.options, $select.search)" repeat="item in form.schema.items | propsFilter: {label: $select.search, description: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\') }"><div ng-if="item.isTag" ng-bind-html="\'<div>\' + (item.label | highlight: $select.search) + \' \' + form.options.taggingLabel + \'</div><div class=&quot;divider&quot;></div>\'"></div><div ng-if="!item.isTag" ng-bind-html="item.label + item.isTag | highlight: $select.search"></div><div ng-if="item.description"><span ng-bind-html="\'<small>\' + (\'\'+item.description | highlight: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\')) + \'</small>\'"></span></div></ui-select-choices></ui-select><input toggle-model="" type="hidden" ng-model="insideModel" sf-changed="form" schema-validate="form"> <span ng-if="form.feedback !== false" class="form-control-feedback" ng-class="evalInScope(form.feedback) || {\'glyphicon\': true, \'glyphicon-ok\': hasSuccess(), \'glyphicon-remove\': hasError() }"></span><div class="help-block" ng-show="(hasError() && errorMessage(schemaError())) || form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div></div></div>'),a.put("directives/decorators/bootstrap/uiselect/single.html",'<div class="form-group" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}" ng-init="select_models=(form.schema.items | where : {value: $$value$$})"><label class="control-label" ng-show="showTitle()">{{form.title}}</label><div class="form-group" ng-init="select_model.selected=select_models[0]"><ui-select ng-model="select_model.selected" ng-controller="UiSelectController" ng-if="!(form.options.tagging||false)" theme="bootstrap" ng-disabled="form.disabled" on-select="$$value$$=$item.value" class="{{form.options.uiClass}}"><ui-select-match placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}">{{select_model.selected.label}}</ui-select-match><ui-select-choices refresh="fetchResult(form.schema, form.options, $select.search)" refresh-delay="form.options.refreshDelay" group-by="form.options.groupBy" repeat="item in form.schema.items | propsFilter: {label: $select.search, description: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\') }"><div ng-bind-html="item.label | highlight: $select.search"></div><div ng-if="item.description"><span ng-bind-html="\'<small>\' + (\'\'+item.description | highlight: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\'))+ \'</small>\'"></span></div></ui-select-choices></ui-select><ui-select ng-controller="UiSelectController" ng-model="select_model.selected" ng-if="(form.options.tagging||false) && !(form.options.groupBy || false)" tagging="form.options.tagging||false" tagging-label="form.options.taggingLabel" tagging-tokens="form.options.taggingTokens" theme="bootstrap" ng-disabled="form.disabled" on-select="$$value$$=$item.value" class="{{form.options.uiClass}}"><ui-select-match placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}">{{select_model.selected.label}}&nbsp;<small>{{(select_model.selected.isTag===true ? form.options.taggingLabel : \'\')}}</small></ui-select-match><ui-select-choices refresh="form.options.refreshMethod(form.schema, $select.search)" refresh-delay="form.options.refreshDelay" repeat="item in form.schema.items | propsFilter: {label: $select.search, description: (form.options.searchDescription===true ? $select.search : \'NOTSEARCHINGFORTHIS\') }"><div ng-if="item.isTag" ng-bind-html="\'<div>\' + (item.label | highlight: $select.search) + \' \' + form.options.taggingLabel + \'</div><div class=&quot;divider&quot;></div>\'"></div><div ng-if="!item.isTag" ng-bind-html="item.label + item.isTag| highlight: $select.search"></div><div ng-if="item.description"><span ng-bind-html="\'<small>\' + (\'\'+item.description | highlight: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\')) + \'</small>\'"></span></div></ui-select-choices></ui-select><ui-select ng-controller="UiSelectController" ng-model="select_model.selected" ng-if="(form.options.tagging||false) && (form.options.groupBy || false)" tagging="form.options.tagging||false" tagging-label="form.options.taggingLabel" tagging-tokens="form.options.taggingTokens" theme="bootstrap" ng-disabled="form.disabled" on-select="$$value$$=$item.value" class="{{form.options.uiClass}}"><ui-select-match placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}">{{select_model.selected.label}}&nbsp;<small>{{(select_model.selected.isTag===true ? form.options.taggingLabel : \'\')}}</small></ui-select-match><ui-select-choices group-by="form.options.groupBy" refresh="form.options.refreshMethod(form.schema, $select.search)" refresh-delay="form.options.refreshDelay" repeat="item in form.schema.items | propsFilter: {label: $select.search, description: (form.options.searchDescription===true ? $select.search : \'NOTSEARCHINGFORTHIS\') }"><div ng-if="item.isTag" ng-bind-html="\'<div>\' + (item.label | highlight: $select.search) + \' \' + form.options.taggingLabel + \'</div><div class=&quot;divider&quot;></div>\'"></div><div ng-if="!item.isTag" ng-bind-html="item.label + item.isTag| highlight: $select.search"></div><div ng-if="item.description"><span ng-bind-html="\'<small>\' + (\'\'+item.description | highlight: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\')) + \'</small>\'"></span></div></ui-select-choices></ui-select><input type="hidden" toggle-single-model="" sf-changed="form" ng-model="insideModel" schema-validate="form"> <span ng-if="form.feedback !== false" class="form-control-feedback" ng-class="evalInScope(form.feedback) || {\'glyphicon\': true, \'glyphicon-ok\': hasSuccess(), \'glyphicon-remove\': hasError() }"></span><div class="help-block" ng-show="(hasError() && errorMessage(schemaError())) || form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div></div></div>')}]),angular.module("schemaForm").config(["schemaFormProvider","schemaFormDecoratorsProvider","sfPathProvider",function(a,b,c){var d=function(b,d,e){if("string"===d.type&&"uiselect"==d.format){var f=a.stdFormObj(b,d,e);return f.key=e.path,f.type="uiselect",e.lookup[c.stringify(e.path)]=f,f}};a.defaults.string.unshift(d);var d=function(b,d,e){if("number"===d.type&&"uiselect"==d.format){var f=a.stdFormObj(b,d,e);return f.key=e.path,f.type="uiselect",e.lookup[c.stringify(e.path)]=f,f}};a.defaults.number.unshift(d);var e=function(b,d,e){if("array"===d.type&&"uiselect"==d.format){var f=a.stdFormObj(b,d,e);return f.key=e.path,f.type="uimultiselect",e.lookup[c.stringify(e.path)]=f,f}};a.defaults.array.unshift(e),b.addMapping("bootstrapDecorator","uiselect","directives/decorators/bootstrap/uiselect/single.html"),b.createDirective("uiselect","directives/decorators/bootstrap/uiselect/single.html"),b.addMapping("bootstrapDecorator","uimultiselect","directives/decorators/bootstrap/uiselect/multi.html"),b.createDirective("uimultiselect","directives/decorators/bootstrap/uiselect/multi.html")}]).directive("toggleSingleModel",function(){return{require:"ngModel",restrict:"A",scope:{},replace:!0,controller:["$scope",function(a){a.$parent.$watch("select_model.selected",function(){void 0!=a.$parent.select_model.selected&&(a.$parent.insideModel=a.$parent.select_model.selected.value,a.$parent.ngModel.$setViewValue(a.$parent.select_model.selected.value))})}]}}).directive("toggleModel",function(){return{require:"ngModel",restrict:"A",scope:{},replace:!0,controller:["$scope","sfSelect",function(a,b){var c=b(a.$parent.form.key,a.$parent.model);angular.isUndefined(c)&&(c=[],b(a.$parent.form.key,a.$parent.model,c)),a.$parent.$watch("form.select_models",function(){0==a.$parent.form.select_models.length?(a.$parent.insideModel=a.$parent.$$value$$,void 0!=a.$parent.ngModel.$viewValue&&a.$parent.ngModel.$setViewValue(a.$parent.form.select_models)):(a.$parent.insideModel=a.$parent.form.select_models,a.$parent.ngModel.$setViewValue(a.$parent.form.select_models))},!0)}]}}).filter("whereMulti",function(){return function(a,b,c){var d=[];return angular.isArray(c)?c.forEach(function(c){for(var e=0;e<a.length;e++)if(c==a[e][b]){d.push(a[e]);break}}):d=a,d}}).filter("propsFilter",function(){return function(a,b){var c=[];return angular.isArray(a)?a.forEach(function(a){for(var d=!1,e=Object.keys(b),f=0;f<e.length;f++){var g=e[f];if(a.hasOwnProperty(g)){var h=b[g].toLowerCase();if(0===a[g].toString().toLowerCase().indexOf(h)||-1!==a[g].toString().toLowerCase().indexOf(" "+h)){d=!0;break}}}d&&c.push(a)}):c=a,c}}).controller("UiSelectController",["$scope","$http",function(a,b){a.fetchResult=function(a,c,d){if(c)if(c.callback)a.items=c.callback(a,c,d),console.log("items",a.items);else{if(c.http_post)return b.post(c.http_post.url,c.http_post.parameter).then(function(b){a.items=b.data,console.log("items",a.items)},function(a,b){alert("Loading select items failed (URL: '"+String(c.http_post.url)+"' Parameter: "+String(c.http_post.parameter)+"\nError: "+b)});if(c.http_get)return b.get(c.http_get.url,c.http_get.parameter).then(function(b){a.items=b.data,console.log("items",a.items)},function(a,b){alert("Loading select items failed (URL: '"+String(c.http_get.url)+"\nError: "+b)});if(c.async)return c.async.call(a,c,d).then(function(b){a.items=b.data,console.log("items",a.items)},function(a,b){alert("Loading select items failed(Options: '"+String(c)+"\nError: "+b)})}}}]),angular.module("schemaForm").run(["$templateCache",function(a){a.put("directives/decorators/bootstrap/codemirror/codemirror.html",'<div class="form-group" ng-class="{\'has-error\': hasError()}" ng-init="codemirrorOptions = {foo: \'bar\'}"><label class="control-label" ng-show="showTitle()">{{form.title}}</label><div ng-if="form.codemirrorButtons" class="cm-buttons"><span class="btn-group" ng-repeat="buttonGroup in form.codemirrorButtons"><button ng-repeat="button in buttonGroup" ng-click="evalInScope(button.onClick)" type="button" class="btn btn-sm btn-default" id="btnBold" title="{{ button.title }}"><span ng-if="button.icon" class="glyphicon" ng-class="\'glyphicon-\' + button.icon"></span> <span ng-if="button.label" ng-bind-html="button.label"></span></button></span></div><div codemirror-buttons="" ui-codemirror="" ui-codemirror-opts="getCodemirrorOptions()" ng-style="form.style" ng-model="$$value$$" schema-validate="form" sf-changed="form"></div><span class="help-block">{{ (hasError() && errorMessage(schemaError())) || form.description}}</span></div>')}]),angular.module("schemaForm").config(["schemaFormProvider","schemaFormDecoratorsProvider",function(a,b){b.addMapping("bootstrapDecorator","codemirror","directives/decorators/bootstrap/codemirror/codemirror.html"),b.createDirective("codemirror","directives/decorators/bootstrap/codemirror/codemirror.html")}]).directive("codemirrorButtons",function(){return{controller:["$scope",function(a){a.getCodemirrorOptions=function(){var b=a.form.schema&&a.form.schema.codemirrorOptions?angular.extend({},a.form.codemirrorOptions,a.form.schema.codemirrorOptions):angular.copy(a.form.codemirrorOptions);return b.onLoad=function(b){a.cm=b},b}}]}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(b,d){function e(){b.display.wrapper.offsetHeight?(c(b,d),b.display.lastWrapHeight!=b.display.wrapper.clientHeight&&b.refresh()):d.timeout=setTimeout(e,d.delay)}d.timeout=setTimeout(e,d.delay),d.hurry=function(){clearTimeout(d.timeout),d.timeout=setTimeout(e,50)},a.on(window,"mouseup",d.hurry),a.on(window,"keyup",d.hurry)}function c(b,c){clearTimeout(c.timeout),a.off(window,"mouseup",c.hurry),a.off(window,"keyup",c.hurry)}a.defineOption("autoRefresh",!1,function(a,d){a.state.autoRefresh&&(c(a,a.state.autoRefresh),a.state.autoRefresh=null),d&&0==a.display.wrapper.offsetHeight&&b(a,a.state.autoRefresh={delay:d.delay||250})})}),function(a,b,c){"use strict";function d(a,c,d,e,f,g){function h(a,c){return angular.element((c||b).querySelectorAll(a))}function i(a){return j[a]?j[a]:j[a]=c.get(a,{cache:g}).then(function(a){return a.data})}this.compile=function(b){b.template&&/\.html$/.test(b.template)&&(console.warn("Deprecated use of `template` option to pass a file. Please use the `templateUrl` option instead."),b.templateUrl=b.template,b.template="");var c=b.templateUrl,g=b.template||"",j=b.controller,k=b.controllerAs,l=b.resolve||{},m=b.locals||{},n=b.transformTemplate||angular.identity,o=b.bindToController;if(angular.forEach(l,function(a,b){angular.isString(a)?l[b]=d.get(a):l[b]=d.invoke(a)}),angular.extend(l,m),g)l.$template=a.when(g);else{if(!c)throw new Error("Missing `template` / `templateUrl` option.");l.$template=i(c)}return b.titleTemplate&&(l.$template=a.all([l.$template,i(b.titleTemplate)]).then(function(a){var b=angular.element(a[0]);return h('[ng-bind="title"]',b[0]).removeAttr("ng-bind").html(a[1]),b[0].outerHTML})),b.contentTemplate&&(l.$template=a.all([l.$template,i(b.contentTemplate)]).then(function(a){var c=angular.element(a[0]),d=h('[ng-bind="content"]',c[0]).removeAttr("ng-bind").html(a[1]);return b.templateUrl||d.next().remove(),c[0].outerHTML})),a.all(l).then(function(a){var c=n(a.$template);b.html&&(c=c.replace(/ng-bind="/gi,'ng-bind-html="'));var d=angular.element("<div>").html(c.trim()).contents(),g=e(d);return{locals:a,element:d,link:function(b){if(a.$scope=b,j){var c=f(j,a,!0);o&&angular.extend(c.instance,a);var e=angular.isObject(c)?c:c();d.data("$ngControllerController",e),d.children().data("$ngControllerController",e),k&&(b[k]=e)}return g.apply(null,arguments)}}})};var j={}}d.$inject=["$q","$http","$injector","$compile","$controller","$templateCache"],angular.module("mgcrea.ngStrap.typeahead",["mgcrea.ngStrap.tooltip","mgcrea.ngStrap.helpers.parseOptions"]).provider("$typeahead",function(){var a=this.defaults={animation:"am-fade",prefixClass:"typeahead",prefixEvent:"$typeahead",placement:"bottom-left",templateUrl:"typeahead/typeahead.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,minLength:1,filter:"bsAsyncFilter",limit:6,autoSelect:!1,comparator:"",trimValue:!0};this.$get=["$window","$rootScope","$tooltip","$$rAF","$timeout",function(b,c,d,e,f){function g(b,c,g){var i={},j=angular.extend({},a,g);i=d(b,j);var k=g.scope,l=i.$scope;l.$resetMatches=function(){l.$matches=[],l.$activeIndex=j.autoSelect?0:-1},l.$resetMatches(),l.$activate=function(a){l.$$postDigest(function(){i.activate(a)})},l.$select=function(a,b){l.$$postDigest(function(){i.select(a)})},l.$isVisible=function(){return i.$isVisible()},i.update=function(a){l.$matches=a,l.$activeIndex>=a.length&&(l.$activeIndex=j.autoSelect?0:-1),h(l),e(i.$applyPlacement)},i.activate=function(a){l.$activeIndex=a},i.select=function(a){if(-1!==a){var b=l.$matches[a].value;c.$setViewValue(b),c.$render(),l.$resetMatches(),k&&k.$digest(),l.$emit(j.prefixEvent+".select",b,a,i),angular.isDefined(j.onSelect)&&angular.isFunction(j.onSelect)&&j.onSelect(b,a,i)}},i.$isVisible=function(){return j.minLength&&c?l.$matches.length&&angular.isString(c.$viewValue)&&c.$viewValue.length>=j.minLength:!!l.$matches.length},i.$getIndex=function(a){var b;for(b=l.$matches.length;b--&&!angular.equals(l.$matches[b].value,a););return b},i.$onMouseDown=function(a){a.preventDefault(),a.stopPropagation()},i.$$updateScrollTop=function(a,b){if(b>-1&&b<a.children.length){var c=a.children[b],d=c.offsetTop,e=c.offsetTop+c.clientHeight,f=a.scrollTop,g=a.scrollTop+a.clientHeight;e>=f&&d<f?a.scrollTop=Math.max(0,a.scrollTop-a.clientHeight):e>g&&(a.scrollTop=d)}},i.$onKeyDown=function(a){/(38|40|13)/.test(a.keyCode)&&(!i.$isVisible()||13===a.keyCode&&-1===l.$activeIndex||(a.preventDefault(),a.stopPropagation()),13===a.keyCode&&l.$matches.length?i.select(l.$activeIndex):38===a.keyCode&&l.$activeIndex>0?l.$activeIndex--:40===a.keyCode&&l.$activeIndex<l.$matches.length-1?l.$activeIndex++:angular.isUndefined(l.$activeIndex)&&(l.$activeIndex=0),i.$$updateScrollTop(i.$element[0],l.$activeIndex),l.$digest())};var m=i.show;i.show=function(){m(),f(function(){i.$element&&(i.$element.on("mousedown",i.$onMouseDown),j.keyboard&&b&&b.on("keydown",i.$onKeyDown))},0,!1)};var n=i.hide;return i.hide=function(){i.$element&&i.$element.off("mousedown",i.$onMouseDown),j.keyboard&&b&&b.off("keydown",i.$onKeyDown),j.autoSelect||i.activate(-1),n()},i}function h(a){a.$$phase||a.$root&&a.$root.$$phase||a.$digest()}return g.defaults=a,g}]}).filter("bsAsyncFilter",["$filter",function(a){return function(b,c,d){return b&&angular.isFunction(b.then)?b.then(function(b){return a("filter")(b,c,d)}):a("filter")(b,c,d)}}]).directive("bsTypeahead",["$window","$parse","$q","$typeahead","$parseOptions",function(a,b,c,d,e){var f=d.defaults;return{restrict:"EAC",require:"ngModel",link:function(a,b,c,g){b.off("change");var h={scope:a};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","keyboard","html","animation","filter","limit","minLength","watchOptions","selectMode","autoSelect","comparator","id","prefixEvent","prefixClass"],function(a){angular.isDefined(c[a])&&(h[a]=c[a])});var i=/^(false|0|)$/i;angular.forEach(["html","container","trimValue","filter"],function(a){angular.isDefined(c[a])&&i.test(c[a])&&(h[a]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide","onSelect"],function(b){var d="bs"+b.charAt(0).toUpperCase()+b.slice(1);angular.isDefined(c[d])&&(h[b]=a.$eval(c[d]))}),b.attr("autocomplete")||b.attr("autocomplete","off");var j=angular.isDefined(h.filter)?h.filter:f.filter,k=h.limit||f.limit,l=h.comparator||f.comparator,m=c.bsOptions;j&&(m+=" | "+j+":$viewValue",l&&(m+=":"+l)),k&&(m+=" | limitTo:"+k);var n=e(m),o=d(b,g,h);if(h.watchOptions){var p=n.$match[7].replace(/\|.+/,"").replace(/\(.*\)/g,"").trim();a.$watchCollection(p,function(b,c){n.valuesFn(a,g).then(function(a){o.update(a),g.$render()})})}a.$watch(c.ngModel,function(b,c){a.$modelValue=b,n.valuesFn(a,g).then(function(a){if(h.selectMode&&!a.length&&b.length>0)return void g.$setViewValue(g.$viewValue.substring(0,g.$viewValue.length-1));a.length>k&&(a=a.slice(0,k)),o.update(a),g.$render()})}),g.$formatters.push(function(a){var b=n.displayValue(a);return b||(angular.isDefined(a)&&"object"!=typeof a?a:"")}),g.$render=function(){if(g.$isEmpty(g.$viewValue))return b.val("");var a=o.$getIndex(g.$modelValue),c=-1!==a?o.$scope.$matches[a].label:g.$viewValue;c=angular.isObject(c)?n.displayValue(c):c;var d=c?c.toString().replace(/<(?:.|\n)*?>/gm,""):"",e=b[0].selectionStart,f=b[0].selectionEnd;b.val(!1===h.trimValue?d:d.trim()),b[0].setSelectionRange(e,f)},a.$on("$destroy",function(){o&&o.destroy(),h=null,o=null})}}}]),angular.module("mgcrea.ngStrap.tooltip",["mgcrea.ngStrap.core","mgcrea.ngStrap.helpers.dimensions"]).provider("$tooltip",function(){var a=this.defaults={animation:"am-fade",customClass:"",prefixClass:"tooltip",prefixEvent:"tooltip",container:!1,target:!1,placement:"top",templateUrl:"tooltip/tooltip.tpl.html",template:"",titleTemplate:!1,trigger:"hover focus",keyboard:!1,html:!1,show:!1,title:"",type:"",delay:0,autoClose:!1,bsEnabled:!0,mouseDownPreventDefault:!0,mouseDownStopPropagation:!0,viewport:{selector:"body",padding:0}};this.$get=["$window","$rootScope","$bsCompiler","$q","$templateCache","$http","$animate","$sce","dimensions","$$rAF","$timeout",function(c,d,e,f,g,h,i,j,k,l,m){function n(f,g){function h(){I.$emit(G.prefixEvent+".show",F),angular.isDefined(G.onShow)&&angular.isFunction(G.onShow)&&G.onShow(F)}function n(){if(I.$emit(G.prefixEvent+".hide",F),angular.isDefined(G.onHide)&&angular.isFunction(G.onHide)&&G.onHide(F),O===S){if(R&&"focus"===G.trigger)return f[0].blur();E()}}function q(){var a=G.trigger.split(" ");angular.forEach(a,function(a){"click"===a||"contextmenu"===a?f.on(a,F.toggle):"manual"!==a&&(f.on("hover"===a?"mouseenter":"focus",F.enter),f.on("hover"===a?"mouseleave":"blur",F.leave),"button"===J&&"hover"!==a&&f.on(r?"touchstart":"mousedown",F.$onFocusElementMouseDown))})}function t(){for(var a=G.trigger.split(" "),b=a.length;b--;){var c=a[b];"click"===c||"contextmenu"===c?f.off(c,F.toggle):"manual"!==c&&(f.off("hover"===c?"mouseenter":"focus",F.enter),f.off("hover"===c?"mouseleave":"blur",F.leave),"button"===J&&"hover"!==c&&f.off(r?"touchstart":"mousedown",F.$onFocusElementMouseDown))}}function u(){"focus"!==G.trigger?O.on("keyup",F.$onKeyUp):f.on("keyup",F.$onFocusKeyUp)}function v(){"focus"!==G.trigger?O.off("keyup",F.$onKeyUp):f.off("keyup",F.$onFocusKeyUp)}function w(){m(function(){O.on("click",y),s.on("click",F.hide),T=!0},0,!1)}function x(){T&&(O.off("click",y),s.off("click",F.hide),T=!1)}function y(a){a.stopPropagation()}function z(a){a=a||G.target||f;var d=a[0],e="BODY"===d.tagName,g=d.getBoundingClientRect(),h={};for(var i in g)h[i]=g[i];null===h.width&&(h=angular.extend({},h,{width:g.right-g.left,height:g.bottom-g.top}));var j=e?{top:0,left:0}:k.offset(d),l={scroll:e?b.documentElement.scrollTop||b.body.scrollTop:a.prop("scrollTop")||0},m=e?{width:b.documentElement.clientWidth,height:c.innerHeight}:null;return angular.extend({},h,l,m,j)}function A(a,b,c,d){var e,f=a.split("-");switch(f[0]){case"right":e={top:b.top+b.height/2-d/2,left:b.left+b.width};break;case"bottom":e={top:b.top+b.height,left:b.left+b.width/2-c/2};break;case"left":e={top:b.top+b.height/2-d/2,left:b.left-c};break;default:e={top:b.top-d,left:b.left+b.width/2-c/2}}if(!f[1])return e;if("top"===f[0]||"bottom"===f[0])switch(f[1]){case"left":e.left=b.left;break;case"right":e.left=b.left+b.width-c}else if("left"===f[0]||"right"===f[0])switch(f[1]){case"top":e.top=b.top-d+b.height;break;case"bottom":e.top=b.top}return e}function B(a,b){var c=O[0],d=c.offsetWidth,e=c.offsetHeight,f=parseInt(k.css(c,"margin-top"),10),g=parseInt(k.css(c,"margin-left"),10);isNaN(f)&&(f=0),isNaN(g)&&(g=0),a.top=a.top+f,a.left=a.left+g,k.setOffset(c,angular.extend({using:function(a){O.css({top:Math.round(a.top)+"px",left:Math.round(a.left)+"px",right:""})}},a),0);var h=c.offsetWidth,i=c.offsetHeight;if("top"===b&&i!==e&&(a.top=a.top+e-i),!/top-left|top-right|bottom-left|bottom-right/.test(b)){var j=C(b,a,h,i);if(j.left?a.left+=j.left:a.top+=j.top,k.setOffset(c,a),/top|right|bottom|left/.test(b)){var l=/top|bottom/.test(b);D(l?2*j.left-d+h:2*j.top-e+i,c[l?"offsetWidth":"offsetHeight"],l)}}}function C(a,b,c,d){var e={top:0,left:0};if(!F.$viewport)return e;var f=G.viewport&&G.viewport.padding||0,g=z(F.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e}function D(a,b,c){p(".tooltip-arrow, .arrow",O[0]).css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")}function E(){clearTimeout(L),F.$isShown&&null!==O&&(G.autoClose&&x(),G.keyboard&&v()),Q&&(Q.$destroy(),Q=null),O&&(O.remove(),O=F.$element=null)}var F={},G=F.$options=angular.extend({},a,g),H=F.$promise=e.compile(G),I=F.$scope=G.scope&&G.scope.$new()||d.$new(),J=f[0].nodeName.toLowerCase();if(G.delay&&angular.isString(G.delay)){var K=G.delay.split(",").map(parseFloat);G.delay=K.length>1?{show:K[0],hide:K[1]}:K[0]}F.$id=G.id||f.attr("id")||"",G.title&&(I.title=j.trustAsHtml(G.title)),I.$setEnabled=function(a){I.$$postDigest(function(){F.setEnabled(a)})},I.$hide=function(){I.$$postDigest(function(){F.hide()})},I.$show=function(){I.$$postDigest(function(){F.show()})},I.$toggle=function(){I.$$postDigest(function(){F.toggle()})},F.$isShown=I.$isShown=!1;var L,M,N,O,P,Q;H.then(function(a){N=a,F.init()}),F.init=function(){G.delay&&angular.isNumber(G.delay)&&(G.delay={show:G.delay,hide:G.delay}),"self"===G.container?P=f:angular.isElement(G.container)?P=G.container:G.container&&(P=p(G.container)),q(),G.target&&(G.target=angular.isElement(G.target)?G.target:p(G.target)),G.show&&I.$$postDigest(function(){"focus"===G.trigger?f[0].focus():F.show()})},F.destroy=function(){t(),E(),I.$destroy()},F.enter=function(){if(clearTimeout(L),M="in",!G.delay||!G.delay.show)return F.show();L=setTimeout(function(){"in"===M&&F.show()},G.delay.show)},F.show=function(){if(G.bsEnabled&&!F.$isShown){I.$emit(G.prefixEvent+".show.before",F),angular.isDefined(G.onBeforeShow)&&angular.isFunction(G.onBeforeShow)&&G.onBeforeShow(F);var a,b;G.container?(a=P,b=P[0].lastChild?angular.element(P[0].lastChild):null):(a=null,b=f),O&&E(),Q=F.$scope.$new(),O=F.$element=N.link(Q,function(a,b){}),O.css({top:"-9999px",left:"-9999px",right:"auto",display:"block",visibility:"hidden"}),G.animation&&O.addClass(G.animation),G.type&&O.addClass(G.prefixClass+"-"+G.type),G.customClass&&O.addClass(G.customClass),b?b.after(O):a.prepend(O),F.$isShown=I.$isShown=!0,o(I),F.$applyPlacement(),angular.version.minor<=2?i.enter(O,a,b,h):i.enter(O,a,b).then(h),o(I),l(function(){O&&O.css({visibility:"visible"}),G.keyboard&&("focus"!==G.trigger&&F.focus(),u())}),G.autoClose&&w()}},F.leave=function(){if(clearTimeout(L),M="out",!G.delay||!G.delay.hide)return F.hide();L=setTimeout(function(){"out"===M&&F.hide()},G.delay.hide)};var R,S;F.hide=function(a){F.$isShown&&(I.$emit(G.prefixEvent+".hide.before",F),angular.isDefined(G.onBeforeHide)&&angular.isFunction(G.onBeforeHide)&&G.onBeforeHide(F),R=a,S=O,null!==O&&(angular.version.minor<=2?i.leave(O,n):i.leave(O).then(n)),F.$isShown=I.$isShown=!1,o(I),G.keyboard&&null!==O&&v(),G.autoClose&&null!==O&&x())},F.toggle=function(a){a&&a.preventDefault(),F.$isShown?F.leave():F.enter()},F.focus=function(){O[0].focus()},F.setEnabled=function(a){G.bsEnabled=a},F.setViewport=function(a){G.viewport=a},F.$applyPlacement=function(){if(O){
  var b=G.placement,c=/\s?auto?\s?/i,d=c.test(b);d&&(b=b.replace(c,"")||a.placement),O.addClass(G.placement);var e=z(),f=O.prop("offsetWidth"),g=O.prop("offsetHeight");if(F.$viewport=G.viewport&&p(G.viewport.selector||G.viewport),d){var h=b,i=z(F.$viewport);/bottom/.test(h)&&e.bottom+g>i.bottom?b=h.replace("bottom","top"):/top/.test(h)&&e.top-g<i.top&&(b=h.replace("top","bottom")),/left/.test(h)&&e.left-f<i.left?b=b.replace("left","right"):/right/.test(h)&&e.right+f>i.width&&(b=b.replace("right","left")),O.removeClass(h).addClass(b)}B(A(b,e,f,g),b)}},F.$onKeyUp=function(a){27===a.which&&F.$isShown&&(F.hide(),a.stopPropagation())},F.$onFocusKeyUp=function(a){27===a.which&&(f[0].blur(),a.stopPropagation())},F.$onFocusElementMouseDown=function(a){G.mouseDownPreventDefault&&a.preventDefault(),G.mouseDownStopPropagation&&a.stopPropagation(),F.$isShown?f[0].blur():f[0].focus()};var T=!1;return F}function o(a){a.$$phase||a.$root&&a.$root.$$phase||a.$digest()}function p(a,c){return angular.element((c||b).querySelectorAll(a))}var q=/(ip[ao]d|iphone|android)/gi.test(c.navigator.userAgent),r="createTouch"in c.document&&q,s=angular.element(c.document);return n}]}).directive("bsTooltip",["$window","$location","$sce","$parse","$tooltip","$$rAF",function(a,b,c,d,e,f){return{restrict:"EAC",scope:!0,link:function(a,b,d,g){var h,i={scope:a};angular.forEach(["template","templateUrl","controller","controllerAs","titleTemplate","placement","container","delay","trigger","html","animation","backdropAnimation","type","customClass","id"],function(a){angular.isDefined(d[a])&&(i[a]=d[a])});var j=/^(false|0|)$/i;angular.forEach(["html","container"],function(a){angular.isDefined(d[a])&&j.test(d[a])&&(i[a]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(b){var c="bs"+b.charAt(0).toUpperCase()+b.slice(1);angular.isDefined(d[c])&&(i[b]=a.$eval(d[c]))});var k=b.attr("data-target");angular.isDefined(k)&&(j.test(k)?i.target=!1:i.target=k),a.hasOwnProperty("title")||(a.title=""),d.$observe("title",function(b){if(angular.isDefined(b)||!a.hasOwnProperty("title")){var d=a.title;a.title=c.trustAsHtml(b),angular.isDefined(d)&&f(function(){h&&h.$applyPlacement()})}}),d.$observe("disabled",function(a){a&&h.$isShown&&h.hide()}),d.bsTooltip&&a.$watch(d.bsTooltip,function(b,c){angular.isObject(b)?angular.extend(a,b):a.title=b,angular.isDefined(c)&&f(function(){h&&h.$applyPlacement()})},!0),d.bsShow&&a.$watch(d.bsShow,function(a,b){h&&angular.isDefined(a)&&(angular.isString(a)&&(a=!!a.match(/true|,?(tooltip),?/i)),!0===a?h.show():h.hide())}),d.bsEnabled&&a.$watch(d.bsEnabled,function(a,b){h&&angular.isDefined(a)&&(angular.isString(a)&&(a=!!a.match(/true|1|,?(tooltip),?/i)),!1===a?h.setEnabled(!1):h.setEnabled(!0))}),d.viewport&&a.$watch(d.viewport,function(a){h&&angular.isDefined(a)&&h.setViewport(a)}),h=e(b,i),a.$on("$destroy",function(){h&&h.destroy(),i=null,h=null})}}}]),angular.module("mgcrea.ngStrap.timepicker",["mgcrea.ngStrap.helpers.dateParser","mgcrea.ngStrap.helpers.dateFormatter","mgcrea.ngStrap.tooltip"]).provider("$timepicker",function(){var a=this.defaults={animation:"am-fade",defaultDate:"auto",prefixClass:"timepicker",placement:"bottom-left",templateUrl:"timepicker/timepicker.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,useNative:!0,timeType:"date",timeFormat:"shortTime",timezone:null,modelTimeFormat:null,autoclose:!1,minTime:-1/0,maxTime:1/0,length:5,hourStep:1,minuteStep:5,secondStep:5,roundDisplay:!1,iconUp:"glyphicon glyphicon-chevron-up",iconDown:"glyphicon glyphicon-chevron-down",arrowBehavior:"pager"};this.$get=["$window","$document","$rootScope","$sce","$dateFormatter","$tooltip","$timeout",function(b,c,d,e,f,g,h){function i(b,c,d){function e(a,c){var d=a+c;if(b[0].createTextRange){var e=b[0].createTextRange();e.collapse(!0),e.moveStart("character",a),e.moveEnd("character",d),e.select()}else b[0].setSelectionRange?b[0].setSelectionRange(a,d):angular.isUndefined(b[0].selectionStart)&&(b[0].selectionStart=a,b[0].selectionEnd=d)}function i(){b[0].focus()}var l=g(b,angular.extend({},a,d)),m=d.scope,n=l.$options,o=l.$scope,p=n.lang,q=function(a,b,c){return f.formatDate(a,b,p,c)},r=0,s=n.roundDisplay?function(a){var b=6e4*n.minuteStep;return new Date(Math.floor(a.getTime()/b)*b)}(new Date):new Date,t=c.$dateValue||s,u={hour:t.getHours(),meridian:t.getHours()<12,minute:t.getMinutes(),second:t.getSeconds(),millisecond:t.getMilliseconds()},v=f.getDatetimeFormat(n.timeFormat,p),w=f.hoursFormat(v),x=f.timeSeparator(v),y=f.minutesFormat(v),z=f.secondsFormat(v),A=f.showSeconds(v),B=f.showAM(v);o.$iconUp=n.iconUp,o.$iconDown=n.iconDown,o.$select=function(a,b){l.select(a,b)},o.$moveIndex=function(a,b){l.$moveIndex(a,b)},o.$switchMeridian=function(a){l.switchMeridian(a)},l.update=function(a){angular.isDate(a)&&!isNaN(a.getTime())?(l.$date=a,angular.extend(u,{hour:a.getHours(),minute:a.getMinutes(),second:a.getSeconds(),millisecond:a.getMilliseconds()}),l.$build()):l.$isBuilt||l.$build()},l.select=function(a,b,d){c.$dateValue&&!isNaN(c.$dateValue.getTime())||(c.$dateValue="today"===n.defaultDate?new Date:new Date(1970,0,1)),angular.isDate(a)||(a=new Date(a)),0===b?c.$dateValue.setHours(a.getHours()):1===b?c.$dateValue.setMinutes(a.getMinutes()):2===b&&c.$dateValue.setSeconds(a.getSeconds()),c.$setViewValue(angular.copy(c.$dateValue)),c.$render(),n.autoclose&&!d&&h(function(){l.hide(!0)})},l.switchMeridian=function(a){if(c.$dateValue&&!isNaN(c.$dateValue.getTime())){var b=(a||c.$dateValue).getHours();c.$dateValue.setHours(b<12?b+12:b-12),c.$setViewValue(angular.copy(c.$dateValue)),c.$render()}},l.$build=function(){var a,b,c=o.midIndex=parseInt(n.length/2,10),d=[];for(a=0;a<n.length;a++)b=new Date(1970,0,1,u.hour-(c-a)*n.hourStep),d.push({date:b,label:q(b,w),selected:l.$date&&l.$isSelected(b,0),disabled:l.$isDisabled(b,0)});var e,f=[];for(a=0;a<n.length;a++)e=new Date(1970,0,1,0,u.minute-(c-a)*n.minuteStep),f.push({date:e,label:q(e,y),selected:l.$date&&l.$isSelected(e,1),disabled:l.$isDisabled(e,1)});var g,h=[];for(a=0;a<n.length;a++)g=new Date(1970,0,1,0,0,u.second-(c-a)*n.secondStep),h.push({date:g,label:q(g,z),selected:l.$date&&l.$isSelected(g,2),disabled:l.$isDisabled(g,2)});var i=[];for(a=0;a<n.length;a++)A?i.push([d[a],f[a],h[a]]):i.push([d[a],f[a]]);o.rows=i,o.showSeconds=A,o.showAM=B,o.isAM=(l.$date||d[c].date).getHours()<12,o.timeSeparator=x,l.$isBuilt=!0},l.$isSelected=function(a,b){return!!l.$date&&(0===b?a.getHours()===l.$date.getHours():1===b?a.getMinutes()===l.$date.getMinutes():2===b?a.getSeconds()===l.$date.getSeconds():void 0)},l.$isDisabled=function(a,b){var c;return 0===b?c=a.getTime()+6e4*u.minute+1e3*u.second:1===b?c=a.getTime()+36e5*u.hour+1e3*u.second:2===b&&(c=a.getTime()+36e5*u.hour+6e4*u.minute),c<1*n.minTime||c>1*n.maxTime},o.$arrowAction=function(a,b){"picker"===n.arrowBehavior?l.$setTimeByStep(a,b):l.$moveIndex(a,b)},l.$setTimeByStep=function(a,b){var c=new Date(l.$date||t),d=c.getHours(),e=c.getMinutes(),f=c.getSeconds();0===b?c.setHours(d-parseInt(n.hourStep,10)*a):1===b?c.setMinutes(e-parseInt(n.minuteStep,10)*a):2===b&&c.setSeconds(f-parseInt(n.secondStep,10)*a),l.select(c,b,!0)},l.$moveIndex=function(a,b){var c;0===b?(c=new Date(1970,0,1,u.hour+a*n.length,u.minute,u.second),angular.extend(u,{hour:c.getHours()})):1===b?(c=new Date(1970,0,1,u.hour,u.minute+a*n.length*n.minuteStep,u.second),angular.extend(u,{minute:c.getMinutes()})):2===b&&(c=new Date(1970,0,1,u.hour,u.minute,u.second+a*n.length*n.secondStep),angular.extend(u,{second:c.getSeconds()})),l.$build()},l.$onMouseDown=function(a){if("input"!==a.target.nodeName.toLowerCase()&&a.preventDefault(),a.stopPropagation(),k){var b=angular.element(a.target);"button"!==b[0].nodeName.toLowerCase()&&(b=b.parent()),b.triggerHandler("click")}},l.$onKeyDown=function(a){if(/(38|37|39|40|13)/.test(a.keyCode)&&!a.shiftKey&&!a.altKey){if(a.preventDefault(),a.stopPropagation(),13===a.keyCode)return void l.hide(!0);var b=new Date(l.$date),c=b.getHours(),d=q(b,w).length,f=b.getMinutes(),g=q(b,y).length,h=b.getSeconds(),i=q(b,z).length,j=/(37|39)/.test(a.keyCode),k=2+1*A+1*B;j&&(37===a.keyCode?r=r<1?k-1:r-1:39===a.keyCode&&(r=r<k-1?r+1:0));var o=[0,d],p=0;38===a.keyCode&&(p=-1),40===a.keyCode&&(p=1);var s=2===r&&A,t=2===r&&!A||3===r&&A;0===r?(b.setHours(c+p*parseInt(n.hourStep,10)),d=q(b,w).length,o=[0,d]):1===r?(b.setMinutes(f+p*parseInt(n.minuteStep,10)),g=q(b,y).length,o=[d+1,g]):s?(b.setSeconds(h+p*parseInt(n.secondStep,10)),i=q(b,z).length,o=[d+1+g+1,i]):t&&(j||l.switchMeridian(),o=[d+1+g+1+(i+1)*A,2]),l.select(b,r,!0),e(o[0],o[1]),m.$digest()}};var C=l.init;l.init=function(){if(j&&n.useNative)return b.prop("type","time"),void b.css("-webkit-appearance","textfield");k&&(b.prop("type","text"),b.attr("readonly","true"),b.on("click",i)),C()};var D=l.destroy;l.destroy=function(){j&&n.useNative&&b.off("click",i),D()};var E=l.show;l.show=function(){!k&&b.attr("readonly")||b.attr("disabled")||(E(),h(function(){l.$element&&l.$element.on(k?"touchstart":"mousedown",l.$onMouseDown),n.keyboard&&b&&b.on("keydown",l.$onKeyDown)},0,!1))};var F=l.hide;return l.hide=function(a){l.$isShown&&(l.$element&&l.$element.off(k?"touchstart":"mousedown",l.$onMouseDown),n.keyboard&&b&&b.off("keydown",l.$onKeyDown),F(a))},l}var j=/(ip[ao]d|iphone|android)/gi.test(b.navigator.userAgent),k="createTouch"in b.document&&j;return a.lang||(a.lang=f.getDefaultLocale()),i.defaults=a,i}]}).directive("bsTimepicker",["$window","$parse","$q","$dateFormatter","$dateParser","$timepicker",function(a,b,d,e,f,g){var h=g.defaults,i=/(ip[ao]d|iphone|android)/gi.test(a.navigator.userAgent);return{restrict:"EAC",require:"ngModel",link:function(a,b,d,j){function k(a){if(angular.isDate(a)){var b=isNaN(m.minTime)||new Date(a.getTime()).setFullYear(1970,0,1)>=m.minTime,c=isNaN(m.maxTime)||new Date(a.getTime()).setFullYear(1970,0,1)<=m.maxTime,d=b&&c;j.$setValidity("date",d),j.$setValidity("min",b),j.$setValidity("max",c),d&&(j.$dateValue=a)}}function l(){return!j.$dateValue||isNaN(j.$dateValue.getTime())?"":q(j.$dateValue,m.timeFormat)}var m={scope:a};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","keyboard","html","animation","autoclose","timeType","timeFormat","timezone","modelTimeFormat","useNative","hourStep","minuteStep","secondStep","length","arrowBehavior","iconUp","iconDown","roundDisplay","id","prefixClass","prefixEvent","defaultDate"],function(a){angular.isDefined(d[a])&&(m[a]=d[a])});var n=/^(false|0|)$/i;angular.forEach(["html","container","autoclose","useNative","roundDisplay"],function(a){angular.isDefined(d[a])&&n.test(d[a])&&(m[a]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(b){var c="bs"+b.charAt(0).toUpperCase()+b.slice(1);angular.isDefined(d[c])&&(m[b]=a.$eval(d[c]))}),i&&(m.useNative||h.useNative)&&(m.timeFormat="HH:mm");var o=g(b,j,m);m=o.$options;var p=m.lang,q=function(a,b,c){return e.formatDate(a,b,p,c)};d.bsShow&&a.$watch(d.bsShow,function(a,b){o&&angular.isDefined(a)&&(angular.isString(a)&&(a=!!a.match(/true|,?(timepicker),?/i)),!0===a?o.show():o.hide())});var r=f({format:m.timeFormat,lang:p});angular.forEach(["minTime","maxTime"],function(a){angular.isDefined(d[a])&&d.$observe(a,function(b){o.$options[a]=r.getTimeForAttribute(a,b),isNaN(o.$options[a])||o.$build(),k(j.$dateValue)})}),a.$watch(d.ngModel,function(a,b){o.update(j.$dateValue)},!0),j.$parsers.unshift(function(a){var b;if(!a)return j.$setValidity("date",!0),null;var d=angular.isDate(a)?a:r.parse(a,j.$dateValue);return!d||isNaN(d.getTime())?(j.$setValidity("date",!1),c):(k(d),"string"===m.timeType?(b=r.timezoneOffsetAdjust(d,m.timezone,!0),q(b,m.modelTimeFormat||m.timeFormat)):(b=r.timezoneOffsetAdjust(j.$dateValue,m.timezone,!0),"number"===m.timeType?b.getTime():"unix"===m.timeType?b.getTime()/1e3:"iso"===m.timeType?b.toISOString():new Date(b)))}),j.$formatters.push(function(a){var b;return b=angular.isUndefined(a)||null===a?NaN:angular.isDate(a)?a:"string"===m.timeType?r.parse(a,null,m.modelTimeFormat):"unix"===m.timeType?new Date(1e3*a):new Date(a),j.$dateValue=r.timezoneOffsetAdjust(b,m.timezone),l()}),j.$render=function(){b.val(l())},a.$on("$destroy",function(){o&&o.destroy(),m=null,o=null})}}}]),angular.module("mgcrea.ngStrap.tab",[]).provider("$tab",function(){var a=this.defaults={animation:"am-fade",template:"tab/tab.tpl.html",navClass:"nav-tabs",activeClass:"active"},b=this.controller=function(b,c,d){var e=this;e.$options=angular.copy(a),angular.forEach(["animation","navClass","activeClass"],function(a){angular.isDefined(d[a])&&(e.$options[a]=d[a])}),b.$navClass=e.$options.navClass,b.$activeClass=e.$options.activeClass,e.$panes=b.$panes=[],e.$activePaneChangeListeners=e.$viewChangeListeners=[],e.$push=function(a){angular.isUndefined(e.$panes.$active)&&b.$setActive(a.name||0),e.$panes.push(a)},e.$remove=function(a){var b,c=e.$panes.indexOf(a),d=e.$panes.$active;b=angular.isString(d)?e.$panes.map(function(a){return a.name}).indexOf(d):e.$panes.$active,e.$panes.splice(c,1),c<b?b--:c===b&&b===e.$panes.length&&b--,b>=0&&b<e.$panes.length?e.$setActive(e.$panes[b].name||b):e.$setActive()},e.$setActive=b.$setActive=function(a){e.$panes.$active=a,e.$activePaneChangeListeners.forEach(function(a){a()})},e.$isActive=b.$isActive=function(a,b){return e.$panes.$active===a.name||e.$panes.$active===b}};this.$get=function(){var c={};return c.defaults=a,c.controller=b,c}}).directive("bsTabs",["$window","$animate","$tab","$parse",function(a,b,c,d){var e=c.defaults;return{require:["?ngModel","bsTabs"],transclude:!0,scope:!0,controller:["$scope","$element","$attrs",c.controller],templateUrl:function(a,b){return b.template||e.template},link:function(a,b,c,e){var f=e[0],g=e[1];if(f&&(g.$activePaneChangeListeners.push(function(){f.$setViewValue(g.$panes.$active)}),f.$formatters.push(function(a){return g.$setActive(a),a})),c.bsActivePane){var h=d(c.bsActivePane);g.$activePaneChangeListeners.push(function(){h.assign(a,g.$panes.$active)}),a.$watch(c.bsActivePane,function(a,b){g.$setActive(a)},!0)}}}}]).directive("bsPane",["$window","$animate","$sce",function(a,b,c){return{require:["^?ngModel","^bsTabs"],scope:!0,link:function(a,d,e,f){function g(){var c=h.$panes.indexOf(a);b[h.$isActive(a,c)?"addClass":"removeClass"](d,h.$options.activeClass)}var h=f[1];d.addClass("tab-pane"),e.$observe("title",function(b,d){a.title=c.trustAsHtml(b)}),a.name=e.name,h.$options.animation&&d.addClass(h.$options.animation),e.$observe("disabled",function(b,c){a.disabled=a.$eval(b)}),h.$push(a),a.$on("$destroy",function(){h.$remove(a)}),h.$activePaneChangeListeners.push(function(){g()}),g()}}}]),angular.module("mgcrea.ngStrap.select",["mgcrea.ngStrap.tooltip","mgcrea.ngStrap.helpers.parseOptions"]).provider("$select",function(){var a=this.defaults={animation:"am-fade",prefixClass:"select",prefixEvent:"$select",placement:"bottom-left",templateUrl:"select/select.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,multiple:!1,allNoneButtons:!1,sort:!0,caretHtml:'&nbsp;<span class="caret"></span>',placeholder:"Choose among the following...",allText:"All",noneText:"None",maxLength:3,maxLengthHtml:"selected",iconCheckmark:"glyphicon glyphicon-ok",toggle:!1};this.$get=["$window","$document","$rootScope","$tooltip","$timeout",function(b,d,e,f,g){function h(e,h,i){var k={},l=angular.extend({},a,i);k=f(e,l);var m=k.$scope;m.$matches=[],l.multiple?m.$activeIndex=[]:m.$activeIndex=-1,m.$isMultiple=l.multiple,m.$showAllNoneButtons=l.allNoneButtons&&l.multiple,m.$iconCheckmark=l.iconCheckmark,m.$allText=l.allText,m.$noneText=l.noneText,m.$activate=function(a){m.$$postDigest(function(){k.activate(a)})},m.$select=function(a,b){m.$$postDigest(function(){k.select(a)})},m.$isVisible=function(){return k.$isVisible()},m.$isActive=function(a){return k.$isActive(a)},m.$selectAll=function(){for(var a=0;a<m.$matches.length;a++)m.$isActive(a)||m.$select(a)},m.$selectNone=function(){for(var a=0;a<m.$matches.length;a++)m.$isActive(a)&&m.$select(a)},k.update=function(a){m.$matches=a,k.$updateActiveIndex()},k.activate=function(a){return l.multiple?(k.$isActive(a)?m.$activeIndex.splice(m.$activeIndex.indexOf(a),1):m.$activeIndex.push(a),l.sort&&m.$activeIndex.sort(function(a,b){return a-b})):m.$activeIndex=a,m.$activeIndex},k.select=function(a){if(!(angular.isUndefined(a)||a<0||a>=m.$matches.length)){var b=m.$matches[a].value;m.$apply(function(){k.activate(a),l.multiple?h.$setViewValue(m.$activeIndex.map(function(a){return angular.isUndefined(m.$matches[a])?null:m.$matches[a].value})):(l.toggle?h.$setViewValue(b===h.$modelValue?c:b):h.$setViewValue(b),k.hide())}),m.$emit(l.prefixEvent+".select",b,a,k),angular.isDefined(l.onSelect)&&angular.isFunction(l.onSelect)&&l.onSelect(b,a,k)}},k.$updateActiveIndex=function(){l.multiple?angular.isArray(h.$modelValue)?m.$activeIndex=h.$modelValue.map(function(a){return k.$getIndex(a)}):m.$activeIndex=[]:angular.isDefined(h.$modelValue)&&m.$matches.length?m.$activeIndex=k.$getIndex(h.$modelValue):m.$activeIndex=-1},k.$isVisible=function(){return l.minLength&&h?m.$matches.length&&h.$viewValue.length>=l.minLength:m.$matches.length},k.$isActive=function(a){return l.multiple?-1!==m.$activeIndex.indexOf(a):m.$activeIndex===a},k.$getIndex=function(a){var b;for(b=m.$matches.length;b--&&!angular.equals(m.$matches[b].value,a););return b},k.$onMouseDown=function(a){if(a.preventDefault(),a.stopPropagation(),j){var b,c=angular.element(a.target);if("A"!==a.target.nodeName)for(var d=c.parent();!b&&d.length>0;)"A"===d[0].nodeName&&(b=d),d=d.parent();b?angular.element(b).triggerHandler("click"):c.triggerHandler("click")}},k.$onKeyDown=function(a){if(/(9|13|38|40)/.test(a.keyCode))return 9!==a.keyCode&&(a.preventDefault(),a.stopPropagation()),l.multiple&&9===a.keyCode?k.hide():l.multiple||13!==a.keyCode&&9!==a.keyCode?void(l.multiple||(38===a.keyCode&&m.$activeIndex>0?m.$activeIndex--:38===a.keyCode&&m.$activeIndex<0?m.$activeIndex=m.$matches.length-1:40===a.keyCode&&m.$activeIndex<m.$matches.length-1?m.$activeIndex++:angular.isUndefined(m.$activeIndex)&&(m.$activeIndex=0),m.$digest())):k.select(m.$activeIndex)},k.$isIE=function(){var a=b.navigator.userAgent;return a.indexOf("MSIE ")>0||a.indexOf("Trident/")>0||a.indexOf("Edge/")>0},k.$selectScrollFix=function(a){"UL"===d[0].activeElement.tagName&&(a.preventDefault(),a.stopImmediatePropagation(),a.target.focus())};var n=k.show;k.show=function(){n(),l.multiple&&k.$element.addClass("select-multiple"),g(function(){k.$element.on(j?"touchstart":"mousedown",k.$onMouseDown),l.keyboard&&e.on("keydown",k.$onKeyDown)},0,!1)};var o=k.hide;return k.hide=function(){!l.multiple&&angular.isUndefined(h.$modelValue)&&(m.$activeIndex=-1),k.$element.off(j?"touchstart":"mousedown",k.$onMouseDown),l.keyboard&&e.off("keydown",k.$onKeyDown),o(!0)},k}var i=/(ip[ao]d|iphone|android)/gi.test(b.navigator.userAgent),j="createTouch"in b.document&&i;return h.defaults=a,h}]}).directive("bsSelect",["$window","$parse","$q","$select","$parseOptions",function(a,b,c,d,e){var f=d.defaults;return{restrict:"EAC",require:"ngModel",link:function(a,b,c,g){var h={scope:a,placeholder:f.placeholder};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","keyboard","html","animation","placeholder","allNoneButtons","maxLength","maxLengthHtml","allText","noneText","iconCheckmark","autoClose","id","sort","caretHtml","prefixClass","prefixEvent","toggle"],function(a){angular.isDefined(c[a])&&(h[a]=c[a])});var i=/^(false|0|)$/i;angular.forEach(["html","container","allNoneButtons","sort"],function(a){angular.isDefined(c[a])&&i.test(c[a])&&(h[a]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide","onSelect"],function(b){var d="bs"+b.charAt(0).toUpperCase()+b.slice(1);angular.isDefined(c[d])&&(h[b]=a.$eval(c[d]))});var j=b.attr("data-multiple");if(angular.isDefined(j)&&(i.test(j)?h.multiple=!1:h.multiple=j),"select"===b[0].nodeName.toLowerCase()){var k=b;k.css("display","none"),b=angular.element('<button type="button" class="btn btn-default"></button>'),k.after(b)}var l=e(c.bsOptions),m=d(b,g,h);m.$isIE()&&b[0].addEventListener("blur",m.$selectScrollFix);var n=l.$match[7].replace(/\|.+/,"").trim();a.$watch(n,function(b,c){l.valuesFn(a,g).then(function(a){m.update(a),g.$render()})},!0),a.$watch(c.ngModel,function(a,b){m.$updateActiveIndex(),g.$render()},!0),g.$render=function(){var a,c;h.multiple&&angular.isArray(g.$modelValue)?(a=g.$modelValue.map(function(a){return-1!==(c=m.$getIndex(a))&&m.$scope.$matches[c].label}).filter(angular.isDefined),a=a.length>(h.maxLength||f.maxLength)?a.length+" "+(h.maxLengthHtml||f.maxLengthHtml):a.join(", ")):(c=m.$getIndex(g.$modelValue),a=-1!==c&&m.$scope.$matches[c].label),b.html((a||h.placeholder)+(h.caretHtml||f.caretHtml))},h.multiple&&(g.$isEmpty=function(a){return!a||0===a.length}),a.$on("$destroy",function(){m&&m.destroy(),h=null,m=null})}}}]),angular.module("mgcrea.ngStrap.scrollspy",["mgcrea.ngStrap.helpers.debounce","mgcrea.ngStrap.helpers.dimensions"]).provider("$scrollspy",function(){var a=this.$$spies={},c=this.defaults={debounce:150,throttle:100,offset:100};this.$get=["$window","$document","$rootScope","dimensions","debounce","throttle",function(d,e,f,g,h,i){function j(a,b){return a[0].nodeName&&a[0].nodeName.toLowerCase()===b.toLowerCase()}function k(e){var k=angular.extend({},c,e);k.element||(k.element=n);var o=j(k.element,"body"),p=o?l:k.element,q=o?"window":k.id;if(a[q])return a[q].$$count++,a[q];var r,s,t,u,v,w,x,y,z={},A=z.$trackedElements=[],B=[];return z.init=function(){this.$$count=1,u=h(this.checkPosition,k.debounce),v=i(this.checkPosition,k.throttle),p.on("click",this.checkPositionWithEventLoop),l.on("resize",u),p.on("scroll",v),w=h(this.checkOffsets,k.debounce),r=f.$on("$viewContentLoaded",w),s=f.$on("$includeContentLoaded",w),w(),q&&(a[q]=z)},z.destroy=function(){--this.$$count>0||(p.off("click",this.checkPositionWithEventLoop),l.off("resize",u),p.off("scroll",v),r(),s(),q&&delete a[q])},z.checkPosition=function(){if(B.length){if(y=(o?d.pageYOffset:p.prop("scrollTop"))||0,x=Math.max(d.innerHeight,m.prop("clientHeight")),y<B[0].offsetTop&&t!==B[0].target)return z.$activateElement(B[0]);for(var a=B.length;a--;)if(!angular.isUndefined(B[a].offsetTop)&&null!==B[a].offsetTop&&t!==B[a].target&&!(y<B[a].offsetTop||B[a+1]&&y>B[a+1].offsetTop))return z.$activateElement(B[a])}},z.checkPositionWithEventLoop=function(){setTimeout(z.checkPosition,1)},z.$activateElement=function(a){if(t){var b=z.$getTrackedElement(t);b&&(b.source.removeClass("active"),j(b.source,"li")&&j(b.source.parent().parent(),"li")&&b.source.parent().parent().removeClass("active"))}t=a.target,a.source.addClass("active"),j(a.source,"li")&&j(a.source.parent().parent(),"li")&&a.source.parent().parent().addClass("active")},z.$getTrackedElement=function(a){return A.filter(function(b){return b.target===a})[0]},z.checkOffsets=function(){angular.forEach(A,function(a){var c=b.querySelector(a.target);a.offsetTop=c?g.offset(c).top:null,k.offset&&null!==a.offsetTop&&(a.offsetTop-=1*k.offset)}),B=A.filter(function(a){return null!==a.offsetTop}).sort(function(a,b){return a.offsetTop-b.offsetTop}),u()},z.trackElement=function(a,b){A.push({target:a,source:b})},z.untrackElement=function(a,b){for(var c,d=A.length;d--;)if(A[d].target===a&&A[d].source===b){c=d;break}A.splice(c,1)},z.activate=function(a){A[a].addClass("active")},z.init(),z}var l=angular.element(d),m=angular.element(e.prop("documentElement")),n=angular.element(d.document.body);return k}]}).directive("bsScrollspy",["$rootScope","debounce","dimensions","$scrollspy",function(a,b,c,d){return{restrict:"EAC",link:function(a,b,c){var e={scope:a};angular.forEach(["offset","target"],function(a){angular.isDefined(c[a])&&(e[a]=c[a])});var f=d(e);f.trackElement(e.target,b),a.$on("$destroy",function(){f&&(f.untrackElement(e.target,b),f.destroy()),e=null,f=null})}}}]).directive("bsScrollspyList",["$rootScope","debounce","dimensions","$scrollspy",function(a,b,c,d){return{restrict:"A",compile:function(a,b){var c=a[0].querySelectorAll("li > a[href]");angular.forEach(c,function(a){var b=angular.element(a);b.parent().attr("bs-scrollspy","").attr("data-target",b.attr("href"))})}}}]),angular.module("mgcrea.ngStrap.popover",["mgcrea.ngStrap.tooltip"]).provider("$popover",function(){var a=this.defaults={animation:"am-fade",customClass:"",container:!1,target:!1,placement:"right",templateUrl:"popover/popover.tpl.html",contentTemplate:!1,trigger:"click",keyboard:!0,html:!1,title:"",content:"",delay:0,autoClose:!1};this.$get=["$tooltip",function(b){function c(c,d){var e=angular.extend({},a,d),f=b(c,e);return e.content&&(f.$scope.content=e.content),f}return c}]}).directive("bsPopover",["$window","$sce","$popover",function(a,b,c){var d=a.requestAnimationFrame||a.setTimeout;return{restrict:"EAC",scope:!0,link:function(a,e,f){var g,h={scope:a};angular.forEach(["template","templateUrl","controller","controllerAs","contentTemplate","placement","container","delay","trigger","html","animation","customClass","autoClose","id","prefixClass","prefixEvent","bsEnabled"],function(a){angular.isDefined(f[a])&&(h[a]=f[a])});var i=/^(false|0|)$/i;angular.forEach(["html","container","autoClose"],function(a){angular.isDefined(f[a])&&i.test(f[a])&&(h[a]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(b){var c="bs"+b.charAt(0).toUpperCase()+b.slice(1);angular.isDefined(f[c])&&(h[b]=a.$eval(f[c]))});var j=e.attr("data-target");angular.isDefined(j)&&(i.test(j)?h.target=!1:h.target=j),angular.forEach(["title","content"],function(c){f[c]&&f.$observe(c,function(e,f){a[c]=b.trustAsHtml(e),angular.isDefined(f)&&d(function(){g&&g.$applyPlacement()})})}),f.bsPopover&&a.$watch(f.bsPopover,function(b,c){angular.isObject(b)?angular.extend(a,b):a.content=b,angular.isDefined(c)&&d(function(){g&&g.$applyPlacement()})},!0),f.bsShow&&a.$watch(f.bsShow,function(a,b){g&&angular.isDefined(a)&&(angular.isString(a)&&(a=!!a.match(/true|,?(popover),?/i)),!0===a?g.show():g.hide())}),f.bsEnabled&&a.$watch(f.bsEnabled,function(a){g&&angular.isDefined(a)&&(angular.isString(a)&&(a=!!a.match(/true|1|,?(popover),?/i)),!1===a?g.setEnabled(!1):g.setEnabled(!0))}),f.viewport&&a.$watch(f.viewport,function(a){g&&angular.isDefined(a)&&g.setViewport(a)}),g=c(e,h),a.$on("$destroy",function(){g&&g.destroy(),h=null,g=null})}}}]),angular.module("mgcrea.ngStrap.navbar",[]).provider("$navbar",function(){var a=this.defaults={activeClass:"active",routeAttr:"data-match-route",strict:!1};this.$get=function(){return{defaults:a}}}).directive("bsNavbar",["$window","$location","$navbar",function(a,b,c){var d=c.defaults;return{restrict:"A",link:function(a,c,e,f){var g=angular.copy(d);angular.forEach(Object.keys(d),function(a){angular.isDefined(e[a])&&(g[a]=e[a])}),a.$watch(function(){return b.path()},function(a,b){var d=c[0].querySelectorAll("li["+g.routeAttr+"]");angular.forEach(d,function(b){var c=angular.element(b),d=c.attr(g.routeAttr).replace("/","\\/");g.strict&&(d="^"+d+"$"),new RegExp(d,"i").test(a)?c.addClass(g.activeClass):c.removeClass(g.activeClass)})})}}}]),angular.module("mgcrea.ngStrap.modal",["mgcrea.ngStrap.core","mgcrea.ngStrap.helpers.dimensions"]).provider("$modal",function(){var a=this.defaults={animation:"am-fade",backdropAnimation:"am-fade",customClass:"",prefixClass:"modal",prefixEvent:"modal",placement:"top",templateUrl:"modal/modal.tpl.html",template:"",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0,size:null,zIndex:null};this.$get=["$window","$rootScope","$bsCompiler","$animate","$timeout","$sce","dimensions",function(c,d,e,f,g,h,i){function j(b){function c(){B.$emit(z.prefixEvent+".show",y),angular.isDefined(z.onShow)&&angular.isFunction(z.onShow)&&z.onShow(y)}function g(){B.$emit(z.prefixEvent+".hide",y),angular.isDefined(z.onHide)&&angular.isFunction(z.onHide)&&z.onHide(y),l(".modal").length<=0&&o.removeClass(z.prefixClass+"-open"),z.animation&&o.removeClass(z.prefixClass+"-with-"+z.animation)}function i(){z.backdrop&&(D.on("click",v),F.on("click",v),F.on("wheel",w))}function j(){z.backdrop&&(D.off("click",v),F.off("click",v),F.off("wheel",w))}function t(){z.keyboard&&D.on("keyup",y.$onKeyUp)}function u(){z.keyboard&&D.off("keyup",y.$onKeyUp)}function v(a){a.target===a.currentTarget&&("static"===z.backdrop?y.focus():y.hide())}function w(a){a.preventDefault()}function x(){y.$isShown&&null!==D&&(j(),u()),E&&(E.$destroy(),E=null),D&&(D.remove(),D=y.$element=null)}var y={},z=y.$options=angular.extend({},a,b),A=y.$promise=e.compile(z),B=y.$scope=z.scope&&z.scope.$new()||d.$new();z.element||z.container||(z.container="body"),z.zIndex&&(q=parseInt(z.zIndex,10),r=q-10),y.$id=z.id||z.element&&z.element.attr("id")||"",m(["title","content"],function(a){z[a]&&(B[a]=h.trustAsHtml(z[a]))}),B.$hide=function(){B.$$postDigest(function(){y.hide()})},B.$show=function(){B.$$postDigest(function(){y.show()})},B.$toggle=function(){B.$$postDigest(function(){y.toggle()})},y.$isShown=B.$isShown=!1;var C,D,E,F=angular.element('<div class="'+z.prefixClass+'-backdrop"/>');return F.css({position:"fixed",top:"0px",left:"0px",bottom:"0px",right:"0px"}),A.then(function(a){C=a,y.init()}),y.init=function(){z.show&&B.$$postDigest(function(){y.show()})},y.destroy=function(){x(),F&&(F.remove(),F=null),B.$destroy()},y.show=function(){if(!y.$isShown){var a,b;if(angular.isElement(z.container)?(a=z.container,b=z.container[0].lastChild?angular.element(z.container[0].lastChild):null):z.container?(a=l(z.container),b=a[0]&&a[0].lastChild?angular.element(a[0].lastChild):null):(a=null,b=z.element),D&&x(),E=y.$scope.$new(),D=y.$element=C.link(E,function(a,b){}),z.backdrop&&(D.css({"z-index":q+20*p}),F.css({"z-index":r+20*p}),p++),!B.$emit(z.prefixEvent+".show.before",y).defaultPrevented){angular.isDefined(z.onBeforeShow)&&angular.isFunction(z.onBeforeShow)&&z.onBeforeShow(y),D.css({display:"block"}).addClass(z.placement),z.customClass&&D.addClass(z.customClass),z.size&&s[z.size]&&angular.element(l(".modal-dialog",D[0])).addClass(s[z.size]),z.animation&&(z.backdrop&&F.addClass(z.backdropAnimation),D.addClass(z.animation)),z.backdrop&&f.enter(F,o,null),angular.version.minor<=2?f.enter(D,a,b,c):f.enter(D,a,b).then(c),y.$isShown=B.$isShown=!0,k(B);var d=D[0];n(function(){d.focus()}),o.addClass(z.prefixClass+"-open"),z.animation&&o.addClass(z.prefixClass+"-with-"+z.animation),i(),t()}}},y.hide=function(){y.$isShown&&(B.$emit(z.prefixEvent+".hide.before",y).defaultPrevented||(angular.isDefined(z.onBeforeHide)&&angular.isFunction(z.onBeforeHide)&&z.onBeforeHide(y),angular.version.minor<=2?f.leave(D,g):f.leave(D).then(g),z.backdrop&&(p--,f.leave(F)),y.$isShown=B.$isShown=!1,k(B),j(),u()))},y.toggle=function(){y.$isShown?y.hide():y.show()},y.focus=function(){D[0].focus()},y.$onKeyUp=function(a){27===a.which&&y.$isShown&&(y.hide(),a.stopPropagation())},y}function k(a){a.$$phase||a.$root&&a.$root.$$phase||a.$digest()}function l(a,c){return angular.element((c||b).querySelectorAll(a))}var m=angular.forEach,n=c.requestAnimationFrame||c.setTimeout,o=angular.element(c.document.body),p=0,q=1050,r=1040,s={lg:"modal-lg",sm:"modal-sm"};return j}]}).directive("bsModal",["$window","$sce","$parse","$modal",function(a,b,c,d){return{restrict:"EAC",scope:!0,link:function(a,c,e,f){var g={scope:a,element:c,show:!1};angular.forEach(["template","templateUrl","controller","controllerAs","contentTemplate","placement","backdrop","keyboard","html","container","animation","backdropAnimation","id","prefixEvent","prefixClass","customClass","modalClass","size","zIndex"],function(a){angular.isDefined(e[a])&&(g[a]=e[a])}),g.modalClass&&(g.customClass=g.modalClass);var h=/^(false|0|)$/i;angular.forEach(["backdrop","keyboard","html","container"],function(a){angular.isDefined(e[a])&&h.test(e[a])&&(g[a]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(b){var c="bs"+b.charAt(0).toUpperCase()+b.slice(1)
  ;angular.isDefined(e[c])&&(g[b]=a.$eval(e[c]))}),angular.forEach(["title","content"],function(c){e[c]&&e.$observe(c,function(d,e){a[c]=b.trustAsHtml(d)})}),e.bsModal&&a.$watch(e.bsModal,function(b,c){angular.isObject(b)?angular.extend(a,b):a.content=b},!0);var i=d(g);c.on(e.trigger||"click",i.toggle),a.$on("$destroy",function(){i&&i.destroy(),g=null,i=null})}}}]),angular.version.minor<3&&angular.version.dot<14&&angular.module("ng").factory("$$rAF",["$window","$timeout",function(a,b){var c=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame,d=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelRequestAnimationFrame,e=!!c,f=e?function(a){var b=c(a);return function(){d(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};return f.supported=e,f}]),angular.module("mgcrea.ngStrap.helpers.parseOptions",[]).provider("$parseOptions",function(){var a=this.defaults={regexp:/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/};this.$get=["$parse","$q",function(b,c){function d(d,e){function f(a,b){return a.map(function(a,c){var d,e,f={};return f[k]=a,d=j(b,f),e=n(b,f),{label:d,value:e,index:c}})}var g={},h=angular.extend({},a,e);g.$values=[];var i,j,k,l,m,n,o;return g.init=function(){g.$match=i=d.match(h.regexp),j=b(i[2]||i[1]),k=i[4]||i[6],l=i[5],m=b(i[3]||""),n=b(i[2]?i[1]:k),o=b(i[7])},g.valuesFn=function(a,b){return c.when(o(a,b)).then(function(b){return angular.isArray(b)||(b=[]),g.$values=b.length?f(b,a):[],g.$values})},g.displayValue=function(a){var b={};return b[k]=a,j(b)},g.init(),g}return d}]}),angular.module("mgcrea.ngStrap.helpers.dimensions",[]).factory("dimensions",function(){function b(a){var b=a.ownerDocument,e=a.offsetParent||b;if(d(e,"#document"))return b.documentElement;for(;e&&!d(e,"html")&&"static"===c.css(e,"position");)e=e.offsetParent;return e||b.documentElement}var c={},d=c.nodeName=function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()};return c.css=function(b,c,d){var e;return e=b.currentStyle?b.currentStyle[c]:a.getComputedStyle?a.getComputedStyle(b)[c]:b.style[c],!0===d?parseFloat(e)||0:e},c.offset=function(b){var c=b.getBoundingClientRect(),d=b.ownerDocument;return{width:c.width||b.offsetWidth,height:c.height||b.offsetHeight,top:c.top+(a.pageYOffset||d.documentElement.scrollTop)-(d.documentElement.clientTop||0),left:c.left+(a.pageXOffset||d.documentElement.scrollLeft)-(d.documentElement.clientLeft||0)}},c.setOffset=function(a,b,d){var e,f,g,h,i,j,k,l=c.css(a,"position"),m=angular.element(a),n={};"static"===l&&(a.style.position="relative"),i=c.offset(a),g=c.css(a,"top"),j=c.css(a,"left"),k=("absolute"===l||"fixed"===l)&&(g+j).indexOf("auto")>-1,k?(e=c.position(a),h=e.top,f=e.left):(h=parseFloat(g)||0,f=parseFloat(j)||0),angular.isFunction(b)&&(b=b.call(a,d,i)),null!==b.top&&(n.top=b.top-i.top+h),null!==b.left&&(n.left=b.left-i.left+f),"using"in b?b.using.call(m,n):m.css({top:n.top+"px",left:n.left+"px"})},c.position=function(a){var e,f,g={top:0,left:0};return"fixed"===c.css(a,"position")?f=a.getBoundingClientRect():(e=b(a),f=c.offset(a),d(e,"html")||(g=c.offset(e)),g.top+=c.css(e,"borderTopWidth",!0),g.left+=c.css(e,"borderLeftWidth",!0)),{width:a.offsetWidth,height:a.offsetHeight,top:f.top-g.top-c.css(a,"marginTop",!0),left:f.left-g.left-c.css(a,"marginLeft",!0)}},c.height=function(a,b){var d=a.offsetHeight;return b?d+=c.css(a,"marginTop",!0)+c.css(a,"marginBottom",!0):d-=c.css(a,"paddingTop",!0)+c.css(a,"paddingBottom",!0)+c.css(a,"borderTopWidth",!0)+c.css(a,"borderBottomWidth",!0),d},c.width=function(a,b){var d=a.offsetWidth;return b?d+=c.css(a,"marginLeft",!0)+c.css(a,"marginRight",!0):d-=c.css(a,"paddingLeft",!0)+c.css(a,"paddingRight",!0)+c.css(a,"borderLeftWidth",!0)+c.css(a,"borderRightWidth",!0),d},c}),angular.module("mgcrea.ngStrap.helpers.debounce",[]).factory("debounce",["$timeout",function(a){return function(b,c,d){var e=null;return function(){var f=this,g=arguments,h=d&&!e;return e&&a.cancel(e),e=a(function(){e=null,d||b.apply(f,g)},c,!1),h&&b.apply(f,g),e}}}]).factory("throttle",["$timeout",function(a){return function(b,c,d){var e=null;return d||(d={}),function(){var f=this,g=arguments;e||(!1!==d.leading&&b.apply(f,g),e=a(function(){e=null,!1!==d.trailing&&b.apply(f,g)},c,!1))}}}]),angular.module("mgcrea.ngStrap.helpers.dateParser",[]).provider("$dateParser",["$localeProvider",function(a){function b(){this.year=1970,this.month=0,this.day=1,this.hours=0,this.minutes=0,this.seconds=0,this.milliseconds=0}function c(){}function d(a){return!isNaN(parseFloat(a))&&isFinite(a)}function e(a,b){for(var c=a.length,d=b.toString().toLowerCase(),e=0;e<c;e++)if(a[e].toLowerCase()===d)return e;return-1}b.prototype.setMilliseconds=function(a){this.milliseconds=a},b.prototype.setSeconds=function(a){this.seconds=a},b.prototype.setMinutes=function(a){this.minutes=a},b.prototype.setHours=function(a){this.hours=a},b.prototype.getHours=function(){return this.hours},b.prototype.setDate=function(a){this.day=a},b.prototype.setMonth=function(a){this.month=a},b.prototype.setFullYear=function(a){this.year=a},b.prototype.fromDate=function(a){return this.year=a.getFullYear(),this.month=a.getMonth(),this.day=a.getDate(),this.hours=a.getHours(),this.minutes=a.getMinutes(),this.seconds=a.getSeconds(),this.milliseconds=a.getMilliseconds(),this},b.prototype.toDate=function(){return new Date(this.year,this.month,this.day,this.hours,this.minutes,this.seconds,this.milliseconds)};var f=b.prototype,g=this.defaults={format:"shortDate",strict:!1};this.$get=["$locale","dateFilter",function(a,h){return function(i){function j(a){return o(k(a))}function k(a){var b=l(a),c=b.replace(/''/g,"\\'"),d=/('(?:\\'|.)*?')/,e=c.split(d),f=Object.keys(v),g=[];return angular.forEach(e,function(a){if(m(a))a=n(a);else for(var b=0;b<f.length;b++)a=a.split(f[b]).join("${"+b+"}");g.push(a)}),g.join("")}function l(a){return a.replace(/\\/g,"[\\\\]").replace(/-/g,"[-]").replace(/\./g,"[.]").replace(/\*/g,"[*]").replace(/\+/g,"[+]").replace(/\?/g,"[?]").replace(/\$/g,"[$]").replace(/\^/g,"[^]").replace(/\//g,"[/]").replace(/\\s/g,"[\\s]")}function m(a){return/^'.*'$/.test(a)}function n(a){return a.replace(/^'(.*)'$/,"$1")}function o(a){for(var b=Object.keys(v),c=a,d=0;d<b.length;d++)c=c.split("${"+d+"}").join("("+v[b[d]]+")");return new RegExp("^"+c+"$",["i"])}function p(a){return q(k(a))}function q(a){for(var b,c,d,e,f=Object.keys(v),g=new RegExp("\\${(\\d+)}","g"),h=[];null!==(b=g.exec(a));)c=b[1],d=f[c],e=w[d],h.push(e);return h}var r,s,t=angular.extend({},g,i),u={},v={sss:"[0-9]{3}",ss:"[0-5][0-9]",s:t.strict?"[1-5]?[0-9]":"[0-9]|[0-5][0-9]",mm:"[0-5][0-9]",m:t.strict?"[1-5]?[0-9]":"[0-9]|[0-5][0-9]",HH:"[01][0-9]|2[0-3]",H:t.strict?"1?[0-9]|2[0-3]":"[01]?[0-9]|2[0-3]",hh:"[0][1-9]|[1][012]",h:t.strict?"[1-9]|1[012]":"0?[1-9]|1[012]",a:"AM|PM",EEEE:a.DATETIME_FORMATS.DAY.join("|"),EEE:a.DATETIME_FORMATS.SHORTDAY.join("|"),dd:"0[1-9]|[12][0-9]|3[01]",d:t.strict?"[1-9]|[1-2][0-9]|3[01]":"0?[1-9]|[1-2][0-9]|3[01]",MMMM:a.DATETIME_FORMATS.MONTH.join("|"),MMM:a.DATETIME_FORMATS.SHORTMONTH.join("|"),MM:"0[1-9]|1[012]",M:t.strict?"[1-9]|1[012]":"0?[1-9]|1[012]",yyyy:"[1]{1}[0-9]{3}|[2]{1}[0-9]{3}",yy:"[0-9]{2}",y:t.strict?"-?(0|[1-9][0-9]{0,3})":"-?0*[0-9]{1,4}"},w={sss:f.setMilliseconds,ss:f.setSeconds,s:f.setSeconds,mm:f.setMinutes,m:f.setMinutes,HH:f.setHours,H:f.setHours,hh:f.setHours,h:f.setHours,EEEE:c,EEE:c,dd:f.setDate,d:f.setDate,a:function(a){var b=this.getHours()%12;return this.setHours(a.match(/pm/i)?b+12:b)},MMMM:function(b){return this.setMonth(e(a.DATETIME_FORMATS.MONTH,b))},MMM:function(b){return this.setMonth(e(a.DATETIME_FORMATS.SHORTMONTH,b))},MM:function(a){return this.setMonth(1*a-1)},M:function(a){return this.setMonth(1*a-1)},yyyy:f.setFullYear,yy:function(a){return this.setFullYear(2e3+1*a)},y:function(a){return 1*a<=50&&2===a.length?this.setFullYear(2e3+1*a):this.setFullYear(1*a)}};return u.init=function(){u.$format=a.DATETIME_FORMATS[t.format]||t.format,r=j(u.$format),s=p(u.$format)},u.isValid=function(a){return angular.isDate(a)?!isNaN(a.getTime()):r.test(a)},u.parse=function(c,d,e,f){e&&(e=a.DATETIME_FORMATS[e]||e),angular.isDate(c)&&(c=h(c,e||u.$format,f));var g=e?j(e):r,i=e?p(e):s,k=g.exec(c);if(!k)return!1;for(var l=d&&!isNaN(d.getTime())?(new b).fromDate(d):(new b).fromDate(new Date(1970,0,1,0)),m=0;m<k.length-1;m++)i[m]&&i[m].call(l,k[m+1]);var n=l.toDate();return parseInt(l.day,10)===n.getDate()&&n},u.getDateForAttribute=function(a,b){var c;if("today"===b){var e=new Date;c=new Date(e.getFullYear(),e.getMonth(),e.getDate()+("maxDate"===a?1:0),0,0,0,"minDate"===a?0:-1)}else c=angular.isString(b)&&b.match(/^".+"$/)?new Date(b.substr(1,b.length-2)):d(b)?new Date(parseInt(b,10)):angular.isString(b)&&0===b.length?"minDate"===a?-1/0:1/0:new Date(b);return c},u.getTimeForAttribute=function(a,b){return"now"===b?(new Date).setFullYear(1970,0,1):angular.isString(b)&&b.match(/^".+"$/)?new Date(b.substr(1,b.length-2)).setFullYear(1970,0,1):d(b)?new Date(parseInt(b,10)).setFullYear(1970,0,1):angular.isString(b)&&0===b.length?"minTime"===a?-1/0:1/0:u.parse(b,new Date(1970,0,1,0))},u.daylightSavingAdjust=function(a){return a?(a.setHours(a.getHours()>12?a.getHours()+2:0),a):null},u.timezoneOffsetAdjust=function(a,b,c){return a?(b&&"UTC"===b&&(a=new Date(a.getTime()),a.setMinutes(a.getMinutes()+(c?-1:1)*a.getTimezoneOffset())),a):null},u.init(),u}}]}]),angular.module("mgcrea.ngStrap.helpers.dateFormatter",[]).service("$dateFormatter",["$locale","dateFilter",function(a,b){function c(a){return/(h+)([:\.])?(m+)([:\.])?(s*)[ ]?(a?)/i.exec(a).slice(1)}this.getDefaultLocale=function(){return a.id},this.getDatetimeFormat=function(b,c){return a.DATETIME_FORMATS[b]||b},this.weekdaysShort=function(b){return a.DATETIME_FORMATS.SHORTDAY},this.hoursFormat=function(a){return c(a)[0]},this.minutesFormat=function(a){return c(a)[2]},this.secondsFormat=function(a){return c(a)[4]},this.timeSeparator=function(a){return c(a)[1]},this.showSeconds=function(a){return!!c(a)[4]},this.showAM=function(a){return!!c(a)[5]},this.formatDate=function(a,c,d,e){return b(a,c,e)}}]),angular.module("mgcrea.ngStrap.core",[]).service("$bsCompiler",d),angular.module("mgcrea.ngStrap.dropdown",["mgcrea.ngStrap.tooltip"]).provider("$dropdown",function(){var a=this.defaults={animation:"am-fade",prefixClass:"dropdown",prefixEvent:"dropdown",placement:"bottom-left",templateUrl:"dropdown/dropdown.tpl.html",trigger:"click",container:!1,keyboard:!0,html:!1,delay:0};this.$get=["$window","$rootScope","$tooltip","$timeout",function(b,c,d,e){function f(b,f){function i(a){if(a.target!==b[0])return a.target!==b[0]&&j.hide()}var j={},k=angular.extend({},a,f);j.$scope=k.scope&&k.scope.$new()||c.$new(),j=d(b,k);var l=b.parent();j.$onKeyDown=function(a){if(/(38|40)/.test(a.keyCode)){a.preventDefault(),a.stopPropagation();var b=angular.element(j.$element[0].querySelectorAll("li:not(.divider) a"));if(b.length){var c;angular.forEach(b,function(a,b){h&&h.call(a,":focus")&&(c=b)}),38===a.keyCode&&c>0?c--:40===a.keyCode&&c<b.length-1?c++:angular.isUndefined(c)&&(c=0),b.eq(c)[0].focus()}}};var m=j.show;j.show=function(){m(),e(function(){k.keyboard&&j.$element&&j.$element.on("keydown",j.$onKeyDown),g.on("click",i)},0,!1),l.hasClass("dropdown")&&l.addClass("open")};var n=j.hide;j.hide=function(){j.$isShown&&(k.keyboard&&j.$element&&j.$element.off("keydown",j.$onKeyDown),g.off("click",i),l.hasClass("dropdown")&&l.removeClass("open"),n())};var o=j.destroy;return j.destroy=function(){g.off("click",i),o()},j}var g=angular.element(b.document.body),h=Element.prototype.matchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector;return f}]}).directive("bsDropdown",["$window","$sce","$dropdown",function(a,b,d){return{restrict:"EAC",scope:!0,compile:function(a,b){if(!b.bsDropdown){for(var e=a[0].nextSibling;e&&1!==e.nodeType;)e=e.nextSibling;e&&e.className.split(" ").indexOf("dropdown-menu")>=0&&(b.template=e.outerHTML,b.templateUrl=c,e.parentNode.removeChild(e))}return function(a,c,e){var f={scope:a};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","keyboard","html","animation","id","autoClose"],function(a){angular.isDefined(b[a])&&(f[a]=b[a])});var g=/^(false|0|)$/i;angular.forEach(["html","container"],function(a){angular.isDefined(e[a])&&g.test(e[a])&&(f[a]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(b){var c="bs"+b.charAt(0).toUpperCase()+b.slice(1);angular.isDefined(e[c])&&(f[b]=a.$eval(e[c]))}),e.bsDropdown&&a.$watch(e.bsDropdown,function(b,c){a.content=b},!0);var h=d(c,f);e.bsShow&&a.$watch(e.bsShow,function(a,b){h&&angular.isDefined(a)&&(angular.isString(a)&&(a=!!a.match(/true|,?(dropdown),?/i)),!0===a?h.show():h.hide())}),a.$on("$destroy",function(){h&&h.destroy(),f=null,h=null})}}}}]),angular.module("mgcrea.ngStrap.button",[]).provider("$button",function(){var a=this.defaults={activeClass:"active",toggleEvent:"click"};this.$get=function(){return{defaults:a}}}).directive("bsCheckboxGroup",function(){return{restrict:"A",require:"ngModel",compile:function(a,b){a.attr("data-toggle","buttons"),a.removeAttr("ng-model");var c=a[0].querySelectorAll('input[type="checkbox"]');angular.forEach(c,function(a){var c=angular.element(a);c.attr("bs-checkbox",""),c.attr("ng-model",b.ngModel+"."+c.attr("value"))})}}}).directive("bsCheckbox",["$button","$$rAF",function(a,b){var c=a.defaults,d=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(a,e,f,g){var h=c,i="INPUT"===e[0].nodeName,j=i?e.parent():e,k=!angular.isDefined(f.trueValue)||f.trueValue;d.test(f.trueValue)&&(k=a.$eval(f.trueValue));var l=!!angular.isDefined(f.falseValue)&&f.falseValue;d.test(f.falseValue)&&(l=a.$eval(f.falseValue)),("boolean"!=typeof k||"boolean"!=typeof l)&&(g.$parsers.push(function(a){return a?k:l}),g.$formatters.push(function(a){return angular.equals(a,k)})),g.$render=function(){var a=!!g.$viewValue;b(function(){i&&(e[0].checked=a),j.toggleClass(h.activeClass,a)})},e.bind(h.toggleEvent,function(){a.$apply(function(){i||g.$setViewValue(!j.hasClass("active")),g.$render()})})}}}]).directive("bsRadioGroup",function(){return{restrict:"A",require:"ngModel",compile:function(a,b){a.attr("data-toggle","buttons"),a.removeAttr("ng-model");var c=a[0].querySelectorAll('input[type="radio"]');angular.forEach(c,function(a){angular.element(a).attr("bs-radio",""),angular.element(a).attr("ng-model",b.ngModel)})}}}).directive("bsRadio",["$button","$$rAF",function(a,b){var c=a.defaults,d=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(a,e,f,g){var h,i=c,j="INPUT"===e[0].nodeName,k=j?e.parent():e;f.$observe("value",function(b){h="boolean"!=typeof b&&d.test(b)?a.$eval(b):b,g.$render()}),g.$render=function(){var a=angular.equals(g.$viewValue,h);b(function(){j&&(e[0].checked=a),k.toggleClass(i.activeClass,a)})},e.bind(i.toggleEvent,function(){a.$apply(function(){g.$setViewValue(h),g.$render()})})}}}]),angular.module("mgcrea.ngStrap.datepicker",["mgcrea.ngStrap.helpers.dateParser","mgcrea.ngStrap.helpers.dateFormatter","mgcrea.ngStrap.tooltip"]).provider("$datepicker",function(){var a=this.defaults={animation:"am-fade",prefixClass:"datepicker",placement:"bottom-left",templateUrl:"datepicker/datepicker.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,useNative:!1,dateType:"date",dateFormat:"shortDate",timezone:null,modelDateFormat:null,dayFormat:"dd",monthFormat:"MMM",yearFormat:"yyyy",monthTitleFormat:"MMMM yyyy",yearTitleFormat:"yyyy",strictFormat:!1,autoclose:!1,minDate:-1/0,maxDate:1/0,startView:0,minView:0,startWeek:0,daysOfWeekDisabled:"",hasToday:!1,hasClear:!1,iconLeft:"glyphicon glyphicon-chevron-left",iconRight:"glyphicon glyphicon-chevron-right"};this.$get=["$window","$document","$rootScope","$sce","$dateFormatter","datepickerViews","$tooltip","$timeout",function(b,c,d,e,f,g,h,i){function j(b,c,d){function e(a){a.selected=j.$isSelected(a.date)}function f(){b[0].focus()}var j=h(b,angular.extend({},a,d)),m=d.scope,n=j.$options,o=j.$scope;n.startView&&(n.startView-=n.minView);var p=g(j);j.$views=p.views;var q=p.viewDate;o.$mode=n.startView,o.$iconLeft=n.iconLeft,o.$iconRight=n.iconRight,o.$hasToday=n.hasToday,o.$hasClear=n.hasClear;var r=j.$views[o.$mode];o.$select=function(a,b){b||j.select(a)},o.$selectPane=function(a){j.$selectPane(a)},o.$toggleMode=function(){j.setMode((o.$mode+1)%j.$views.length)},o.$setToday=function(){n.autoclose?(j.setMode(0),j.select(new Date)):j.select(new Date,!0)},o.$clear=function(){n.autoclose?(j.setMode(0),j.select(null)):j.select(null,!0)},j.update=function(a){angular.isDate(a)&&!isNaN(a.getTime())&&(j.$date=a,r.update.call(r,a)),j.$build(!0)},j.updateDisabledDates=function(a){n.disabledDateRanges=a;for(var b=0,c=o.rows.length;b<c;b++)angular.forEach(o.rows[b],j.$setDisabledEl)},j.select=function(a,b){angular.isDate(a)?angular.isDate(c.$dateValue)&&!isNaN(c.$dateValue.getTime())||(c.$dateValue=new Date(a)):c.$dateValue=null,!o.$mode||b?(c.$setViewValue(angular.copy(a)),c.$render(),n.autoclose&&!b&&i(function(){j.hide(!0)})):(angular.extend(q,{year:a.getFullYear(),month:a.getMonth(),date:a.getDate()}),j.setMode(o.$mode-1),j.$build())},j.setMode=function(a){o.$mode=a,r=j.$views[o.$mode],j.$build()},j.$build=function(a){!0===a&&r.built||(!1!==a||r.built)&&r.build.call(r)},j.$updateSelected=function(){for(var a=0,b=o.rows.length;a<b;a++)angular.forEach(o.rows[a],e)},j.$isSelected=function(a){return r.isSelected(a)},j.$setDisabledEl=function(a){a.disabled=r.isDisabled(a.date)},j.$selectPane=function(a){var b=r.steps,c=new Date(Date.UTC(q.year+(b.year||0)*a,q.month+(b.month||0)*a,1));angular.extend(q,{year:c.getUTCFullYear(),month:c.getUTCMonth(),date:c.getUTCDate()}),j.$build()},j.$onMouseDown=function(a){if(a.preventDefault(),a.stopPropagation(),l){var b=angular.element(a.target);"button"!==b[0].nodeName.toLowerCase()&&(b=b.parent()),b.triggerHandler("click")}},j.$onKeyDown=function(a){if(/(38|37|39|40|13)/.test(a.keyCode)&&!a.shiftKey&&!a.altKey){if(a.preventDefault(),a.stopPropagation(),13===a.keyCode)return void(o.$mode?o.$apply(function(){j.setMode(o.$mode-1)}):j.hide(!0));r.onKeyDown(a),m.$digest()}};var s=j.init;j.init=function(){if(k&&n.useNative)return b.prop("type","date"),void b.css("-webkit-appearance","textfield");l&&(b.prop("type","text"),b.attr("readonly","true"),b.on("click",f)),s()};var t=j.destroy;j.destroy=function(){k&&n.useNative&&b.off("click",f),t()};var u=j.show;j.show=function(){!l&&b.attr("readonly")||b.attr("disabled")||(u(),i(function(){j.$isShown&&(j.$element.on(l?"touchstart":"mousedown",j.$onMouseDown),n.keyboard&&b.on("keydown",j.$onKeyDown))},0,!1))};var v=j.hide;return j.hide=function(a){j.$isShown&&(j.$element.off(l?"touchstart":"mousedown",j.$onMouseDown),n.keyboard&&b.off("keydown",j.$onKeyDown),v(a))},j}var k=/(ip[ao]d|iphone|android)/gi.test(b.navigator.userAgent),l="createTouch"in b.document&&k;return a.lang||(a.lang=f.getDefaultLocale()),j.defaults=a,j}]}).directive("bsDatepicker",["$window","$parse","$q","$dateFormatter","$dateParser","$datepicker",function(a,b,c,d,e,f){var g=/(ip[ao]d|iphone|android)/gi.test(a.navigator.userAgent);return{restrict:"EAC",require:"ngModel",link:function(a,b,c,h){function i(a){return a&&a.length?a:null}function j(a){if(angular.isDate(a)){var b=isNaN(n.$options.minDate)||a.getTime()>=n.$options.minDate,c=isNaN(n.$options.maxDate)||a.getTime()<=n.$options.maxDate,d=b&&c;h.$setValidity("date",d),h.$setValidity("min",b),h.$setValidity("max",c),d&&(h.$dateValue=a)}}function k(){return!h.$dateValue||isNaN(h.$dateValue.getTime())?"":p(h.$dateValue,l.dateFormat)}var l={scope:a};angular.forEach(["template","templateUrl","controller","controllerAs","placement","container","delay","trigger","html","animation","autoclose","dateType","dateFormat","timezone","modelDateFormat","dayFormat","strictFormat","startWeek","startDate","useNative","lang","startView","minView","iconLeft","iconRight","daysOfWeekDisabled","id","prefixClass","prefixEvent","hasToday","hasClear"],function(a){angular.isDefined(c[a])&&(l[a]=c[a])});var m=/^(false|0|)$/i;angular.forEach(["html","container","autoclose","useNative","hasToday","hasClear"],function(a){angular.isDefined(c[a])&&m.test(c[a])&&(l[a]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(b){var d="bs"+b.charAt(0).toUpperCase()+b.slice(1);angular.isDefined(c[d])&&(l[b]=a.$eval(c[d]))});var n=f(b,h,l);l=n.$options,g&&l.useNative&&(l.dateFormat="yyyy-MM-dd");var o=l.lang,p=function(a,b){return d.formatDate(a,b,o)},q=e({format:l.dateFormat,lang:o,strict:l.strictFormat});c.bsShow&&a.$watch(c.bsShow,function(a,b){n&&angular.isDefined(a)&&(angular.isString(a)&&(a=!!a.match(/true|,?(datepicker),?/i)),!0===a?n.show():n.hide())}),angular.forEach(["minDate","maxDate"],function(a){angular.isDefined(c[a])&&c.$observe(a,function(b){n.$options[a]=q.getDateForAttribute(a,b),isNaN(n.$options[a])||n.$build(!1),j(h.$dateValue)})}),angular.isDefined(c.dateFormat)&&c.$observe("dateFormat",function(a){n.$options.dateFormat=a}),a.$watch(c.ngModel,function(a,b){n.update(h.$dateValue)},!0),angular.isDefined(c.disabledDates)&&a.$watch(c.disabledDates,function(a,b){a=i(a),b=i(b),a&&n.updateDisabledDates(a)}),h.$parsers.unshift(function(a){var b;if(!a)return h.$setValidity("date",!0),null;var c=q.parse(a,h.$dateValue);return!c||isNaN(c.getTime())?void h.$setValidity("date",!1):(j(c),"string"===l.dateType?(b=q.timezoneOffsetAdjust(c,l.timezone,!0),p(b,l.modelDateFormat||l.dateFormat)):(b=q.timezoneOffsetAdjust(h.$dateValue,l.timezone,!0),"number"===l.dateType?b.getTime():"unix"===l.dateType?b.getTime()/1e3:"iso"===l.dateType?b.toISOString():new Date(b)))}),h.$formatters.push(function(a){var b;return b=angular.isUndefined(a)||null===a?NaN:angular.isDate(a)?a:"string"===l.dateType?q.parse(a,null,l.modelDateFormat):"unix"===l.dateType?new Date(1e3*a):new Date(a),h.$dateValue=q.timezoneOffsetAdjust(b,l.timezone),k()}),h.$render=function(){b.val(k())},a.$on("$destroy",function(){n&&n.destroy(),l=null,n=null})}}}]).provider("datepickerViews",function(){function a(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c}function b(a,b){return(a%b+b)%b}this.$get=["$dateFormatter","$dateParser","$sce",function(c,d,e){return function(f){var g=f.$scope,h=f.$options,i=h.lang,j=function(a,b){return c.formatDate(a,b,i)},k=d({format:h.dateFormat,lang:i,strict:h.strictFormat}),l=c.weekdaysShort(i),m=l.slice(h.startWeek).concat(l.slice(0,h.startWeek)),n=e.trustAsHtml('<th class="dow text-center">'+m.join('</th><th class="dow text-center">')+"</th>"),o=f.$date||(h.startDate?k.getDateForAttribute("startDate",h.startDate):new Date),p={year:o.getFullYear(),month:o.getMonth(),date:o.getDate()},q=[{format:h.dayFormat,split:7,steps:{month:1},update:function(a,b){!this.built||b||a.getFullYear()!==p.year||a.getMonth()!==p.month?(angular.extend(p,{year:f.$date.getFullYear(),month:f.$date.getMonth(),date:f.$date.getDate()}),f.$build()):a.getDate()===p.date&&1!==a.getDate()||(p.date=f.$date.getDate(),f.$updateSelected())},build:function(){var c=new Date(p.year,p.month,1),d=c.getTimezoneOffset(),e=new Date(+c-864e5*b(c.getDay()-h.startWeek,7)),i=e.getTimezoneOffset(),l=k.timezoneOffsetAdjust(new Date,h.timezone).toDateString();i!==d&&(e=new Date(+e+6e4*(i-d)));for(var m,o=[],q=0;q<42;q++)m=k.daylightSavingAdjust(new Date(e.getFullYear(),e.getMonth(),e.getDate()+q)),o.push({date:m,isToday:m.toDateString()===l,label:j(m,this.format),selected:f.$date&&this.isSelected(m),muted:m.getMonth()!==p.month,disabled:this.isDisabled(m)});g.title=j(c,h.monthTitleFormat),g.showLabels=!0,g.labels=n,g.rows=a(o,this.split),g.isTodayDisabled=this.isDisabled(new Date),this.built=!0},isSelected:function(a){return f.$date&&a.getFullYear()===f.$date.getFullYear()&&a.getMonth()===f.$date.getMonth()&&a.getDate()===f.$date.getDate()},isDisabled:function(a){var b=a.getTime();if(b<h.minDate||b>h.maxDate)return!0;if(-1!==h.daysOfWeekDisabled.indexOf(a.getDay()))return!0;if(h.disabledDateRanges)for(var c=0;c<h.disabledDateRanges.length;c++)if(b>=h.disabledDateRanges[c].start&&b<=h.disabledDateRanges[c].end)return!0;return!1},onKeyDown:function(a){if(f.$date){var b,c=f.$date.getTime();37===a.keyCode?b=new Date(c-864e5):38===a.keyCode?b=new Date(c-6048e5):39===a.keyCode?b=new Date(c+864e5):40===a.keyCode&&(b=new Date(c+6048e5)),this.isDisabled(b)||f.select(b,!0)}}},{name:"month",format:h.monthFormat,split:4,steps:{year:1},update:function(a,b){this.built&&a.getFullYear()===p.year?a.getMonth()!==p.month&&(angular.extend(p,{month:f.$date.getMonth(),date:f.$date.getDate()}),f.$updateSelected()):(angular.extend(p,{year:f.$date.getFullYear(),month:f.$date.getMonth(),date:f.$date.getDate()}),f.$build())},build:function(){for(var b,c=[],d=0;d<12;d++)b=new Date(p.year,d,1),c.push({date:b,label:j(b,this.format),selected:f.$isSelected(b),disabled:this.isDisabled(b)});g.title=j(b,h.yearTitleFormat),g.showLabels=!1,g.rows=a(c,this.split),this.built=!0},isSelected:function(a){return f.$date&&a.getFullYear()===f.$date.getFullYear()&&a.getMonth()===f.$date.getMonth()},isDisabled:function(a){return+new Date(a.getFullYear(),a.getMonth()+1,0)<h.minDate||a.getTime()>h.maxDate},onKeyDown:function(a){if(f.$date){var b=f.$date.getMonth(),c=new Date(f.$date);37===a.keyCode?c.setMonth(b-1):38===a.keyCode?c.setMonth(b-4):39===a.keyCode?c.setMonth(b+1):40===a.keyCode&&c.setMonth(b+4),this.isDisabled(c)||f.select(c,!0)}}},{name:"year",format:h.yearFormat,split:4,steps:{year:12},update:function(a,b){!this.built||b||parseInt(a.getFullYear()/20,10)!==parseInt(p.year/20,10)?(angular.extend(p,{year:f.$date.getFullYear(),month:f.$date.getMonth(),date:f.$date.getDate()}),f.$build()):a.getFullYear()!==p.year&&(angular.extend(p,{year:f.$date.getFullYear(),month:f.$date.getMonth(),date:f.$date.getDate()}),f.$updateSelected())},build:function(){for(var b,c=p.year-p.year%(3*this.split),d=[],e=0;e<12;e++)b=new Date(c+e,0,1),d.push({date:b,label:j(b,this.format),selected:f.$isSelected(b),disabled:this.isDisabled(b)});g.title=d[0].label+"-"+d[d.length-1].label,g.showLabels=!1,g.rows=a(d,this.split),this.built=!0},isSelected:function(a){return f.$date&&a.getFullYear()===f.$date.getFullYear()},isDisabled:function(a){return+new Date(a.getFullYear()+1,0,0)<h.minDate||a.getTime()>h.maxDate},onKeyDown:function(a){if(f.$date){var b=f.$date.getFullYear(),c=new Date(f.$date);37===a.keyCode?c.setYear(b-1):38===a.keyCode?c.setYear(b-4):39===a.keyCode?c.setYear(b+1):40===a.keyCode&&c.setYear(b+4),this.isDisabled(c)||f.select(c,!0)}}}];return{views:h.minView?Array.prototype.slice.call(q,h.minView):q,viewDate:p}}}]}),angular.module("mgcrea.ngStrap.collapse",[]).provider("$collapse",function(){var a=this.defaults={animation:"am-collapse",disallowToggle:!1,activeClass:"in",startCollapsed:!1,allowMultiple:!1},b=this.controller=function(b,c,d){function e(a){for(var b=i.$targets.$active,c=0;c<b.length;c++)a<b[c]&&(b[c]=b[c]-1),b[c]===i.$targets.length&&(b[c]=i.$targets.length-1)}function f(a){return-1!==i.$targets.$active.indexOf(a)}function g(a){var b=i.$targets.$active.indexOf(a);-1!==b&&i.$targets.$active.splice(b,1)}function h(a){i.$options.allowMultiple||i.$targets.$active.splice(0,1),-1===i.$targets.$active.indexOf(a)&&i.$targets.$active.push(a)}var i=this;i.$options=angular.copy(a),angular.forEach(["animation","disallowToggle","activeClass","startCollapsed","allowMultiple"],function(a){angular.isDefined(d[a])&&(i.$options[a]=d[a])});var j=/^(false|0|)$/i;angular.forEach(["disallowToggle","startCollapsed","allowMultiple"],function(a){angular.isDefined(d[a])&&j.test(d[a])&&(i.$options[a]=!1)}),i.$toggles=[],i.$targets=[],i.$viewChangeListeners=[],i.$registerToggle=function(a){i.$toggles.push(a)},i.$registerTarget=function(a){i.$targets.push(a)},i.$unregisterToggle=function(a){var b=i.$toggles.indexOf(a);i.$toggles.splice(b,1)},i.$unregisterTarget=function(a){var b=i.$targets.indexOf(a);i.$targets.splice(b,1),i.$options.allowMultiple&&g(a),e(b),i.$viewChangeListeners.forEach(function(a){a()})},i.$targets.$active=i.$options.startCollapsed?[]:[0],i.$setActive=b.$setActive=function(a){angular.isArray(a)?i.$targets.$active=a:!i.$options.disallowToggle&&f(a)?g(a):h(a),i.$viewChangeListeners.forEach(function(a){a()})},i.$activeIndexes=function(){return i.$options.allowMultiple?i.$targets.$active:1===i.$targets.$active.length?i.$targets.$active[0]:-1}};this.$get=function(){var c={};return c.defaults=a,c.controller=b,c}}).directive("bsCollapse",["$window","$animate","$collapse",function(a,b,c){return{require:["?ngModel","bsCollapse"],controller:["$scope","$element","$attrs",c.controller],link:function(a,b,c,d){var e=d[0],f=d[1];e&&(f.$viewChangeListeners.push(function(){e.$setViewValue(f.$activeIndexes())}),e.$formatters.push(function(a){if(angular.isArray(a))f.$setActive(a);else{var b=f.$activeIndexes();angular.isArray(b)?-1===b.indexOf(1*a)&&f.$setActive(1*a):b!==1*a&&f.$setActive(1*a)}return a}))}}}]).directive("bsCollapseToggle",function(){return{require:["^?ngModel","^bsCollapse"],link:function(a,b,c,d){var e=d[1];b.attr("data-toggle","collapse"),e.$registerToggle(b),a.$on("$destroy",function(){e.$unregisterToggle(b)}),b.on("click",function(){if(!c.disabled){var d=c.bsCollapseToggle&&"bs-collapse-toggle"!==c.bsCollapseToggle?c.bsCollapseToggle:e.$toggles.indexOf(b);e.$setActive(1*d),a.$apply()}})}}}).directive("bsCollapseTarget",["$animate",function(a){return{require:["^?ngModel","^bsCollapse"],link:function(b,c,d,e){function f(){var b=g.$targets.indexOf(c),d=g.$activeIndexes(),e="removeClass";angular.isArray(d)?-1!==d.indexOf(b)&&(e="addClass"):b===d&&(e="addClass"),a[e](c,g.$options.activeClass)}var g=e[1];c.addClass("collapse"),g.$options.animation&&c.addClass(g.$options.animation),g.$registerTarget(c),b.$on("$destroy",function(){g.$unregisterTarget(c)}),g.$viewChangeListeners.push(function(){f()}),f()}}}]),angular.module("mgcrea.ngStrap.aside",["mgcrea.ngStrap.modal"]).provider("$aside",function(){var a=this.defaults={animation:"am-fade-and-slide-right",prefixClass:"aside",prefixEvent:"aside",placement:"right",templateUrl:"aside/aside.tpl.html",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0};this.$get=["$modal",function(b){function c(c){var d=angular.extend({},a,c);return b(d)}return c}]}).directive("bsAside",["$window","$sce","$aside",function(a,b,c){return{restrict:"EAC",scope:!0,link:function(a,d,e,f){var g={scope:a,element:d,show:!1};angular.forEach(["template","templateUrl","controller","controllerAs","contentTemplate","placement","backdrop","keyboard","html","container","animation"],function(a){angular.isDefined(e[a])&&(g[a]=e[a])});var h=/^(false|0|)$/i;angular.forEach(["backdrop","keyboard","html","container"],function(a){angular.isDefined(e[a])&&h.test(e[a])&&(g[a]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(b){var c="bs"+b.charAt(0).toUpperCase()+b.slice(1);angular.isDefined(e[c])&&(g[b]=a.$eval(e[c]))}),angular.forEach(["title","content"],function(c){e[c]&&e.$observe(c,function(d,e){a[c]=b.trustAsHtml(d)})}),e.bsAside&&a.$watch(e.bsAside,function(b,c){angular.isObject(b)?angular.extend(a,b):a.content=b},!0);var i=c(g);d.on(e.trigger||"click",i.toggle),a.$on("$destroy",function(){i&&i.destroy(),g=null,i=null})}}}]),angular.module("mgcrea.ngStrap.alert",["mgcrea.ngStrap.modal"]).provider("$alert",function(){var a=this.defaults={animation:"am-fade",prefixClass:"alert",prefixEvent:"alert",placement:null,templateUrl:"alert/alert.tpl.html",container:!1,element:null,backdrop:!1,keyboard:!0,show:!0,duration:!1,type:!1,dismissable:!0};this.$get=["$modal","$timeout",function(b,c){function d(d){var e={},f=angular.extend({},a,d);e=b(f),
  e.$scope.dismissable=!!f.dismissable,f.type&&(e.$scope.type=f.type);var g=e.show;return f.duration&&(e.show=function(){g(),c(function(){e.hide()},1e3*f.duration)}),e}return d}]}).directive("bsAlert",["$window","$sce","$alert",function(a,b,c){return{restrict:"EAC",scope:!0,link:function(a,d,e,f){var g={scope:a,element:d,show:!1};angular.forEach(["template","templateUrl","controller","controllerAs","placement","keyboard","html","container","animation","duration","dismissable"],function(a){angular.isDefined(e[a])&&(g[a]=e[a])});var h=/^(false|0|)$/i;angular.forEach(["keyboard","html","container","dismissable"],function(a){angular.isDefined(e[a])&&h.test(e[a])&&(g[a]=!1)}),angular.forEach(["onBeforeShow","onShow","onBeforeHide","onHide"],function(b){var c="bs"+b.charAt(0).toUpperCase()+b.slice(1);angular.isDefined(e[c])&&(g[b]=a.$eval(e[c]))}),a.hasOwnProperty("title")||(a.title=""),angular.forEach(["title","content","type"],function(c){e[c]&&e.$observe(c,function(d,e){a[c]=b.trustAsHtml(d)})}),e.bsAlert&&a.$watch(e.bsAlert,function(b,c){angular.isObject(b)?angular.extend(a,b):a.content=b},!0);var i=c(g);d.on(e.trigger||"click",i.toggle),a.$on("$destroy",function(){i&&i.destroy(),g=null,i=null})}}}]),angular.module("mgcrea.ngStrap.affix",["mgcrea.ngStrap.helpers.dimensions","mgcrea.ngStrap.helpers.debounce"]).provider("$affix",function(){var a=this.defaults={offsetTop:"auto",inlineStyles:!0,setWidth:!0};this.$get=["$window","debounce","dimensions",function(b,c,d){function e(e,h){function i(a,b,c){var d=j(),e=k();return d<=r?"top":null!==a?d+a<=b.top?"middle":"bottom":null!==s&&b.top+c+p>=e-s?"bottom":"middle"}function j(){return n[0]===b?b.pageYOffset:n[0].scrollTop}function k(){return n[0]===b?b.document.body.scrollHeight:n[0].scrollHeight}var l={},m=angular.extend({},a,h),n=m.target,o=!1,p=0,q=0,r=0,s=0,t=null,u=null,v=e.parent();if(m.offsetParent)if(m.offsetParent.match(/^\d+$/))for(var w=0;w<1*m.offsetParent-1;w++)v=v.parent();else v=angular.element(m.offsetParent);return l.init=function(){this.$parseOffsets(),q=d.offset(e[0]).top+p,o=m.setWidth&&!e[0].style.width,n.on("scroll",this.checkPosition),n.on("click",this.checkPositionWithEventLoop),g.on("resize",this.$debouncedOnResize),this.checkPosition(),this.checkPositionWithEventLoop()},l.destroy=function(){n.off("scroll",this.checkPosition),n.off("click",this.checkPositionWithEventLoop),g.off("resize",this.$debouncedOnResize)},l.checkPositionWithEventLoop=function(){setTimeout(l.checkPosition,1)},l.checkPosition=function(){var a=j(),b=d.offset(e[0]),c=d.height(e[0]),g=i(u,b,c);t!==g&&(t=g,"top"===g?(u=null,o&&e.css("width",""),m.inlineStyles&&(e.css("position",m.offsetParent?"":"relative"),e.css("top",""))):"bottom"===g?(u=m.offsetUnpin?-1*m.offsetUnpin:b.top-a,o&&e.css("width",""),m.inlineStyles&&(e.css("position",m.offsetParent?"":"relative"),e.css("top",m.offsetParent?"":f[0].offsetHeight-s-c-q+"px"))):(u=null,o&&e.css("width",e[0].offsetWidth+"px"),m.inlineStyles&&(e.css("position","fixed"),e.css("top",p+"px"))),e.removeClass("affix affix-top affix-bottom").addClass("affix"+("middle"!==g?"-"+g:"")))},l.$onResize=function(){l.$parseOffsets(),l.checkPosition()},l.$debouncedOnResize=c(l.$onResize,50),l.$parseOffsets=function(){var a=e[0].style.position,b=e[0].style.top;m.inlineStyles&&(e.css("position",m.offsetParent?"":"relative"),e.css("top","")),m.offsetTop&&("auto"===m.offsetTop&&(m.offsetTop="+0"),m.offsetTop.match(/^[-+]\d+$/)?(p=1*-m.offsetTop,r=m.offsetParent?d.offset(v[0]).top+1*m.offsetTop:d.offset(e[0]).top-d.css(e[0],"marginTop",!0)+1*m.offsetTop):r=1*m.offsetTop),m.offsetBottom&&(s=m.offsetParent&&m.offsetBottom.match(/^[-+]\d+$/)?k()-(d.offset(v[0]).top+d.height(v[0]))+1*m.offsetBottom+1:1*m.offsetBottom),m.inlineStyles&&(e.css("position",a),e.css("top",b))},l.init(),l}var f=angular.element(b.document.body),g=angular.element(b);return e}]}).directive("bsAffix",["$affix","$window","$timeout",function(a,b,c){return{restrict:"EAC",require:"^?bsAffixTarget",link:function(d,e,f,g){var h={scope:d,target:g?g.$element:angular.element(b)};angular.forEach(["offsetTop","offsetBottom","offsetParent","offsetUnpin","inlineStyles","setWidth"],function(a){if(angular.isDefined(f[a])){var b=f[a];/true/i.test(b)&&(b=!0),/false/i.test(b)&&(b=!1),h[a]=b}});var i;c(function(){i=a(e,h)}),d.$on("$destroy",function(){i&&i.destroy(),h=null,i=null})}}}]).directive("bsAffixTarget",function(){return{controller:["$element",function(a){this.$element=a}]}}),angular.module("mgcrea.ngStrap",["mgcrea.ngStrap.modal","mgcrea.ngStrap.aside","mgcrea.ngStrap.alert","mgcrea.ngStrap.button","mgcrea.ngStrap.select","mgcrea.ngStrap.datepicker","mgcrea.ngStrap.timepicker","mgcrea.ngStrap.navbar","mgcrea.ngStrap.tooltip","mgcrea.ngStrap.popover","mgcrea.ngStrap.dropdown","mgcrea.ngStrap.typeahead","mgcrea.ngStrap.scrollspy","mgcrea.ngStrap.affix","mgcrea.ngStrap.tab","mgcrea.ngStrap.collapse"])}(window,document),function(a,b,c){"use strict";angular.module("mgcrea.ngStrap.alert").run(["$templateCache",function(a){a.put("alert/alert.tpl.html",'<div class="alert" ng-class="[type ? \'alert-\' + type : null]"><button type="button" class="close" ng-if="dismissable" ng-click="$hide()">&times;</button> <span ng-if="title"><strong ng-bind="title"></strong>&nbsp;<span ng-bind-html="content"></span> </span><span ng-if="!title" ng-bind-html="content"></span></div>')}]),angular.module("mgcrea.ngStrap.aside").run(["$templateCache",function(a){a.put("aside/aside.tpl.html",'<div class="aside" tabindex="-1" role="dialog"><div class="aside-dialog"><div class="aside-content"><div class="aside-header" ng-show="title"><button type="button" class="close" ng-click="$hide()">&times;</button><h4 class="aside-title" ng-bind="title"></h4></div><div class="aside-body" ng-bind="content"></div><div class="aside-footer"><button type="button" class="btn btn-default" ng-click="$hide()">Close</button></div></div></div></div>')}]),angular.module("mgcrea.ngStrap.datepicker").run(["$templateCache",function(a){a.put("datepicker/datepicker.tpl.html",'<div class="dropdown-menu datepicker" ng-class="\'datepicker-mode-\' + $mode" style="max-width: 320px"><table style="table-layout: fixed; height: 100%; width: 100%"><thead><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$selectPane(-1)"><i class="{{$iconLeft}}"></i></button></th><th colspan="{{ rows[0].length - 2 }}"><button tabindex="-1" type="button" class="btn btn-default btn-block text-strong" ng-click="$toggleMode()"><strong style="text-transform: capitalize" ng-bind="title"></strong></button></th><th><button tabindex="-1" type="button" class="btn btn-default pull-right" ng-click="$selectPane(+1)"><i class="{{$iconRight}}"></i></button></th></tr><tr ng-if="showLabels" ng-bind-html="labels"></tr></thead><tbody><tr ng-repeat="(i, row) in rows" height="{{ 100 / rows.length }}%"><td class="text-center" ng-repeat="(j, el) in row"><button tabindex="-1" type="button" class="btn btn-default" style="width: 100%" ng-class="{\'btn-primary\': el.selected, \'btn-info btn-today\': el.isToday && !el.selected}" ng-click="$select(el.date, el.disabled)" ng-disabled="el.disabled"><span ng-class="{\'text-muted\': el.muted}" ng-bind="el.label"></span></button></td></tr></tbody><tfoot><tr><td colspan="{{ rows[0].length }}"><div class="btn-group btn-group-justified" role="group"><div class="btn-group" role="group" ng-if="$hasToday"><button type="button" class="btn btn-default today" ng-click="$setToday()" ng-disabled="isTodayDisabled"><strong style="text-transform: capitalize">Today</strong></button></div><div class="btn-group" role="group" ng-if="$hasClear"><button type="button" class="btn btn-default clear" ng-click="$clear()"><strong style="text-transform: capitalize">Clear</strong></button></div></div></td></tr></tfoot></table></div>')}]),angular.module("mgcrea.ngStrap.dropdown").run(["$templateCache",function(a){a.put("dropdown/dropdown.tpl.html",'<ul tabindex="-1" class="dropdown-menu" role="menu" ng-show="content && content.length"><li role="presentation" ng-class="{divider: item.divider, active: item.active}" ng-repeat="item in content"><a role="menuitem" tabindex="-1" ng-href="{{item.href}}" ng-if="!item.divider && item.href" target="{{item.target || \'\'}}" ng-bind="item.text"></a> <a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-if="!item.divider && item.click" ng-click="$eval(item.click);$hide()" ng-bind="item.text"></a></li></ul>')}]),angular.module("mgcrea.ngStrap.modal").run(["$templateCache",function(a){a.put("modal/modal.tpl.html",'<div class="modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header" ng-show="title"><button type="button" class="close" aria-label="Close" ng-click="$hide()"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" ng-bind="title"></h4></div><div class="modal-body" ng-bind="content"></div><div class="modal-footer"><button type="button" class="btn btn-default" ng-click="$hide()">Close</button></div></div></div></div>')}]),angular.module("mgcrea.ngStrap.popover").run(["$templateCache",function(a){a.put("popover/popover.tpl.html",'<div class="popover" tabindex="-1"><div class="arrow"></div><h3 class="popover-title" ng-bind="title" ng-show="title"></h3><div class="popover-content" ng-bind="content"></div></div>')}]),angular.module("mgcrea.ngStrap.select").run(["$templateCache",function(a){a.put("select/select.tpl.html",'<ul tabindex="-1" class="select dropdown-menu" ng-show="$isVisible()" role="select"><li ng-if="$showAllNoneButtons"><div class="btn-group" style="margin-bottom: 5px; margin-left: 5px"><button type="button" class="btn btn-default btn-xs" ng-click="$selectAll()">{{$allText}}</button> <button type="button" class="btn btn-default btn-xs" ng-click="$selectNone()">{{$noneText}}</button></div></li><li role="presentation" ng-repeat="match in $matches" ng-class="{active: $isActive($index)}"><a role="menuitem" tabindex="-1" ng-click="$select($index, $event)"><i class="{{$iconCheckmark}} pull-right" ng-if="$isMultiple && $isActive($index)"></i> <span ng-bind="match.label"></span></a></li></ul>')}]),angular.module("mgcrea.ngStrap.tab").run(["$templateCache",function(a){a.put("tab/tab.tpl.html",'<ul class="nav" ng-class="$navClass" role="tablist"><li role="presentation" ng-repeat="$pane in $panes track by $index" ng-class="[ $isActive($pane, $index) ? $activeClass : \'\', $pane.disabled ? \'disabled\' : \'\' ]"><a role="tab" data-toggle="tab" ng-click="!$pane.disabled && $setActive($pane.name || $index)" data-index="{{ $index }}" ng-bind-html="$pane.title" aria-controls="$pane.title" href=""></a></li></ul><div ng-transclude class="tab-content"></div>')}]),angular.module("mgcrea.ngStrap.timepicker").run(["$templateCache",function(a){a.put("timepicker/timepicker.tpl.html",'<div class="dropdown-menu timepicker" style="min-width: 0px;width: auto"><table height="100%"><thead><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 0)"><i class="{{ $iconUp }}"></i></button></th><th>&nbsp;</th><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 1)"><i class="{{ $iconUp }}"></i></button></th><th ng-if="showSeconds">&nbsp;</th><th ng-if="showSeconds"><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 2)"><i class="{{ $iconUp }}"></i></button></th></tr></thead><tbody><tr ng-repeat="(i, row) in rows"><td class="text-center"><button tabindex="-1" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[0].selected}" ng-click="$select(row[0].date, 0)" ng-disabled="row[0].disabled"><span ng-class="{\'text-muted\': row[0].muted}" ng-bind="row[0].label"></span></button></td><td><span ng-bind="i == midIndex ? timeSeparator : \' \'"></span></td><td class="text-center"><button tabindex="-1" ng-if="row[1].date" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[1].selected}" ng-click="$select(row[1].date, 1)" ng-disabled="row[1].disabled"><span ng-class="{\'text-muted\': row[1].muted}" ng-bind="row[1].label"></span></button></td><td ng-if="showSeconds"><span ng-bind="i == midIndex ? timeSeparator : \' \'"></span></td><td ng-if="showSeconds" class="text-center"><button tabindex="-1" ng-if="row[2].date" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[2].selected}" ng-click="$select(row[2].date, 2)" ng-disabled="row[2].disabled"><span ng-class="{\'text-muted\': row[2].muted}" ng-bind="row[2].label"></span></button></td><td ng-if="showAM">&nbsp;</td><td ng-if="showAM"><button tabindex="-1" ng-show="i == midIndex - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !!isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">AM</button> <button tabindex="-1" ng-show="i == midIndex + 1 - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">PM</button></td></tr></tbody><tfoot><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 0)"><i class="{{ $iconDown }}"></i></button></th><th>&nbsp;</th><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 1)"><i class="{{ $iconDown }}"></i></button></th><th ng-if="showSeconds">&nbsp;</th><th ng-if="showSeconds"><button ng-if="showSeconds" tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 2)"><i class="{{ $iconDown }}"></i></button></th></tr></tfoot></table></div>')}]),angular.module("mgcrea.ngStrap.tooltip").run(["$templateCache",function(a){a.put("tooltip/tooltip.tpl.html",'<div class="tooltip in" ng-show="title"><div class="tooltip-arrow"></div><div class="tooltip-inner" ng-bind="title"></div></div>')}]),angular.module("mgcrea.ngStrap.typeahead").run(["$templateCache",function(a){a.put("typeahead/typeahead.tpl.html",'<ul tabindex="-1" class="typeahead dropdown-menu" ng-show="$isVisible()" role="select"><li role="presentation" ng-repeat="match in $matches" ng-class="{active: $index == $activeIndex}"><a role="menuitem" tabindex="-1" ng-click="$select($index, $event)" ng-bind="match.label"></a></li></ul>')}])}(window,document),function(a,b){"function"==typeof define&&define.amd?define(["angular-schema-form"],b):"object"==typeof exports?module.exports=b(require("angular-schema-form")):a.angularSchemaFormDynamicSelect=b(a.schemaForm)}(this,function(a){angular.module("schemaForm").run(["$templateCache",function(a){a.put("directives/decorators/bootstrap/strap/strapmultiselect.html",'<div ng-controller="dynamicSelectController" class="form-group {{form.htmlClass}}"\n     ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}">\n    <label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label>\n\n    <div class="form-group {{form.fieldHtmlClass}}" ng-init="populateTitleMap(form)">\n        <button type="button" class="btn btn-default" sf-changed="form" schema-validate="form" ng-model="$$value$$"\n                data-placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\')}}"\n                data-html="1"\n                data-multiple="1"  data-multiple="1" data-max-length="{{form.options.inlineMaxLength}}"\n                data-max-length-html="{{form.options.inlineMaxLengthHtml}}"\n                bs-options="item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:&quot;$$value$$&quot;"\n                bs-select>\n        </button>\n        <span class="help-block">{{ (hasError() && errorMessage(schemaError())) || form.description}}</span>\n    </div>\n</div>\n'),a.put("directives/decorators/bootstrap/strap/strapselect.html",'<div ng-controller="dynamicSelectController" class="select-controller form-group {{form.htmlClass}}"\n     ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess()}">\n    <label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label>\n\n    <div class="form-group {{form.fieldHtmlClass}}" ng-init="populateTitleMap(form)">\n        <button ng-if="(form.options.multiple == \'true\') || (form.options.multiple == true)"\n                type="button" class="btn btn-default" sf-changed="form" schema-validate="form" ng-model="$$value$$"\n                data-placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\')}}"\n                data-html="1" data-multiple="1" data-max-length="{{form.options.inlineMaxLength}}"\n                data-max-length-html="{{form.options.inlineMaxLengthHtml}}"\n                bs-options="item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:&quot;$$value$$&quot;"\n         data-toggle="true"       bs-select>\n        </button>\n        <button ng-if="!((form.options.multiple == \'true\') || (form.options.multiple == true))"\n                type="button" class="btn btn-default" sf-changed="form" schema-validate="form" ng-model="$$value$$"\n                data-placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\')}}"\n                data-html="1"\n                bs-options="item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:&quot;$$value$$&quot;"\n                data-toggle="true" bs-select>\n        </button>\n        <span class="help-block">{{ (hasError() && errorMessage(schemaError())) || form.description}} </span>\n    </div>\n</div>\n\n')}]),angular.module("schemaForm").run(["$templateCache",function(a){a.put("directives/decorators/bootstrap/uiselect/uiselect.html",'<div ng-controller="dynamicSelectController" class="form-group"\n     ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}"\n         ng-init="insideModel=$$value$$;">\n    <label class="control-label" ng-show="showTitle()">{{form.title}}</label>\n\n    <div class="form-group">\n        <ui-select append-to-body="true" ng-model="select_model.selected"\n                   ng-if="!(form.options.tagging||false)" theme="bootstrap" ng-disabled="form.disabled"\n                   on-select="$$value$$=$item.value" class="{{form.options.uiClass}}">\n            <ui-select-match\n                    placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}">\n                {{select_model.selected.name}}\n            </ui-select-match>\n            <ui-select-choices refresh="populateTitleMap(form, $select.search)"\n                               refresh-delay="form.options.refreshDelay" group-by="form.options.groupBy"\n                               repeat="item in form.titleMap | propsFilter: {name: $select.search, description: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\') }">\n                <div ng-bind-html="item.name | highlight: $select.search"></div>\n                <div ng-if="item.description">\n                    <span ng-bind-html="\'<small>\' + (\'\'+item.description | highlight: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\'))+ \'</small>\'"></span>\n                </div>\n            </ui-select-choices>\n        </ui-select>\n        <ui-select  append-to-body="true" ng-controller="dynamicSelectController" ng-model="select_model.selected"\n                   ng-if="(form.options.tagging||false) && !(form.options.groupBy || false)"\n                   tagging="form.options.tagging||false" tagging-label="form.options.taggingLabel"\n                   tagging-tokens="form.options.taggingTokens"\n                   theme="bootstrap" ng-disabled="form.disabled" on-select="$$value$$=$item.value"\n                   class="{{form.options.uiClass}}">\n            <ui-select-match\n                    placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}">\n                {{select_model.selected.name}}&nbsp;\n                <small>{{(select_model.selected.isTag===true ? form.options.taggingLabel : \'\')}}</small>\n            </ui-select-match>\n            \x3c!--repeat code because tagging does not display properly under group by but is still useful --\x3e\n            <ui-select-choices refresh="populateTitleMap(form, $select.search))"\n                               refresh-delay="form.options.refreshDelay"\n                               repeat="item in form.titleMap | propsFilter: {name: $select.search, description: (form.options.searchDescription===true ? $select.search : \'NOTSEARCHINGFORTHIS\') }">\n                <div ng-if="item.isTag"\n                     ng-bind-html="\'<div>\' + (item.name   | highlight: $select.search) + \' \' + form.options.taggingLabel + \'</div><div class=&quot;divider&quot;></div>\'"></div>\n                <div ng-if="!item.isTag" ng-bind-html="item.name + item.isTag| highlight: $select.search"></div>\n                <div ng-if="item.description">\n                    <span ng-bind-html="\'<small>\' + (\'\'+item.description | highlight: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\')) + \'</small>\'"></span>\n                </div>\n            </ui-select-choices>\n        </ui-select>\n\n        \x3c!--repeat code because tagging does not display properly under group by but is still useful --\x3e\n\n        <ui-select  append-to-body="true" ng-controller="dynamicSelectController" ng-model="select_model.selected"\n                   ng-if="(form.options.tagging||false) && (form.options.groupBy || false)"\n                   tagging="form.options.tagging||false" tagging-label="form.options.taggingLabel"\n                   tagging-tokens="form.options.taggingTokens"\n                   theme="bootstrap" ng-disabled="form.disabled" on-select="$$value$$=$item.value"\n                   class="{{form.options.uiClass}}">\n            <ui-select-match\n                    placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}">\n                {{select_model.selected.name}}&nbsp;\n                <small>{{(select_model.selected.isTag===true ? form.options.taggingLabel : \'\')}}</small>\n            </ui-select-match>\n            <ui-select-choices group-by="form.options.groupBy"\n                               refresh="populateTitleMap(form, $select.search)"\n                               refresh-delay="form.options.refreshDelay"\n                               repeat="item in form.titleMap | propsFilter: {name: $select.search, description: (form.options.searchDescription===true ? $select.search : \'NOTSEARCHINGFORTHIS\') }">\n                <div ng-if="item.isTag"\n                     ng-bind-html="\'<div>\' + (item.name  | highlight: $select.search) + \' \' + form.options.taggingLabel + \'</div><div class=&quot;divider&quot;></div>\'"></div>\n                <div ng-if="!item.isTag" ng-bind-html="item.name + item.isTag| highlight: $select.search"></div>\n                <div ng-if="item.description">\n                    <span ng-bind-html="\'<small>\' + (\'\'+item.description | highlight: (form.options.searchDescriptions===true ? $select.search : \'NOTSEARCHINGFORTHIS\')) + \'</small>\'"></span>\n                </div>\n            </ui-select-choices>\n        </ui-select>\n\n        <input type="hidden" toggle-single-model sf-changed="form" ng-model="insideModel" schema-validate="form"/>\n    <span ng-if="form.feedback !== false"\n          class="form-control-feedback"\n          ng-class="evalInScope(form.feedback) || {\'glyphicon\': true, \'glyphicon-ok\': hasSuccess(), \'glyphicon-remove\': hasError() }"></span>\n\n        <div class="help-block"\n             ng-show="(hasError() && errorMessage(schemaError())) || form.description"\n             ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div>\n    </div>\n</div>\n'),a.put("directives/decorators/bootstrap/uiselect/uiselectmultiple.html",'\n<div class="form-group" ng-class="{\'has-error\': hasError(), \'has-success\': hasSuccess(), \'has-feedback\': form.feedback !== false}"\n       ng-controller="dynamicSelectController" ng-init="$$value$$=$$value$$||[];uiMultiSelectInitInternalModel($$value$$)">\n  <label class="control-label" ng-show="showTitle()">{{form.title}}</label>\n  <div class="form-group">\n    <ui-select  ng-disabled="form.disabled"\n first-item-active="false" skip-focusser="true" remove-selected="true" limit="{{form.options.limit}}" multiple autofocus="true"  close-on-select="{{form.options.closeOnSelect}}" append-to-body="true" sortable-options="{{form.sortableOptions}}" ng-model="internalModel" sf-changed="form" theme="bootstrap"\n  schema-validate="form"             on-select="$$value$$.push($item.value)" on-remove="$$value$$.splice($$value$$.indexOf($item.value), 1)"\n               class="{{form.options.uiClass}}">\n      <ui-select-match placeholder="{{form.placeholder || form.schema.placeholder || (\'placeholders.select\' | translate)}}">{{$item.name}}</ui-select-match>\n      <ui-select-choices first-item-active="false" skip-focusser="true" repeat="item in form.titleMap | propsFilter: {name: $select.search} | limitTo: form.options.limitTo"\n         refresh="populateTitleMap(form, $select.search)"\n         refresh-delay="form.options.refreshDelay"\n         group-by="form.options.groupBy">\n        <div ng-bind-html="item.name | highlight: $select.search"></div>\n      </ui-select-choices>\n    </ui-select>\n    <span ng-if="form.feedback !== false"\n      class="form-control-feedback"\n      ng-class="evalInScope(form.feedback) || {\'glyphicon\': true, \'glyphicon-ok\': hasSuccess(), \'glyphicon-remove\': hasError() }"></span>\n    <div class="help-block"\n      ng-show="(hasError() && errorMessage(schemaError())) || form.description"\n      ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div>\n  </div>\n</div>\n')}]),angular.module("schemaForm").config(["schemaFormProvider","schemaFormDecoratorsProvider","sfPathProvider",function(a,b,c){var d=function(b,d,e){if("string"===d.type&&"enum"in d){var f=a.stdFormObj(b,d,e);return f.key=e.path,f.type="strapselect",e.lookup[c.stringify(e.path)]=f,f}};a.defaults.string.unshift(d),b.addMapping("bootstrapDecorator","strapselect","directives/decorators/bootstrap/strap/strapselect.html"),b.addMapping("bootstrapDecorator","strapmultiselect","directives/decorators/bootstrap/strap/strapmultiselect.html"),b.addMapping("bootstrapDecorator","strapselectdynamic","directives/decorators/bootstrap/strap/strapselect.html"),b.addMapping("bootstrapDecorator","strapmultiselectdynamic","directives/decorators/bootstrap/strap/strapmultiselect.html"),b.addMapping("bootstrapDecorator","uiselect","directives/decorators/bootstrap/uiselect/uiselect.html"),b.addMapping("bootstrapDecorator","uiselectmultiple","directives/decorators/bootstrap/uiselect/uiselectmultiple.html")}]).directive("toggleSingleModel",function(){return{require:"ngModel",restrict:"A",scope:{},replace:!0,controller:["$scope",function(a){a.$parent.$watch("select_model.selected",function(){void 0!=a.$parent.select_model.selected&&(a.$parent.insideModel=a.$parent.select_model.selected.value,a.$parent.ngModel.$setViewValue(a.$parent.select_model.selected.value))})}]}}).directive("multipleOn",function(){return{link:function(a,b,c){a.$watch(function(){return b.attr("multiple-on")},function(a){if("true"==a){var c=angular.element(b).scope().$$childTail;c.$isMultiple=!0,c.options.multiple=!0,c.$select.$element.addClass("select-multiple")}else angular.element(b).scope().$$childTail.$isMultiple=!1})}}}).filter("whereMulti",function(){return function(a,b,c){var d=[];return angular.isArray(c)&&void 0!==a?c.forEach(function(c){for(var e=0;e<a.length;e++)if(c==a[e][b]){d.push(a[e]);break}}):d=a,d}}).filter("propsFilter",function(){return function(a,b){var c=[],d=0;return angular.isArray(a)?a.forEach(function(a){for(var e=!1,f=Object.keys(b),g=0;g<f.length;g++){var h=f[g];if(a.hasOwnProperty(h)){var i=b[h].toLowerCase();if((0===a[h].toString().toLowerCase().indexOf(i)||-1!==a[h].toString().toLowerCase().indexOf(" "+i))&&d<2e3){d++,e=!0;break}}}e&&c.push(a)}):c=a,c}}),angular.module("schemaForm").controller("dynamicSelectController",["$scope","$http","$timeout",function(a,b,c){a.form.options||(a.form.options={}),a.select_model={},a.form.options.scope=a,a.triggerTitleMap=function(){a.form.titleMap.push({value:"345890u340598u3405u9",name:"34095u3p4ouij"}),c(function(){a.form.titleMap.pop()})},a.initFiltering=function(b){a.form.options.filterTriggers&&a.form.options.filterTriggers.forEach(function(b){a.$parent.$watch(b,a.triggerTitleMap)}),a.localModelType=Object.prototype.toString.call(b),a.filteringInitialized=!0},a.finalizeTitleMap=function(b,c,d){if(b.titleMap=[],d&&"map"in d&&d.map){var e=d.map.nameProperty.length-1,f=d.map.separatorValue?d.map.separatorValue:" - ";c.forEach(function(a){if(a.value=a[d.map.valueProperty],"string"!=typeof d.map.nameProperty){var c="";for(var g in d.map.nameProperty)c+=a[d.map.nameProperty[g]],g!=e&&(c+=f);a.name=c}else a.name=a[d.map.nameProperty];b.titleMap.push(a)})}else c.forEach(function(a){"text"in a&&(a.name=a.text)}),b.titleMap=c;a.insideModel&&void 0===a.select_model.selected&&(a.select_model.selected=a.find_in_titleMap(a.insideModel)),a.internalModel&&a.uiMultiSelectInitInternalModel(a.externalModel)},a.clone=function(b){if(null==b||"object"!=typeof b)return b;var c=b.constructor();for(var d in b)b[d]!=a&&b.hasOwnProperty(d)&&(c[d]=a.clone(b[d]));return c},a.getCallback=function(b){if("string"==typeof b){var c=a.$parent.evalExpr(b);if("function"==typeof c)return c;throw"A callback string must match name of a function in the parent scope"}if("function"==typeof b)return b;throw"A callback must either be a string matching the name of a function in the parent scope or a direct function reference"},a.getOptions=function(b,c){return b.httpPost&&b.httpPost.optionsCallback?(newOptionInstance=a.clone(b),a.getCallback(b.httpPost.optionsCallback)(newOptionInstance,c)):b.httpGet&&b.httpGet.optionsCallback?(newOptionInstance=a.clone(b),a.getCallback(b.httpGet.optionsCallback)(newOptionInstance,c)):b},a.test=function(a){a.titleMap.pop()},a.populateTitleMap=function(c,d){if(c.schema&&"enum"in c.schema)c.titleMap=[],c.schema.enum.forEach(function(a){c.titleMap.push({value:a,name:a})});else if(c.options)if(c.options.callback)c.titleMap=a.getCallback(c.options.callback)(c.options,d),a.finalizeTitleMap(c,c.titleMap,c.options);else{if(c.options.asyncCallback)return a.getCallback(c.options.asyncCallback)(c.options,d).then(function(b){a.finalizeTitleMap(c,b.data,c.options)},function(a,b){alert("Loading select items failed(Options: '"+String(c.options)+"\nError: "+b)});if(c.options.httpPost){var e=a.getOptions(c.options,d);return b.post(e.httpPost.url,e.httpPost.parameter).then(function(b){a.finalizeTitleMap(c,b.data,e)},function(a,b){alert("Loading select items failed (URL: '"+String(e.httpPost.url)+"' Parameter: "+String(e.httpPost.parameter)+"\nError: "+b)})}if(c.options.httpGet){var e=a.getOptions(c.options,d);return b.get(e.httpGet.url,e.httpGet.parameter).then(function(b){a.finalizeTitleMap(c,b.data,e)},function(a,b){alert("Loading select items failed (URL: '"+String(e.httpGet.url)+"\nError: "+b)})}a.insideModel&&void 0===a.select_model.selected&&(a.select_model.selected=a.find_in_titleMap(a.insideModel)),a.internalModel&&a.uiMultiSelectInitInternalModel(a.externalModel)}else;},a.find_in_titleMap=function(b){for(i=0;i<a.form.titleMap.length;i++)if(a.form.titleMap[i].value==b)return a.form.titleMap[i]},
  a.uiMultiSelectInitInternalModel=function(b){a.externalModel=b,a.internalModel=[],a.form.titleMap&&void 0!==b&&angular.isArray(b)&&b.forEach(function(b){var c=a.find_in_titleMap(b);if(c)a.internalModel.push(c);else{var d=a.externalModel.indexOf(b);-1!=d&&a.externalModel.splice(d,1)}})}}]),angular.module("schemaForm").filter("selectFilter",[function(a){return function(a,b,c,d){if(!angular.isDefined(a)||!angular.isDefined(b.form.options)||!angular.isDefined(b.form.options.filter)||""==b.form.options.filter)return a;b.filteringInitialized||b.initFiltering(c);var e=[];return angular.forEach(a,function(a){b.$eval(b.form.options.filter,{item:a})?e.push(a):c&&("[object Array]"==b.localModelType&&c.indexOf(a.value)>-1?c.splice(c.indexOf(a.value),1):c==a.value&&(c=null))}),"[object Array]"!=b.localModelType||c||b.$eval(d+"=[]"),e}}])}),angular.module("btford.markdown",["ngSanitize"]).provider("markdownConverter",function(){var a={};return{config:function(b){a=b},$get:function(){return showdown.setFlavor("github"),new showdown.Converter(a)}}}).directive("btfMarkdown",["$sanitize","markdownConverter",function(a,b){return{restrict:"AE",link:function(c,d,e){if(e.btfMarkdown)c.$watch(e.btfMarkdown,function(a){var c=new XMLHttpRequest;c.open("GET",a),c.onreadystatechange=function(){var e=c.responseText,f=a?b.makeHtml(e):"";d.html(f)},c.send()});else{var f=a(b.makeHtml(d.text()));d.html(f)}}}}]);