angular.module("Directives.Slider",[]).directive("stSlider",[function(){return{restrict:"A",replace:!1,link:function(n,t){var s=!0,i=undefined,e=0,f=[],r=0,u=0,o=function(){s=!0},v=function(){i=$(t).children(".st-slider-rolling-container").children(".st-slider-rolling").children(".item-rolling");u=i.length;e=i[0].clientWidth+4.2;p();y()},y=function(){var n=$(t).children(".st-btn-next"),i=$(t).children(".st-btn-prev");$(n).click(a);$(i).click(l)},p=function(){for(var n=0;n<i.length;n++)f[n]=-e,i[n].addEventListener("transitionend",o,!0),i[n].addEventListener("webkitTransitionEnd",o,!0),i[n].addEventListener("oTransitionEnd",o,!0),i[n].addEventListener("MSTransitionEnd",o,!0)},w=function(){v();d()},b=function(){return r--,r=r==-1?u-1:r,r%u},k=function(){return r++,(r-1)%u},h=function(n,t){for(var i=0;i<u;i++)c(i,t,"1");c(n,-1*t*u,"0")},c=function(n,t,r){var u=i[n];u.style.opacity=r;u.style.transform="translate("+(f[n]+t)+"px)";u.style.webkitTransform="translate("+(f[n]+t)+"px)";f[n]=f[n]+t},l=function(){s===!0&&h(b(),+e)},a=function(){s===!0&&h(k(),-e)},d=function(){$(t).Swipe({Left:a,Rigth:l})};w()}}}]);angular.module("Directives.Timer",[]).directive("stTimer",["$interval",function(n){return{restrict:"A",replace:!1,link:function(t,i,r){var u=0;t.Clock={Minute:0,Second:0};var e=function(){u=o(r.interval)},o=function(n){return n*60},s=function(i){n(function(){u-=1;t.Clock.Minute=parseInt(u/60);t.Clock.Second=u%60;h(u==0,i)},1e3,u)},h=function(n,i){n&&(i(),f(t[r.stTimer]))},f=function(){e();s(t[r.stTimer])};f()}}}]);angular.module("Directives.Required",[]).directive("btRequiredMessage",["$parse","MessageService",function(n,t){return{restrict:"A",replace:!1,link:function(i,r,u){i.$watch(u.attr,function(){i.Validates==undefined&&n("Validates").assign(i,[]);i.ValidatesForm==undefined&&n("ValidatesForm").assign(i,{});u.formname!=undefined&&i.ValidatesForm[u.formname]==undefined&&(i.ValidatesForm[u.formname]=[]);var r=function(){return u.allowingZero!=undefined&&i.$eval(u.ngModel)!=undefined?!0:i.$eval(u.ngModel)==undefined||i.$eval(u.ngModel)==0?(t.Show({Tittle:"Atenção",Body:u.btRequiredMessage}),!1):!0};u.formname==undefined?i.Validates.push(r):i.ValidatesForm[u.formname].push(r)})}}}]);angular.module("Directives.Format",[]).directive("stFormat",["$filter",function(){function n(n){switch(n.format){case"money":return new t(n);case"taxa":return new r(n);case"date":return new f(n);case"taxahoje":return new u(n);case"turismo":return new i(n);case"cep":return new e(n);case"telefone":return new o(n)}}function t(){this._mask=function(n,t){n.mask("###.###.###,##",{reverse:!0});setTimeout(function(){t!=undefined&&(t=t.length<3&&t!=""?t*100:(t*1).toFixed(2));n.val(n.masked(t))},100)};this._unmask=function(n,t){for(var i=t.masked(n);i.indexOf(".")>-1;)i=i.replace(".","");return i=i.replace(",","."),i*1}}function i(){this._mask=function(n,t){n.mask("###.###.###",{reverse:!0});setTimeout(function(){n.val(n.masked(t))},100)};this._unmask=function(n){for(var t=n;t.indexOf(".")>-1;)t=t.replace(".","");return t*1}}function r(){this._mask=function(n){n.mask("R$#,########",{reverse:!1,placeholder:"R$"})};this._unmask=function(n){var t=n.replace(".","");return t=t.replace(",","."),t.replace("R$","")}}function u(){this._mask=function(n,t){n.mask("#,########",{reverse:!1});setTimeout(function(){n.val(n.masked(t))},100)};this._unmask=function(n){var t=n.replace(".","");return t.replace(",",".")}}function f(){this._mask=function(n){n.mask("00/00/0000",{placeholder:"DD/MM/AAAA"})};this._unmask=function(n){return n.substr(6,4).concat("-").concat(n.substr(3,2)).concat("-").concat(n.substr(0,2))}}function e(){this._mask=function(n){n.mask("00000-000",{placeholder:"00000-000"})};this._unmask=function(n){return n.replace("-","")}}function o(){this._mask=function(n){console.log(n);n.mask("(00)00000-0000",{placeholder:"(xx)xxxx-xxxx"})};this._unmask=function(n){var t=n.replace("(","");return t=t.replace(")",""),t.replace("-","")}}return{require:"?ngModel",link:function(t,i,r,u){if(u){var f=n(r);u.$formatters.unshift(function(n){return f._mask(i,n)});u.$parsers.unshift(function(n){return f._unmask(n,i)})}}}}]);angular.module("Directives.EvolucaoMoeda",[]).directive("stEvolucaoMoeda",[function(){return{require:"?ngModel",link:function(n,t,i){n.$watch(i.ngModel,function(){if(n[i.ngModel]!==undefined){var r=n[i.ngModel],u=r.Where(function(n){return n!==undefined}).Select(function(n){return new Date(n.Data).toLocaleDateString()}),f=r.Where(function(n){return n!==undefined}).Select(function(n){return{x:new Date(n.Data),y:n.Taxa}});n.Chart!=undefined&&n.Chart.destroy();n.Chart=new chartPointer(t[0],{type:"line",data:{labels:u,datasets:[{label:"Taxa",backgroundColor:"#eceaf7db",borderColor:"#462eb0",data:f,borderWidth:2}]},options:{scales:{yAxes:[{stacked:!1}]},elements:{line:{tension:0}},legend:{display:!1}}})}})}}}]);angular.module("Directives.Map",[]).directive("btMap",[function(){return{require:"?ngModel",link:function(n,t,i){n.$watch(i.ngModel,function(){n[i.ngModel]!=undefined&&(n.Marks=[],n.Marks.push(new Mark({Title:n[i.ngModel].Nome,MapPoint:new MapPoint(n[i.ngModel].Endereco.Latitude,n[i.ngModel].Endereco.Longitude),ContentPanel:undefined,Icon:"/Images/pin_user.png"})),n.MapObject=n.MapObject==undefined?new StallosMap(t[0]):n.MapObject,n.MapObject.ClearAll(),n.CenterPoint=new MapPoint(n[i.ngModel].Endereco.Latitude,n[i.ngModel].Endereco.Longitude),n.MapObject.CenterMap(n.CenterPoint),n.MapObject.SetMarks(n.Marks),google.maps.event.trigger(n.MapObject,"resize"))})}}}]);angular.module("Directives.PopOver",[]).directive("btPopOver",["$parse",function(n){return{require:"?ngModel",link:function(t,i,r){t.$watch(r.ngModel,function(){var u=n(r.ngModel);u(t)!=undefined&&$(i).popover({html:!0,content:function(){return $(r.btPopoverBody).html()}})})}}}]);angular.module("Directives.RoundProgress",[]).directive("stRoundProgress",[function(){return{require:"ngModel",link:function(n,t,i){var o=function(n,t){this.X=n;this.Y=t},v=function(){return new o(f.X/2,f.Y/2)},y=function(){return new o(r.canvas.width,r.canvas.height)},p=function(){return u.X-10},r=t[0].getContext("2d"),e=0,s=4.72,f=y(),u=v(),h=p(),w=i.stRoundLimit,c=0,l=undefined,a=function(){r.strokeStyle="#e8e2e2";r.lineWidth=10;r.beginPath();r.arc(u.X,u.Y,h,0,90);r.stroke();b(i.stRoundText)},b=function(n){r.textAlign="center";r.font="bold 1.5em Arial";r.fillStyle="#3f27a1";r.fillText(n,u.X,u.Y+5)},k=function(){c=e/100*Math.PI*20;r.clearRect(0,0,f.X,f.Y);a();r.lineWidth=8;r.lineCap="round";r.strokeStyle="#3f27a1";r.beginPath();r.arc(u.X,u.Y,h,s,c/10+s);r.stroke();e>=w&&clearTimeout(l);e++};n.$watch(i.ngModel,function(){n.$eval(i.ngModel)!=undefined?l=setInterval(k,20):a()})}}}]);angular.module("Directives.Observer",[]).directive("btObserver",[function(){return{link:function(n,t){n.$watch(t,function(){ObserveImage!==undefined&&ObserveImage(t[0])})}}}]);angular.module("Directives",["Directives.Required","Directives.Format","Directives.Timer","Directives.Slider","Directives.EvolucaoMoeda","Directives.Map","Directives.PopOver","Directives.RoundProgress","Directives.Observer"])