vobi_lib 1.7.13 → 1.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -209,7 +209,7 @@ declare const validateMobilePhoneNumber: (data: any) => boolean;
209
209
 
210
210
  declare const valueReplacer: (value: any) => any;
211
211
 
212
- declare const normalizeString: (str: string) => string;
212
+ declare const normalizeString: (str?: string, keetSensitive?: boolean) => string;
213
213
 
214
214
  interface Item {
215
215
  id?: number | string;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";var re=Object.create;var R=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var le=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty;var de=(e,a)=>{for(var t in a)R(e,t,{get:a[t],enumerable:!0})},W=(e,a,t,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of ie(a))!ce.call(e,r)&&r!==t&&R(e,r,{get:()=>a[r],enumerable:!(o=se(a,r))||o.enumerable});return e};var D=(e,a,t)=>(t=e!=null?re(le(e)):{},W(a||!e||!e.__esModule?R(t,"default",{value:e,enumerable:!0}):t,e)),ue=e=>W(R({},"__esModule",{value:!0}),e);var Ma={};de(Ma,{BAD_GATEWAY:()=>ge,BAD_REQUEST:()=>d,FORBIDDEN:()=>me,INTERNAL_SERVER_ERROR:()=>F,IsJsonString:()=>he,METHOD_NOT_ALLOWED:()=>fe,NOT_ALLOWED:()=>w,NOT_FOUND:()=>L,SERVICE_UNAVAILABLE:()=>ye,UNAUTHORIZED:()=>P,_setSharpForTesting:()=>Pa,asArray:()=>O,asBrazilianDate:()=>M,asDate:()=>T,asyncForEach:()=>be,base64ToFile:()=>ka,brazilianDateTime:()=>K,brazilianDateToDate:()=>Me,capitalize:()=>U,checkApprovalAuthority:()=>va,checkCnpj:()=>Ae,checkCpf:()=>Ie,checkEmail:()=>ve,compressImage:()=>Ua,configure:()=>xe,containsEncodedComponents:()=>Ne,createThumbnail:()=>Oa,currentDay:()=>V,curry:()=>Re,dateIsValid:()=>Je,decodeToken:()=>ra,decrypt:()=>Pe,diffObject:()=>Be,dynamici18nString:()=>Te,elasticTransformOr:()=>Se,encrypt:()=>we,enumHelper:()=>n,error:()=>y,eventBus:()=>Le,extractMonthInfo:()=>Ia,extractValueFromWhere:()=>Fe,filterAttributes:()=>Ue,filterEmpty:()=>ke,findValue:()=>k,firstMonthDay:()=>j,flatMapData:()=>Ca,flattenChildren:()=>q,formatCurrency:()=>_,formatDate:()=>Q,formatDocument:()=>Na,formatNumber:()=>Ke,formatNumberAnyFormat:()=>Qe,get:()=>v,getConfig:()=>De,getDateOpenFinance:()=>Ra,getExtension:()=>Xe,getMonthNumber:()=>He,getNameWithoutExtension:()=>Oe,getNextDay:()=>_e,getNextWeekday:()=>X,getPreviewsWeekday:()=>ee,getToday:()=>Ve,getToken:()=>na,getTomorrow:()=>ze,getUUIDFromEmail:()=>_a,getYesterday:()=>qe,imgSrcRegex:()=>ea,isAfter:()=>Ge,isDateValid:()=>aa,isNumber:()=>ta,isOfAge:()=>$e,isValidUrl:()=>oa,lastMonthDay:()=>G,makeRefurbishFileUrl:()=>sa,maxDateToList:()=>We,minDateToList:()=>Ye,monthsBetween:()=>je,normalizeString:()=>Da,nullIfEmpty:()=>ia,padLeft:()=>la,parseArrayAsObject:()=>ca,parseRouteToModel:()=>da,prepareDoc:()=>ua,prepareSession:()=>pa,promiseAny:()=>ma,promiseEach:()=>Ee,removeProperty:()=>fa,removeSpecialChar:()=>ga,replaceNumberOrPercentage:()=>Aa,slugify:()=>ya,splitList:()=>ha,sum:()=>Ea,sumByFunction:()=>ba,upload:()=>Fa,validateAccess:()=>Ce,validateMobilePhoneNumber:()=>xa,valueReplacer:()=>S});module.exports=ue(Ma);var Y={userNotFound:"Usu\xE1rio n\xE3o foi encontrado.",pageNotFound:"Desculpe. P\xE1gina n\xE3o encontrada.",notAuthorized:"A\xE7\xE3o n\xE3o autorizada, atualize a p\xE1gina e tente novamente.",tokenExpired:"Sess\xE3o expirada.",invalidToken:"Token inv\xE1lido.",notUpdated:"Nenhum registro foi alterado.",cantDelete:"Esse registro est\xE1 sendo usado, por isso n\xE3o \xE9 poss\xEDvel apaga-lo.",general:"Ocorreu um erro.",sentError:"Erro ao enviar proposta",noUser:"Usu\xE1rio n\xE3o encontrado.",noEmail:"E-mail n\xE3o foi informado",noPassword:"Senha n\xE3o foi informada.",invalidEmail:"O e-mail informado \xE9 inv\xE1lido.",uniqueEmail:"O e-mail informado j\xE1 est\xE1 cadastrado.",invalidCPF:"O CPF informado \xE9 inv\xE1lido.",invalidCNPJ:"O CNPJ informado \xE9 inv\xE1lido.",uniqueName:"Nome informado j\xE1 cadastrado.",noName:"Nome n\xE3o foi informado.",noData:"Dados n\xE3o informados.",noDate:"Data n\xE3o informada.",noModel:"Ocorreu um erro com a entidade",invalidId:"Id inv\xE1lido",invalidCredentials:"Usu\xE1rio e/ou senha inv\xE1lidos.",noPhone:"Telefone n\xE3o foi informado.",noCPF:"CPF n\xE3o foi informado.",noRG:"RG n\xE3o foi informado.",noZipcode:"CEP n\xE3o foi informado.",noStreet:"Endere\xE7o n\xE3o foi informado.",noNumber:"N\xFAmero n\xE3o foi informado.",noState:"Estado n\xE3o foi informado.",noCity:"Cidade n\xE3o foi informada.",noNeighborhood:"Bairro n\xE3o foi informado.",noCNPJ:"CNPJ n\xE3o foi informado.",noCompanyName:"Raz\xE3o social n\xE3o foi informada.",noTrademarkName:"Nome fantasia n\xE3o foi informado.",noCompanyZipcode:"CEP da empresa n\xE3o foi informado.",noCompanyStreet:"Endere\xE7o da empresa n\xE3o foi informado.",noCompanyNumber:"N\xFAmero da empresa n\xE3o foi informado.",noCompanyState:"Estado da empresa n\xE3o foi informado.",noCompanyCity:"Cidade da empresa n\xE3o foi informado.",noCompanyNeighborhood:"Bairro da empresa n\xE3o foi informado.",noBirthdate:"Data de nascimento n\xE3o foi informada.",noCompany:"Empresa n\xE3o informada.",invalidURL:"URL inv\xE1lida.",noPermissions:"Permiss\xF5es n\xE3o encontradas.",fileLimit50:"Os arquivos n\xE3o pode ter mais de 50 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo.",fileLimit10:"Os arquivos n\xE3o pode ter mais de 10 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo no corpo da mensagem.",maxLength:"O nome deve ter no m\xE1ximo 255 caracteres.",invalidData:"Dados inv\xE1lidos.",invalidDate:"Data inv\xE1lida.",invalidDates:"Data de in\xEDcio n\xE3o pode ser maior que data de fim.",invalidUUID:"A URL informada n\xE3o foi encontrada, verifique se est\xE1 correto o link desejado.",invalidValue:"Valor informado inv\xE1lido.",invalidDoc:"O documento informado (CNPJ/CPF) est\xE1 incorreto.",docAlreadyExists:"Documento j\xE1 cadastrado.",tokenPasswordError:"Link de recupera\xE7\xE3o de senha inv\xE1lido.",errPassword:"Senha est\xE1 inv\xE1lida.",noParameters:"Par\xE2metros n\xE3o informado.",uniqueCode:"C\xF3digo j\xE1 cadastrado."};var y={},J={en:Y,"pt-br":"PT_BR_LOCALE"},c=J.en||J.en,d=400,w=405,P=401,me=403,L=404,fe=405,F=500,ge=502,ye=503;y.NOT_FOUND={userNotFound:{statusCode:L,code:"NF-00001",message:c.userNotFound},pageNotFound:{statusCode:L,code:"NF-00002",message:c.pageNotFound}};y.UNAUTHORIZED={notAuthorized:{statusCode:P,code:"UA-00001",message:c.notAuthorized},tokenExpired:{statusCode:P,code:"UA-00002",message:c.tokenExpired},invalidToken:{statusCode:P,code:"UA-00003",message:c.invalidToken}};y.NOT_ALLOWED={notUpdated:{statusCode:w,code:"NA-00001",message:c.notUpdated},cantDelete:{statusCode:w,code:"NA-00002",message:c.cantDelete}};y.INTERNAL_SERVER_ERROR={general:{statusCode:F,code:"ISE-00001",message:c.general},sentError:{statusCode:F,code:"ISE-00002",message:c.sentError}};y.BAD_REQUEST={noUser:{statusCode:d,code:"LIB-B-00001",message:c.noUser},noEmail:{statusCode:d,code:"LIB-B-00002",message:c.noEmail},noPassword:{statusCode:d,code:"LIB-B-00003",message:c.noPassword},invalidEmail:{statusCode:d,code:"LIB-B-00004",message:c.invalidEmail},uniqueEmail:{statusCode:d,code:"LIB-B-00005",message:c.uniqueEmail},invalidCPF:{statusCode:d,code:"LIB-B-00006",message:c.invalidCPF},invalidCNPJ:{statusCode:d,code:"LIB-B-00007",message:c.invalidCNPJ},uniqueName:{statusCode:d,code:"LIB-B-00008",message:c.uniqueName},noName:{statusCode:d,code:"LIB-B-00009",message:c.noName},noData:{statusCode:d,code:"LIB-B-00010",message:c.noData},invalidCredentials:{statusCode:d,code:"LIB-B-00011",message:c.invalidCredentials},tokenPasswordError:{statusCode:d,code:"LIB-B-00012",message:c.tokenPasswordError},errPassword:{statusCode:d,code:"LIB-B-00013",message:c.errPassword},noPhone:{statusCode:d,code:"LIB-B-00014",message:c.noPhone},noCPF:{statusCode:d,code:"LIB-B-00015",message:c.noCPF},noRG:{statusCode:d,code:"LIB-B-00016",message:c.noRG},noZipcode:{statusCode:d,code:"LIB-B-00017",message:c.noZipcode},noStreet:{statusCode:d,code:"LIB-B-00018",message:c.noStreet},noNumber:{statusCode:d,code:"LIB-B-00019",message:c.noNumber},noState:{statusCode:d,code:"LIB-B-00020",message:c.noState},noCity:{statusCode:d,code:"LIB-B-00021",message:c.noCity},noNeighborhood:{statusCode:d,code:"LIB-B-00022",message:c.noNeighborhood},noCNPJ:{statusCode:d,code:"LIB-B-00023",message:c.noCNPJ},noCompanyName:{statusCode:d,code:"LIB-B-00024",message:c.noCompanyName},noTrademarkName:{statusCode:d,code:"LIB-B-00025",message:c.noTrademarkName},noCompanyZipcode:{statusCode:d,code:"LIB-B-00026",message:c.noCompanyZipcode},noCompanyStreet:{statusCode:d,code:"LIB-B-00027",message:c.noCompanyStreet},noCompanyNumber:{statusCode:d,code:"LIB-B-00028",message:c.noCompanyNumber},noCompanyState:{statusCode:d,code:"LIB-B-00029",message:c.noCompanyState},noCompanyCity:{statusCode:d,code:"LIB-B-00030",message:c.noCompanyCity},noCompanyNeighborhood:{statusCode:d,code:"PRO-00031",message:c.noCompanyNeighborhood},noBirthdate:{statusCode:d,code:"LIB-B-00032",message:c.noBirthdate},noCompany:{statusCode:d,code:"LIB-B-00033",message:c.noCompany},noParameters:{statusCode:d,code:"LIB-B-00034",message:c.noParameters},invalidDoc:{statusCode:d,code:"LIB-B-00035",message:c.invalidDoc},docAlreadyExists:{statusCode:d,code:"LIB-B-00036",message:c.docAlreadyExists},invalidURL:{statusCode:d,code:"LIB-B-00037",message:c.invalidURL},noPermissions:{statusCode:d,code:"LIB-B-00038",message:c.noPermissions},fileLimit50:{statusCode:d,code:"LIB-B-00039",message:c.fileLimit50},fileLimit10:{statusCode:d,code:"LIB-B-00040",message:c.fileLimit10},invalidDates:{statusCode:d,code:"LIB-B-00041",message:c.invalidDates},maxLength:{statusCode:d,code:"LIB-B-00042",message:c.maxLength},uniqueCode:{statusCode:d,code:"LIB-B-00043",message:c.uniqueCode},invalidValue:{statusCode:d,code:"LIB-B-00044",message:c.invalidValue},invalidData:{statusCode:d,code:"LIB-B-00045",message:c.invalidData},invalidUUID:{statusCode:d,code:"LIB-B-00046",message:c.invalidUUID},noDate:{statusCode:d,code:"LIB-B-00047",message:c.noDate},invalidDate:{statusCode:d,code:"LIB-B-00048",message:c.invalidDate},invalidId:{statusCode:d,code:"LIB-B-00049",message:c.invalidId},noModel:{statusCode:d,code:"LIB-B-00050",message:c.noModel},sequelizeValidation:{statusCode:d,code:"LIB-B-00999"}};var he=e=>{try{JSON.parse(e)}catch{return!1}return JSON.parse(e)};var Ee=async(e,a)=>{for(let t of e)await a(t,e.indexOf(t))};var O=e=>e==null?[]:Array.isArray(e)?e:[e];var be=async(e,a)=>{await Promise.all(e.map((t,o)=>a(t,o,e)))};var n={};n.fileType={receipt:"receipt",paymentVoucher:"paymentVoucher",quote:"quote",others:"others",project:"project",proposal:"proposal",bankBillet:"bankBillet",refund:"refund",eml:"eml"};n.refurbishItemStatus={approved:{label:"Aprovado",value:"approved"},rejected:{label:"N\xE3o aprovado",value:"rejected"},pending:{label:"Para aprovar",value:"pending"},activeStatus:["approved","pending"]};n.companyStatus={created:{id:1,name:"Cadastro iniciado"},onBoarding:{id:2,name:"Aguardando libera\xE7\xE3o"},active:{id:3,name:"Ativo"},blocked:{id:4,name:"Bloqueado"},cancelled:{id:5,name:"Cancelada"}};n.companyType={architect:{id:1,name:"Arquitetura e design de interiores",roles:["architect"]},service:{id:2,name:"Execu\xE7\xE3o de obra"},store:{id:3,name:"Loja de produtos e materiais"},factory:{id:4,name:"Fabricante"},other:{id:10,name:"Outros"}};n.refurbishStatus={new:{id:1,name:"Novo"},contact:{id:2,name:"Em contato"},proposalSent:{id:3,name:"Proposta enviada"},archived:{id:4,name:"Arquivada"},winner:{id:5,name:"Ganha",winner:!0},execution:{id:5,name:"Em andamento"},finished:{id:6,name:"Finalizado"},cancelled:{id:7,name:"Cancelado"},activeOpportunity:[1,2,3],opportunity:[1,2,3,4],project:[5,6,7],end:[4,5,6,7]};n.refurbishStage={1:{id:1,name:"Oportunidade"},2:{id:2,name:"Projeto"}};n.roles={admin:{id:"admin",name:"Administrador"},sales:{id:"sales",name:"Venda"},arch:{id:"architect",name:"Arquitetura"},plan:{id:"plan",name:"Planejamento"},work:{id:"work",name:"Obra"},quality:{id:"quality",name:"Qualidade"},supply:{id:"supply",name:"Suprimentos"},contractor:{id:"contractor",name:"Empreiteiro"},beta:{id:"beta",name:"Beta user"}};n.userType={guest:{name:"Visitante",value:"guest",type:"visitante"},operator:{name:"Operador",value:"operator",type:"operador"},customer:{name:"Cliente",value:"customer",type:"cliente"},provider:{name:"Profissional",value:"provider",type:"profissional"},system:{name:"Sistema",value:"system",type:"sistema"},anonymous:{name:"An\xF4nimo",value:"anonymous"},realTypes:["guest","operator","customer","provider"],skipPermission:["operator","customer"],all:["system","provider","customer","operator"]};n.paymentStatus={waitingOrder:1,analyzing:2,waitingRelease:3,released:4,transferred:5,markAsPaid:6,allowTransfer:[3,4],allowChange:[1,6],sendEmail:[4,5]};n.personTypes={pf:"pf",pj:"pj"};n.asaasPersonTypes={pf:"FISICA",pj:"JURIDICA"};n.stepAccount={personal:0,address:1,documents:2};n.statusVobiPay={PENDING:{color:"#FF8E1B",label:"Em an\xE1lise"}};n.refurbishItemType={product:1,labor:2,parent:3,composition:4,notParent:[1,2,4],productLabor:[1,2]};n.notificationChannel={system:"system",email:"email",whatsApp:"whatsApp"};n.planType={free:{value:"free",label:"freemium"},paid:{value:"paid",label:"Pago"}};n.installmentStatuses={pendingPayment:1,paid:2,confirm:3,paidManually:4,inAnalysis:5,refunded:6,refundRequested:7,onGoingRefund:8,chargebackRequested:9,onGoingChargeback:10,waitingChargeback:11,cancelled:12,all:[1,2,3,4,5,6,7,8,9,10],paidVobiPay:[2,3,7,8,9,10,11],bankStatement:[2,4,6,7,8,9,10,11],allPaid:[2,3,4,7,8,9,10,11],allPaidBalance:[2,4,7,8,9,10,11],allPending:[1,5]};n.paymentStatuses={draft:1,open:2,paid:3,cancelled:4,realValues:[2,3],allStatus:[1,2,3,4]};n.billType={income:"receita",expense:"despesa",transfer:"transferencia",balance:"saldo inicial"};n.paymentTypeValues={expense:{value:"expense",label:"despesa"},income:{value:"income",label:"receita"},transfer:{value:"transfer",label:"transfer\xEAncia"},payment:{value:"payment",label:"pagamento do cliente"},balance:{value:"balance",label:"saldo inicial"}};n.financialCategories={serviceSelling:1,productsSelling:2,fee:3,investimentIncome:4,others:5,advanceFutureCapital:6,capitalIncrease:7,bankLoan:8,institutionLoan:9,partnerLoan:10,paymentShareCapital:11};n.getEnumValue=(e,a,t=["id","name"])=>{let o=null;return!e||!a||Object.keys(e).some(r=>e[r][t[0]]===a?(o=e[r][t[1]],!0):!1),o};n.asaasPixType={CPF:"CPF",CNPJ:"CNPJ",EMAIL:"E-mail",PHONE:"Celular",EVP:"Aleat\xF3ria"};n.paymentTypes={pix:1,bankSlip:2,creditCard:3,debitCard:4,transfer:5,money:6,other:7};n.paymentTypesDesc={1:"Pix",2:"Boleto",3:"Cart\xE3o de cr\xE9dito",4:"Cart\xE3o de d\xE9bito",5:"Transfer\xEAncia",6:"Dinheiro",7:"Outro"};n.vobiPayPaymentType={pix:1,bankSlip:2,creditCard:3,all:[1,2,3],1:"pix",2:"bankSlip",3:"creditCard"};n.asaasPaymentStatus={PENDING:{label:"PENDING",value:n.installmentStatuses.pendingPayment},RECEIVED:{label:"RECEIVED",value:n.installmentStatuses.paid},CONFIRMED:{label:"CONFIRMED",value:n.installmentStatuses.confirm},OVERDUE:{label:"OVERDUE",value:null},REFUNDED:{label:"REFUNDED",value:n.installmentStatuses.refunded},RECEIVED_IN_CASH:{label:"RECEIVED_IN_CASH",value:n.installmentStatuses.paidManually},REFUND_REQUESTED:{label:"REFUND_REQUESTED",value:n.installmentStatuses.refundRequested},REFUND_IN_PROGRESS:{label:"REFUND_IN_PROGRESS",value:n.installmentStatuses.onGoingRefund},CHARGEBACK_REQUESTED:{label:"CHARGEBACK_REQUESTED",value:n.installmentStatuses.chargebackRequested},CHARGEBACK_DISPUTE:{label:"CHARGEBACK_DISPUTE",value:n.installmentStatuses.onGoingChargeback},AWAITING_CHARGEBACK_REVERSAL:{label:"AWAITING_CHARGEBACK_REVERSAL",value:n.installmentStatuses.waitingChargeback},DUNNING_REQUESTED:{label:"DUNNING_REQUESTED",value:null},DUNNING_RECEIVED:{label:"DUNNING_RECEIVED",value:null},AWAITING_RISK_ANALYSIS:{label:"AWAITING_RISK_ANALYSIS",value:n.installmentStatuses.inAnalysis}};n.maxLimitPayment={credit:{value:2e4,label:"20.000,00"},installment:{value:15e4,label:"150.000,00"},minimumInstallmentValue:{value:10,label:"10,00"},maximumInstallments:{value:12}};n.asaasWithdrawStatus={PENDING:"PENDING",PROCESSING:"PROCESSING",DONE:"DONE",FAILED:"FAILED",CANCELLED:"CANCELLED",BLOCKED:"BLOCKED"};n.withdrawStatuses={DONE:"Efetuada",PENDING:"Pendente",BANK_PROCESSING:"Processando",CANCELLED:"Cancelada",FAILED:"Falhou",BLOCKED:"Bloqueado",group:{done:["DONE"],open:["PENDING","BANK_PROCESSING"],error:["CANCELLED","FAILED","BLOCKED"]}};n.vobiPayBankAccountType={corrente:"CONTA_CORRENTE",poupanca:"CONTA_POUPANCA",salario:"CONTA_SALARIO",pagamento:"CONTA_DE_PAGAMENTO"};n.withdrawSteps={list:1,fillData:2,confirmData:3};n.billingManagerStatus={pending:1,send:2,error:3,discarded:4,notSent:5,sending:6};n.billingManagerStatusDesc={1:"Aguardando",2:"Enviado",3:"Erro",4:"Descartado",5:"N\xE3o enviado",6:"Enviando"};n.billingManagerChannels={allChannels:["email","sms","whatsapp"],email:{value:"email",label:"E-mail"},sms:{value:"sms",label:"SMS"},whatsapp:{value:"whatsapp",label:"WhatsApp"}};n.billingManagerType={allTypes:["DC","D-3","D0","D+1","D+3","D+6"],billingRulerType:["D-3","D0","D+1","D+3","D+6"],DC:{label:"Cria\xE7\xE3o da cobran\xE7a",value:"DC",tooltip:"Ao criar a cobran\xE7a",message:"de cobran\xE7a criada para {customerName} {value}"},"D-3":{label:"3 dias antes do vencimento",value:"D-3",tooltip:"3 dias antes do vencimento das parcelas",message:"de aviso de vencimento em 3 dias para {customerName} {value}"},D0:{label:"Dia do vencimento",value:"D0",tooltip:"No dia do vencimento da parcela",message:"de aviso de cobran\xE7a vencendo hoje para {customerName} {value}"},"D+1":{label:"1 dia ap\xF3s o vencimento",value:"D+1",tooltip:"1 dia ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 1 dia para {customerName} {value}"},"D+3":{label:"3 dias ap\xF3s o vencimento",value:"D+3",tooltip:"3 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 3 dias para {customerName} {value}"},"D+6":{label:"6 dias ap\xF3s o vencimento",value:"D+6",tooltip:"6 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 6 dias para {customerName} {value}"}};n.paymentCreditPermission={allowed:2e4,blocked:0};n.withdrawLimit={pj:{daytime:15e3,nightly:5e3},pf:{daytime:15e3,nightly:5e3}};n.optionsRefurbishReport={financialPhysical:"financialPhysics",budgeted:"budgeted",financial:"financial",physic:"physic",financialPhysicBudgeted:{value:"financialPhysics.budgeted"},physicBudgeted:{value:"physic.budgeted"},physicAccomplished:{value:"physic.accomplished"},financialBudgeted:{value:"financial.budgeted"},financialAccomplished:{value:"financial.accomplished"},financialBudAcp:{value:"financial.budgetedAccomplished"},physicBudAcp:{value:"physic.budgetedAccomplished"}};n.refurbishReportType={budgeted:[n.optionsRefurbishReport.financialPhysicBudgeted.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.financialBudgeted.value],accomplished:[n.optionsRefurbishReport.physicAccomplished.value,n.optionsRefurbishReport.financialAccomplished.value],budgetedAccomplished:[n.optionsRefurbishReport.financialBudAcp.value,n.optionsRefurbishReport.physicBudAcp.value],common:[n.optionsRefurbishReport.financialPhysicBudgeted.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.physicBudAcp.value,n.optionsRefurbishReport.financialBudgeted.value,n.optionsRefurbishReport.financialBudAcp.value],measurement:[n.optionsRefurbishReport.physicAccomplished.value],financial:[n.optionsRefurbishReport.financialAccomplished.value],customColumns:[n.optionsRefurbishReport.physicBudAcp.value,n.optionsRefurbishReport.financialBudAcp.value],simpleExport:[n.optionsRefurbishReport.physicAccomplished.value,n.optionsRefurbishReport.financialAccomplished.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.financialBudgeted.value]};n.reportTypeActions={consolidatedByProject:{model:"refurbishes",clickRow:!1,groupBy:"refurbishes",rangeField:"paidDate",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howFinancialReportByProjectStatusPaid",tableTitle:"Resultado de projetos",tableTitleTooltip:"S\xE3o contabilizadas apenas parcelas que j\xE1 foram marcadas como pago das receitas e despesas.",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial/report",exportEntity:"consolidatedByProject"},foreseenByProject:{model:"refurbishes",clickRow:!1,groupBy:"refurbishes",rangeField:"dueDate",howDoesItsWorksId:"howFinancialReportByProjectAllStatus",tableTitle:"Previs\xE3o de resultado dos projetos",tableTitleTooltip:"S\xE3o contabilizadas todas as receitas e despesas, que j\xE1 foram pagas ou ainda em aberto.",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial/report",exportEntity:"foreseenByProject"},resultsByInstallment:{model:"installments",clickRow:!0,groupBy:"months",rangeField:"paidDate",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howResultsWork",tableTitle:"Transa\xE7\xF5es realizadas",tableTitleTooltip:"S\xE3o contabilizadas apenas parcelas que j\xE1 foram marcadas como pago das receitas e despesas",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial",exportEntity:"resultsByInstallment"},"cashFlow-monthly":{model:"cashFlow",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howCashFlowWork",tableTitle:"Fluxo de caixa",tableTitleTooltip:"",withResultChart:!1,filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,yearPicker:!0,columns:!0},showLegend:!1,exportCsvModel:"financial/cashFlow",exportEntity:"cashFlow"},dre:{model:"dre",howDoesItsWorksId:"howDREWorks",filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,yearPicker:!0,columns:!1},showLegend:!1,exportCsvModel:"financial/dre",exportEntity:"dre"},"cashFlow-daily":{model:"cashFlow",howDoesItsWorksId:"howDailyCashFlowWorks",tableTitleTooltip:"",filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,monthPicker:!0,columns:!1,paymentBankAccount:!0},showLegend:!1,exportCsvModel:"financial/dailyCashFlow",exportEntity:"dailyCashFlow"}};n.extraValuesPayment={taxes:"taxes",discount:"discount",shipping:"shipping",dueDateDiscount:"dueDateDiscount",dueDateDiscountType:"dueDateDiscountType",dueDateLimitDays:"dueDateLimitDays",fine:"fine",fineType:"fineType",interest:"interest"};n.extraValuesPaymentType={simple:[n.extraValuesPayment.taxes,n.extraValuesPayment.discount,n.extraValuesPayment.shipping],asaas:[n.extraValuesPayment.dueDateDiscount,n.extraValuesPayment.dueDateDiscountType,n.extraValuesPayment.dueDateLimitDays,n.extraValuesPayment.fine,n.extraValuesPayment.fineType,n.extraValuesPayment.interest]};n.fineInterestDiscountType={percentage:{value:"PERCENTAGE",label:"Percentual"},fixed:{value:"FIXED",label:"Valor fixo"}};n.paymentPermissions={financialResume:"financialResume",financialSupplier:"financialSupplier",financialOwnBusiness:"financialOwnBusiness",financialIncome:"financialIncome",financialExpense:"financialExpense",financialTransfer:"financialTransfer",financialResults:"financialResults",financialBankStatement:"financialBankStatement",financialReport:"financialReport",projectResume:"projectResume",projectSupplier:"projectSupplier",projectOwnBusiness:"projectOwnBusiness",projectIncome:"projectIncome",projectExpense:"projectExpense",projectResults:"projectResults",projectBudgetedAccomplished:"projectBudgetedAccomplished"};n.administrativePermissions={administrative:"administrative",admNote:"admNote",admFile:"admFile",admDetails:"admDetails",admTasks:"admTasks",admFinancial:"admFinancial",admFinancialExpense:"admFinancialExpense",admFinancialIncome:"admFinancialIncome",admFinancialResults:"admFinancialResults",admFinancialResume:"admFinancialResume",admPurchase:"admPurchase",admPurchaseQuote:"admPurchaseQuote",admPurchaseOrder:"admPurchaseOrder",admPurchaseOverview:"admPurchaseOverview",admPurchaseSolicitation:"admPurchaseSolicitation"};n.colors={primary50:"#EBF0FF",primary100:"#D6E2FF",primary400:"#4F8EFA",primary500:"#2F74DE",teal500:"#00a296",teal600:"#009389",green500:"#46a22e",green600:"#40932A",yellow400:"#e0a819",yellow500:"#BA8A12",orange500:"#de7400",orange600:"#CA6A00",red50:"#fdeceb",red100:"#fac4c0",red500:"#ef4134",red600:"#D93B2F",pink500:"#e547a6",pink600:"#D04197",violet500:"#a145de",violet600:"#933FCA",neutral500:"#6F778B",neutral600:"#565E71"};n.maxInstallmentLength=60;n.purchaseSolicitationStatus={draft:1,open:2,quote:3,buy:4,closed:5,canceled:6,approved:19,rejected:20,editable:[1,2,20],ongoing:[2,3,4,19,20]};n.purchaseOrderStatus={draft:7,centralDraft:23,open:8,sent:9,accepted:10,refused:11,closed:12,approved:21,rejected:22,centralLinked:24,centralDeleted:25,requestableRefund:[10,12],chargeableAdministrationFee:[10,12],editable:[23,7,8,22],ongoing:[8,9],finished:[10,12],allRejected:[11,22],central:[23,24,25],centralModal:[24,25]};n.purchaseQuoteStatus={draft:13,open:14,pendingResponse:15,quoted:16,buy:17,finished:18,editable:[13,14,15],ongoing:[14,15,16,17]};n.groupPermission={admin:1,member:2};n.mimeTypes={DOCUMENT:{PDF:"application/pdf"},IMAGE:{JPEG:"image/jpeg",PNG:"image/png",WEBP:"image/webp"},AUDIO:{MPEG:"audio/mpeg",OGG:"audio/ogg",WAV:"audio/wav",MP4:"audio/mp4",AAC:"audio/aac"}};n.conciliationStatus={draft:"Rascunho",open:"Em an\xE1lise",done:"Finalizado",cancel:"Cancelado"};n.OPFEventEnum={created:"AUTHORIZED",login_succeeded:"AWAITING_AUTHORIZATION",error:"REJECTED"};n.openFinanceStatus={1:"AWAITING_AUTHORIZATION",2:"AUTHORIZED",3:"REJECTED"};n.openFinanceEnum={AWAITING_AUTHORIZATION:{value:1,label:"Aguardando autoriza\xE7\xE3o",enum:n.openFinanceStatus[1]},AUTHORIZED:{value:2,label:"Autorizado",enum:n.openFinanceStatus[2],event:"created"},REJECTED:{value:3,label:"Rejeitado",enum:n.openFinanceStatus[3]},connected:[1,2]};n.openFinanceAlertMessage={[n.openFinanceEnum.AWAITING_AUTHORIZATION.value]:{message:`As conex\xF5es podem levar alguns minutos para serem conclu\xEDdas,
1
+ "use strict";var re=Object.create;var R=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var le=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty;var de=(e,a)=>{for(var t in a)R(e,t,{get:a[t],enumerable:!0})},W=(e,a,t,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of ie(a))!ce.call(e,r)&&r!==t&&R(e,r,{get:()=>a[r],enumerable:!(o=se(a,r))||o.enumerable});return e};var D=(e,a,t)=>(t=e!=null?re(le(e)):{},W(a||!e||!e.__esModule?R(t,"default",{value:e,enumerable:!0}):t,e)),ue=e=>W(R({},"__esModule",{value:!0}),e);var Ma={};de(Ma,{BAD_GATEWAY:()=>ge,BAD_REQUEST:()=>d,FORBIDDEN:()=>me,INTERNAL_SERVER_ERROR:()=>F,IsJsonString:()=>he,METHOD_NOT_ALLOWED:()=>fe,NOT_ALLOWED:()=>w,NOT_FOUND:()=>L,SERVICE_UNAVAILABLE:()=>ye,UNAUTHORIZED:()=>P,_setSharpForTesting:()=>Pa,asArray:()=>O,asBrazilianDate:()=>M,asDate:()=>T,asyncForEach:()=>Ee,base64ToFile:()=>ka,brazilianDateTime:()=>K,brazilianDateToDate:()=>Me,capitalize:()=>U,checkApprovalAuthority:()=>va,checkCnpj:()=>Ae,checkCpf:()=>Ie,checkEmail:()=>ve,compressImage:()=>Ua,configure:()=>xe,containsEncodedComponents:()=>Ne,createThumbnail:()=>Oa,currentDay:()=>V,curry:()=>Re,dateIsValid:()=>Je,decodeToken:()=>ra,decrypt:()=>Pe,diffObject:()=>Be,dynamici18nString:()=>Te,elasticTransformOr:()=>Se,encrypt:()=>we,enumHelper:()=>n,error:()=>y,eventBus:()=>Le,extractMonthInfo:()=>Ia,extractValueFromWhere:()=>Fe,filterAttributes:()=>Ue,filterEmpty:()=>ke,findValue:()=>k,firstMonthDay:()=>j,flatMapData:()=>Ca,flattenChildren:()=>q,formatCurrency:()=>_,formatDate:()=>Q,formatDocument:()=>Na,formatNumber:()=>Ke,formatNumberAnyFormat:()=>Qe,get:()=>v,getConfig:()=>De,getDateOpenFinance:()=>Ra,getExtension:()=>Xe,getMonthNumber:()=>He,getNameWithoutExtension:()=>Oe,getNextDay:()=>_e,getNextWeekday:()=>X,getPreviewsWeekday:()=>ee,getToday:()=>Ve,getToken:()=>na,getTomorrow:()=>ze,getUUIDFromEmail:()=>_a,getYesterday:()=>qe,imgSrcRegex:()=>ea,isAfter:()=>Ge,isDateValid:()=>aa,isNumber:()=>ta,isOfAge:()=>$e,isValidUrl:()=>oa,lastMonthDay:()=>G,makeRefurbishFileUrl:()=>sa,maxDateToList:()=>We,minDateToList:()=>Ye,monthsBetween:()=>je,normalizeString:()=>Da,nullIfEmpty:()=>ia,padLeft:()=>la,parseArrayAsObject:()=>ca,parseRouteToModel:()=>da,prepareDoc:()=>ua,prepareSession:()=>pa,promiseAny:()=>ma,promiseEach:()=>be,removeProperty:()=>fa,removeSpecialChar:()=>ga,replaceNumberOrPercentage:()=>Aa,slugify:()=>ya,splitList:()=>ha,sum:()=>ba,sumByFunction:()=>Ea,upload:()=>Fa,validateAccess:()=>Ce,validateMobilePhoneNumber:()=>xa,valueReplacer:()=>S});module.exports=ue(Ma);var Y={userNotFound:"Usu\xE1rio n\xE3o foi encontrado.",pageNotFound:"Desculpe. P\xE1gina n\xE3o encontrada.",notAuthorized:"A\xE7\xE3o n\xE3o autorizada, atualize a p\xE1gina e tente novamente.",tokenExpired:"Sess\xE3o expirada.",invalidToken:"Token inv\xE1lido.",notUpdated:"Nenhum registro foi alterado.",cantDelete:"Esse registro est\xE1 sendo usado, por isso n\xE3o \xE9 poss\xEDvel apaga-lo.",general:"Ocorreu um erro.",sentError:"Erro ao enviar proposta",noUser:"Usu\xE1rio n\xE3o encontrado.",noEmail:"E-mail n\xE3o foi informado",noPassword:"Senha n\xE3o foi informada.",invalidEmail:"O e-mail informado \xE9 inv\xE1lido.",uniqueEmail:"O e-mail informado j\xE1 est\xE1 cadastrado.",invalidCPF:"O CPF informado \xE9 inv\xE1lido.",invalidCNPJ:"O CNPJ informado \xE9 inv\xE1lido.",uniqueName:"Nome informado j\xE1 cadastrado.",noName:"Nome n\xE3o foi informado.",noData:"Dados n\xE3o informados.",noDate:"Data n\xE3o informada.",noModel:"Ocorreu um erro com a entidade",invalidId:"Id inv\xE1lido",invalidCredentials:"Usu\xE1rio e/ou senha inv\xE1lidos.",noPhone:"Telefone n\xE3o foi informado.",noCPF:"CPF n\xE3o foi informado.",noRG:"RG n\xE3o foi informado.",noZipcode:"CEP n\xE3o foi informado.",noStreet:"Endere\xE7o n\xE3o foi informado.",noNumber:"N\xFAmero n\xE3o foi informado.",noState:"Estado n\xE3o foi informado.",noCity:"Cidade n\xE3o foi informada.",noNeighborhood:"Bairro n\xE3o foi informado.",noCNPJ:"CNPJ n\xE3o foi informado.",noCompanyName:"Raz\xE3o social n\xE3o foi informada.",noTrademarkName:"Nome fantasia n\xE3o foi informado.",noCompanyZipcode:"CEP da empresa n\xE3o foi informado.",noCompanyStreet:"Endere\xE7o da empresa n\xE3o foi informado.",noCompanyNumber:"N\xFAmero da empresa n\xE3o foi informado.",noCompanyState:"Estado da empresa n\xE3o foi informado.",noCompanyCity:"Cidade da empresa n\xE3o foi informado.",noCompanyNeighborhood:"Bairro da empresa n\xE3o foi informado.",noBirthdate:"Data de nascimento n\xE3o foi informada.",noCompany:"Empresa n\xE3o informada.",invalidURL:"URL inv\xE1lida.",noPermissions:"Permiss\xF5es n\xE3o encontradas.",fileLimit50:"Os arquivos n\xE3o pode ter mais de 50 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo.",fileLimit10:"Os arquivos n\xE3o pode ter mais de 10 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo no corpo da mensagem.",maxLength:"O nome deve ter no m\xE1ximo 255 caracteres.",invalidData:"Dados inv\xE1lidos.",invalidDate:"Data inv\xE1lida.",invalidDates:"Data de in\xEDcio n\xE3o pode ser maior que data de fim.",invalidUUID:"A URL informada n\xE3o foi encontrada, verifique se est\xE1 correto o link desejado.",invalidValue:"Valor informado inv\xE1lido.",invalidDoc:"O documento informado (CNPJ/CPF) est\xE1 incorreto.",docAlreadyExists:"Documento j\xE1 cadastrado.",tokenPasswordError:"Link de recupera\xE7\xE3o de senha inv\xE1lido.",errPassword:"Senha est\xE1 inv\xE1lida.",noParameters:"Par\xE2metros n\xE3o informado.",uniqueCode:"C\xF3digo j\xE1 cadastrado."};var y={},J={en:Y,"pt-br":"PT_BR_LOCALE"},c=J.en||J.en,d=400,w=405,P=401,me=403,L=404,fe=405,F=500,ge=502,ye=503;y.NOT_FOUND={userNotFound:{statusCode:L,code:"NF-00001",message:c.userNotFound},pageNotFound:{statusCode:L,code:"NF-00002",message:c.pageNotFound}};y.UNAUTHORIZED={notAuthorized:{statusCode:P,code:"UA-00001",message:c.notAuthorized},tokenExpired:{statusCode:P,code:"UA-00002",message:c.tokenExpired},invalidToken:{statusCode:P,code:"UA-00003",message:c.invalidToken}};y.NOT_ALLOWED={notUpdated:{statusCode:w,code:"NA-00001",message:c.notUpdated},cantDelete:{statusCode:w,code:"NA-00002",message:c.cantDelete}};y.INTERNAL_SERVER_ERROR={general:{statusCode:F,code:"ISE-00001",message:c.general},sentError:{statusCode:F,code:"ISE-00002",message:c.sentError}};y.BAD_REQUEST={noUser:{statusCode:d,code:"LIB-B-00001",message:c.noUser},noEmail:{statusCode:d,code:"LIB-B-00002",message:c.noEmail},noPassword:{statusCode:d,code:"LIB-B-00003",message:c.noPassword},invalidEmail:{statusCode:d,code:"LIB-B-00004",message:c.invalidEmail},uniqueEmail:{statusCode:d,code:"LIB-B-00005",message:c.uniqueEmail},invalidCPF:{statusCode:d,code:"LIB-B-00006",message:c.invalidCPF},invalidCNPJ:{statusCode:d,code:"LIB-B-00007",message:c.invalidCNPJ},uniqueName:{statusCode:d,code:"LIB-B-00008",message:c.uniqueName},noName:{statusCode:d,code:"LIB-B-00009",message:c.noName},noData:{statusCode:d,code:"LIB-B-00010",message:c.noData},invalidCredentials:{statusCode:d,code:"LIB-B-00011",message:c.invalidCredentials},tokenPasswordError:{statusCode:d,code:"LIB-B-00012",message:c.tokenPasswordError},errPassword:{statusCode:d,code:"LIB-B-00013",message:c.errPassword},noPhone:{statusCode:d,code:"LIB-B-00014",message:c.noPhone},noCPF:{statusCode:d,code:"LIB-B-00015",message:c.noCPF},noRG:{statusCode:d,code:"LIB-B-00016",message:c.noRG},noZipcode:{statusCode:d,code:"LIB-B-00017",message:c.noZipcode},noStreet:{statusCode:d,code:"LIB-B-00018",message:c.noStreet},noNumber:{statusCode:d,code:"LIB-B-00019",message:c.noNumber},noState:{statusCode:d,code:"LIB-B-00020",message:c.noState},noCity:{statusCode:d,code:"LIB-B-00021",message:c.noCity},noNeighborhood:{statusCode:d,code:"LIB-B-00022",message:c.noNeighborhood},noCNPJ:{statusCode:d,code:"LIB-B-00023",message:c.noCNPJ},noCompanyName:{statusCode:d,code:"LIB-B-00024",message:c.noCompanyName},noTrademarkName:{statusCode:d,code:"LIB-B-00025",message:c.noTrademarkName},noCompanyZipcode:{statusCode:d,code:"LIB-B-00026",message:c.noCompanyZipcode},noCompanyStreet:{statusCode:d,code:"LIB-B-00027",message:c.noCompanyStreet},noCompanyNumber:{statusCode:d,code:"LIB-B-00028",message:c.noCompanyNumber},noCompanyState:{statusCode:d,code:"LIB-B-00029",message:c.noCompanyState},noCompanyCity:{statusCode:d,code:"LIB-B-00030",message:c.noCompanyCity},noCompanyNeighborhood:{statusCode:d,code:"PRO-00031",message:c.noCompanyNeighborhood},noBirthdate:{statusCode:d,code:"LIB-B-00032",message:c.noBirthdate},noCompany:{statusCode:d,code:"LIB-B-00033",message:c.noCompany},noParameters:{statusCode:d,code:"LIB-B-00034",message:c.noParameters},invalidDoc:{statusCode:d,code:"LIB-B-00035",message:c.invalidDoc},docAlreadyExists:{statusCode:d,code:"LIB-B-00036",message:c.docAlreadyExists},invalidURL:{statusCode:d,code:"LIB-B-00037",message:c.invalidURL},noPermissions:{statusCode:d,code:"LIB-B-00038",message:c.noPermissions},fileLimit50:{statusCode:d,code:"LIB-B-00039",message:c.fileLimit50},fileLimit10:{statusCode:d,code:"LIB-B-00040",message:c.fileLimit10},invalidDates:{statusCode:d,code:"LIB-B-00041",message:c.invalidDates},maxLength:{statusCode:d,code:"LIB-B-00042",message:c.maxLength},uniqueCode:{statusCode:d,code:"LIB-B-00043",message:c.uniqueCode},invalidValue:{statusCode:d,code:"LIB-B-00044",message:c.invalidValue},invalidData:{statusCode:d,code:"LIB-B-00045",message:c.invalidData},invalidUUID:{statusCode:d,code:"LIB-B-00046",message:c.invalidUUID},noDate:{statusCode:d,code:"LIB-B-00047",message:c.noDate},invalidDate:{statusCode:d,code:"LIB-B-00048",message:c.invalidDate},invalidId:{statusCode:d,code:"LIB-B-00049",message:c.invalidId},noModel:{statusCode:d,code:"LIB-B-00050",message:c.noModel},sequelizeValidation:{statusCode:d,code:"LIB-B-00999"}};var he=e=>{try{JSON.parse(e)}catch{return!1}return JSON.parse(e)};var be=async(e,a)=>{for(let t of e)await a(t,e.indexOf(t))};var O=e=>e==null?[]:Array.isArray(e)?e:[e];var Ee=async(e,a)=>{await Promise.all(e.map((t,o)=>a(t,o,e)))};var n={};n.fileType={receipt:"receipt",paymentVoucher:"paymentVoucher",quote:"quote",others:"others",project:"project",proposal:"proposal",bankBillet:"bankBillet",refund:"refund",eml:"eml"};n.refurbishItemStatus={approved:{label:"Aprovado",value:"approved"},rejected:{label:"N\xE3o aprovado",value:"rejected"},pending:{label:"Para aprovar",value:"pending"},activeStatus:["approved","pending"]};n.companyStatus={created:{id:1,name:"Cadastro iniciado"},onBoarding:{id:2,name:"Aguardando libera\xE7\xE3o"},active:{id:3,name:"Ativo"},blocked:{id:4,name:"Bloqueado"},cancelled:{id:5,name:"Cancelada"}};n.companyType={architect:{id:1,name:"Arquitetura e design de interiores",roles:["architect"]},service:{id:2,name:"Execu\xE7\xE3o de obra"},store:{id:3,name:"Loja de produtos e materiais"},factory:{id:4,name:"Fabricante"},other:{id:10,name:"Outros"}};n.refurbishStatus={new:{id:1,name:"Novo"},contact:{id:2,name:"Em contato"},proposalSent:{id:3,name:"Proposta enviada"},archived:{id:4,name:"Arquivada"},winner:{id:5,name:"Ganha",winner:!0},execution:{id:5,name:"Em andamento"},finished:{id:6,name:"Finalizado"},cancelled:{id:7,name:"Cancelado"},activeOpportunity:[1,2,3],opportunity:[1,2,3,4],project:[5,6,7],end:[4,5,6,7]};n.refurbishStage={1:{id:1,name:"Oportunidade"},2:{id:2,name:"Projeto"}};n.roles={admin:{id:"admin",name:"Administrador"},sales:{id:"sales",name:"Venda"},arch:{id:"architect",name:"Arquitetura"},plan:{id:"plan",name:"Planejamento"},work:{id:"work",name:"Obra"},quality:{id:"quality",name:"Qualidade"},supply:{id:"supply",name:"Suprimentos"},contractor:{id:"contractor",name:"Empreiteiro"},beta:{id:"beta",name:"Beta user"}};n.userType={guest:{name:"Visitante",value:"guest",type:"visitante"},operator:{name:"Operador",value:"operator",type:"operador"},customer:{name:"Cliente",value:"customer",type:"cliente"},provider:{name:"Profissional",value:"provider",type:"profissional"},system:{name:"Sistema",value:"system",type:"sistema"},anonymous:{name:"An\xF4nimo",value:"anonymous"},realTypes:["guest","operator","customer","provider"],skipPermission:["operator","customer"],all:["system","provider","customer","operator"]};n.paymentStatus={waitingOrder:1,analyzing:2,waitingRelease:3,released:4,transferred:5,markAsPaid:6,allowTransfer:[3,4],allowChange:[1,6],sendEmail:[4,5]};n.personTypes={pf:"pf",pj:"pj"};n.asaasPersonTypes={pf:"FISICA",pj:"JURIDICA"};n.stepAccount={personal:0,address:1,documents:2};n.statusVobiPay={PENDING:{color:"#FF8E1B",label:"Em an\xE1lise"}};n.refurbishItemType={product:1,labor:2,parent:3,composition:4,notParent:[1,2,4],productLabor:[1,2]};n.notificationChannel={system:"system",email:"email",whatsApp:"whatsApp"};n.planType={free:{value:"free",label:"freemium"},paid:{value:"paid",label:"Pago"}};n.installmentStatuses={pendingPayment:1,paid:2,confirm:3,paidManually:4,inAnalysis:5,refunded:6,refundRequested:7,onGoingRefund:8,chargebackRequested:9,onGoingChargeback:10,waitingChargeback:11,cancelled:12,all:[1,2,3,4,5,6,7,8,9,10],paidVobiPay:[2,3,7,8,9,10,11],bankStatement:[2,4,6,7,8,9,10,11],allPaid:[2,3,4,7,8,9,10,11],allPaidBalance:[2,4,7,8,9,10,11],allPending:[1,5]};n.paymentStatuses={draft:1,open:2,paid:3,cancelled:4,realValues:[2,3],allStatus:[1,2,3,4]};n.billType={income:"receita",expense:"despesa",transfer:"transferencia",balance:"saldo inicial"};n.paymentTypeValues={expense:{value:"expense",label:"despesa"},income:{value:"income",label:"receita"},transfer:{value:"transfer",label:"transfer\xEAncia"},payment:{value:"payment",label:"pagamento do cliente"},balance:{value:"balance",label:"saldo inicial"}};n.financialCategories={serviceSelling:1,productsSelling:2,fee:3,investimentIncome:4,others:5,advanceFutureCapital:6,capitalIncrease:7,bankLoan:8,institutionLoan:9,partnerLoan:10,paymentShareCapital:11};n.getEnumValue=(e,a,t=["id","name"])=>{let o=null;return!e||!a||Object.keys(e).some(r=>e[r][t[0]]===a?(o=e[r][t[1]],!0):!1),o};n.asaasPixType={CPF:"CPF",CNPJ:"CNPJ",EMAIL:"E-mail",PHONE:"Celular",EVP:"Aleat\xF3ria"};n.paymentTypes={pix:1,bankSlip:2,creditCard:3,debitCard:4,transfer:5,money:6,other:7};n.paymentTypesDesc={1:"Pix",2:"Boleto",3:"Cart\xE3o de cr\xE9dito",4:"Cart\xE3o de d\xE9bito",5:"Transfer\xEAncia",6:"Dinheiro",7:"Outro"};n.vobiPayPaymentType={pix:1,bankSlip:2,creditCard:3,all:[1,2,3],1:"pix",2:"bankSlip",3:"creditCard"};n.asaasPaymentStatus={PENDING:{label:"PENDING",value:n.installmentStatuses.pendingPayment},RECEIVED:{label:"RECEIVED",value:n.installmentStatuses.paid},CONFIRMED:{label:"CONFIRMED",value:n.installmentStatuses.confirm},OVERDUE:{label:"OVERDUE",value:null},REFUNDED:{label:"REFUNDED",value:n.installmentStatuses.refunded},RECEIVED_IN_CASH:{label:"RECEIVED_IN_CASH",value:n.installmentStatuses.paidManually},REFUND_REQUESTED:{label:"REFUND_REQUESTED",value:n.installmentStatuses.refundRequested},REFUND_IN_PROGRESS:{label:"REFUND_IN_PROGRESS",value:n.installmentStatuses.onGoingRefund},CHARGEBACK_REQUESTED:{label:"CHARGEBACK_REQUESTED",value:n.installmentStatuses.chargebackRequested},CHARGEBACK_DISPUTE:{label:"CHARGEBACK_DISPUTE",value:n.installmentStatuses.onGoingChargeback},AWAITING_CHARGEBACK_REVERSAL:{label:"AWAITING_CHARGEBACK_REVERSAL",value:n.installmentStatuses.waitingChargeback},DUNNING_REQUESTED:{label:"DUNNING_REQUESTED",value:null},DUNNING_RECEIVED:{label:"DUNNING_RECEIVED",value:null},AWAITING_RISK_ANALYSIS:{label:"AWAITING_RISK_ANALYSIS",value:n.installmentStatuses.inAnalysis}};n.maxLimitPayment={credit:{value:2e4,label:"20.000,00"},installment:{value:15e4,label:"150.000,00"},minimumInstallmentValue:{value:10,label:"10,00"},maximumInstallments:{value:12}};n.asaasWithdrawStatus={PENDING:"PENDING",PROCESSING:"PROCESSING",DONE:"DONE",FAILED:"FAILED",CANCELLED:"CANCELLED",BLOCKED:"BLOCKED"};n.withdrawStatuses={DONE:"Efetuada",PENDING:"Pendente",BANK_PROCESSING:"Processando",CANCELLED:"Cancelada",FAILED:"Falhou",BLOCKED:"Bloqueado",group:{done:["DONE"],open:["PENDING","BANK_PROCESSING"],error:["CANCELLED","FAILED","BLOCKED"]}};n.vobiPayBankAccountType={corrente:"CONTA_CORRENTE",poupanca:"CONTA_POUPANCA",salario:"CONTA_SALARIO",pagamento:"CONTA_DE_PAGAMENTO"};n.withdrawSteps={list:1,fillData:2,confirmData:3};n.billingManagerStatus={pending:1,send:2,error:3,discarded:4,notSent:5,sending:6};n.billingManagerStatusDesc={1:"Aguardando",2:"Enviado",3:"Erro",4:"Descartado",5:"N\xE3o enviado",6:"Enviando"};n.billingManagerChannels={allChannels:["email","sms","whatsapp"],email:{value:"email",label:"E-mail"},sms:{value:"sms",label:"SMS"},whatsapp:{value:"whatsapp",label:"WhatsApp"}};n.billingManagerType={allTypes:["DC","D-3","D0","D+1","D+3","D+6"],billingRulerType:["D-3","D0","D+1","D+3","D+6"],DC:{label:"Cria\xE7\xE3o da cobran\xE7a",value:"DC",tooltip:"Ao criar a cobran\xE7a",message:"de cobran\xE7a criada para {customerName} {value}"},"D-3":{label:"3 dias antes do vencimento",value:"D-3",tooltip:"3 dias antes do vencimento das parcelas",message:"de aviso de vencimento em 3 dias para {customerName} {value}"},D0:{label:"Dia do vencimento",value:"D0",tooltip:"No dia do vencimento da parcela",message:"de aviso de cobran\xE7a vencendo hoje para {customerName} {value}"},"D+1":{label:"1 dia ap\xF3s o vencimento",value:"D+1",tooltip:"1 dia ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 1 dia para {customerName} {value}"},"D+3":{label:"3 dias ap\xF3s o vencimento",value:"D+3",tooltip:"3 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 3 dias para {customerName} {value}"},"D+6":{label:"6 dias ap\xF3s o vencimento",value:"D+6",tooltip:"6 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 6 dias para {customerName} {value}"}};n.paymentCreditPermission={allowed:2e4,blocked:0};n.withdrawLimit={pj:{daytime:15e3,nightly:5e3},pf:{daytime:15e3,nightly:5e3}};n.optionsRefurbishReport={financialPhysical:"financialPhysics",budgeted:"budgeted",financial:"financial",physic:"physic",financialPhysicBudgeted:{value:"financialPhysics.budgeted"},physicBudgeted:{value:"physic.budgeted"},physicAccomplished:{value:"physic.accomplished"},financialBudgeted:{value:"financial.budgeted"},financialAccomplished:{value:"financial.accomplished"},financialBudAcp:{value:"financial.budgetedAccomplished"},physicBudAcp:{value:"physic.budgetedAccomplished"}};n.refurbishReportType={budgeted:[n.optionsRefurbishReport.financialPhysicBudgeted.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.financialBudgeted.value],accomplished:[n.optionsRefurbishReport.physicAccomplished.value,n.optionsRefurbishReport.financialAccomplished.value],budgetedAccomplished:[n.optionsRefurbishReport.financialBudAcp.value,n.optionsRefurbishReport.physicBudAcp.value],common:[n.optionsRefurbishReport.financialPhysicBudgeted.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.physicBudAcp.value,n.optionsRefurbishReport.financialBudgeted.value,n.optionsRefurbishReport.financialBudAcp.value],measurement:[n.optionsRefurbishReport.physicAccomplished.value],financial:[n.optionsRefurbishReport.financialAccomplished.value],customColumns:[n.optionsRefurbishReport.physicBudAcp.value,n.optionsRefurbishReport.financialBudAcp.value],simpleExport:[n.optionsRefurbishReport.physicAccomplished.value,n.optionsRefurbishReport.financialAccomplished.value,n.optionsRefurbishReport.physicBudgeted.value,n.optionsRefurbishReport.financialBudgeted.value]};n.reportTypeActions={consolidatedByProject:{model:"refurbishes",clickRow:!1,groupBy:"refurbishes",rangeField:"paidDate",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howFinancialReportByProjectStatusPaid",tableTitle:"Resultado de projetos",tableTitleTooltip:"S\xE3o contabilizadas apenas parcelas que j\xE1 foram marcadas como pago das receitas e despesas.",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial/report",exportEntity:"consolidatedByProject"},foreseenByProject:{model:"refurbishes",clickRow:!1,groupBy:"refurbishes",rangeField:"dueDate",howDoesItsWorksId:"howFinancialReportByProjectAllStatus",tableTitle:"Previs\xE3o de resultado dos projetos",tableTitleTooltip:"S\xE3o contabilizadas todas as receitas e despesas, que j\xE1 foram pagas ou ainda em aberto.",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial/report",exportEntity:"foreseenByProject"},resultsByInstallment:{model:"installments",clickRow:!0,groupBy:"months",rangeField:"paidDate",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howResultsWork",tableTitle:"Transa\xE7\xF5es realizadas",tableTitleTooltip:"S\xE3o contabilizadas apenas parcelas que j\xE1 foram marcadas como pago das receitas e despesas",withResultChart:!0,filters:{dateRangePicker:!0,selectDateFieldTofilter:!0,yearPicker:!1,columns:!0},showLegend:!0,exportCsvModel:"financial",exportEntity:"resultsByInstallment"},"cashFlow-monthly":{model:"cashFlow",idInstallmentStatus:n.installmentStatuses.allPaid,howDoesItsWorksId:"howCashFlowWork",tableTitle:"Fluxo de caixa",tableTitleTooltip:"",withResultChart:!1,filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,yearPicker:!0,columns:!0},showLegend:!1,exportCsvModel:"financial/cashFlow",exportEntity:"cashFlow"},dre:{model:"dre",howDoesItsWorksId:"howDREWorks",filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,yearPicker:!0,columns:!1},showLegend:!1,exportCsvModel:"financial/dre",exportEntity:"dre"},"cashFlow-daily":{model:"cashFlow",howDoesItsWorksId:"howDailyCashFlowWorks",tableTitleTooltip:"",filters:{dateRangePicker:!1,selectDateFieldTofilter:!1,monthPicker:!0,columns:!1,paymentBankAccount:!0},showLegend:!1,exportCsvModel:"financial/dailyCashFlow",exportEntity:"dailyCashFlow"}};n.extraValuesPayment={taxes:"taxes",discount:"discount",shipping:"shipping",dueDateDiscount:"dueDateDiscount",dueDateDiscountType:"dueDateDiscountType",dueDateLimitDays:"dueDateLimitDays",fine:"fine",fineType:"fineType",interest:"interest"};n.extraValuesPaymentType={simple:[n.extraValuesPayment.taxes,n.extraValuesPayment.discount,n.extraValuesPayment.shipping],asaas:[n.extraValuesPayment.dueDateDiscount,n.extraValuesPayment.dueDateDiscountType,n.extraValuesPayment.dueDateLimitDays,n.extraValuesPayment.fine,n.extraValuesPayment.fineType,n.extraValuesPayment.interest]};n.fineInterestDiscountType={percentage:{value:"PERCENTAGE",label:"Percentual"},fixed:{value:"FIXED",label:"Valor fixo"}};n.paymentPermissions={financialResume:"financialResume",financialSupplier:"financialSupplier",financialOwnBusiness:"financialOwnBusiness",financialIncome:"financialIncome",financialExpense:"financialExpense",financialTransfer:"financialTransfer",financialResults:"financialResults",financialBankStatement:"financialBankStatement",financialReport:"financialReport",projectResume:"projectResume",projectSupplier:"projectSupplier",projectOwnBusiness:"projectOwnBusiness",projectIncome:"projectIncome",projectExpense:"projectExpense",projectResults:"projectResults",projectBudgetedAccomplished:"projectBudgetedAccomplished"};n.administrativePermissions={administrative:"administrative",admNote:"admNote",admFile:"admFile",admDetails:"admDetails",admTasks:"admTasks",admFinancial:"admFinancial",admFinancialExpense:"admFinancialExpense",admFinancialIncome:"admFinancialIncome",admFinancialResults:"admFinancialResults",admFinancialResume:"admFinancialResume",admPurchase:"admPurchase",admPurchaseQuote:"admPurchaseQuote",admPurchaseOrder:"admPurchaseOrder",admPurchaseOverview:"admPurchaseOverview",admPurchaseSolicitation:"admPurchaseSolicitation"};n.colors={primary50:"#EBF0FF",primary100:"#D6E2FF",primary400:"#4F8EFA",primary500:"#2F74DE",teal500:"#00a296",teal600:"#009389",green500:"#46a22e",green600:"#40932A",yellow400:"#e0a819",yellow500:"#BA8A12",orange500:"#de7400",orange600:"#CA6A00",red50:"#fdeceb",red100:"#fac4c0",red500:"#ef4134",red600:"#D93B2F",pink500:"#e547a6",pink600:"#D04197",violet500:"#a145de",violet600:"#933FCA",neutral500:"#6F778B",neutral600:"#565E71"};n.maxInstallmentLength=60;n.purchaseSolicitationStatus={draft:1,open:2,quote:3,buy:4,closed:5,canceled:6,approved:19,rejected:20,editable:[1,2,20],ongoing:[2,3,4,19,20]};n.purchaseOrderStatus={draft:7,centralDraft:23,open:8,sent:9,accepted:10,refused:11,closed:12,approved:21,rejected:22,centralLinked:24,centralDeleted:25,requestableRefund:[10,12],chargeableAdministrationFee:[10,12],editable:[23,7,8,22],ongoing:[8,9],finished:[10,12],allRejected:[11,22],central:[23,24,25],centralModal:[24,25]};n.purchaseQuoteStatus={draft:13,open:14,pendingResponse:15,quoted:16,buy:17,finished:18,editable:[13,14,15],ongoing:[14,15,16,17]};n.groupPermission={admin:1,member:2};n.mimeTypes={DOCUMENT:{PDF:"application/pdf"},IMAGE:{JPEG:"image/jpeg",PNG:"image/png",WEBP:"image/webp"},AUDIO:{MPEG:"audio/mpeg",OGG:"audio/ogg",WAV:"audio/wav",MP4:"audio/mp4",AAC:"audio/aac"}};n.conciliationStatus={draft:"Rascunho",open:"Em an\xE1lise",done:"Finalizado",cancel:"Cancelado"};n.OPFEventEnum={created:"AUTHORIZED",login_succeeded:"AWAITING_AUTHORIZATION",error:"REJECTED"};n.openFinanceStatus={1:"AWAITING_AUTHORIZATION",2:"AUTHORIZED",3:"REJECTED"};n.openFinanceEnum={AWAITING_AUTHORIZATION:{value:1,label:"Aguardando autoriza\xE7\xE3o",enum:n.openFinanceStatus[1]},AUTHORIZED:{value:2,label:"Autorizado",enum:n.openFinanceStatus[2],event:"created"},REJECTED:{value:3,label:"Rejeitado",enum:n.openFinanceStatus[3]},connected:[1,2]};n.openFinanceAlertMessage={[n.openFinanceEnum.AWAITING_AUTHORIZATION.value]:{message:`As conex\xF5es podem levar alguns minutos para serem conclu\xEDdas,
2
2
  portanto \xE9 normal que alguns dados ainda n\xE3o estejam vis\xEDveis.`,background:n.colors.primary50,borderColor:n.colors.primary100,icon:"faCircleInfo",iconColor:n.colors.primary500},[n.openFinanceEnum.REJECTED.value]:{message:`N\xE3o foi poss\xEDvel conectar sua conta. Verifique sua conex\xE3o e os dados
3
- informados e tente conectar novamente. Se o erro persistir, contate o suporte.`,background:n.colors.red50,borderColor:n.colors.red100,icon:"faCircleXmark",iconColor:n.colors.red500}};var I=n;var C={sources:[],baseUrl:""},xe=(e={})=>{Object.keys(e).forEach(a=>{typeof e[a]=="object"&&e[a]!==null&&!Array.isArray(e[a])?C[a]={...C[a],...e[a]}:C[a]=e[a]})},De=()=>C,v=(e,a=null)=>e in C?C[e]:a;var Ce=({data:e,allowAudience:a=[...I.userType.all],permissions:t})=>{var o,r;try{let i=v("sources",[]),{user:s,isPublic:m,isAnonymous:p,source:u=""}=e;if(m||s!=null&&s.isCustomerView)return null;let f=[...a,I.userType.system.value];return!(s!=null&&s.id)||s.isActive===!1||p||!f.includes(s.userType||"")?y.UNAUTHORIZED.notAuthorized:(s==null?void 0:s.userType)===I.userType.system.value&&!(s!=null&&s.idCompany)?i!=null&&i.includes(u)?null:y.UNAUTHORIZED.notAuthorized:(o=I.userType.skipPermission)!=null&&o.includes((s==null?void 0:s.userType)||"")||!(t!=null&&t.length)?null:!((r=s.permissions)!=null&&r.find(E=>t==null?void 0:t.includes(E)))?y.UNAUTHORIZED.notAuthorized:null}catch{return y.UNAUTHORIZED.notAuthorized}};var U=e=>{if(typeof e!="string")return"";let a=e.trim();return a.charAt(0).toUpperCase()+a.slice(1)};var Ae=e=>{let a,t,o,r,i,s,m=!0;if(e.length<14)return!1;for(let p=1;p<e.length;p++)if(e.charAt(p-1)!==e.charAt(p)){m=!1;break}if(!m){s=e.length-2,a=e.substring(0,s),t=e.substring(s),o=0,i=s-7;for(let p=0;p<s;p++)o+=parseInt(a.charAt(p))*i--,i<2&&(i=9);if(r=o%11<2?0:11-o%11,r!==parseInt(t.charAt(0)))return!1;s+=1,a=e.substring(0,s),o=0,i=s-7;for(let p=0;p<s;p++)o+=parseInt(a.charAt(p))*i--,i<2&&(i=9);return r=o%11<2?0:11-o%11,r===parseInt(t.charAt(1))}return!1};var Ie=(e,a=!1)=>{let t,o;return t=0,e.length<11||!a&&e.split("").every(r=>r===e[0])||(Array.from({length:9}).forEach((r,i)=>{t+=parseInt(e.substring(i,i+1),10)*(11-(i+1))}),o=t*10%11,(o===10||o===11)&&(o=0),o!==parseInt(e.substring(9,10),10))?!1:(t=0,Array.from({length:10}).forEach((r,i)=>{t+=parseInt(e.substring(i,i+1),10)*(12-(i+1))}),o=t*10%11,(o===10||o===11)&&(o=0),o===parseInt(e.substring(10,11),10))};var ve=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);var Ne=e=>decodeURI(e)!==decodeURIComponent(e);var Re=e=>(...a)=>e.length>a.length?e.bind(null,...a):e(...a);var B=D(require("crypto-js")),Pe=(e,a)=>B.AES.decrypt(e,a).toString(B.enc.Utf8);var Be=(e,a)=>Object.keys(a).reduce((t,o)=>{if(e[o]===a[o]||o==="lastModifiedBy"||o==="createdAt")return t;let{oldData:r,newData:i}=t;return{oldData:{...r,[o]:e[o]},newData:{...i,[o]:a[o]}}},{});var Te=(e,a)=>e&&typeof e=="string"?e.search(/[a-z]\.[a-z]/i)>=0?a.__(e):e:"";var Se=e=>{let a={};return e==null||e.forEach(t=>{Object.keys(t).forEach(r=>{typeof t[r]=="string"&&(t[r].toLowerCase()==="true"||t[r].toLowerCase()==="false")?a[r]=t[r].toLowerCase()==="true":a[r]=t[r]})}),a};var Z=D(require("crypto-js")),we=(e,a)=>(typeof e=="object"&&(e=JSON.stringify(e)),Z.AES.encrypt(e,a).toString());var Le={on(e,a){document.addEventListener(e,a)},dispatch(e,a){document.dispatchEvent(new CustomEvent(e,{detail:a}))},remove(e,a){document.removeEventListener(e,a)}};var k=(e,a)=>{if(Array.isArray(e)===!1)return null;let t=null;return e.some(o=>(t=a(o),!!t)),t};var Fe=(e,a)=>e?e[a]?e[a]:k(e.or,t=>t[a]):null;var Oe=e=>{let a=e.lastIndexOf(".");return a===-1?e:e.substring(0,a)};var Ue=(e,a)=>e&&e.length&&a&&a.length?e.map(t=>Object.entries(t).filter(([o])=>a.includes(o)).reduce((o,[r,i])=>Object.assign(o,{[r]:i}),{})):[];var ke=e=>e.filter(a=>O(a).length>0&&a);var _=(e,a={})=>{let t={decimalCount:2,decimal:",",thousands:".",...a},{decimal:o,thousands:r,currencySymbol:i}=t,{decimalCount:s}=t;try{s=Math.abs(s),s=isNaN(s)?2:s;let m=e<0?"-":"",p=parseInt(e=Math.abs(Number(e)||0).toFixed(s),10).toString(),u=p.length>3?p.length%3:0;return(i?`${m}${i}`:m)+(u?p.substr(0,u)+r:"")+p.substr(u).replace(/(\d{3})(?=\d)/g,`$1${r}`)+(s?o+Math.abs(e-parseInt(p,10)).toFixed(s).slice(2):"")}catch(m){return console.log(m),""}};var g=D(require("moment-timezone")),K=e=>{let a=e?new Date(e):new Date,t={timeZone:"America/Sao_Paulo"},o=a.toLocaleString("en-US",t);return new Date(o)},Q=(e,a,t,o,r)=>{if(!e)return null;if(r)return(0,g.default)(e,a);let i=g.default.utc(e);return o||i.local(),t&&i.locale(t),i.format(a)},_e=(e,a="YYYY-MM-DD")=>{let t=(0,g.default)(e,a).add(1,"days");return typeof e=="string"?t.format(a):t.toDate()},X=(e=new Date,a=1)=>{let t=new Date(e.setDate(e.getDate()+a));return t.getDay()%6?t:X(t)},ee=(e=new Date,a=1)=>{let t=new Date(e.setDate(e.getDate()-a));return t.getDay()%6?t:ee(t)},T=e=>e?g.default.utc(e).local():null,M=e=>e&&g.default.tz(new Date(e),"America/Sao_Paulo"),Me=(e,a)=>{let t=M(e);return t&&t.format(a||"YYYY-MM-DDTHH:mm:ssZ")},je=(e,a)=>{if(!e||!a)return null;let t=T(e),o=T(a);return!t||!o?null:o.diff(t,"months")},Ge=(e,a)=>{var t;return!e||!a?null:(t=T(e))==null?void 0:t.isAfter(a)},Ve=(e=!0)=>{let a=g.default.tz("America/Sao_Paulo");return e?a.startOf("day").toDate():a.toDate()},qe=(e=!0)=>{let a=g.default.tz("America/Sao_Paulo").subtract(1,"day");return e?a.startOf("day").toDate():a.toDate()},ze=(e=!0)=>{let a=g.default.tz("America/Sao_Paulo").add(1,"day");return e?a.startOf("day").toDate():a.toDate()},He=e=>{let a=K(e);return`${a.getFullYear()}${a.getMonth().toString().padStart(2,"0")}`},$e=(e,a)=>{let t=new Date(e),o=new Date;return new Date(o.getFullYear()-a,o.getMonth(),o.getDate()).getTime()>t.getTime()},We=e=>g.default.max(e),Ye=e=>g.default.min(e),Je=e=>(0,g.default)(e).isValid(),j=(e,a)=>new Date(e,a-1,1).toISOString().split("T")[0],G=(e,a)=>new Date(e,a,0).toISOString().split("T")[0],V=()=>{let e=new Date(M(new Date));return Q(e,"YYYY-MM-DD")};var Ze=D(require("dayjs"));var S=e=>e.length===2?[e[0].replace(/\./g,""),e[1].replace(/\./g,"")]:e;var ae=e=>{let a=S(e.toString().replace("%","").replace("R$","").replace(/\s/g,"").trim().split(","));if(a.length===2)return a.join(".");let t=S(a[0].split("."));return t.length===2?t.join("."):a[0].replace(/\./g,"")},Ke=e=>{if(e==null)return e;if(!ae(e))return null;let a=Number(ae(e));return a>=Number.MAX_SAFE_INTEGER||Number.isNaN(a)?null:a},Qe=e=>{var t,o;if(!e)return null;let a=e.toString();return a.indexOf("/")>=0?null:(a=a.replace(/[^0-9.,-]/g,""),a.includes(",")&&a.includes(".")?(a.lastIndexOf(",")>a.lastIndexOf(".")?a=a.replace(/\./g,"").replace(",","."):a=a.replace(/,/g,""),Number(a)):a.includes(",")&&((t=a.split(",")[1])==null?void 0:t.length)>0?Number(a.replace(",",".")):a.includes(".")&&((o=a.split(".")[1])==null?void 0:o.length)>0?Number(a):Number(a.replace(/[.,]/g,"")))};var Xe=e=>{let a=e.indexOf("."),t=e.length;return a&&t?e.substr(a,t):""};var ea=new RegExp('<img[^>]+src="(https://vobi-storage[^">]+)"',"gm");var aa=e=>{if(!e)return!1;let a=new Date(e);return!isNaN(a.getTime())};var ta=e=>!isNaN(parseFloat(e))&&!isNaN(e-0);var oa=e=>{try{return!!new URL(e)}catch{return!1}};var te=D(require("jwt-decode")),na=e=>{var r;let{authorization:a,Authorization:t}=e,o=(r=a||t)==null?void 0:r.split(" ");return(o==null?void 0:o[0])==="Bearer"?o[1]:null},ra=e=>{let{user:a,isCustomerView:t,accessedBy:o,exp:r,iss:i}=e?(0,te.default)(e):{};return{...a,isCustomerView:t,accessedBy:o,exp:r,currentDevice:i}};var sa=(e,a,t,o)=>{let r=e.idStatus>=5?"projetos":"oportunidades",i=a==="customer"?"cliente":"profissional",s=`/${i}/${r}/perfil/${e.id}`,m=`/${i}`;return`${{operator:s,provider:s,customer:m}}/arquivos?arquivo=${t.id}${o?"&visualizar":""}`};var ia=e=>(e==null?void 0:e.length)===0?null:e;var la=(e,a="0000")=>(a+e).slice(a.length*-1);var ca=(e,a=!1)=>{let t={};for(let o=0;o<e.length;o++){let r=e[o];t[r.value]=a?{...r}:r.label}return t};var da=e=>e.replace(/ /g,"").split("-").reduce((a,t)=>a+U(t),"");var ua=e=>e==null?void 0:e.replace(/[,-./]/g,"");var pa=({id:e,name:a,email:t,idCompany:o,userType:r,type:i,isOwner:s,MGMCode:m,groupPermission:p,isActive:u,limitAccess:f,company:h})=>({id:e,name:a,email:t,idCompany:o,userType:r,type:i,isOwner:s,MGMCode:m,groupPermission:p,isActive:u,limitAccess:f,idPlan:h==null?void 0:h.idPlan});var ma=e=>{let a=new Array(e.length),t=0;return new Promise((o,r)=>{e.forEach((i,s)=>{Promise.resolve(i).then(o).catch(m=>{a[s]=m,t+=1,t===e.length&&r(a)})})})};var fa=(e,a)=>Object.keys(a).filter(t=>t!==e).reduce((t,o)=>({...t,[o]:a[o]}),{});var ga=(e,a,t=!0)=>{if(!e)return e;let o=e.toLowerCase();return t&&(o=o.replace(new RegExp("\\s","g"),"")),o=o.replace(new RegExp("[\xE0\xE1\xE2\xE3\xE4\xE5]","g"),"a"),o=o.replace(new RegExp("\xE6","g"),"ae"),o=o.replace(new RegExp("\xE7","g"),"c"),o=o.replace(new RegExp("[\xE8\xE9\xEA\xEB]","g"),"e"),o=o.replace(new RegExp("[\xEC\xED\xEE\xEF]","g"),"i"),o=o.replace(new RegExp("\xF1","g"),"n"),o=o.replace(new RegExp("[\xF2\xF3\xF4\xF5\xF6]","g"),"o"),o=o.replace(new RegExp("\u0153","g"),"oe"),o=o.replace(new RegExp("[\xF9\xFA\xFB\xFC]","g"),"u"),o=o.replace(new RegExp("[\xFD\xFF]","g"),"y"),o=o.replace("'",""),o=o.replace("\xB4",""),o=o.replace("`",""),a&&(o=o.replace(new RegExp("\\W","g"),"")),o};var ya=e=>e==null?void 0:e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-zA-Z0-9-/\s]/g,"").replace(/\//g,"").replace(/\s+/g,"-").toLowerCase();var ha=(e,a)=>e.reduce((t,o,r)=>{let i=Math.floor(r/a),s=[...t];return t[i]||(s[i]=[]),s[i].push(o),s},[]);var Ea=(e,a,t)=>{let o=t||a;return(e==null?void 0:e.map(r=>o?r[t]||r[a]:r).reduce((r,i)=>r+(Number(i||0)||0),0))||0};var ba=(e,a)=>(e==null?void 0:e.map(t=>a(t)).reduce((t,o)=>t+(Number(o||0)||0),0))||0;var xa=e=>{let a=e.replace(/\D/g,"");return/^(?:\+?55 ?)?(?:0?[1-9]{2})?9\d{8}$/.test(a)};var Da=e=>typeof e!="string"||!e?"":e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim();var q=(e,a="")=>!e||e.length<=0?[]:e.flatMap((t,o)=>{let r=a?`${a}.${o+1}`:`${o+1}`,{children:i,...s}=t;return[{...s,index:r},...q(i||[],r)]}),Ca=e=>q(e).reduce((t,o)=>o.id?{...t,[o.id]:o}:t,{});var Aa=(e,a)=>{var o;let t=e?(o=Number(e).toFixed(2))==null?void 0:o.replace(".",","):0;return a?`${_(e*100)}%`:t};var Ia=e=>{if(!e)return{};let[a,t]=e.split("-").map(Number),o=V(),r=j(a,t),i=G(a,t);return{startDate:r,endDate:i,actualDate:o}};var va=({oldStatus:e,newStatus:a,total:t,user:o,moveStatus:r})=>{var h,E,b,x,H;let{userApprovalAuthorities:i,isOwner:s,groupPermission:m,company:p}=o||{},u=r==null?void 0:r[e];if(!((h=u==null?void 0:u[a])!=null&&h.isAllowed))return null;if(s||m===n.groupPermission.admin||!((E=u==null?void 0:u[a])!=null&&E.authorityLevel))return u==null?void 0:u[a];let f=i==null?void 0:i.find(N=>{var $;return(N==null?void 0:N.idApprovalAuthority)===(($=u==null?void 0:u[a])==null?void 0:$.authorityLevel)});return!f&&((x=p==null?void 0:p.approvalAuthority)!=null&&x[(b=u==null?void 0:u[a])==null?void 0:b.authorityLevel])?!1:(H=u==null?void 0:u[a])!=null&&H.maxAmount?!Number((f==null?void 0:f.maxAmount)||0)&&(f==null?void 0:f.maxAmount)!==0||Number(t||0)<=Number(f==null?void 0:f.maxAmount)?u==null?void 0:u[a]:!1:u==null?void 0:u[a]};var Na=e=>{if(!e)return null;let a=e==null?void 0:e.replace(/\D/g,"");return(a==null?void 0:a.length)===11?a==null?void 0:a.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4"):(a==null?void 0:a.length)===14?a==null?void 0:a.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/,"$1.$2.$3/$4-$5"):a};var z=D(require("dayjs")),Ra=()=>{let e=(0,z.default)().format("YYYY-MM-DD"),a=(0,z.default)().subtract(2,"day").format("YYYY-MM-DD");return{today:e,yesterday:a}};var A;try{A=require("sharp")}catch{}var Pa=e=>{A=e},oe=10*1024*1024,Ba=300,Ta=300,Sa=9999,wa=9999,ne=80,La=async(e,a)=>{let t=Object.keys(a);return await Promise.all(t.map(async o=>{let r=Number(o),i=r*oe,s=(r+1)*oe,m=e.slice(i,s),p=await fetch(a[o],{method:"PUT",body:m,headers:{"Content-Type":e.type}});if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);return{ETag:p.headers.get("etag"),PartNumber:r+1}}))},Fa=async({file:e,idCompany:a=""})=>{let t=v("baseUrl","");if(!e)throw new Error("Nenhum arquivo fornecido");try{let{size:o=0,type:r="image/jpeg",name:i}=e,s={name:i,size:o,type:r},m=await fetch(`${t}/media/start/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identify:a,file:s})});if(!m.ok){let x=await m.json().catch(()=>({}));throw new Error(`Failed to start upload. Status: ${m.status}, Data: ${JSON.stringify(x)}`)}let p=await m.json(),{signUrls:u,uploadId:f}=p;console.log("file",e);let h=await La(e,u),E=await fetch(`${t}/media/complete/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identify:a,file:s,uploadId:f,parts:h})});if(!E.ok){let x=await E.json().catch(()=>({}));throw new Error(`Failed to complete upload. Status: ${E.status}, Data: ${JSON.stringify(x)}`)}let b=await E.json();return console.log("uploadCompleteData",b),b==null?void 0:b.location}catch(o){throw o}},Oa=async(e,a)=>{var t,o;if(!A)throw new Error(`Sharp is required for image processing. Install it with:
3
+ informados e tente conectar novamente. Se o erro persistir, contate o suporte.`,background:n.colors.red50,borderColor:n.colors.red100,icon:"faCircleXmark",iconColor:n.colors.red500}};var I=n;var C={sources:[],baseUrl:""},xe=(e={})=>{Object.keys(e).forEach(a=>{typeof e[a]=="object"&&e[a]!==null&&!Array.isArray(e[a])?C[a]={...C[a],...e[a]}:C[a]=e[a]})},De=()=>C,v=(e,a=null)=>e in C?C[e]:a;var Ce=({data:e,allowAudience:a=[...I.userType.all],permissions:t})=>{var o,r;try{let i=v("sources",[]),{user:s,isPublic:m,isAnonymous:p,source:u=""}=e;if(m||s!=null&&s.isCustomerView)return null;let f=[...a,I.userType.system.value];return!(s!=null&&s.id)||s.isActive===!1||p||!f.includes(s.userType||"")?y.UNAUTHORIZED.notAuthorized:(s==null?void 0:s.userType)===I.userType.system.value&&!(s!=null&&s.idCompany)?i!=null&&i.includes(u)?null:y.UNAUTHORIZED.notAuthorized:(o=I.userType.skipPermission)!=null&&o.includes((s==null?void 0:s.userType)||"")||!(t!=null&&t.length)?null:!((r=s.permissions)!=null&&r.find(b=>t==null?void 0:t.includes(b)))?y.UNAUTHORIZED.notAuthorized:null}catch{return y.UNAUTHORIZED.notAuthorized}};var U=e=>{if(typeof e!="string")return"";let a=e.trim();return a.charAt(0).toUpperCase()+a.slice(1)};var Ae=e=>{let a,t,o,r,i,s,m=!0;if(e.length<14)return!1;for(let p=1;p<e.length;p++)if(e.charAt(p-1)!==e.charAt(p)){m=!1;break}if(!m){s=e.length-2,a=e.substring(0,s),t=e.substring(s),o=0,i=s-7;for(let p=0;p<s;p++)o+=parseInt(a.charAt(p))*i--,i<2&&(i=9);if(r=o%11<2?0:11-o%11,r!==parseInt(t.charAt(0)))return!1;s+=1,a=e.substring(0,s),o=0,i=s-7;for(let p=0;p<s;p++)o+=parseInt(a.charAt(p))*i--,i<2&&(i=9);return r=o%11<2?0:11-o%11,r===parseInt(t.charAt(1))}return!1};var Ie=(e,a=!1)=>{let t,o;return t=0,e.length<11||!a&&e.split("").every(r=>r===e[0])||(Array.from({length:9}).forEach((r,i)=>{t+=parseInt(e.substring(i,i+1),10)*(11-(i+1))}),o=t*10%11,(o===10||o===11)&&(o=0),o!==parseInt(e.substring(9,10),10))?!1:(t=0,Array.from({length:10}).forEach((r,i)=>{t+=parseInt(e.substring(i,i+1),10)*(12-(i+1))}),o=t*10%11,(o===10||o===11)&&(o=0),o===parseInt(e.substring(10,11),10))};var ve=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);var Ne=e=>decodeURI(e)!==decodeURIComponent(e);var Re=e=>(...a)=>e.length>a.length?e.bind(null,...a):e(...a);var B=D(require("crypto-js")),Pe=(e,a)=>B.AES.decrypt(e,a).toString(B.enc.Utf8);var Be=(e,a)=>Object.keys(a).reduce((t,o)=>{if(e[o]===a[o]||o==="lastModifiedBy"||o==="createdAt")return t;let{oldData:r,newData:i}=t;return{oldData:{...r,[o]:e[o]},newData:{...i,[o]:a[o]}}},{});var Te=(e,a)=>e&&typeof e=="string"?e.search(/[a-z]\.[a-z]/i)>=0?a.__(e):e:"";var Se=e=>{let a={};return e==null||e.forEach(t=>{Object.keys(t).forEach(r=>{typeof t[r]=="string"&&(t[r].toLowerCase()==="true"||t[r].toLowerCase()==="false")?a[r]=t[r].toLowerCase()==="true":a[r]=t[r]})}),a};var Z=D(require("crypto-js")),we=(e,a)=>(typeof e=="object"&&(e=JSON.stringify(e)),Z.AES.encrypt(e,a).toString());var Le={on(e,a){document.addEventListener(e,a)},dispatch(e,a){document.dispatchEvent(new CustomEvent(e,{detail:a}))},remove(e,a){document.removeEventListener(e,a)}};var k=(e,a)=>{if(Array.isArray(e)===!1)return null;let t=null;return e.some(o=>(t=a(o),!!t)),t};var Fe=(e,a)=>e?e[a]?e[a]:k(e.or,t=>t[a]):null;var Oe=e=>{let a=e.lastIndexOf(".");return a===-1?e:e.substring(0,a)};var Ue=(e,a)=>e&&e.length&&a&&a.length?e.map(t=>Object.entries(t).filter(([o])=>a.includes(o)).reduce((o,[r,i])=>Object.assign(o,{[r]:i}),{})):[];var ke=e=>e.filter(a=>O(a).length>0&&a);var _=(e,a={})=>{let t={decimalCount:2,decimal:",",thousands:".",...a},{decimal:o,thousands:r,currencySymbol:i}=t,{decimalCount:s}=t;try{s=Math.abs(s),s=isNaN(s)?2:s;let m=e<0?"-":"",p=parseInt(e=Math.abs(Number(e)||0).toFixed(s),10).toString(),u=p.length>3?p.length%3:0;return(i?`${m}${i}`:m)+(u?p.substr(0,u)+r:"")+p.substr(u).replace(/(\d{3})(?=\d)/g,`$1${r}`)+(s?o+Math.abs(e-parseInt(p,10)).toFixed(s).slice(2):"")}catch(m){return console.log(m),""}};var g=D(require("moment-timezone")),K=e=>{let a=e?new Date(e):new Date,t={timeZone:"America/Sao_Paulo"},o=a.toLocaleString("en-US",t);return new Date(o)},Q=(e,a,t,o,r)=>{if(!e)return null;if(r)return(0,g.default)(e,a);let i=g.default.utc(e);return o||i.local(),t&&i.locale(t),i.format(a)},_e=(e,a="YYYY-MM-DD")=>{let t=(0,g.default)(e,a).add(1,"days");return typeof e=="string"?t.format(a):t.toDate()},X=(e=new Date,a=1)=>{let t=new Date(e.setDate(e.getDate()+a));return t.getDay()%6?t:X(t)},ee=(e=new Date,a=1)=>{let t=new Date(e.setDate(e.getDate()-a));return t.getDay()%6?t:ee(t)},T=e=>e?g.default.utc(e).local():null,M=e=>e&&g.default.tz(new Date(e),"America/Sao_Paulo"),Me=(e,a)=>{let t=M(e);return t&&t.format(a||"YYYY-MM-DDTHH:mm:ssZ")},je=(e,a)=>{if(!e||!a)return null;let t=T(e),o=T(a);return!t||!o?null:o.diff(t,"months")},Ge=(e,a)=>{var t;return!e||!a?null:(t=T(e))==null?void 0:t.isAfter(a)},Ve=(e=!0)=>{let a=g.default.tz("America/Sao_Paulo");return e?a.startOf("day").toDate():a.toDate()},qe=(e=!0)=>{let a=g.default.tz("America/Sao_Paulo").subtract(1,"day");return e?a.startOf("day").toDate():a.toDate()},ze=(e=!0)=>{let a=g.default.tz("America/Sao_Paulo").add(1,"day");return e?a.startOf("day").toDate():a.toDate()},He=e=>{let a=K(e);return`${a.getFullYear()}${a.getMonth().toString().padStart(2,"0")}`},$e=(e,a)=>{let t=new Date(e),o=new Date;return new Date(o.getFullYear()-a,o.getMonth(),o.getDate()).getTime()>t.getTime()},We=e=>g.default.max(e),Ye=e=>g.default.min(e),Je=e=>(0,g.default)(e).isValid(),j=(e,a)=>new Date(e,a-1,1).toISOString().split("T")[0],G=(e,a)=>new Date(e,a,0).toISOString().split("T")[0],V=()=>{let e=new Date(M(new Date));return Q(e,"YYYY-MM-DD")};var Ze=D(require("dayjs"));var S=e=>e.length===2?[e[0].replace(/\./g,""),e[1].replace(/\./g,"")]:e;var ae=e=>{let a=S(e.toString().replace("%","").replace("R$","").replace(/\s/g,"").trim().split(","));if(a.length===2)return a.join(".");let t=S(a[0].split("."));return t.length===2?t.join("."):a[0].replace(/\./g,"")},Ke=e=>{if(e==null)return e;if(!ae(e))return null;let a=Number(ae(e));return a>=Number.MAX_SAFE_INTEGER||Number.isNaN(a)?null:a},Qe=e=>{var t,o;if(!e)return null;let a=e.toString();return a.indexOf("/")>=0?null:(a=a.replace(/[^0-9.,-]/g,""),a.includes(",")&&a.includes(".")?(a.lastIndexOf(",")>a.lastIndexOf(".")?a=a.replace(/\./g,"").replace(",","."):a=a.replace(/,/g,""),Number(a)):a.includes(",")&&((t=a.split(",")[1])==null?void 0:t.length)>0?Number(a.replace(",",".")):a.includes(".")&&((o=a.split(".")[1])==null?void 0:o.length)>0?Number(a):Number(a.replace(/[.,]/g,"")))};var Xe=e=>{let a=e.indexOf("."),t=e.length;return a&&t?e.substr(a,t):""};var ea=new RegExp('<img[^>]+src="(https://vobi-storage[^">]+)"',"gm");var aa=e=>{if(!e)return!1;let a=new Date(e);return!isNaN(a.getTime())};var ta=e=>!isNaN(parseFloat(e))&&!isNaN(e-0);var oa=e=>{try{return!!new URL(e)}catch{return!1}};var te=D(require("jwt-decode")),na=e=>{var r;let{authorization:a,Authorization:t}=e,o=(r=a||t)==null?void 0:r.split(" ");return(o==null?void 0:o[0])==="Bearer"?o[1]:null},ra=e=>{let{user:a,isCustomerView:t,accessedBy:o,exp:r,iss:i}=e?(0,te.default)(e):{};return{...a,isCustomerView:t,accessedBy:o,exp:r,currentDevice:i}};var sa=(e,a,t,o)=>{let r=e.idStatus>=5?"projetos":"oportunidades",i=a==="customer"?"cliente":"profissional",s=`/${i}/${r}/perfil/${e.id}`,m=`/${i}`;return`${{operator:s,provider:s,customer:m}}/arquivos?arquivo=${t.id}${o?"&visualizar":""}`};var ia=e=>(e==null?void 0:e.length)===0?null:e;var la=(e,a="0000")=>(a+e).slice(a.length*-1);var ca=(e,a=!1)=>{let t={};for(let o=0;o<e.length;o++){let r=e[o];t[r.value]=a?{...r}:r.label}return t};var da=e=>e.replace(/ /g,"").split("-").reduce((a,t)=>a+U(t),"");var ua=e=>e==null?void 0:e.replace(/[,-./]/g,"");var pa=({id:e,name:a,email:t,idCompany:o,userType:r,type:i,isOwner:s,MGMCode:m,groupPermission:p,isActive:u,limitAccess:f,company:h})=>({id:e,name:a,email:t,idCompany:o,userType:r,type:i,isOwner:s,MGMCode:m,groupPermission:p,isActive:u,limitAccess:f,idPlan:h==null?void 0:h.idPlan});var ma=e=>{let a=new Array(e.length),t=0;return new Promise((o,r)=>{e.forEach((i,s)=>{Promise.resolve(i).then(o).catch(m=>{a[s]=m,t+=1,t===e.length&&r(a)})})})};var fa=(e,a)=>Object.keys(a).filter(t=>t!==e).reduce((t,o)=>({...t,[o]:a[o]}),{});var ga=(e,a,t=!0)=>{if(!e)return e;let o=e.toLowerCase();return t&&(o=o.replace(new RegExp("\\s","g"),"")),o=o.replace(new RegExp("[\xE0\xE1\xE2\xE3\xE4\xE5]","g"),"a"),o=o.replace(new RegExp("\xE6","g"),"ae"),o=o.replace(new RegExp("\xE7","g"),"c"),o=o.replace(new RegExp("[\xE8\xE9\xEA\xEB]","g"),"e"),o=o.replace(new RegExp("[\xEC\xED\xEE\xEF]","g"),"i"),o=o.replace(new RegExp("\xF1","g"),"n"),o=o.replace(new RegExp("[\xF2\xF3\xF4\xF5\xF6]","g"),"o"),o=o.replace(new RegExp("\u0153","g"),"oe"),o=o.replace(new RegExp("[\xF9\xFA\xFB\xFC]","g"),"u"),o=o.replace(new RegExp("[\xFD\xFF]","g"),"y"),o=o.replace("'",""),o=o.replace("\xB4",""),o=o.replace("`",""),a&&(o=o.replace(new RegExp("\\W","g"),"")),o};var ya=e=>e==null?void 0:e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-zA-Z0-9-/\s]/g,"").replace(/\//g,"").replace(/\s+/g,"-").toLowerCase();var ha=(e,a)=>e.reduce((t,o,r)=>{let i=Math.floor(r/a),s=[...t];return t[i]||(s[i]=[]),s[i].push(o),s},[]);var ba=(e,a,t)=>{let o=t||a;return(e==null?void 0:e.map(r=>o?r[t]||r[a]:r).reduce((r,i)=>r+(Number(i||0)||0),0))||0};var Ea=(e,a)=>(e==null?void 0:e.map(t=>a(t)).reduce((t,o)=>t+(Number(o||0)||0),0))||0;var xa=e=>{let a=e.replace(/\D/g,"");return/^(?:\+?55 ?)?(?:0?[1-9]{2})?9\d{8}$/.test(a)};var Da=(e,a)=>{if(typeof e!="string"||!e)return"";let t=e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim();return a?t:t.toLowerCase()};var q=(e,a="")=>!e||e.length<=0?[]:e.flatMap((t,o)=>{let r=a?`${a}.${o+1}`:`${o+1}`,{children:i,...s}=t;return[{...s,index:r},...q(i||[],r)]}),Ca=e=>q(e).reduce((t,o)=>o.id?{...t,[o.id]:o}:t,{});var Aa=(e,a)=>{var o;let t=e?(o=Number(e).toFixed(2))==null?void 0:o.replace(".",","):0;return a?`${_(e*100)}%`:t};var Ia=e=>{if(!e)return{};let[a,t]=e.split("-").map(Number),o=V(),r=j(a,t),i=G(a,t);return{startDate:r,endDate:i,actualDate:o}};var va=({oldStatus:e,newStatus:a,total:t,user:o,moveStatus:r})=>{var h,b,E,x,H;let{userApprovalAuthorities:i,isOwner:s,groupPermission:m,company:p}=o||{},u=r==null?void 0:r[e];if(!((h=u==null?void 0:u[a])!=null&&h.isAllowed))return null;if(s||m===n.groupPermission.admin||!((b=u==null?void 0:u[a])!=null&&b.authorityLevel))return u==null?void 0:u[a];let f=i==null?void 0:i.find(N=>{var $;return(N==null?void 0:N.idApprovalAuthority)===(($=u==null?void 0:u[a])==null?void 0:$.authorityLevel)});return!f&&((x=p==null?void 0:p.approvalAuthority)!=null&&x[(E=u==null?void 0:u[a])==null?void 0:E.authorityLevel])?!1:(H=u==null?void 0:u[a])!=null&&H.maxAmount?!Number((f==null?void 0:f.maxAmount)||0)&&(f==null?void 0:f.maxAmount)!==0||Number(t||0)<=Number(f==null?void 0:f.maxAmount)?u==null?void 0:u[a]:!1:u==null?void 0:u[a]};var Na=e=>{if(!e)return null;let a=e==null?void 0:e.replace(/\D/g,"");return(a==null?void 0:a.length)===11?a==null?void 0:a.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4"):(a==null?void 0:a.length)===14?a==null?void 0:a.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/,"$1.$2.$3/$4-$5"):a};var z=D(require("dayjs")),Ra=()=>{let e=(0,z.default)().format("YYYY-MM-DD"),a=(0,z.default)().subtract(2,"day").format("YYYY-MM-DD");return{today:e,yesterday:a}};var A;try{A=require("sharp")}catch{}var Pa=e=>{A=e},oe=10*1024*1024,Ba=300,Ta=300,Sa=9999,wa=9999,ne=80,La=async(e,a)=>{let t=Object.keys(a);return await Promise.all(t.map(async o=>{let r=Number(o),i=r*oe,s=(r+1)*oe,m=e.slice(i,s),p=await fetch(a[o],{method:"PUT",body:m,headers:{"Content-Type":e.type}});if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);return{ETag:p.headers.get("etag"),PartNumber:r+1}}))},Fa=async({file:e,idCompany:a=""})=>{let t=v("baseUrl","");if(!e)throw new Error("Nenhum arquivo fornecido");try{let{size:o=0,type:r="image/jpeg",name:i}=e,s={name:i,size:o,type:r},m=await fetch(`${t}/media/start/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identify:a,file:s})});if(!m.ok){let x=await m.json().catch(()=>({}));throw new Error(`Failed to start upload. Status: ${m.status}, Data: ${JSON.stringify(x)}`)}let p=await m.json(),{signUrls:u,uploadId:f}=p;console.log("file",e);let h=await La(e,u),b=await fetch(`${t}/media/complete/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identify:a,file:s,uploadId:f,parts:h})});if(!b.ok){let x=await b.json().catch(()=>({}));throw new Error(`Failed to complete upload. Status: ${b.status}, Data: ${JSON.stringify(x)}`)}let E=await b.json();return console.log("uploadCompleteData",E),E==null?void 0:E.location}catch(o){throw o}},Oa=async(e,a)=>{var t,o;if(!A)throw new Error(`Sharp is required for image processing. Install it with:
4
4
  For Lambda ARM64: npm install --platform=linux --arch=arm64 sharp
5
5
  For Lambda x86_64: npm install --platform=linux --arch=x64 sharp
6
6
  For local development: npm install sharp`);if(!((t=e==null?void 0:e.type)!=null&&t.includes("image"))||(o=e==null?void 0:e.type)!=null&&o.includes("tif"))return null;try{let r=await e.arrayBuffer(),i=await A(Buffer.from(r)).resize(Ba,Ta,{fit:"inside",withoutEnlargement:!0}).jpeg({quality:ne}).toBuffer(),s=new Blob([i],{type:"image/jpeg"});return new File([s],a||e.name,{type:"image/jpeg"})}catch(r){throw new Error(`Error creating thumbnail: ${r instanceof Error?r.message:"Unknown error"}`)}},Ua=async(e,a)=>{var t,o;if(!A)throw new Error(`Sharp is required for image processing. Install it with:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vobi_lib",
3
- "version": "1.7.13",
3
+ "version": "1.7.14",
4
4
  "description": "Vobi Library",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",