text: angular.module("ngFabForm",["ngMessages"]),angular.module("ngFabForm").directive("form",["ngFabFormDirective",function(a){"use strict";return a}]),angular.module("ngFabForm").directive("input",["ngFabFormValidationsDirective",function(a){"use strict";return a}]),angular.module("ngFabForm").directive("textarea",["ngFabFormValidationsDirective",function(a){"use strict";return a}]),angular.module("ngFabForm").directive("select",["ngFabFormValidationsDirective",function(a){"use strict";return a}]),angular.module("ngFabForm").provider("ngFabForm",function(){"use strict";function a(a,b){var d=angular.element(angular.element("<div/>").html(a));return angular.forEach(b,function(a,b){var e=new RegExp(c.validationMsgPrefix);if(b.match(e)){var f=b.replace(c.validationMsgPrefix,"");f=f.charAt(0).toLowerCase()+f.slice(1);var g=d[0].querySelector('[ng-message="'+f+'"]');if(g)angular.element(g).html(a);else if(!g&&c.createMessageElTplFn){var h=d[0].querySelector("[ng-message]");h&&angular.element(h).after(c.createMessageElTplFn(f,a))}}}),d}var b,c={validationsTemplate:"default-validation-msgs.html",preventInvalidSubmit:!0,preventDoubleSubmit:!0,preventDoubleSubmitTimeoutLength:1e3,setFormDirtyOnSubmit:!0,scrollToAndFocusFirstErrorOnSubmit:!0,scrollAnimationTime:500,scrollOffset:-100,disabledForms:!0,globalFabFormDisable:!1,setNovalidate:!0,setNamesByNgModel:!0,setAsteriskForRequiredLabel:!1,asteriskStr:"*",validationMsgPrefix:"validationMsg",emailRegex:/[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i,watchForFormCtrl:!1,formChangeEvent:"NG_FAB_FORM_OPTIONS_CHANGED",createMessageElTplFn:function(a,b){return'<li ng-message="'+a+'">'+b+"</li>"}},d=function(a,b,c){"checkbox"===c.type||"radio"===c.type?b.parent().after(a):b.after(a)},e=function(){function a(a,b,c,d){return(a/=d/2)<1?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function b(a,b){var c=500,d=Math.abs(a),e=b/10;return b*d/c+e}return function(c,d,e){function f(){l+=m;var b=a(l,j,k,i);window.scrollTo(h,b),i>l?setTimeout(f,m):c.focus()}var g=c.getBoundingClientRect().top+parseInt(e),h=c.getBoundingClientRect().left,i=b(g,d),j=window.pageYOffset,k=g,l=0,m=20;return 0===k?void c.focus():void f()}}();return{extendConfig:function(a){c=angular.extend(c,a)},setInsertErrorTplFn:function(a){d=a},setScrollToFn:function(a){e=a},setCustomValidatorsFn:function(a){b=a},$get:function(){return{insertErrorTpl:d,addCustomValidations:a,customValidators:b,scrollTo:e,config:c}}}}),angular.module("ngFabForm").run(["$templateCache",function(a){"use strict";a.put("default-validation-msgs.html",'<div class="validation" ng-show="attrs.required==\'\'|| attrs.required"><ul class="list-unstyled validation-errors" ng-messages="field.$error" ng-show="field.$invalid && (field.$touched || field.$dirty || form.$triedSubmit)"><li ng-message="required">This field is required</li><li ng-message="ngFabEnsureExpression">Not valid condition</li><li ng-message="password">Please enter a valid password</li><li ng-message="email">Please enter a valid e-mail</li><li ng-message="pattern">Invalid input format</li><li ng-message="date">Please enter a valid date</li><li ng-message="time">Please enter a valid time</li><li ng-message="datetime">Please enter a valid date and time</li><li ng-message="datetime-local">Please enter a valid date and time</li><li ng-message="number">This field must be numeric</li><li ng-message="color">Please enter a valid color</li><li ng-message="range">Please enter a valid range</li><li ng-message="month">Please enter a valid month</li><li ng-message="url">Please enter a valid URL</li><li ng-message="file">Invalid file</li><li ng-message="minlength">Please use at least {{ attrs.minlength }} characters</li><li ng-message="maxlength">Please do not exceed {{ attrs.maxlength }} characters</li><li ng-message="ngFabMatch">The {{ attrs.type ===\'password\'? \'passwords\' : \'values\' }} should match</li><li ng-if="attrs.type == \'time\' " ng-message="min">The time provided should after {{ attrs.min |date: \'HH:MM\' }}</li><li ng-message="max" ng-if="attrs.type == \'time\' ">The time provided should be before {{attrs.max |date: \'HH:MM\'}}</li><li ng-message="min" ng-if="attrs.type == \'date\' ">The date provided should be after {{attrs.min |date:\'dd.MM.yy\'}}</li><li ng-message="max" ng-if="attrs.type == \'date\' ">The date provided should be before {{attrs.max |date: \'dd.MM.yy\'}}</li><li ng-message="min" ng-if="attrs.type === \'number\' ">The number provided should be at least {{attrs.min}}</li><li ng-message="max" ng-if="attrs.type === \'number\' ">The number provided should be at max {{attrs.max}}</li></ul><div class="validation-success" ng-show="field.$valid && !field.$invalid"></div></div>')}]),angular.module("ngFabForm").factory("ngFabFormValidationsDirective",["ngFabForm","$compile","$templateRequest",function(a,b,c){"use strict";function d(d){var e=d.el,f=d.cfg,g=d.formCtrl,h=d.ngModelCtrl,i=d.attrs,j=d.scope;d.currentValidationVars.tpl&&0!==Object.keys(d.currentValidationVars.tpl).length&&angular.element(d.currentValidationVars.tpl).remove(),c(f.validationsTemplate).then(function(c){var f=j.$new(!0);d.currentValidationVars.privateScope=f,c=a.addCustomValidations(c,i),f.attrs=i,f.form=g,f.field=h;var k=b(c.children())(f);d.currentValidationVars.tpl=k[0],a.insertErrorTpl(k[0],e,i)})}function e(a,b,c){var d=document.querySelectorAll('label[for="'+b.name+'"]');if(!d||d.length<1){var e=a[0].previousElementSibling;e&&"LABEL"===e.tagName&&(d=[e])}if(d&&d.length>0&&"radio"!==b.type&&"checkbox"!==b.type)for(var f=0;f<d.length;f++){var g=d[f];g.textContent.slice(-c.asteriskStr.length)!==c.asteriskStr&&(g.textContent=g.textContent+c.asteriskStr)}}return{restrict:"E",require:"?ngModel",compile:function(b,c){return!c.type||"submit"!==c.type.toLowerCase()&&"button"!==c.type.toLowerCase()?(a.config.setNamesByNgModel&&c.ngModel&&!c.name&&!a.config.globalFabFormDisable&&(b.attr("name",c.ngModel),c.name=c.ngModel),function(b,c,f,g){function h(a){!g||!j.validationsTemplate||0===Object.keys(g.$validators).length&&0===Object.keys(g.$asyncValidators).length||a&&j.validationsTemplate===a.validationsTemplate?!j.validationsTemplate&&n.tpl&&0!==Object.keys(n.tpl).length&&(n.privateScope.$destroy(),angular.element(n.tpl).remove()):d({scope:b,el:c,cfg:j,formCtrl:k,ngModelCtrl:g,attrs:f,currentValidationVars:n}),!j.setAsteriskForRequiredLabel||f.required!==!0||a&&j.setAsteriskForRequiredLabel===a.setAsteriskForRequiredLabel&&j.asteriskStr===a.asteriskStr||e(c,f,j)}function i(){b.$evalAsync(function(){if(k=c.controller("form"),k&&g){if(j||(j=k.ngFabFormConfig),!j)return;j.emailRegex&&"email"===f.type&&(g.$validators.email=function(a){return g.$isEmpty(a)||j.emailRegex.test(a)}),a.customValidators&&a.customValidators(g,f),h(),l=b.$on(a.formChangeEvent,function(a,b,c){j=b,h(c)})}})}var j,k,l,m,n={tpl:void 0,privateScope:void 0};a.config.watchForFormCtrl?m=b.$watch(function(){return c.controller("form")},function(a){a&&(m(),i())}):i(),b.$on("$destroy",function(){n&&n.privateScope&&n.privateScope.$destroy()})}):void 0}}}]),angular.module("ngFabForm").directive("ngFabEnsureExpression",["$http","$parse",function(a,b){"use strict";return{require:"ngModel",link:function(a,c,d,e){a.$watch(d.ngModel,function(){var c=b(d.ngFabEnsureExpression)(a);e.$setValidity("ngFabEnsureExpression",c),e.$validate()})}}}]),angular.module("ngFabForm").directive("ngFabMatch",function(){"use strict";return{require:"ngModel",restrict:"A",scope:{ngFabMatch:"="},link:function(a,b,c,d){d.$validators.ngFabMatch=function(b){return Boolean(b)&&b==a.ngFabMatch},a.$watch("ngFabMatch",function(){d.$validate()})}}}),angular.module("ngFabForm").directive("ngFabResetFormOn",function(){"use strict";return{require:"^form",restrict:"A",scope:{ngFabResetFormOn:"@",doNotClearInputs:"@"},link:function(a,b,c,d){c.ngFabResetFormOn||(c.ngFabResetFormOn="click"),b.on(c.ngFabResetFormOn,function(){c.doNotClearInputs?d.$resetForm():d.$resetForm(!0),a.$apply()})}}}),angular.module("ngFabForm").factory("ngFabFormDirective",["$compile","$timeout","ngFabForm",function(a,b,c){"use strict";function d(a){a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation()}function e(a,b){if(b.disableForm){a.contents().wrap("<fieldset>");var c=a.children();b.$observe("disableForm",function(){"true"===b.disableForm||b.disableForm===!0?c.attr("disabled",!0):c.attr("disabled",!1)})}}function f(a,b,d,e){var f=a[0].querySelector(".ng-invalid");f&&b.$invalid&&c.scrollTo(f,parseInt(d),e)}return{restrict:"EAC",scope:!1,require:"?^form",compile:function(a,g){var h,i=angular.copy(c.config);if(i.globalFabFormDisable!==!0||!angular.isUndefined(g.ngFabForm))return!g.novalidate&&i.setNovalidate&&(a.attr("novalidate",!0),g.novalidate=!0),{pre:function(a,c,e,g){c.bind("submit",function(e){i.setFormDirtyOnSubmit&&a.$apply(function(){g.$triedSubmit=!0}),i.preventInvalidSubmit&&!g.$valid?d(e):i.preventDoubleSubmit&&(g.$preventDoubleSubmit&&d(e),h&&b.cancel(h),g.$preventDoubleSubmit=!0,h=b(function(){g.$preventDoubleSubmit=!1},i.preventDoubleSubmitTimeoutLength)),i.scrollToAndFocusFirstErrorOnSubmit&&f(c,g,i.scrollAnimationTime,i.scrollOffset)})},post:function(a,d,f,g){g.$triedSubmit=!1,g.$preventDoubleSubmit=!1,g.ngFabFormConfig=i,g.$resetForm=function(a){if(a===!0)for(var b=d.find("input"),c=0;c<b.length;c++){var e=angular.element(b[c]),f=e.controller("ngModel");f&&(f.$setViewValue(""),f.$render())}g.$triedSubmit=!1,g.$setPristine(),g.$setUntouched()},i.disabledForms&&e(d,f),f.ngFabFormOptions&&a.$watch(f.ngFabFormOptions,function(b){if(b){var d=angular.copy(i);i=g.ngFabFormConfig=angular.extend(i,b),a.$broadcast(c.formChangeEvent,i,d)}},!0),a.$on("$destroy",function(){h&&b.cancel(h)})}}}}}]),angular.module("ngFabForm").directive("ngForm",["ngFabFormDirective",function(a){"use strict";return a}]);