angular.module("Services.Await",[]).service("AwaitService",["$interval",function(n){this.AwaitResource=function(t,i){var r=n(function(){t()!=undefined&&(i(),n.cancel(r))},100)}}]);angular.module("Services.Parceiros",[]).service("ParceirosService",["BaseService",function(n){this.Parceiros=function(t){n.GET("Parceiros/Parceiros",t)}}]);angular.module("Services.Faq",[]).service("FaqService",["BaseService",function(n){this.Perguntas=function(t){n.GET("Faq/Perguntas",t)}}]);angular.module("Services.Enfoque",[]).service("EnfoqueService",["BaseService",function(n){this.NoticiasEnfoque=function(t){n.GET("Enfoque/Noticias",t)}}]);angular.module("Services.Message",[]).service("MessageService",[function(){this.Show=function(n){n.Tittle!=undefined&&$("#required-tittle").text(n.Tittle);n.Body!=undefined&&$("#required-message-body").text(n.Body);$("#RequiredMessage").modal()}}]);angular.module("Services.LojaVirtual",[]).service("LojaVirtualService",["$http","BaseService","$window","AcessoService",function(n,t,i,r){this.Pedido=function(n,u){i.location.search!=""?r.AcessoCompra(function(i){n.IdAcesso=i;t.POST_LOJA("Acesso/AcessoLoja",n,u)}):t.POST_LOJA("Acesso/AcessoLoja",n,u)};this.OpenLoja=function(){i.location.href=t.EndPoints.LojaVirtual+"/Acesso/BoaTaxa"}}]);angular.module("Services.Navigate",[]).service("NavigateService",["BaseService","StorageService","$window",function(n,t,i){this.Navigate=function(n,t){this.SetStorage(t);i.location.href=(i.location.origin+"/"+n).concat(i.location.search)};this.SetStorage=function(n){n!=undefined&&t.Insert(n.Index,n.Object)};this.Model=function(n,i){if(typeof i=="function")i(t.Select(n));else return t.Select(n)};this.FormatUrl=function(n,t){for(var r=n,i=0;i<t.length;i++)r=r.replace("{"+i+"}",t[i]);return r};this.LoadFromLink=function(){return i.location.hash.replace("#!","")};this.ClearLastNavigateForIndex=function(n,i){if(typeof i=="function")i(t.Remover(n));else return t.Remove(n)}}]);angular.module("Services.Contate",[]).service("ContateService",["BaseService",function(n){this.Contate=function(t,i){n.POST("Contate/Contate",t,i)}}]);angular.module("Services.TipoContate",[]).service("TipoContateService",["BaseService","StorageService",function(n,t){this.TiposContate=function(i){t.Select("TiposContate")==undefined?n.GET("TipoContate/TiposContate",function(n){t.Insert("TiposContate",n);i(n)}):i(t.Select("TiposContate"))}}]);angular.module("Services.Validate",[]).service("ValidateService",[function(){this.ValidRequired=function(n,t){for(var i=0;i<n.length;i++)if(!n[i].call())return!1;t()}}]);angular.module("Services.Produto",[]).service("ProdutoService",["BaseService","StorageService",function(n,t){this.Produtos=function(i){t.Select("Produtos")==undefined?n.GET("Produto/Produtos",i):i(t.Select("Produtos"))}}]);angular.module("Services.GrupoProduto",[]).service("GrupoProdutoService",["BaseService","StorageService",function(n,t){this.GrupoProdutos=function(i){t.Select("GrupoProduto")==undefined?n.GET("GrupoProduto/GrupoProdutos",i):i(t.Select("GrupoProduto"))}}]);angular.module("Services.Alerta",[]).service("AlertaService",["BaseService",function(n){this.Alerta=function(t,i){n.POST("Alerta/Alerta",t,i)};this.Leilao=function(t,i){n.POST("Alerta/Leilao",t,i)}}]);angular.module("Services.VerMais",[]).service("VerMaisService",["BaseService","StorageService",function(n){this.MapObject;this.DetalhesTurismo=function(t,i){n.POST("VerMais/DetalhesTurismo",t,function(n){i(n)})};this.DetalhesComercial=function(t,i){n.POST("VerMais/DetalhesComercial",t,function(n){i(n)})}}]);angular.module("Services.Cotacao",[]).service("CotacaoService",["BaseService","MessageService",function(n,t){this.Turismo=function(t,i){n.POST("Cotacao/Turismo",t,i)};this.Comercial=function(t,i){n.POST("Cotacao/Comercial",t,i)};this.Remessa=function(t,i){n.POST("Cotacao/Remessa",t,i)};this.ValidLimite=function(n,i){var r=n.TipoOperacao=="V"?n.Moeda.TaxaEquivalenteVenda:n.Moeda.TaxaEquivalenteCompra;if(n.Quantidade<r*Math.pow(10,2))return t.Show({Tittle:"Atenção",Body:"O valor mínimo permitido é o equivalente a USD 100,00"}),!1;if(n.Moeda.Mercado.toUpperCase()=="TURISMO"&&n.Quantidade>r*Math.pow(10,4))return t.Show({Tittle:"Atenção",Body:"O valor maximo permitido para turismo é o equivalente a USD 10.000,00"}),!1;if(n.Moeda.Mercado.toUpperCase()!="TURISMO"&&n.Quantidade>r*Math.pow(10,5))return t.Show({Tittle:"Atenção",Body:"O valor maximo permitido para comercial ou remessa é o equivalente a USD 100.000,00"}),!1;i()};this.TaxaLinkDireto=function(n){return n.TipoOperacao=="V"?n.Moeda.ValorPadrao:n.Moeda.ValorPadrao};this.BancoPagamento=function(t,i){n.POST("Cotacao/BancoPagamento",t,i)}}]);angular.module("Services.Storage",[]).service("StorageService",function(){this.Insert=function(n,t){sessionStorage.setItem(n,JSON.stringify(t))};this.Select=function(n){return JSON.parse(sessionStorage.getItem(n))};this.Remove=function(n){sessionStorage.removeItem(n)}});angular.module("Services.Moeda",[]).service("MoedaService",["BaseService","StorageService",function(n,t){var r,i;this.Sended=!1;r=[];this.MoedaProduto=function(u){t.Select("Moedas")==undefined?(r.push(u),this.Sended||(this.Sended=!0,n.GET("Moeda/MoedaMercado",function(n){var u={};u.Turismo=$.grep(n.MoedaTurismo,i)[0];u.Comercial=$.grep(n.MoedaComercial,i)[0];u.Remessa=$.grep(n.MoedaRemessa,i)[0];t.Insert("Moedas",n);t.Insert("MoedaPadrao",u);$.each(r,function(t,i){i(n)})}))):u(t.Select("Moedas"))};this.Moedas=function(t){n.GET("Moeda/Moedas",t)};i=function(n){return n.CodMoeda==220};this.MoedaPadrao=function(){return t.Select("MoedaPadrao")};this.MoedaTurismo=function(n,t){this.MoedaProduto(function(i){t($.grep(i.MoedaTurismo,function(t){return t.CodMoeda==n})[0])})};this.MoedaEquivalente=function(t,i){n.POST("Moeda/MoedaEquivalente",t,i)};this.Filter=function(n,t,i){var r=[];this.MoedaProduto(function(u){t=="Turismo"?r=u.MoedaTurismo:t=="Comercial"?r=u.MoedaTurismo:t=="Remessa"&&(r=u.MoedaRemessa);i($.grep(r,function(t){return t.CodMoeda==n})[0])})}}]);angular.module("Services.Cidade",[]).service("CidadeService",["BaseService","StorageService",function(n,t){this.Cidades=function(i){t.Select("Cidades")==undefined?n.GET("Cidade/Cidades",function(n){t.Insert("Cidades",n);t.Insert("CidadePadrao",$.grep(n,function(n){return n.CodIbge==3550308})[0]);i(n)}):i(t.Select("Cidades"))};this.CidadePadrao=function(){return t.Select("CidadePadrao")};this.Filter=function(n,i){var r=n.term.ToSlug(),u=t.Select("Cidades"),f=$.grep(u,function(n){return BeginPartial(r.toUpperCase(),n.Descricao.ToSlug().toUpperCase())});i(f)};this.GetCidadeIbge=function(n,t){this.Cidades(function(i){t($.grep(i,function(t){return t.CodIbge==n})[0])})};this.SetCidadeSelecionada=function(n){t.Insert("CidadeSelected",n)};this.GetCidadeSelecionada=function(){return t.Select("CidadeSelected")};this.CidadesAtendidas=function(t){n.GET("Cidade/CidadesAtendidas",t)}}]);angular.module("Services.Acesso",[]).service("AcessoService",["BaseService",function(n){this.AcessoCotacao=function(t){window.location.search!=""&&n.GET("AcessoParceiro/AcessoCotacao".concat(window.location.search),t)};this.AcessoCompra=function(t){window.location.search!=""&&n.GET("AcessoParceiro/AcessoCompra".concat(window.location.search),t)};this.AcessoVenda=function(t){window.location.search!=""&&n.GET("AcessoParceiro/AcessoVenda".concat(window.location.search),t)};this.AcessoLeilao=function(t){window.location.search!=""&&n.GET("AcessoParceiro/AcessoLeilao".concat(window.location.search),t)}}]);angular.module("Services.MoedaHoje",[]).service("MoedaHojeService",["BaseService","MoedaService",function(n){this.CotacaoHojeTurismo=function(t,i){n.POST("MoedaHoje/CotacaoHojeTurismo",t,i)};this.CotacaoHojeComercial=function(t,i){n.POST("MoedaHoje/CotacaoHojeComercial",t,i)}}]);angular.module("Services.TaxaHistorico",[]).service("TaxaHistoricoService",["BaseService",function(n){this.UltimoMes=function(t,i){n.POST("TaxaHistorico/UltimoMes",t,i)};this.UltimosDias=function(n,t){return n.CopyBlock(n.length-t,n.length)}}]);angular.module("Services.Posts",[]).service("PostsService",["BaseService",function(n){this.RecentPosts=function(t,i){n.GET("Posts/LastPosts?NumberPosts="+t,i)}}]);angular.module("Services.ComoFunciona",[]).service("ComoFuncionaService",["BaseService",function(n){this.ComoFunciona=function(t){n.GET("ComoFunciona/ComoFunciona",t)}}]);angular.module("Services.IntencaoNegocio",[]).service("IntencaoNegocioService",["BaseService",function(n){this.CreateIntencao=function(n){var t={};return t.QuantidadeMoeda=n.Quantidade,t.TaxaVet=n.TaxaFinal,t.TaxaEnfoque=n.TaxaEnfoque,t.ValorTotal=n.ValorTotal,t.NomeCliente="",t.EmailCliente="",t.TelefoneCliente="",t.IdProduto=n.Produto.IdProduto,t.TipoEntrega=1,t.NomeEmpresa=n.NomeEmpresa,t.IdGrupoCotacao=n.IdGrupoCotacao,t.TipoOperacao=n.TipoOperacao,t.IdMoeda=n.Moeda.CodMoeda,t.ValorMoeda=n.Quantidade,t};this.PostosEntrega=function(t,i){n.GET("IntencaoNegocio/CarregarPostosEntrega?IdGrupoCotacao="+t,i)};this.GravarIntencaoNegocio=function(t,i){n.POST("IntencaoNegocio/CriarIntencao",t,i)}}]);angular.module("Services.Interface",[]).service("InterfaceService",["BaseService",function(n){this.CarregarDadosCliente=function(t,i,r,u){n.GET_INTERFACE("InterfaceControle/ConfirmarLeilao",r,u)};this.InformarFimLeilao=function(t,i,r){n.GET_INTERFACE("InterfaceControle/InformarFimLeilao",i,r)};this.InformarNegacaoLeilao=function(t,i,r){n.GET_INTERFACE("InterfaceControle/InformarNegacaoLeilao",i,r)};this.InformarEmNegociacao=function(t,i,r){n.GET_INTERFACE("InterfaceControle/InformarNegociacaoLeilao",i,r)};this.AceitarPedido=function(t,i,r){n.GET_INTERFACE("InterfaceControle/AceitarOperacao",i,r)};this.RegeitarOperacao=function(t,i,r){n.GET_INTERFACE("InterfaceControle/RegeitarOperacao",i,r)};this.CarregarDadosClienteOperacao=function(t,i,r){n.GET_INTERFACE("InterfaceControle/CarregarDadosClienteOperacao",i,r)};this.EmNegociacaoOperacao=function(t,i,r){n.GET_INTERFACE("InterfaceControle/EmNegociacaoOperacao",i,r)}}]);var Services=angular.module("Services",["Services.Storage","Services.Moeda","Services.Cidade","Services.Cotacao","Services.VerMais","Services.Alerta","Services.GrupoProduto","Services.Produto","Services.Validate","Services.Contate","Services.TipoContate","Services.Navigate","Services.LojaVirtual","Services.Message","Services.Enfoque","Services.Faq","Services.Parceiros","Services.Acesso","Services.MoedaHoje","Services.Await","Services.TaxaHistorico","Services.Posts","Services.ComoFunciona","Services.IntencaoNegocio","Services.Interface"]);Services.service("BaseService",["$http",function(n){this.EndPoints={BoaTaxaApi:"/Api",LojaVirtual:"/LojaVirtual"};this.Request=function(t,i,r,u,f,e){n({method:t,url:this.CreateEndPoint(f,i),data:r}).then(function(n){u(n.data)},function(n){console.log("Error : "+n);e&&e(n)})};this.GET=function(n,t){this.Request("GET",n,undefined,t,"BoaTaxaApi",undefined)};this.POST=function(n,t,i){this.Request("POST",n,t,i,"BoaTaxaApi",undefined)};this.POST_LOJA=function(n,t,i){this.Request("POST",n,t,i,"LojaVirtual",undefined)};this.GET_LOJA=function(n,t){this.Request("GET",n,undefined,t,"LojaVirtual",undefined)};this.GET_INTERFACE=function(n,t,i){this.Request("GET",n,undefined,t,"BoaTaxaApi",i)};this.ValidateRequest=function(n,t){var i=$.grep(n,function(n){return n.call()});i.length==n.length&&t()};this.CreateEndPoint=function(n,t){return(this.EndPoints[n]+"/"+t).concat(window.location.search)}}])