define(["require","jquery","angular","jquery.vclick","angularElementScroll","angularAnimate","angularElement","polyfills","jquery.ripple"],(function(e){e(["nouislider"]);var t,n,i,r=e("polyfills"),o=e("angular"),l=e("jquery"),a=r.isEmpty,s=r.String.isEmpty,c=r.Number.isNumber,u=r.Number.toNumber,d=e("jquery.ripple");Number.prototype.formatMoney=function(e,t,n,i){return r.Number.formatMoney(this,e,t,n,i)},o.module("extra",["duScroll"]).constant("date",r.Date).constant("$viewport",(t={},n={},i={body:o.element(document).cssSelect("#viewport").eq(0),data:function(e,n){if(null==n)return t[e];t[e]=n},scrolling:!1,scrollTop:function(e){if(null==e)return this.body.prop("scrollTop");this.body.prop("scrollTop",e)},scrollStop:function(e){setTimeout((function(){for(var t=i.data("scrollTop");i.scrollTop()!=t;)i.scrollTop(t);e&&e()}))},scrollHeight:function(){return this.body.prop("scrollHeight")},scrollTopFixed:function(e,t){var n,r=function(e){i.scrollTop()!==n&&i.scrollTop(n),e.preventDefault(),e.stopImmediatePropagation()};n=t||this.scrollTop(),this.body.off("scroll",r),e&&this.body.on("scroll",r)},setBody:function(e){i.body=e},setup:function(){i.data("scrollTop",0),i.body.on("scroll",(function(){i.data("scrollTop",i.scrollTop()),o.element(document).trigger("scrolling")}))},scrollSave:function(e){n.scrl=void 0!==e?e:this.body.prop("scrollTop")},scrollRestore:function(){this.data("scrollTo",n.scrl||1),n.scrl=1}},i)).run(["$viewport","$rootScope",function(e,t){e.setup()}]).directive("ngDropdown",["$timeout","$viewport","$document","$rootScope",function(e,t,n,i){return{restrict:"A",scope:{modelValue:"=ngModel",disabled:"=disabled",listItems:"=?ngDrpListItems",afterSelect:"=?ngDrpAfterSelect",onSelect:"=?ngDrpOnSelect",tabindex:"=?ngDrpTabindex",labelId:"=?ngDrpLabelId",drpPlaceholder:"=?ngDrpPlaceholder"},transclude:!0,template:'<span tabindex="{{tabindex || 0}}" role="button" aria-haspopup="listbox" aria-expanded="{{list_opened}}" class="{{selected_class}}" ng-if="!no_select && !empty_select && !disabled" ng-aria-label="label_value" hm-highlight data-sel-id="dropdown-selected">{{display_value}}</span><span tabindex="{{tabindex || 0}}" role="button" aria-haspopup="listbox" aria-expanded="{{list_opened}}" class="{{placeholder_class}}" ng-if="(no_select || empty_select) && placeholder && !disabled"  hm-highlight>{{placeholder}}</span><span tabindex="0" role="text" class="{{selected_class}}" ng-if="disabled" data-sel-id="dropdown-selected">{{display_value || placeholder}}</span><ul aria-labelledby="{{list_label}}" aria-activedescendant="{{activedescendant}}" role="listbox" tabindex="0" class="ng-animate-enabled basic-trans ng-hide" ng-class="[list_class,{ fast: !$root.isAndroid, enter : !$root.isAndroid }]" ng-show="list_opened" ng-keydown="ListOnKey($event)" hm-tap="preventEv($event)" hm-options="{ ripple: false, delay : 0 }"><li ng-attr-id="{{optionid+\'-\'+$index}}" ng-attr-aria-selected="{{value == selected_value || false}}" role="option" ng-class="[item_class,{ active : value == selected_value  }]" ng-repeat="value in selectList track by $index" hm-tap="select($event,value,$index)" hm-options="{ ripple: false, delay : 0 }" ng-focus-when="(!(no_select || empty_select) && selected_value == value) || ((no_select || empty_select) && $index == 0)" ng-bind-html="value" ng-aria-label="labelList[$index]" data-sel-id="dropdown-item"></li></ul>',compile:function(l,a){return{pre:function(e,t,n){var i=e.$eval(n.ngDropdown)||{};e.list_opened=!1,e.preventEv=function(e){e.stopPropagation()},e.selectList=[];var r=void 0!==i.arrowClass?i.arrowClass:"ng-dropdown-arrow bf-icon-down-open";r&&t.append('<span class="'+r+'" tabindex="-1" aria-hidden="true"></span>')},post:function(l,a,s){var c,u=l.$eval(s.ngDropdown)||{},d=[],f=[],p=[],v=null,g=13,h=38,m=40,$=0;l.activedescendant=null,l.optionid=r.uniqid("option-"),l.display_value="",l.selected_value="",l.$watch("listItems",(function(e){for(var t in f=e||[],d=[],l.selectList=[],l.labelList=[],p=[],f)o.isArray(f[t])?(d[t]=f[t][1],o.isArray(f[t][0])?(l.selectList[t]=f[t][0][0],l.labelList[t]=f[t][0][f[t][0].length-1]||f[t][0][0],3==f[t][0].length?p[t]=f[t][0][1]:p[t]=f[t][0][0]):(l.selectList[t]=f[t][0],l.labelList[t]=f[t][0],p[t]=f[t][0])):(d[t]=f[t],l.selectList[t]=f[t],l.labelList[t]=f[t],p[t]=f[t]);r.Array.forEach(l.selectList,(function(e,t){if(l.selected_value==e)return l.activedescendant=l.optionid+"-"+t.toString(),$=t,l.label_value=(v?v+". ":"")+l.labelList[t],!1})),l.activedescendant||(l.activedescendant=l.optionid+"-0",$=0)}),!0),l.$watch("drpPlaceholder",(function(e){e&&(l.placeholder=e)})),l.$watch(s.ngDropdown,(function(e){if(e=l.$eval(s.ngDropdown)||{},!l.listItems&&e.list)for(var t in f=e.list||[],d=[],p=[],l.selectList=[],l.labelList=[],f)o.isArray(f[t])?(d[t]=f[t][1],o.isArray(f[t][0])?(l.selectList[t]=f[t][0][0],l.labelList[t]=f[t][0][f[t][0].length-1]||f[t][0][0],3==f[t][0].length?p[t]=f[t][0][1]:p[t]=f[t][0][0]):(l.selectList[t]=f[t][0],l.labelList[t]=f[t][0],p[t]=f[t][0])):(d[t]=f[t],l.selectList[t]=f[t],l.labelList[t]=f[t],p[t]=f[t]);if(l.list_label=l.labelId||e["list-label-id"]||"",l.list_class=e.listClass||"ng-dropdown-list",l.item_class=e.itemClass||"ng-dropdown-item",l.placeholder_class=e.placeholderClass||"ng-dropdown-placeholder",l.selected_class=e.selectedClass||"ng-dropdown-selected",l.no_select=void 0!==e.noSelect&&e.noSelect,l.placeholder=void 0!==e.placeholder?e.placeholder:e.fallbackPlaceholder?e.fallbackPlaceholder:"Choose",l.change_list_position=e.changeListPosition,l.list_position_offset=e.listPositionOffset||0,null==v)if(e.listTitle)v=e.listTitle;else if(l.list_label){var n=document.querySelector("#"+l.list_label);n&&(v=n.textContent)}}),!0),l.$watch("modelValue",(function(e){var t,n,i=d.indexOf(e);i>-1?(t=l.selectList[i],n=l.labelList[i],l.label_value=(v?v+". ":"")+n,o.equals(l.selected_value,t)||(l.selected_value=t,l.display_value=p[i]),l.empty_select=!1):l.empty_select=!0,l.list_opened=!1,l.afterSelect&&l.afterSelect(t,i,e);var r=l.$eval(s.ngDropdown)||{};r.afterSelect&&r.afterSelect(t,i,e)})),l.$watch("list_opened",(function(i){e.cancel(c);var o=a.find("ul"),s=u.offsetParent?a.find("ul").parents(u.offsetParent).prop("scrollHeight"):t.body.prop("scrollHeight"),d=u.offsetParent?a.find("ul").parents(u.offsetParent).prop("clientWidth"):t.body.prop("clientWidth");c=e((function(){if(i){if(l.change_list_position){var e=0,t=r.Number.toNumber(d)-(a.offset().left+a.prop("clientWidth")),c=o.prop("clientWidth");a.prop("clientWidth")+t<c&&(e=a.prop("clientWidth")+t-c-15),void 0!==l.list_position_offset&&(e-=l.list_position_offset),o.css({left:e+"px"})}var f=o.offset(!!u.offsetParent&&a.find("ul").parents(u.offsetParent)).top+o.prop("offsetHeight");s<f?o.addClass("upwards"):o.removeClass("upwards"),n.one("vclick",y),n.one("click",y)}else o.removeClass("upwards"),n.off("vclick",y),n.off("click",y)}),50)}));var b=!1;l.select=function(t,n,r){b=!0;var o=d[r],c=l.labelList[r];l.selected_value=n,l.label_value=(v?v+". ":"")+c,l.display_value=p[r],l.modelValue=o,a[0].querySelector('[aria-haspopup="listbox"]').focus(),setTimeout((function(){a[0].querySelector('[aria-haspopup="listbox"]').focus()})),e((function(){l.onSelect&&l.onSelect(n,r,o);var e=l.$eval(s.ngDropdown)||{};e.onSelect&&e.onSelect(n,r,o),l.list_opened=!1}),i.isAndroid?1:100),$=r,l.activedescendant=l.optionid+"-"+$,t&&t.stopPropagation(),setTimeout((function(){b=!1}),50)},l.indexSelect=function(e){l.selected_value=l.selectList[e],l.label_value=(v?v+". ":"")+l.labelList[e],l.modelValue=d[e],l.display_value=p[e]};var y=function(e){l.$applyAsync((function(){l.list_opened=!1}))};a.on("vclick",(function(i){l.disabled||(i.stopPropagation(),e((function(){if(!b){var i=l.$eval(s.ngDropdown)||{};if(!1===i.enabled)return!1;l.list_opened||i.noBubble||n.trigger("vclick"),e((function(){l.list_opened=!l.list_opened}),t.data("android")?200:0)}})))})),l.ListOnKey=function(e){var t=e.keyCode;switch(t){case g:var n=$;r.Number.isNumber(n)&&l.select(null,l.selectList[n],n);break;case h:case m:n=$;$=t==m?n<l.selectList.length-1?n+1:0:n>0?n-1:l.selectList.length-1,l.activedescendant=l.optionid+"-"+$,e.preventDefault()}};var w=function(){n.off("vclick",y),a.off("vclick"),a.off("keydown")};l.$on("$destroy",w),a.one("$destroy",w)}}}}}]).directive("ngSlider",["$document",function(t){return{restrict:"AE",require:"ngModel",link:function(t,n,i,o){var l=n[0],a=!1,s=i.ngModel;e(["nouislider"],(function(e){var d=t.$watch(i.ngSlider,(function(n){var i=r.Object.assign({start:0,step:1,orientation:"horizontal",connect:"lower",range:{min:0,max:100}},n||{});i.range.min||(i.range.min=0),l.noUiSlider&&l.noUiSlider.destroy(),e.create(l,i),l.noUiSlider.off("slide"),l.noUiSlider.on("slide",(function(){a=!0})),l.noUiSlider.off("change"),l.noUiSlider.on("change",(function(e){a=!1,t.$applyAsync((function(){o.$setViewValue(u(e[0])),o.$render()}))})),l.noUiSlider.set(t.$eval(s))}),!0),f=t.$watch(i.ngModel,(function(e){a||l.noUiSlider&&l.noUiSlider.set(c(e)?e:0)}));n.one("$destroy",(function(){d(),f(),l.noUiSlider&&l.noUiSlider.destroy()}))}))}}}]).directive("ngHtmlContent",["$compile","$injector","$timeout","$parse",function(e,t,n,i){return{restrict:"A",link:function(r,o,l){r.$watch(l.ngHtmlContent,(function(a,s){var c;t.has("$sanitize")?t.invoke(["$sanitize",function(e){var t=r.$eval(l.ngHtmlSanitize);c=t?e(a):a}]):c=a;var u=i(l.ngHtmlContentBefore).bind(null,r),d=i(l.ngHtmlContentAfter).bind(null,r);u({$element:o[0]}),o.html(c),e(o.contents())(r),n((function(){d({$element:o[0]})}))}))}}}]).directive("ngHtmlDirect",["$compile","$injector","$timeout","$parse",function(e,t,n,i){return{restrict:"A",link:function(t,n,i){t.$watch(i.ngHtmlDirect,(function(i,r){n.html(i),e(n.contents())(t)}))}}}]).directive("ngSrcSafe",(function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngSrcSafe,(function(e){t[0].setAttribute("src",e)}))}}})).directive("ngNoAutoFocus",["$timeout",function(e){return{restrict:"A",compile:function(t,n){return{pre:function(e,t,n){t.attr("readonly","true")},post:function(t,n,i){e((function(){n.removeAttr("readonly")}),500)}}}}}]).directive("ngFocusWhen",["$timeout",function(e){return{restrict:"A",link:function(e,t,n){var i=e.$eval(n.ngFocusClick);e.$watch(n.ngFocusWhen,(function(e){e&&(i&&t[0].click(),t[0].focus(),setTimeout((function(){i&&t[0].click(),t[0].focus()})))}))}}}]).directive("ngFocusToggle",(function(){return{restrict:"A",scope:{flag:"=ngFocusToggle"},link:function(e,t,n){function i(){e.$applyAsync((function(){e.flag=!0}))}function r(){e.$applyAsync((function(){e.flag=!1}))}t.on("focus",i),t.on("blur",r),e.$on("$destroy",(function(){t.off("focus",i),t.off("blur",r)}))}}})).directive("ngTabNext",["$timeout",function(e){return{restrict:"A",link:function(e,t,n){var i=function(i){if(8==i.keyCode)return!1;var l=r.String.trim(t.val()).length,a=e.$eval(n.ngTabNext),s=(a.length||u(t.attr("maxlength")))<=l,c=o.element().cssSelect(a.selector);s&&c.focus().caret(0)};t.on("keyup",i),e.$on("$destroy",(function(){t.off("keyup",i)}))}}}]).directive("ngTabPrevious",["$timeout",function(e){return{restrict:"A",link:function(e,t,n){var i=function(i){var l=e.$eval(n.ngTabPrevious),a=o.element().cssSelect(l.selector),s=r.String.trim(t.val()).length;8==i.keyCode&&(0==s||t.caret()<=0)&&a.focus().caret(a.val().length)},l=function(i){var l=e.$eval(n.ngTabPrevious),a=o.element().cssSelect(l.selector),s=r.String.trim(t.val()).length;8==i.keyCode&&0==s&&0==s&&a.focus().caret(a.val().length)};t.on("keyup",i).on("keydown",l),e.$on("$destroy",(function(){t.off("keyup",i).off("keydown",l)}))}}}]).directive("ngTabOnEnter",["$timeout",function(e){return{restrict:"A",link:function(e,t,n){var i=function(i){if(i.preventDefault(),13===i.keyCode){var r=e.$eval(n.ngTabOnEnter),l=o.element().cssSelect(r.selector);return t[0].blur(),setTimeout((function(){l&&l.focus()}),700),!1}};t.on("keyup",i),e.$on("$destroy",(function(){t.off("keyup",i)}))}}}]).directive("ngTogglePassword",["$window","$timeout",function(e,t){return{restrict:"A",scope:{onShow:"=?ngShow",onHide:"=?ngHide",ngdelay:"=?ngDelay"},link:function(n,i,r){i.append("<span class='ng-toggle-btn-pass semi-bold-font' style='visibility:hidden;'>show</span>"),i.css({position:"relative"});var l=i.find(".ng-toggle-btn-pass"),a=i.find("input[type='password']");l&&l.css("visibility","hidden"),a&&a.css({"padding-right":"55px"});var s=function(){t((function(){if(l&&a){var e=a.outerHeight(),t=a.position().top,n=a.outerWidth()+a.position().left-55;l.css({position:"absolute","font-size":"13px",right:"auto",display:"block",width:"55px",height:e+"px","line-height":e-2+"px",top:t+"px",left:n+"px",cursor:"pointer","text-align":"center"}),a&&!a.val()?l&&l.css("visibility","hidden"):l.css("visibility","")}}),n.ngdelay||0)};function c(e){t((function(){e.target&&e.target.value?s():l&&l.css("visibility","hidden")}))}s(),o.element(e).on("resize",s),a&&a[0]&&a[0].addEventListener("input",c,!0),n.$watch("onShow",(function(e){e&&s()})),n.$watch("onHide",(function(e){e||s()})),l.on("vclick",(function(e){a&&"password"==a.attr("type")?(a.attr("type","text"),l.prop("innerHTML","hide")):a&&(a.attr("type","password"),l.prop("innerHTML","show"))}));var u=function(){o.element(e).off("resize",s),l&&(l.off("vclick"),l.remove()),a&&a[0]&&a[0].removeEventListener("input",c),i.off("vclick"),l=void 0};n.$on("$destroy",u),i.one("$destroy",u)}}}]).directive("ngToolTip",["$animate","$viewport","$compile","$document","$window","$timeout",function(e,t,n,i,r,l){return{restrict:"A",scope:{open_flag:"=?ngToolTipToggle",tipcontent:"=?ngToolTip"},link:function(a,s,f){var p=document.createElement("div"),v=o.element(p),g=o.merge({ripple:!0,width:400,offsetParent:t.body,offset:{top:0,left:0},class:"ng-tooltip",closeClass:"close-bt bf-icon-cross",preventDef:!1},a.$eval(f.ngToolTipOptions)),h=g.offsetParent,m="string"==typeof h?o.element(document).cssSelect(h):h,$=g.useparent?s.parent():m;v.addClass(g.class).addClass("ng-animate-enabled").append('<div class="tail"></div><div tooltip-content-holder></div><div class="'+g.closeClass+'"></div>');var b=v.children("div").eq(2);b.css({"touch-action":"manipulation","-webkit-user-select":"none","-webkit-user-drag":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),b.attr("role","button"),b.attr("aria-label","Close Popup"),b.attr("tabindex","0"),s.css({"touch-action":"manipulation","-webkit-user-select":"none","-webkit-user-drag":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),"static"==s.getStyle("position")&&s.css("position","relative");var y=function(e){e.target&&e.target.href&&window.open(e.target.href,"_parent"),e.preventDefault(),e.stopPropagation()},w=function(){a.$applyAsync((function(){v&&e.leave(v),g.onClose&&g.onClose(),A=!1,a.open_flag=!1}))},A=!1;t.data("android")&&g.ripple&&d.add(s,!0),s.on("vclick",(function(d){var p=a.$eval(f.ngToolTipEnabled);null==p&&(p=!0),p&&(d.stopPropagation(),g.preventDef&&d.preventDefault(),l((function(){if(A)return A=!1,w(),!1;A=!0,i.trigger("vclick"),a.open_flag=!0;var l=document.createElement("div");l.setAttribute("tooltip-content",""),l.setAttribute("class","content"),o.element(l).prop("innerHTML",a.tipcontent);var d=n(o.element(l))(a.$parent);v.cssSelect("[tooltip-content-holder]").after(d),v.cssSelect("[tooltip-content-holder]").remove(),o.forEach(v.find("input"),(function(e,t,n){n.data("disabled",n.attr("disabled")),n.attr("disabled","disabled")})),v.css({width:"0px",left:"-999px",top:"-999px"}),e.on("leave",v,(function(e,t){v&&(v.off("vclick"),v.find(".close-bt").off("vclick")),i.off("vclick",w),o.element(r).off("resize",w),v.cssSelect("[tooltip-content]").after("<div tooltip-content-holder></div>"),v.cssSelect("[tooltip-content]").remove()})),e.on("enter",v,(function(e,n){if(v&&"start"==n&&(o.element(r).one("resize",w),setTimeout((function(){var e=m.prop("scrollHeight");if(function(){if(m.css("overflow-y","scroll"),v){v.css({width:g.width+"px"});var e=s.offset(parent).left;g.usebound&&s[0]&&s[0].getBoundingClientRect()&&(e=s[0].getBoundingClientRect().left);var n,i=Math.min(e+g.offset.left,m.prop("clientWidth")-v.prop("offsetWidth")-15);i<15?(n=g.width+(i-15),i=15):n=g.width;var r=s[0].getBoundingClientRect(),l=r.top+m.prop("scrollTop");if(g.useparent){var a=s[0].parentNode;l=a.offsetHeight+g.offset.top,i=a.offsetWidth+g.offset.left}else{if(m.is("body")&&!g.useparent){var d=s[0].offsetParent;for(l=r.top;d;)l+=o.element(d).prop("scrollTop"),d=d.offsetParent}var f=u(m.css("border-top-width"));c(f)||(f=0),l-=f;var p=u(t.body.css("padding-top"));c(p)||(p=0),l-=p}var h=Math.min(l+s.prop("offsetHeight")+g.offset.top,m.prop("scrollHeight")-15);!g.useparent&&m.is("body")&&h<s.offset().top?h=Math.min(s.offset().top+s.prop("offsetHeight")+g.offset.top,m.prop("scrollHeight")-15):h<l&&(h=Math.min(l+s.prop("offsetHeight")+g.offset.top,m.prop("scrollHeight")-15)),v.css({width:n+"px",left:i+"px",top:h+"px"}),m.css("overflow-y","")}}(),m.prop("scrollHeight")>e&&v.css({top:v.getStyle("top",!0)-(m.prop("scrollHeight")-e+15)+"px"}),v&&v[0]){var n=v[0].getBoundingClientRect(),i=n.left+n.width,r=v.getStyle("left",!0);i>window.innerWidth&&(r-=i-window.innerWidth+15),null!=r&&v.css({left:r+"px"})}})),v.attr("role","dialog"),v.attr("tabindex","0"),null!==g.role&&v&&v[0])){var i=v[0].querySelector("[tooltip-content]");i&&(i.setAttribute("role",g.role||"tooltip"),i.setAttribute("ng-speak","'header'"),i.setAttribute("tabindex","0"))}})),e.enter(v,$[0]||null,$[0]&&$[0].lastChild||null).then((function(){v&&(o.forEach(v.find("input"),(function(e,t,n){n.data("disabled")?n.attr("disabled",n.data("disabled")):n.removeAttr("disabled")})),v.on("vclick",y),b.one("vclick",(function(e){w(),y(e)})),i.one("vclick",w))}))})))}));var k=function(){v&&(v.off("vclick"),b.off("vclick",w),w(),e.off(v),v.remove()),i.off("vclick",w),o.element(r).off("resize",w),s.off("vclick"),d.remove(s),v=void 0,p=void 0,b=void 0};a.$on("$destroy",k),s.one("$destroy",k)}}}]).directive("ngAutocomplete",["$animate","$http","$q","$parse","$viewport","$document","$timeout","$injector",function(e,t,n,i,l,a,s,c){return{restrict:"A",scope:{key:"=ngKey",selectHandler:"=?ngAutoselect",progress:"=?ngAutoprogress",responseHandler:"=?ngAutoresponse",cancelHandler:"=?ngAutocanceled",autoDisplay:"=?ngAutodisplay",responseData:"=?ngAutoData",activedescendant:"=?ngAcActive",focusHandler:"=?ngAcHighlight",blurOnLimit:"=?ngAcBlurOnLimit",stopCall:"=?ngAcStopCall"},transclude:!0,template:'<ul tabindex="0" role="listbox" ng-attr-id="{{ listid || \'\' }}" class="ng-autocomplete-list ng-animate-enabled basic-trans enter fast ng-hide" ng-show="hasResult" ng-focus="GoToFirst(0)" ng-keydown="AcOnKey($event)" aria-labelledby="{{list_label}}" ng-aria-activedescendant="activedescendant"><li role="option" tabindex="-1" ng-attr-id="{{acid+\'-\'+$index}}" class="ng-autocomplete-item" data-ng-repeat="value in ul track by $index" hm-tap="select($event,$index)" ng-bind-html="value" aria-selected="false" ng-class="{\'selected\' : activedescendant == acid+\'-\'+$index}" ng-focus="GoToFirst($index)"></li></ul>',link:function(e,i,l){var u,d,f,p,v,g;u=o.extend({minlength:1,url:!1,list:"list",method:"GET",keyName:"key"},e.$eval(l.ngAutocomplete)),e.listid=u["list-id"]||"",e.list_label=u["list-label"]||"",e.is_list_object="object"==u.list,e.list_object_key=u["object-key"]?u["object-key"]:"name",e.select=function(t,n){var i=[t];if(e.is_list_object)e.key=e.list[n]&&e.list[n][e.list_object_key]?e.list[n][e.list_object_key]:"",d=e.key,i.push(e.list[n]);else for(var r in e.key=e.list[0][n],d=e.key,e.list)i.push(e.list[r][n]);e.selectHandler&&e.selectHandler.apply(this,i),f=!0,setTimeout((function(){f=!1,a.off("vclick",p)}),100),e.hasResult=!1},d=e.key,p=function(t){e.$applyAsync((function(){e.hasResult=!1,e.$emit("$autocomplete:listdisplay",!1),e.cancelHandler&&!f&&e.cancelHandler()}))},e.$watch("key",(function(i){if(e.stopCall)return e.hasResult=!1,void s.cancel(g);s.cancel(g),g=s((function(){if(e.progress=!1,e.autoDisplay=!1,!i||i.length<u.minlength||i==d)return v&&v.resolve(!0),void((!i||i.length<u.minlength)&&(e.hasResult=!1));d=i,v?v.resolve(!0):v=n.defer(),v=n.defer();var r={};r[u.keyName]=i;var o,l={url:u.url,method:u.method,timeout:v.promise,id:"auto-complete-list",events:!1,ignore_connection:!0,anonymous:!0,required:!1};"POST"==u.method?l.data=r:l.params=r,e.progress=!0,c.has("$api")&&(t=c.get("$api").http,o=!0),(e.responseData?e.responseData(l):u.url?t(l):n.resolve({})).then((function(t){var n,i=o?t:t.data,r=e.responseHandler?e.responseHandler(i):i;if(e.ul=[],"object"==u.list){e.ul=[];for(var l=u["object-key"]?u["object-key"]:"name",a=0;a<r.length;a++)e.ul.push(r[a][l]);e.list=r}else n=u.list.indexOf("|")>-1?u.list.split("|"):[u.list],e.ul=r[n[0]]||[],e.list=function(){for(var e=[],t=0,i=n.length;t<i;t++)e.push(r[n[t]]);return e}();e.activedescendant=null,y=0,e.ul.length>0?e.hasResult=!0:e.hasResult=!1,e.progress=!1,e.$emit("$autocomplete:listdisplay",e.hasResult)}),(function(t){e.hasResult=!1,t.xhrStatus&&"abort"==t.xhrStatus||(e.progress=!1),e.$emit("$autocomplete:listdisplay",!1),e.ul=[]}))}),150)}));var h=200;e.$watch("autoDisplay",(function(t){t?e.ul&&e.ul.length>0&&s((function(){e.hasResult=!0,h=200})):h=0}));var m=13,$=38,b=40,y=0;e.GoToFirst=function(t){t&&(y=t),e.activedescendant=e.acid+"-"+y,e.focusHandler&&e.focusHandler(null,e.ul[y])},e.activedescendant=null,e.acid=r.uniqid("ac-"),e.AcOnKey=function(t){var n=t.keyCode;switch(n){case m:var i=y;r.Number.isNumber(i)&&e.select(null,i);break;case $:case b:i=y;if(n==b){if(i<e.ul.length-1)y=i+1;else if(y=0,e.blurOnLimit)return e.blurOnLimit(t),void(e.activedescendant=null)}else if(i>0)y=i-1;else if(y=e.ul.length-1,e.blurOnLimit)return e.blurOnLimit(t),void(e.activedescendant=null);e.activedescendant=e.acid+"-"+y,e.focusHandler&&e.focusHandler(null,e.ul[y]),t.preventDefault()}},e.$watch("hasResult",(function(e){setTimeout((function(){e&&(a.off("vclick",p),a.one("vclick",p))}),h)})),e.$on("$destroy",(function(){v&&v.resolve(!0),a.off("vclick",p),e.progress=!1}))}}}]).directive("ngScrollTo",["$viewport","$parse","$timeout","$rootScope",function(e,t,n,i){return{restrict:"A",link:function(n,r,l){var a=l.ngScrollTo,s=l.ngScrollBefore,c=l.ngScrollAfter,d=n.$watch(a,(function(e){e&&setTimeout((function(){var e;((e=r[0]).offsetWidth||e.offsetHeight||e.getClientRects().length)&&r.triggerHandler("scrollToMeAnim")}))})),f=function(){var t=o.merge({offset:0,parent:e.body},n.$eval(l.ngScrollOptions)),a="string"==typeof t.parent?"document"==t.parent?o.element().cssSelect("body"):o.element(document).cssSelect(t.parent):t.parent;if(t.offset+=u(a.css("border-top-width")),r[0].getBoundingClientRect().top<0&&t.offset==u(a.css("border-top-width"))&&i.isWeb){var s=document.querySelector("#viewport>header");s&&(t.offset=s.offsetHeight)}return t};r.on("scrollToMeAnim",(function(){var i=f(),l="string"==typeof i.parent?"document"==i.parent?o.element(document):o.element(document).cssSelect(i.parent):i.parent;c&&(c=t(c).bind(null,n)),s&&n.$eval(s),void 0!==i.speed&&0==i.speed?(e.body.css("overflow-y","hidden"),l.duScrollToElement(r,i.offset,0).then((function(){var t=l.prop("scrollTop");n.$applyAsync((function(){c&&c({scrollY:t})})),e.body.css("overflow-y","")}))):l.duScrollToElementAnimated(r,i.offset,void 0!==i.speed&&i.speed).then((function(){var e=l.prop("scrollTop");n.$applyAsync((function(){c&&c({scrollY:e})})),l.duScrollToElement(r,i.offset,0)}))})),r.on("scrollToMe",(function(){var e=f(),i=l.ngScrollBefore,a="string"==typeof e.parent?o.element(document).cssSelect(e.parent):e.parent;i&&n.$eval(i),c&&(c=t(c).bind(null,n)),a.duScrollToElement(r,e.offset,0).then((function(){var t=a.prop("scrollTop");n.$applyAsync((function(){c&&c({scrollY:t})})),a.duScrollToElement(r,e.offset,0)}))}));var p=function(){r.off("scrollToMeAnim"),r.off("scrollToMe"),d()};n.$on("$destroy",p),r.on("$destroy",p)}}}]).directive("ngScrollControl",["$animate",function(e){return function(t,n,i){e.on("enter",n,(function(e,t){o.equals(n,e)&&"close"==t&&e.prev().triggerHandler("scrollToMe")}));var r=function(){e.off(n)};t.$on("$destroy",r),n.on("$destroy",r)}}]).directive("ngScrollInView",["$parse","$timeout",function(e,t){return{restrict:"A",scope:{inView:"&ngScrollInView",offView:"&ngScrollOffView",offset:"<ngScrollOffset"},link:function(n,i,r){var o=e(n.inView),a=e(n.offView),s=function(){var e=n.offset||{},r=function(e,t){var n=e.getBoundingClientRect().top+(t&&t.top||0),i=e.getBoundingClientRect().bottom+(t&&t.bottom||0),r=e.getBoundingClientRect().height,o=window.innerHeight,l=Math.round(.45*o),a=Math.round(.55*o),s=r>Math.round(.45*o);return r>0&&(n>=0&&i<=o||s&&(i>=a&&i<=o||n>=0&&n<=l||n<=0&&i>=o))}(i[0],e);t(r?function(){o()}:function(){a()})},c=function(){l(window).off("scrollend",s)};i.one("$destroy",c),n.$on("$destroy",c),s(),l(window).on("scrollend",s)}}}]).directive("ngMaxChar",(function(){return{require:"ngModel",link:function(e,t,n,i){var r=Number(n.ngMaxChar);function o(e){if(e.length>r){var t=e.substring(0,r);return i.$setViewValue(t),i.$render(),t}return e}i.$parsers.push(o),e.$on("$destroy",(function(){i.$parsers.indexOf(o)>-1&&i.$parsers.splice(o,1)}))}}})).directive("ngMin",(function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,i){e.$watch(n.ngMin,(function(){i.$setViewValue(i.$viewValue)}));var r=function(t){var r=e.$eval(n.ngMin)||0;return!a(t)&&t<r?void i.$setValidity("ngMin",!1):(i.$setValidity("ngMin",!0),t)};i.$parsers.push(r),i.$formatters.push(r),e.$on("$destroy",(function(){var e=i.$parsers.indexOf(r),t=i.$formatters.indexOf(r);e>-1&&i.$parsers.splice(r,1),t>-1&&i.$formatters.splice(r,1)}))}}})).directive("ngMax",(function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,i){e.$watch(n.ngMax,(function(){i.$setViewValue(i.$viewValue)}));var r=function(t){var r=e.$eval(n.ngMax)||1/0;return!a(t)&&t>r?void i.$setValidity("ngMax",!1):(i.$setValidity("ngMax",!0),t)};i.$parsers.push(r),i.$formatters.push(r),e.$on("$destroy",(function(){var e=i.$parsers.indexOf(r),t=i.$formatters.indexOf(r);e>-1&&i.$parsers.splice(r,1),t>-1&&i.$formatters.splice(r,1)}))}}})).directive("ngModelSum",(function(){return{require:"?ngModelSumOptions",scope:{total:"=ngModelSum",options:"=ngModelSumOptions"},controller:["$scope",function(e){var t=[],n={min:-1/0,max:1/0};e.$watch("options",(function(e){o.extend(n,e)}),!0),this.register=function(i,r,o,l){t.push({ctrl:r,el:i,focused:!1});var a=t[t.length-1],s=function(){a.focused=!0},c=function(){a.focused=!1},u=function(){i.off("focus",s).off("blur",c),delete t[t.indexOf(a)]};i.on("focus",s).on("blur",c),i.one("$destroy",u),l.$watch(o,(function(){a.focused&&(e.total=function(e){var i,r,o=0,l=n.max;for(var a in t)o+=isNaN(t[a].ctrl.$modelValue)?0:t[a].ctrl.$modelValue;if(o>l){for(var a in o=l,r=0,t)t[a].ctrl!=e?r+=t[a].ctrl.$modelValue:i=t[a];i&&(i.focused?(i.ctrl.$setViewValue(o-r),i.ctrl.$render(),i.el[0].blur(),setTimeout((function(){i.el[0].focus()}))):(i.ctrl.$setViewValue(o-r),i.ctrl.$commitViewValue()))}return o}(r))})),e.$on("$destroy",u),l.$on("$destroy",u)},e.$on("$destroy",(function(){n={},t=[]}))}]}})).directive("ngSum",(function(){return{require:["^ngModelSum","ngModel"],link:function(e,t,n,i){var r=i[0],o=i[1];r.register(t,o,n.ngModel,e)}}})).directive("onlyNumbers",(function(){return{require:"ngModel",restrict:"A",link:function(e,t,n,i){var r=n.onlyNumbers;r="string"==r;var o=function(e){if(null==e)return"";var t=e.toString().trim();if(s(t))return"";var n=t.replace(/[^0-9]/g,"");return n!=t&&(i.$setViewValue(n),i.$render()),r?n:parseFloat(n)};i.$parsers.push(o),e.$on("$destroy",(function(){i.$parsers.indexOf(o)>-1&&i.$parsers.splice(o,1)}))}}})).directive("modelMatch",[function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,i){e.$watch((function(){var t=e.$eval(n.ngModel),i=e.$eval(n.modelMatch);return o.equals(t,i)}),(function(e){i.$setValidity("match",e)}))}}}]).directive("passMask",["$timeout",function(e){return{require:"ngModel",restrict:"A",link:function(t,n,i,r){var l,a,s,c=null,u=t.$eval(i.ngModel),d=t.$eval(i.passMask)||"•",f=function(e){e.preventDefault()};n.on("paste",f);var p=function(t){if(null==t)return"";if(a)return u;u=void 0!==u?u.toString():"",c&&(t.length,c.length),c=t;var i=t.toString(),f=n.caret(),p=i.substring(f-1,f),v=i.substring(0,f-1),g=i.substring(f),h=u.substring(0,v.length),m=u.substring(u.length-g.length),$=p;$==d&&($=""),u=h+$+m;var b=v.replace(/(.)/g,d)+p+g.replace(/(.)/g,d);s=function(){o.element(document.activeElement).is(n)&&n.caret(f),r.$setViewValue(b),r.$render(),o.element(document.activeElement).is(n)&&n.caret(f)},l&&(e.cancel(l),s());return(l=e((function(){a=!0,b=b.replace(/(.)/g,d),s()}),1e3)).then((function(){a=!1})),u},v=function(){n.off("paste",f);var e=r.$parsers.indexOf(p);e>-1&&r.$parsers.splice(e,1)};r.$parsers.push(p),t.$on("$destroy",v),n.one("$destroy",v)}}}]).directive("customOnChange",(function(){return{restrict:"A",link:function(e,t,n){var i=e.$eval(n.customOnChange);t.on("change",i),e.$on("$destroy",(function(){t.unbind("change",i)})),t.one("$destroy",(function(){t.off("change",i)}))}}})).directive("ngComposed",["$parse",function(e){return{require:"ngModel",restrict:"A",link:function(t,n,i){t.$watch(i.ngComposed,(function(n){e(i.ngModel).assign(t,n.join(""))}))}}}]).directive("fallbackSrc",[function(){return{restrict:"A",link:function(e,t,n){t.on("error",(function(){var i=e.$eval(n.fallbackSrc);t.attr("src",i),t.off("error")})),e.$on("$destroy",(function(){t.off("error")}))}}}]).directive("ngError",["$parse",function(e){return{restrict:"A",link:function(t,n,i){n.on("error",(function(r){var o=e(i.ngError).bind(null,t);t.$applyAsync((function(){o({$event:r,$element:n})}))}))}}}]).directive("unfocusPlaceholder",[function(){return{restrict:"A",link:function(e,t,n){var i,r=function(){(i=t.attr("placeholder"))&&t.prop("placeholder","")},o=function(){t.prop("placeholder",i||"")};t.on("focus",r),t.on("blur",o),e.$on("$destroy",(function(){t.off("focus",r),t.off("blur",o)}))}}}]).directive("windowScroll",[function(){return{restrict:"A",link:function(e,t,n){var i=t.scrollEnd&&!t.data("hasScrollEnd")?t.scrollEnd():null,r=t.data("hasScrollEnd")?"scrollend":"scrollstop";t.on("scrollstart",(function(){o.element(window).trigger("scrollstart")})),t.on(r,(function(){o.element(window).trigger(r)})),t.on("$destroy",(function(){t.off("scrollstart"),t.off(r);try{i&&(i.destroy(),i=null)}catch(e){}})),e.$on("$destroy",(function(){t.off("scrollstart"),t.off(r);try{i&&(i.destroy(),i=null)}catch(e){}}))}}}]).directive("ngObserve",["$parse",function(e){return{restrict:"A",priority:1e3,link:function(t,n,i){t.$watch(i.ngObserve,(function(n){e(i.ngObserveDo).bind(null,t)({$value:n})}))}}}]).directive("ngObserveAttr",["$parse",function(e){return{restrict:"A",priority:999,link:function(t,n,i){var o=i.ngObserveAttr,l=r.String.trim;r.String.isString(o)&&!a(o)&&(o=o.split(","),r.Array.isArray(o)&&t.$watch((function(){var e=!0;return r.Array.forEach(o,(function(n){if(!t.$eval(i[l(n)]))return e=!1,!1})),e}),(function(n){e(i.ngObserveDo).bind(null,t)({$value:n})}),!0))}}}]).directive("forceBlur",["$timeout",function(e){return{restrict:"A",link:function(t,n,i){e((function(){n.val().length>0&&n.triggerHandler("blur")}))}}}]).directive("dateFieldCorrect",(function(){return{require:"ngModel",restrict:"A",link:function(e,t,n,i){var r=function(e){if(null==e)return"";var t=e.toString().trim();if(s(t))return"";var n=t.replace(/[^0-9]/g,"");return 1==n.length&&parseFloat(n)>1&&(n="0"+n,i.$setViewValue(n),i.$render()),n};i.$parsers.push(r),e.$on("$destroy",(function(){i.$parsers.indexOf(r)>-1&&i.$parsers.splice(r,1)}))}}})).directive("ngHidden",(function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngHidden,(function(e){e?t.attr("hidden","hidden"):t.removeAttr("hidden")}))}}})).directive("ngFormOnChange",["$parse",function(e){return{require:"form",link:function(t,n,i){var r=e(i.formOnChange);n.on("change",(function(){r(t)}))}}}]).directive("ngGetElement",["$parse",function(e){return{restrict:"A",scope:!1,priority:1,link:function(t,n,i){e(i.ngGetElement).bind(null,t)({$element:n,$scope:t})}}}]).value("duScrollCancelOnEvents",!1).filter("truncate",(function(){return function(e,t,n){if(void 0!==e)return isNaN(t)&&(t=10),n=n||"...",e.length<=t||e.length-n.length<=t?e:String(e).substring(0,t-n.length)+n}})).filter("capitalize",(function(){return function(e){return r.String.capitalize(e)}})).directive("ngBindValue",(function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngBindValue,(function(e){t.attr("value",e)}))}}})).directive("ngScroll",["$parse",function(e){return{restrict:"A",link:function(t,n,i){n.on("scroll",(function(){e(i.ngScroll).bind(null,t)({$event:n[0].scrollTop})}))}}}]).directive("ngAriaHidden",(function(){return{restrict:"A",link:function(e,t,n){var i=t.attr("tabindex"),r=e.$eval(n.ngAriaHidden);void 0===r||void 0===r?(t.attr("tabindex","-1"),t.attr("aria-hidden","true")):e.$watch(n.ngAriaHidden,(function(e){e?(t.attr("tabindex","-1"),t.attr("aria-hidden","true")):(i?t.attr("tabindex",i):t.removeAttr("tabindex"),t.attr("aria-hidden","false"))}))}}})).directive("ngAriaLabelledby",(function(){return{restrict:"A",priority:100,link:function(e,t,n){function i(e){if("ngAriaHideText"in n)for(var i=t[0],r=0,o=i.childNodes.length;r<o;r++){var a=i.childNodes[r];if(3==a.nodeType){var s=document.createElement(n.ngAriaHideText||"p");l(s).addClass("inline"),a.after(s),s.appendChild(a),s.setAttribute("aria-hidden","true"),s.setAttribute("tabindex","-1")}else 1==a.nodeType&&(a.setAttribute("aria-hidden","true"),a.setAttribute("tabindex","-1"))}}function o(e){var o=t.attr("aria-label"),a=o?o+". ":"";if("_self"==e||"_self_split"==e)if("ngAriaTextLinks"in n)!function(){for(var e=t[0],n=0,i=e.childNodes.length;n<i;n++){var r=e.childNodes[n];if(3==r.nodeType){var o=document.createElement("p");l(o).addClass("inline"),r.after(o),o.appendChild(r),o.setAttribute("aria-hidden","true"),o.setAttribute("tabindex","-1")}}var a=e.querySelector(".inline");a&&(a.setAttribute("aria-label",e.innerText),a.setAttribute("tabindex","0"),a.removeAttribute("aria-hidden"))}();else{if(t.attr("aria-label",a+t[0].innerText),"_self_split"==e){for(var s=[],c=0,u=t[0].childNodes.length;c<u;c++){var d=t[0].childNodes[c],f="";1==d.nodeType?d.hasAttribute("aria-label")?(f=r.String.trim(d.getAttribute("aria-label")),d.removeAttribute("aria-label")):f=r.String.trim(d.innerText):3==d.nodeType&&(f=r.String.trim(d.wholeText)),f&&s.push(f)}t.attr("aria-label",a+s.join(". "))}else t.attr("aria-label",a+t[0].innerText);i()}else{var p=document.getElementById(e);p&&t.attr("aria-label",a+p.innerText),i()}}var a=n.ngAriaLabelledbyDelay?e.$eval(n.ngAriaLabelledbyDelay):null,s=e.$eval(n.ngAriaLabelledby);"none"!==s&&(a?setTimeout((function(){o(s)}),a):o(s))}}})).directive("ngRoleAlert",["$rootScope",function(e){return{restrict:"A",link:function(t,n,i){function o(){n.attr("tabindex","0"),e.isWeb?n[0].hasAttribute("aria-live")||(n.attr("aria-live","assertive"),n.attr("aria-atomic","true")):n.attr("role","alert")}var l=t.$eval(i.ngRoleAlert);if(r.isNullorUndefined(l))o();else var a=t.$watch(i.ngRoleAlert,(function(e){e&&(o(),a())}))}}}]).directive("ngAriaLive",(function(){var e=navigator.userAgent,t=navigator.platform?navigator.platform:"";return{restrict:"A",link:function(n,i,r){i.addClass("a11y-visually-hidden");var o=null,l=null!=e.match(/Android/i)||t&&null!=t.match(/Android/i),a=n.$eval(r.liveType)||"assertive";i.attr("aria-live",a),i.attr("aria-atomic","true"),i.attr("role","status"),l&&(i.attr("aria-hidden","true"),i.attr("tabindex","-1")),n.$watch(r.ngAriaLive,(function(e){clearTimeout(o),o=setTimeout((function(){i.prop("innerHTML",e||""),l?i.attr("aria-label",e||""):(i[0].style.display="none",i[0].style.display="inline")}))}))}}})).directive("ngAriaExpanded",(function(){return{restrict:"A",link:function(e,t,n){t.attr("aria-expanded","false"),e.$watch(n.ngAriaExpanded,(function(e){t.attr("aria-expanded",e?"true":"false")}))}}})).directive("ngAriaSelected",(function(){return{restrict:"A",link:function(e,t,n){t.attr("aria-selected","false"),e.$watch(n.ngAriaSelected,(function(e){t.attr("aria-selected",e?"true":"false")}))}}})).directive("ngAriaLabel",(function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngAriaLabel,(function(e){t.attr("aria-label",e)}))}}})).directive("ngAriaActivedescendant",(function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngAriaActivedescendant,(function(e){t.attr("aria-activedescendant",e)}))}}})).directive("ngTabIndex",(function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngTabIndex,(function(e){"disabled"==e?t.removeAttr("tabindex"):t.attr("tabindex",e?"0":"-1")}))}}})).directive("ngDesktopRoleText",(function(){var e=navigator.userAgent,t=navigator.platform?navigator.platform:"";return{restrict:"A",link:function(n,i,r){n.$watch(r.ngTabIndex,(function(n){null!=e.match(/iPhone|iPad|iPod/i)||t&&null!=t.match(/iPhone|iPad|iPod/i)||null!=e.match(/Android/i)||t&&null!=t.match(/Android/i)||(i.attr("role","text"),i.attr("tabindex","0"))}))}}})).directive("ngRoleText",(function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngRoleText,(function(e){e?(t.attr("role","text"),t.attr("tabindex","0")):(t.removeAttr("role"),t.removeAttr("tabindex"))}))}}}))}));