@cristian.aragao/milharis-core 1.30.42 → 1.30.43
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.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +113 -2
- package/dist/index.d.ts +113 -2
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1100,6 +1100,54 @@ declare const PREMIOS: {
|
|
|
1100
1100
|
};
|
|
1101
1101
|
};
|
|
1102
1102
|
|
|
1103
|
+
declare const COMISSOES_PADRAO: {
|
|
1104
|
+
readonly milhar: {
|
|
1105
|
+
readonly id: "milhar";
|
|
1106
|
+
readonly label: "Milhar";
|
|
1107
|
+
readonly order: 1;
|
|
1108
|
+
};
|
|
1109
|
+
readonly centena: {
|
|
1110
|
+
readonly id: "centena";
|
|
1111
|
+
readonly label: "Centena";
|
|
1112
|
+
readonly order: 2;
|
|
1113
|
+
};
|
|
1114
|
+
readonly dezena: {
|
|
1115
|
+
readonly id: "dezena";
|
|
1116
|
+
readonly label: "Dezena";
|
|
1117
|
+
readonly order: 3;
|
|
1118
|
+
};
|
|
1119
|
+
readonly grupo: {
|
|
1120
|
+
readonly id: "grupo";
|
|
1121
|
+
readonly label: "Grupo";
|
|
1122
|
+
readonly order: 4;
|
|
1123
|
+
};
|
|
1124
|
+
readonly "terno.dezena": {
|
|
1125
|
+
readonly id: "terno.dezena";
|
|
1126
|
+
readonly label: "Terno de Dezena";
|
|
1127
|
+
readonly order: 5;
|
|
1128
|
+
};
|
|
1129
|
+
readonly "terno.grupo": {
|
|
1130
|
+
readonly id: "terno.grupo";
|
|
1131
|
+
readonly label: "Terno de Grupo";
|
|
1132
|
+
readonly order: 6;
|
|
1133
|
+
};
|
|
1134
|
+
readonly "duque.dezena": {
|
|
1135
|
+
readonly id: "duque.dezena";
|
|
1136
|
+
readonly label: "Duque de Dezena";
|
|
1137
|
+
readonly order: 7;
|
|
1138
|
+
};
|
|
1139
|
+
readonly "duque.grupo": {
|
|
1140
|
+
readonly id: "duque.grupo";
|
|
1141
|
+
readonly label: "Duque de Grupo";
|
|
1142
|
+
readonly order: 8;
|
|
1143
|
+
};
|
|
1144
|
+
readonly restante: {
|
|
1145
|
+
readonly id: "restante";
|
|
1146
|
+
readonly label: "Restante";
|
|
1147
|
+
readonly order: 9;
|
|
1148
|
+
};
|
|
1149
|
+
};
|
|
1150
|
+
|
|
1103
1151
|
/**
|
|
1104
1152
|
* Tipo que representa um dispositivo no sistema
|
|
1105
1153
|
*/
|
|
@@ -1937,6 +1985,19 @@ type TypeEnvioDescarga = TypeMetaData & {
|
|
|
1937
1985
|
iniciadoEm: number;
|
|
1938
1986
|
/** Timestamp de conclusão (se houver) */
|
|
1939
1987
|
concluidoEm: number;
|
|
1988
|
+
/**
|
|
1989
|
+
* @description Total geral bruto de jogos por tipo de jogo
|
|
1990
|
+
*/
|
|
1991
|
+
totalGeralJogos: {
|
|
1992
|
+
[GAMES.milhar.id]: number;
|
|
1993
|
+
[GAMES.centena.id]: number;
|
|
1994
|
+
[GAMES.dezena.id]: number;
|
|
1995
|
+
[GAMES.grupo.id]: number;
|
|
1996
|
+
["terno.dezena"]: number;
|
|
1997
|
+
["terno.grupo"]: number;
|
|
1998
|
+
["duque.dezena"]: number;
|
|
1999
|
+
["duque.grupo"]: number;
|
|
2000
|
+
};
|
|
1940
2001
|
/**
|
|
1941
2002
|
* @description Informações do remetente, quem enviou a descarga
|
|
1942
2003
|
*/
|
|
@@ -2431,6 +2492,7 @@ declare const collections: {
|
|
|
2431
2492
|
readonly bancas: (obj?: Partial<TypeBanca>) => TypeBanca;
|
|
2432
2493
|
readonly auditLogs: (obj?: Partial<TypeAuditLog>) => TypeAuditLog;
|
|
2433
2494
|
readonly dispositivos: (obj?: Partial<TypeDevice>) => TypeDevice;
|
|
2495
|
+
readonly comissoes_descarga: (obj?: Partial<TypeComissaoDescarga>) => TypeComissaoDescarga;
|
|
2434
2496
|
};
|
|
2435
2497
|
|
|
2436
2498
|
type Firestore<T = any> = T;
|
|
@@ -2705,6 +2767,34 @@ type TypeAuditLogs = {
|
|
|
2705
2767
|
[id: TypeAuditLog["id"]]: TypeAuditLog;
|
|
2706
2768
|
};
|
|
2707
2769
|
|
|
2770
|
+
type TypeComissaoDescarga = TypeMetaData & {
|
|
2771
|
+
/**
|
|
2772
|
+
* @description Id aleatório gerado para o documento
|
|
2773
|
+
* @example "62e77f29-ba2b-a6a0-af4b-cfd1aab7d546"
|
|
2774
|
+
*/
|
|
2775
|
+
id: string;
|
|
2776
|
+
/**
|
|
2777
|
+
* @description Id incremental por banca
|
|
2778
|
+
*
|
|
2779
|
+
* @example "1"
|
|
2780
|
+
* @example "2"
|
|
2781
|
+
*/
|
|
2782
|
+
id_integer: string;
|
|
2783
|
+
/**
|
|
2784
|
+
* @description tipo do jogo (tem que ser único)
|
|
2785
|
+
* @example "milhar"
|
|
2786
|
+
* @example "centena"
|
|
2787
|
+
*/
|
|
2788
|
+
type_game: keyof typeof COMISSOES_PADRAO;
|
|
2789
|
+
/**
|
|
2790
|
+
* @description porcentagem de comissão
|
|
2791
|
+
*/
|
|
2792
|
+
porcentagem: number;
|
|
2793
|
+
};
|
|
2794
|
+
type TypeComissoesDescarga = {
|
|
2795
|
+
[id: string]: TypeComissaoDescarga;
|
|
2796
|
+
};
|
|
2797
|
+
|
|
2708
2798
|
declare const GameModel: (obj?: Partial<TypeGame>) => TypeGame;
|
|
2709
2799
|
|
|
2710
2800
|
declare const NumberModel: (obj?: Partial<TypeNumero>) => TypeNumero;
|
|
@@ -3607,7 +3697,27 @@ declare const getPropsEnvioIdOldDescarga: (descarga: Partial<TypeDescarga>) => {
|
|
|
3607
3697
|
*/
|
|
3608
3698
|
declare const getDescargaIdPeloEnvio: (numero: TypeNumero, envioId: string) => string;
|
|
3609
3699
|
|
|
3700
|
+
type TypeTotalGeral = {
|
|
3701
|
+
jogos: Record<string, {
|
|
3702
|
+
totalEnviado: number;
|
|
3703
|
+
ordem: number;
|
|
3704
|
+
tipo: keyof typeof COMISSOES_PADRAO;
|
|
3705
|
+
label: string;
|
|
3706
|
+
}>;
|
|
3707
|
+
totalBruto: number;
|
|
3708
|
+
totalLiquido: number;
|
|
3709
|
+
totalComissao: number;
|
|
3710
|
+
};
|
|
3711
|
+
/**
|
|
3712
|
+
* @description Calcula o total geral de uma descarga
|
|
3713
|
+
* @param totalBrutoJogos - Total bruto dos jogos
|
|
3714
|
+
* @param comissoes - Comissões das bancas
|
|
3715
|
+
* @returns Total geral da descarga
|
|
3716
|
+
*/
|
|
3717
|
+
declare const getTotalGeralDescarga: (totalBrutoJogos: TypeEnvioDescarga["totalGeralJogos"], comissoes: TypeComissoesDescarga) => TypeTotalGeral;
|
|
3718
|
+
|
|
3610
3719
|
type descarga_ResultadoDescargaComDiferenca = ResultadoDescargaComDiferenca;
|
|
3720
|
+
type descarga_TypeTotalGeral = TypeTotalGeral;
|
|
3611
3721
|
declare const descarga_generateDescarga: typeof generateDescarga;
|
|
3612
3722
|
declare const descarga_generateDescargas: typeof generateDescargas;
|
|
3613
3723
|
declare const descarga_getDescargaIdPeloEnvio: typeof getDescargaIdPeloEnvio;
|
|
@@ -3616,9 +3726,10 @@ declare const descarga_getDescargasAcimaDoLimite: typeof getDescargasAcimaDoLimi
|
|
|
3616
3726
|
declare const descarga_getPropsEnvioId: typeof getPropsEnvioId;
|
|
3617
3727
|
declare const descarga_getPropsEnvioIdOldDescarga: typeof getPropsEnvioIdOldDescarga;
|
|
3618
3728
|
declare const descarga_getPropsVPDescarga: typeof getPropsVPDescarga;
|
|
3729
|
+
declare const descarga_getTotalGeralDescarga: typeof getTotalGeralDescarga;
|
|
3619
3730
|
declare const descarga_sortDescargas: typeof sortDescargas;
|
|
3620
3731
|
declare namespace descarga {
|
|
3621
|
-
export { type descarga_ResultadoDescargaComDiferenca as ResultadoDescargaComDiferenca, descarga_generateDescarga as generateDescarga, descarga_generateDescargas as generateDescargas, descarga_getDescargaIdPeloEnvio as getDescargaIdPeloEnvio, descarga_getDescargaIdPeloNumero as getDescargaIdPeloNumero, descarga_getDescargasAcimaDoLimite as getDescargasAcimaDoLimite, descarga_getPropsEnvioId as getPropsEnvioId, descarga_getPropsEnvioIdOldDescarga as getPropsEnvioIdOldDescarga, descarga_getPropsVPDescarga as getPropsVPDescarga, descarga_sortDescargas as sortDescargas };
|
|
3732
|
+
export { type descarga_ResultadoDescargaComDiferenca as ResultadoDescargaComDiferenca, type descarga_TypeTotalGeral as TypeTotalGeral, descarga_generateDescarga as generateDescarga, descarga_generateDescargas as generateDescargas, descarga_getDescargaIdPeloEnvio as getDescargaIdPeloEnvio, descarga_getDescargaIdPeloNumero as getDescargaIdPeloNumero, descarga_getDescargasAcimaDoLimite as getDescargasAcimaDoLimite, descarga_getPropsEnvioId as getPropsEnvioId, descarga_getPropsEnvioIdOldDescarga as getPropsEnvioIdOldDescarga, descarga_getPropsVPDescarga as getPropsVPDescarga, descarga_getTotalGeralDescarga as getTotalGeralDescarga, descarga_sortDescargas as sortDescargas };
|
|
3622
3733
|
}
|
|
3623
3734
|
|
|
3624
3735
|
/**
|
|
@@ -3879,4 +3990,4 @@ declare const functionsCore: {
|
|
|
3879
3990
|
utils: typeof utils;
|
|
3880
3991
|
};
|
|
3881
3992
|
|
|
3882
|
-
export { AuditLogModel, type AuthorizationConfig, BancaModel, BetModel, type CacheConfig, DescargaModel, DeviceModel, EXTRACAO, type EnvioAssociacaoFilters, type EnvioAssociacaoParams, type EnvioAssociacaoResponse, EnvioDescargaModel, ExtracaoModel, type FirebaseAdapter, type FirebaseVersion, GAMES, GRUPOS_BICHOS, GameModel, type GenericRepo, type IdSearchStrategy, type IsolationConfig, KEYBOARD, LimitGameModel, MESSAGES, MessageModel, NumberModel, type OperationType, type OrderByCondition, PDFModel, PREFIX_ENVIO, PREFIX_ENVIO_OLD, PREFIX_NUMBER, PREMIOS, PremiacaoAssociacaoModel, PremiacaoModel, ROLES, type RepoCollections, type RepoConfig, type RepoFactoryConfig, type RepoQueryOptions, ResultadoModel, RouteModel, STATUS_DESCARGA, STATUS_DEVICE, STATUS_PULE, TIPO_VISUALIZACAO, type TypeAuditLog, type TypeAuditLogs, type TypeBanca, type TypeBancas, type TypeBet, type TypeCartDescargas, type TypeCartDescargasProps, type TypeCartList, type TypeCartListProps, type TypeDescarga, type TypeDescargas, type TypeDevice, type TypeDevices, type TypeEnvioDescarga, type TypeEnvioDescargas, type TypeExtracao, type TypeExtracoes, type TypeGame, type TypeGames, type TypeLimitGame, type TypeLimitGames, type TypeMessage, type TypeMessages, type TypeMetaData, type TypeNumero, type TypeNumeros, type TypePDFDescargas, type TypePDFsDescargas, type TypePremiacao, type TypePremiacaoAssociacao, type TypePremiacaoItem, type TypePremiacoes, type TypePremiacoesAssociacao, type TypePrize, type TypeResultado, type TypeResultados, type TypeRoute, type TypeRoutes, type TypeUser, type TypeUsers, type TypeValueGame, type TypeValueGames, UserModel, VISUALIZACAO, ValueGameModel, type WhereCondition, arredondarParaCima, calculaValoresDosNumeros, calcularValorDeNumero, calcularValorJogoPeloLimite, calculateAmount, calculateAmountGame, clone, collections, combineDateTime, createAutoRepo, createGenericRepo, createReactNativeAdapter, createReactNativeRepoFactory, createRepoFactory, createV8Adapter, createV9ModularAdapter, createWebAdapter, createWebRepoFactory, dateToNumber, delay, detectFirebaseVersion, dividirArray, extracaoEstaAtivaBoolean, extracaoEstaAtivaTryCatch, fazerJogo, formatPuleId, formatarNumero, formatterBRL, formatterPercentage, formatterPercentageDecimal, functionsCore, generateDescargas, generateId, gerarDezenas, getAllCombinations, getAvailableTimes, getBetDateToNumber, getCodigoAuth, getCreatedBySystem, getDataInicioFim, getFormattedPuleId, getGamesUnicosList, getGamesUnicosObjeto, getInitials, getLimiteJogoPeloTipoJogo, getLimiteSimulado, getLimitsRest, getNumeroId, getNumerosAcimaDoLimite, getPermission, getPremioFormato, getPropsEnvioId$1 as getPropsEnvioId, getPropsEnvioIdOld, getPropsPrefix, getPropsVP, getSomaEnvio, getSomaProps, getSomaVP, getTiposJogos, getValorJogoPeloTipoJogo, invertGame, isAdm, isAdmOrSubAdm, isAssociacao, isCambista, isCambistaTalao, isDigitador, isDigitadorAdm, isDigitadorOrDigitadorAdm, isSuperAdm, matchNormalized, normalize, numberToDate, numbersSelectedFormated, parserBRL, parserPercentage, parserPercentageDecimal, pegarExtracoes, pegarHorarioSaoPaulo, removerLetters, showFormatDate, sortNumeros };
|
|
3993
|
+
export { AuditLogModel, type AuthorizationConfig, BancaModel, BetModel, COMISSOES_PADRAO, type CacheConfig, DescargaModel, DeviceModel, EXTRACAO, type EnvioAssociacaoFilters, type EnvioAssociacaoParams, type EnvioAssociacaoResponse, EnvioDescargaModel, ExtracaoModel, type FirebaseAdapter, type FirebaseVersion, GAMES, GRUPOS_BICHOS, GameModel, type GenericRepo, type IdSearchStrategy, type IsolationConfig, KEYBOARD, LimitGameModel, MESSAGES, MessageModel, NumberModel, type OperationType, type OrderByCondition, PDFModel, PREFIX_ENVIO, PREFIX_ENVIO_OLD, PREFIX_NUMBER, PREMIOS, PremiacaoAssociacaoModel, PremiacaoModel, ROLES, type RepoCollections, type RepoConfig, type RepoFactoryConfig, type RepoQueryOptions, ResultadoModel, RouteModel, STATUS_DESCARGA, STATUS_DEVICE, STATUS_PULE, TIPO_VISUALIZACAO, type TypeAuditLog, type TypeAuditLogs, type TypeBanca, type TypeBancas, type TypeBet, type TypeCartDescargas, type TypeCartDescargasProps, type TypeCartList, type TypeCartListProps, type TypeComissaoDescarga, type TypeComissoesDescarga, type TypeDescarga, type TypeDescargas, type TypeDevice, type TypeDevices, type TypeEnvioDescarga, type TypeEnvioDescargas, type TypeExtracao, type TypeExtracoes, type TypeGame, type TypeGames, type TypeLimitGame, type TypeLimitGames, type TypeMessage, type TypeMessages, type TypeMetaData, type TypeNumero, type TypeNumeros, type TypePDFDescargas, type TypePDFsDescargas, type TypePremiacao, type TypePremiacaoAssociacao, type TypePremiacaoItem, type TypePremiacoes, type TypePremiacoesAssociacao, type TypePrize, type TypeResultado, type TypeResultados, type TypeRoute, type TypeRoutes, type TypeUser, type TypeUsers, type TypeValueGame, type TypeValueGames, UserModel, VISUALIZACAO, ValueGameModel, type WhereCondition, arredondarParaCima, calculaValoresDosNumeros, calcularValorDeNumero, calcularValorJogoPeloLimite, calculateAmount, calculateAmountGame, clone, collections, combineDateTime, createAutoRepo, createGenericRepo, createReactNativeAdapter, createReactNativeRepoFactory, createRepoFactory, createV8Adapter, createV9ModularAdapter, createWebAdapter, createWebRepoFactory, dateToNumber, delay, detectFirebaseVersion, dividirArray, extracaoEstaAtivaBoolean, extracaoEstaAtivaTryCatch, fazerJogo, formatPuleId, formatarNumero, formatterBRL, formatterPercentage, formatterPercentageDecimal, functionsCore, generateDescargas, generateId, gerarDezenas, getAllCombinations, getAvailableTimes, getBetDateToNumber, getCodigoAuth, getCreatedBySystem, getDataInicioFim, getFormattedPuleId, getGamesUnicosList, getGamesUnicosObjeto, getInitials, getLimiteJogoPeloTipoJogo, getLimiteSimulado, getLimitsRest, getNumeroId, getNumerosAcimaDoLimite, getPermission, getPremioFormato, getPropsEnvioId$1 as getPropsEnvioId, getPropsEnvioIdOld, getPropsPrefix, getPropsVP, getSomaEnvio, getSomaProps, getSomaVP, getTiposJogos, getValorJogoPeloTipoJogo, invertGame, isAdm, isAdmOrSubAdm, isAssociacao, isCambista, isCambistaTalao, isDigitador, isDigitadorAdm, isDigitadorOrDigitadorAdm, isSuperAdm, matchNormalized, normalize, numberToDate, numbersSelectedFormated, parserBRL, parserPercentage, parserPercentageDecimal, pegarExtracoes, pegarHorarioSaoPaulo, removerLetters, showFormatDate, sortNumeros };
|
package/dist/index.d.ts
CHANGED
|
@@ -1100,6 +1100,54 @@ declare const PREMIOS: {
|
|
|
1100
1100
|
};
|
|
1101
1101
|
};
|
|
1102
1102
|
|
|
1103
|
+
declare const COMISSOES_PADRAO: {
|
|
1104
|
+
readonly milhar: {
|
|
1105
|
+
readonly id: "milhar";
|
|
1106
|
+
readonly label: "Milhar";
|
|
1107
|
+
readonly order: 1;
|
|
1108
|
+
};
|
|
1109
|
+
readonly centena: {
|
|
1110
|
+
readonly id: "centena";
|
|
1111
|
+
readonly label: "Centena";
|
|
1112
|
+
readonly order: 2;
|
|
1113
|
+
};
|
|
1114
|
+
readonly dezena: {
|
|
1115
|
+
readonly id: "dezena";
|
|
1116
|
+
readonly label: "Dezena";
|
|
1117
|
+
readonly order: 3;
|
|
1118
|
+
};
|
|
1119
|
+
readonly grupo: {
|
|
1120
|
+
readonly id: "grupo";
|
|
1121
|
+
readonly label: "Grupo";
|
|
1122
|
+
readonly order: 4;
|
|
1123
|
+
};
|
|
1124
|
+
readonly "terno.dezena": {
|
|
1125
|
+
readonly id: "terno.dezena";
|
|
1126
|
+
readonly label: "Terno de Dezena";
|
|
1127
|
+
readonly order: 5;
|
|
1128
|
+
};
|
|
1129
|
+
readonly "terno.grupo": {
|
|
1130
|
+
readonly id: "terno.grupo";
|
|
1131
|
+
readonly label: "Terno de Grupo";
|
|
1132
|
+
readonly order: 6;
|
|
1133
|
+
};
|
|
1134
|
+
readonly "duque.dezena": {
|
|
1135
|
+
readonly id: "duque.dezena";
|
|
1136
|
+
readonly label: "Duque de Dezena";
|
|
1137
|
+
readonly order: 7;
|
|
1138
|
+
};
|
|
1139
|
+
readonly "duque.grupo": {
|
|
1140
|
+
readonly id: "duque.grupo";
|
|
1141
|
+
readonly label: "Duque de Grupo";
|
|
1142
|
+
readonly order: 8;
|
|
1143
|
+
};
|
|
1144
|
+
readonly restante: {
|
|
1145
|
+
readonly id: "restante";
|
|
1146
|
+
readonly label: "Restante";
|
|
1147
|
+
readonly order: 9;
|
|
1148
|
+
};
|
|
1149
|
+
};
|
|
1150
|
+
|
|
1103
1151
|
/**
|
|
1104
1152
|
* Tipo que representa um dispositivo no sistema
|
|
1105
1153
|
*/
|
|
@@ -1937,6 +1985,19 @@ type TypeEnvioDescarga = TypeMetaData & {
|
|
|
1937
1985
|
iniciadoEm: number;
|
|
1938
1986
|
/** Timestamp de conclusão (se houver) */
|
|
1939
1987
|
concluidoEm: number;
|
|
1988
|
+
/**
|
|
1989
|
+
* @description Total geral bruto de jogos por tipo de jogo
|
|
1990
|
+
*/
|
|
1991
|
+
totalGeralJogos: {
|
|
1992
|
+
[GAMES.milhar.id]: number;
|
|
1993
|
+
[GAMES.centena.id]: number;
|
|
1994
|
+
[GAMES.dezena.id]: number;
|
|
1995
|
+
[GAMES.grupo.id]: number;
|
|
1996
|
+
["terno.dezena"]: number;
|
|
1997
|
+
["terno.grupo"]: number;
|
|
1998
|
+
["duque.dezena"]: number;
|
|
1999
|
+
["duque.grupo"]: number;
|
|
2000
|
+
};
|
|
1940
2001
|
/**
|
|
1941
2002
|
* @description Informações do remetente, quem enviou a descarga
|
|
1942
2003
|
*/
|
|
@@ -2431,6 +2492,7 @@ declare const collections: {
|
|
|
2431
2492
|
readonly bancas: (obj?: Partial<TypeBanca>) => TypeBanca;
|
|
2432
2493
|
readonly auditLogs: (obj?: Partial<TypeAuditLog>) => TypeAuditLog;
|
|
2433
2494
|
readonly dispositivos: (obj?: Partial<TypeDevice>) => TypeDevice;
|
|
2495
|
+
readonly comissoes_descarga: (obj?: Partial<TypeComissaoDescarga>) => TypeComissaoDescarga;
|
|
2434
2496
|
};
|
|
2435
2497
|
|
|
2436
2498
|
type Firestore<T = any> = T;
|
|
@@ -2705,6 +2767,34 @@ type TypeAuditLogs = {
|
|
|
2705
2767
|
[id: TypeAuditLog["id"]]: TypeAuditLog;
|
|
2706
2768
|
};
|
|
2707
2769
|
|
|
2770
|
+
type TypeComissaoDescarga = TypeMetaData & {
|
|
2771
|
+
/**
|
|
2772
|
+
* @description Id aleatório gerado para o documento
|
|
2773
|
+
* @example "62e77f29-ba2b-a6a0-af4b-cfd1aab7d546"
|
|
2774
|
+
*/
|
|
2775
|
+
id: string;
|
|
2776
|
+
/**
|
|
2777
|
+
* @description Id incremental por banca
|
|
2778
|
+
*
|
|
2779
|
+
* @example "1"
|
|
2780
|
+
* @example "2"
|
|
2781
|
+
*/
|
|
2782
|
+
id_integer: string;
|
|
2783
|
+
/**
|
|
2784
|
+
* @description tipo do jogo (tem que ser único)
|
|
2785
|
+
* @example "milhar"
|
|
2786
|
+
* @example "centena"
|
|
2787
|
+
*/
|
|
2788
|
+
type_game: keyof typeof COMISSOES_PADRAO;
|
|
2789
|
+
/**
|
|
2790
|
+
* @description porcentagem de comissão
|
|
2791
|
+
*/
|
|
2792
|
+
porcentagem: number;
|
|
2793
|
+
};
|
|
2794
|
+
type TypeComissoesDescarga = {
|
|
2795
|
+
[id: string]: TypeComissaoDescarga;
|
|
2796
|
+
};
|
|
2797
|
+
|
|
2708
2798
|
declare const GameModel: (obj?: Partial<TypeGame>) => TypeGame;
|
|
2709
2799
|
|
|
2710
2800
|
declare const NumberModel: (obj?: Partial<TypeNumero>) => TypeNumero;
|
|
@@ -3607,7 +3697,27 @@ declare const getPropsEnvioIdOldDescarga: (descarga: Partial<TypeDescarga>) => {
|
|
|
3607
3697
|
*/
|
|
3608
3698
|
declare const getDescargaIdPeloEnvio: (numero: TypeNumero, envioId: string) => string;
|
|
3609
3699
|
|
|
3700
|
+
type TypeTotalGeral = {
|
|
3701
|
+
jogos: Record<string, {
|
|
3702
|
+
totalEnviado: number;
|
|
3703
|
+
ordem: number;
|
|
3704
|
+
tipo: keyof typeof COMISSOES_PADRAO;
|
|
3705
|
+
label: string;
|
|
3706
|
+
}>;
|
|
3707
|
+
totalBruto: number;
|
|
3708
|
+
totalLiquido: number;
|
|
3709
|
+
totalComissao: number;
|
|
3710
|
+
};
|
|
3711
|
+
/**
|
|
3712
|
+
* @description Calcula o total geral de uma descarga
|
|
3713
|
+
* @param totalBrutoJogos - Total bruto dos jogos
|
|
3714
|
+
* @param comissoes - Comissões das bancas
|
|
3715
|
+
* @returns Total geral da descarga
|
|
3716
|
+
*/
|
|
3717
|
+
declare const getTotalGeralDescarga: (totalBrutoJogos: TypeEnvioDescarga["totalGeralJogos"], comissoes: TypeComissoesDescarga) => TypeTotalGeral;
|
|
3718
|
+
|
|
3610
3719
|
type descarga_ResultadoDescargaComDiferenca = ResultadoDescargaComDiferenca;
|
|
3720
|
+
type descarga_TypeTotalGeral = TypeTotalGeral;
|
|
3611
3721
|
declare const descarga_generateDescarga: typeof generateDescarga;
|
|
3612
3722
|
declare const descarga_generateDescargas: typeof generateDescargas;
|
|
3613
3723
|
declare const descarga_getDescargaIdPeloEnvio: typeof getDescargaIdPeloEnvio;
|
|
@@ -3616,9 +3726,10 @@ declare const descarga_getDescargasAcimaDoLimite: typeof getDescargasAcimaDoLimi
|
|
|
3616
3726
|
declare const descarga_getPropsEnvioId: typeof getPropsEnvioId;
|
|
3617
3727
|
declare const descarga_getPropsEnvioIdOldDescarga: typeof getPropsEnvioIdOldDescarga;
|
|
3618
3728
|
declare const descarga_getPropsVPDescarga: typeof getPropsVPDescarga;
|
|
3729
|
+
declare const descarga_getTotalGeralDescarga: typeof getTotalGeralDescarga;
|
|
3619
3730
|
declare const descarga_sortDescargas: typeof sortDescargas;
|
|
3620
3731
|
declare namespace descarga {
|
|
3621
|
-
export { type descarga_ResultadoDescargaComDiferenca as ResultadoDescargaComDiferenca, descarga_generateDescarga as generateDescarga, descarga_generateDescargas as generateDescargas, descarga_getDescargaIdPeloEnvio as getDescargaIdPeloEnvio, descarga_getDescargaIdPeloNumero as getDescargaIdPeloNumero, descarga_getDescargasAcimaDoLimite as getDescargasAcimaDoLimite, descarga_getPropsEnvioId as getPropsEnvioId, descarga_getPropsEnvioIdOldDescarga as getPropsEnvioIdOldDescarga, descarga_getPropsVPDescarga as getPropsVPDescarga, descarga_sortDescargas as sortDescargas };
|
|
3732
|
+
export { type descarga_ResultadoDescargaComDiferenca as ResultadoDescargaComDiferenca, type descarga_TypeTotalGeral as TypeTotalGeral, descarga_generateDescarga as generateDescarga, descarga_generateDescargas as generateDescargas, descarga_getDescargaIdPeloEnvio as getDescargaIdPeloEnvio, descarga_getDescargaIdPeloNumero as getDescargaIdPeloNumero, descarga_getDescargasAcimaDoLimite as getDescargasAcimaDoLimite, descarga_getPropsEnvioId as getPropsEnvioId, descarga_getPropsEnvioIdOldDescarga as getPropsEnvioIdOldDescarga, descarga_getPropsVPDescarga as getPropsVPDescarga, descarga_getTotalGeralDescarga as getTotalGeralDescarga, descarga_sortDescargas as sortDescargas };
|
|
3622
3733
|
}
|
|
3623
3734
|
|
|
3624
3735
|
/**
|
|
@@ -3879,4 +3990,4 @@ declare const functionsCore: {
|
|
|
3879
3990
|
utils: typeof utils;
|
|
3880
3991
|
};
|
|
3881
3992
|
|
|
3882
|
-
export { AuditLogModel, type AuthorizationConfig, BancaModel, BetModel, type CacheConfig, DescargaModel, DeviceModel, EXTRACAO, type EnvioAssociacaoFilters, type EnvioAssociacaoParams, type EnvioAssociacaoResponse, EnvioDescargaModel, ExtracaoModel, type FirebaseAdapter, type FirebaseVersion, GAMES, GRUPOS_BICHOS, GameModel, type GenericRepo, type IdSearchStrategy, type IsolationConfig, KEYBOARD, LimitGameModel, MESSAGES, MessageModel, NumberModel, type OperationType, type OrderByCondition, PDFModel, PREFIX_ENVIO, PREFIX_ENVIO_OLD, PREFIX_NUMBER, PREMIOS, PremiacaoAssociacaoModel, PremiacaoModel, ROLES, type RepoCollections, type RepoConfig, type RepoFactoryConfig, type RepoQueryOptions, ResultadoModel, RouteModel, STATUS_DESCARGA, STATUS_DEVICE, STATUS_PULE, TIPO_VISUALIZACAO, type TypeAuditLog, type TypeAuditLogs, type TypeBanca, type TypeBancas, type TypeBet, type TypeCartDescargas, type TypeCartDescargasProps, type TypeCartList, type TypeCartListProps, type TypeDescarga, type TypeDescargas, type TypeDevice, type TypeDevices, type TypeEnvioDescarga, type TypeEnvioDescargas, type TypeExtracao, type TypeExtracoes, type TypeGame, type TypeGames, type TypeLimitGame, type TypeLimitGames, type TypeMessage, type TypeMessages, type TypeMetaData, type TypeNumero, type TypeNumeros, type TypePDFDescargas, type TypePDFsDescargas, type TypePremiacao, type TypePremiacaoAssociacao, type TypePremiacaoItem, type TypePremiacoes, type TypePremiacoesAssociacao, type TypePrize, type TypeResultado, type TypeResultados, type TypeRoute, type TypeRoutes, type TypeUser, type TypeUsers, type TypeValueGame, type TypeValueGames, UserModel, VISUALIZACAO, ValueGameModel, type WhereCondition, arredondarParaCima, calculaValoresDosNumeros, calcularValorDeNumero, calcularValorJogoPeloLimite, calculateAmount, calculateAmountGame, clone, collections, combineDateTime, createAutoRepo, createGenericRepo, createReactNativeAdapter, createReactNativeRepoFactory, createRepoFactory, createV8Adapter, createV9ModularAdapter, createWebAdapter, createWebRepoFactory, dateToNumber, delay, detectFirebaseVersion, dividirArray, extracaoEstaAtivaBoolean, extracaoEstaAtivaTryCatch, fazerJogo, formatPuleId, formatarNumero, formatterBRL, formatterPercentage, formatterPercentageDecimal, functionsCore, generateDescargas, generateId, gerarDezenas, getAllCombinations, getAvailableTimes, getBetDateToNumber, getCodigoAuth, getCreatedBySystem, getDataInicioFim, getFormattedPuleId, getGamesUnicosList, getGamesUnicosObjeto, getInitials, getLimiteJogoPeloTipoJogo, getLimiteSimulado, getLimitsRest, getNumeroId, getNumerosAcimaDoLimite, getPermission, getPremioFormato, getPropsEnvioId$1 as getPropsEnvioId, getPropsEnvioIdOld, getPropsPrefix, getPropsVP, getSomaEnvio, getSomaProps, getSomaVP, getTiposJogos, getValorJogoPeloTipoJogo, invertGame, isAdm, isAdmOrSubAdm, isAssociacao, isCambista, isCambistaTalao, isDigitador, isDigitadorAdm, isDigitadorOrDigitadorAdm, isSuperAdm, matchNormalized, normalize, numberToDate, numbersSelectedFormated, parserBRL, parserPercentage, parserPercentageDecimal, pegarExtracoes, pegarHorarioSaoPaulo, removerLetters, showFormatDate, sortNumeros };
|
|
3993
|
+
export { AuditLogModel, type AuthorizationConfig, BancaModel, BetModel, COMISSOES_PADRAO, type CacheConfig, DescargaModel, DeviceModel, EXTRACAO, type EnvioAssociacaoFilters, type EnvioAssociacaoParams, type EnvioAssociacaoResponse, EnvioDescargaModel, ExtracaoModel, type FirebaseAdapter, type FirebaseVersion, GAMES, GRUPOS_BICHOS, GameModel, type GenericRepo, type IdSearchStrategy, type IsolationConfig, KEYBOARD, LimitGameModel, MESSAGES, MessageModel, NumberModel, type OperationType, type OrderByCondition, PDFModel, PREFIX_ENVIO, PREFIX_ENVIO_OLD, PREFIX_NUMBER, PREMIOS, PremiacaoAssociacaoModel, PremiacaoModel, ROLES, type RepoCollections, type RepoConfig, type RepoFactoryConfig, type RepoQueryOptions, ResultadoModel, RouteModel, STATUS_DESCARGA, STATUS_DEVICE, STATUS_PULE, TIPO_VISUALIZACAO, type TypeAuditLog, type TypeAuditLogs, type TypeBanca, type TypeBancas, type TypeBet, type TypeCartDescargas, type TypeCartDescargasProps, type TypeCartList, type TypeCartListProps, type TypeComissaoDescarga, type TypeComissoesDescarga, type TypeDescarga, type TypeDescargas, type TypeDevice, type TypeDevices, type TypeEnvioDescarga, type TypeEnvioDescargas, type TypeExtracao, type TypeExtracoes, type TypeGame, type TypeGames, type TypeLimitGame, type TypeLimitGames, type TypeMessage, type TypeMessages, type TypeMetaData, type TypeNumero, type TypeNumeros, type TypePDFDescargas, type TypePDFsDescargas, type TypePremiacao, type TypePremiacaoAssociacao, type TypePremiacaoItem, type TypePremiacoes, type TypePremiacoesAssociacao, type TypePrize, type TypeResultado, type TypeResultados, type TypeRoute, type TypeRoutes, type TypeUser, type TypeUsers, type TypeValueGame, type TypeValueGames, UserModel, VISUALIZACAO, ValueGameModel, type WhereCondition, arredondarParaCima, calculaValoresDosNumeros, calcularValorDeNumero, calcularValorJogoPeloLimite, calculateAmount, calculateAmountGame, clone, collections, combineDateTime, createAutoRepo, createGenericRepo, createReactNativeAdapter, createReactNativeRepoFactory, createRepoFactory, createV8Adapter, createV9ModularAdapter, createWebAdapter, createWebRepoFactory, dateToNumber, delay, detectFirebaseVersion, dividirArray, extracaoEstaAtivaBoolean, extracaoEstaAtivaTryCatch, fazerJogo, formatPuleId, formatarNumero, formatterBRL, formatterPercentage, formatterPercentageDecimal, functionsCore, generateDescargas, generateId, gerarDezenas, getAllCombinations, getAvailableTimes, getBetDateToNumber, getCodigoAuth, getCreatedBySystem, getDataInicioFim, getFormattedPuleId, getGamesUnicosList, getGamesUnicosObjeto, getInitials, getLimiteJogoPeloTipoJogo, getLimiteSimulado, getLimitsRest, getNumeroId, getNumerosAcimaDoLimite, getPermission, getPremioFormato, getPropsEnvioId$1 as getPropsEnvioId, getPropsEnvioIdOld, getPropsPrefix, getPropsVP, getSomaEnvio, getSomaProps, getSomaVP, getTiposJogos, getValorJogoPeloTipoJogo, invertGame, isAdm, isAdmOrSubAdm, isAssociacao, isCambista, isCambistaTalao, isDigitador, isDigitadorAdm, isDigitadorOrDigitadorAdm, isSuperAdm, matchNormalized, normalize, numberToDate, numbersSelectedFormated, parserBRL, parserPercentage, parserPercentageDecimal, pegarExtracoes, pegarHorarioSaoPaulo, removerLetters, showFormatDate, sortNumeros };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var Jo=Object.defineProperty;var U=(e,o)=>{for(var r in o)Jo(e,r,{get:o[r],enumerable:!0})};var $o=[13,16,19];var A={milhar:{id:"milhar",label:"Milhar",sigla:"M",format:"####",formatDigitar:"####",markAll:!1,max:0,order:1,showPerLine:6},centena:{id:"centena",label:"Centena",sigla:"C",format:"###",formatDigitar:"###",markAll:!1,max:0,order:2,showPerLine:7},dezena:{id:"dezena",label:"Dezena",sigla:"D",format:"##",formatDigitar:"##",markAll:!1,max:0,order:3,showPerLine:0},grupo:{id:"grupo",label:"Grupo",sigla:"G",max:25,format:"##",formatDigitar:"##",markAll:!1,order:4,showPerLine:0},"terno.dezena":{id:"terno.dezena",label:"Terno de Dezena",sigla:"TD",format:"##-##-##",formatDigitar:"######",markAll:!0,max:0,order:5,showPerLine:3},"terno.grupo":{id:"terno.grupo",label:"Terno de Grupo",sigla:"TG",max:25,format:"##-##-##",formatDigitar:"######",markAll:!0,order:6,showPerLine:3},"duque.dezena":{id:"duque.dezena",label:"Duque de Dezena",sigla:"DD",format:"##-##",formatDigitar:"####",markAll:!0,max:0,order:7,showPerLine:5},"duque.grupo":{id:"duque.grupo",label:"Duque de Grupo",sigla:"DG",max:25,format:"##-##",formatDigitar:"####",markAll:!0,order:8,showPerLine:5},"milhar.invertida":{id:"milhar.invertida",label:"Milhar Invertida",sigla:"MI",format:"####",formatDigitar:"####",markAll:!1,max:0,order:0,showPerLine:6},"centena.invertida":{id:"centena.invertida",label:"Centena Invertida",sigla:"CI",format:"###",formatDigitar:"###",markAll:!1,max:0,order:0,showPerLine:7},"milhar@centena":{id:"milhar@centena",label:"Milhar Centena",sigla:"MC",format:"####",formatDigitar:"####",markAll:!1,max:0,order:0,showPerLine:6},"milhar.invertida@centena.invertida":{id:"milhar.invertida@centena.invertida",label:"Milhar e Centena Invertidas",sigla:"MCI",format:"####",formatDigitar:"####",markAll:!1,max:0,order:0,showPerLine:6},"milhar@dezena":{id:"milhar@dezena",label:"Milhar e Dezena",sigla:"MD",format:"####",formatDigitar:"####",markAll:!1,max:0,order:0,showPerLine:6},"milhar@centena@dezena":{id:"milhar@centena@dezena",label:"Milhar, Centena e Dezena",sigla:"MCD",format:"####",formatDigitar:"####",markAll:!1,max:0,order:0,showPerLine:6},"centena@dezena":{id:"centena@dezena",label:"Centena Dezena",sigla:"CD",format:"###",formatDigitar:"###",markAll:!1,max:0,order:0,showPerLine:7}};var i={"01":"Avestruz","02":"\xC1guia","03":"Burro","04":"Borboleta","05":"Cachorro","06":"Cabra","07":"Carneiro","08":"Camelo","09":"Cobra",10:"Coelho",11:"Cavalo",12:"Elefante",13:"Galo",14:"Gato",15:"Jacar\xE9",16:"Le\xE3o",17:"Macaco",18:"Porco",19:"Pav\xE3o",20:"Peru",21:"Touro",22:"Tigre",23:"Urso",24:"Veado",25:"Vaca"},ko={"01":{grupo:"01",bicho:i["01"]},"02":{grupo:"01",bicho:i["01"]},"03":{grupo:"01",bicho:i["01"]},"04":{grupo:"01",bicho:i["01"]},"05":{grupo:"02",bicho:i["02"]},"06":{grupo:"02",bicho:i["02"]},"07":{grupo:"02",bicho:i["02"]},"08":{grupo:"02",bicho:i["02"]},"09":{grupo:"03",bicho:i["03"]},10:{grupo:"03",bicho:i["03"]},11:{grupo:"03",bicho:i["03"]},12:{grupo:"03",bicho:i["03"]},13:{grupo:"04",bicho:i["04"]},14:{grupo:"04",bicho:i["04"]},15:{grupo:"04",bicho:i["04"]},16:{grupo:"04",bicho:i["04"]},17:{grupo:"05",bicho:i["05"]},18:{grupo:"05",bicho:i["05"]},19:{grupo:"05",bicho:i["05"]},20:{grupo:"05",bicho:i["05"]},21:{grupo:"06",bicho:i["06"]},22:{grupo:"06",bicho:i["06"]},23:{grupo:"06",bicho:i["06"]},24:{grupo:"06",bicho:i["06"]},25:{grupo:"07",bicho:i["07"]},26:{grupo:"07",bicho:i["07"]},27:{grupo:"07",bicho:i["07"]},28:{grupo:"07",bicho:i["07"]},29:{grupo:"08",bicho:i["08"]},30:{grupo:"08",bicho:i["08"]},31:{grupo:"08",bicho:i["08"]},32:{grupo:"08",bicho:i["08"]},33:{grupo:"09",bicho:i["09"]},34:{grupo:"09",bicho:i["09"]},35:{grupo:"09",bicho:i["09"]},36:{grupo:"09",bicho:i["09"]},37:{grupo:"10",bicho:i[10]},38:{grupo:"10",bicho:i[10]},39:{grupo:"10",bicho:i[10]},40:{grupo:"10",bicho:i[10]},41:{grupo:"11",bicho:i[11]},42:{grupo:"11",bicho:i[11]},43:{grupo:"11",bicho:i[11]},44:{grupo:"11",bicho:i[11]},45:{grupo:"12",bicho:i[12]},46:{grupo:"12",bicho:i[12]},47:{grupo:"12",bicho:i[12]},48:{grupo:"12",bicho:i[12]},49:{grupo:"13",bicho:i[13]},50:{grupo:"13",bicho:i[13]},51:{grupo:"13",bicho:i[13]},52:{grupo:"13",bicho:i[13]},53:{grupo:"14",bicho:i[14]},54:{grupo:"14",bicho:i[14]},55:{grupo:"14",bicho:i[14]},56:{grupo:"14",bicho:i[14]},57:{grupo:"15",bicho:i[15]},58:{grupo:"15",bicho:i[15]},59:{grupo:"15",bicho:i[15]},60:{grupo:"15",bicho:i[15]},61:{grupo:"16",bicho:i[16]},62:{grupo:"16",bicho:i[16]},63:{grupo:"16",bicho:i[16]},64:{grupo:"16",bicho:i[16]},65:{grupo:"17",bicho:i[17]},66:{grupo:"17",bicho:i[17]},67:{grupo:"17",bicho:i[17]},68:{grupo:"17",bicho:i[17]},69:{grupo:"18",bicho:i[18]},70:{grupo:"18",bicho:i[18]},71:{grupo:"18",bicho:i[18]},72:{grupo:"18",bicho:i[18]},73:{grupo:"19",bicho:i[19]},74:{grupo:"19",bicho:i[19]},75:{grupo:"19",bicho:i[19]},76:{grupo:"19",bicho:i[19]},77:{grupo:"20",bicho:i[20]},78:{grupo:"20",bicho:i[20]},79:{grupo:"20",bicho:i[20]},80:{grupo:"20",bicho:i[20]},81:{grupo:"21",bicho:i[21]},82:{grupo:"21",bicho:i[21]},83:{grupo:"21",bicho:i[21]},84:{grupo:"21",bicho:i[21]},85:{grupo:"22",bicho:i[22]},86:{grupo:"22",bicho:i[22]},87:{grupo:"22",bicho:i[22]},88:{grupo:"22",bicho:i[22]},89:{grupo:"23",bicho:i[23]},90:{grupo:"23",bicho:i[23]},91:{grupo:"23",bicho:i[23]},92:{grupo:"23",bicho:i[23]},93:{grupo:"24",bicho:i[24]},94:{grupo:"24",bicho:i[24]},95:{grupo:"24",bicho:i[24]},96:{grupo:"24",bicho:i[24]},97:{grupo:"25",bicho:i[25]},98:{grupo:"25",bicho:i[25]},99:{grupo:"25",bicho:i[25]},"00":{grupo:"25",bicho:i[25]}};var Ho={required:"Obrigat\xF3rio.",list_length_zero:"Selecione pelo menos um item.",incorrect_login:"Usu\xE1rio e/ou senha incorretos!",incorrect_password:"Senha incorreta.",email_already_in_use:"Este login j\xE1 est\xE1 sendo usado!",invalid_device:"Este login j\xE1 est\xE1 sendo usado em outro dispositivo!"};var qo={super_admin:{id:"super_admin",label:"Super Administrador"},associacao:{id:"associacao",label:"Associa\xE7\xE3o"},admin:{id:"admin",label:"Administrador"},sub_admin:{id:"sub_admin",label:"Sub-administrador"},digitador_adm:{id:"digitador_adm",label:"Digitador Administrador"},digitador:{id:"digitador",label:"Digitador"},cambista_talao:{id:"cambista_talao",label:"Cambista de tal\xE3o"},cambista:{id:"cambista",label:"Cambista"}};var Se={PROCESSANDO:{id:"PROCESSANDO",label:"PROCESSANDO",color:"green",showSite:!1,ordem:0},JOGADA:{id:"JOGADA",label:"PULES JOGADAS",color:"green",showSite:!0,ordem:1},AGUARDANDO_CANCELAMENTO:{id:"AGUARDANDO_CANCELAMENTO",label:"AGUARDANDO CANCELAMENTO",color:"yellow",showSite:!0,ordem:3},CANCELADA:{id:"CANCELADA",label:"CANCELADAS",color:"red",showSite:!0,ordem:4}};var Qo={notificacao:{id:"notificacao",label:"Notifica\xE7\xE3o"},impressao:{id:"impressao",label:"Impress\xE3o"}};var Xo={agora:{id:"agora",label:"Agora"},jogo_hoje:{id:"jogo_hoje",label:"Jogo Hoje"},jogo_pre_datado:{id:"jogo_pre_datado",label:"Jogo Pr\xE9-Datado"},resultado:{id:"resultado",label:"Resultado"}};var P="vp_";var M="envio_old_";var w="envio_";var Ne={ENVIANDO:{id:"ENVIANDO",labelBanca:"ENVIANDO",labelAssociacao:"RECEBENDO",color:"blue",showSite:!1,order:1},DEVOLVENDO:{id:"DEVOLVENDO",labelBanca:"RECEBENDO",labelAssociacao:"DEVOLVENDO",color:"blue",showSite:!1,order:1},ENVIADA:{id:"ENVIADA",labelBanca:"ENVIADA",labelAssociacao:"RECEBIDA",color:"green",showSite:!0,order:2},DEVOLVIDA:{id:"DEVOLVIDA",labelBanca:"DEVOLVIDA",labelAssociacao:"DEVOLVIDA",color:"orange",showSite:!0,order:3},ERRO:{id:"ERRO",labelBanca:"ERRO",labelAssociacao:"ERRO",color:"red",showSite:!1,order:4}};var Wo={Enter:{label:"Enter",value:"enter"},Ctrl:{label:"Ctrl",value:"ctrl"},Tab:{label:"Tab",value:"tab"},Space:{label:"\u23B5",value:"space"},Backspace:{label:"Backspace",value:"backspace"},Escape:{label:"Esc",value:"escape"},Delete:{label:"Del",value:"delete"},Backslash:{label:"\\",value:"backslash"},Semicolon:{label:";",value:"semicolon"},CapsLock:{label:"CapsLock",value:"capslock"},Quote:{label:"'",value:"quote"},Comma:{label:",",value:"decimal,comma"},Insert:{label:"Insert",value:"insert"},Home:{label:"Home",value:"home"},End:{label:"End",value:"end"},PageUp:{label:"Page Up",value:"pageup"},PageDown:{label:"Page Down",value:"pagedown"},ArrowUp:{label:"\u2191",value:"arrowup"},ArrowDown:{label:"\u2193",value:"arrowdown"},ArrowLeft:{label:"\u2190",value:"arrowleft"},ArrowRight:{label:"\u2192",value:"arrowright"},NumLock:{label:"Num Lock",value:"numlock"},Dot:{label:".",value:"period,comma"},Divide:{label:"/",value:"slash,divide"},Subtract:{label:"-",value:"minus,subtract"},Multiply:{label:"*",value:"multiply,shift+8"},Add:{label:"+",value:"add,shift+equal"},Equal:{id:"Equal",label:"=",value:"equal"},F1:{label:"F1",value:"f1"},F2:{label:"F2",value:"f2"},F3:{label:"F3",value:"f3"},F4:{label:"F4",value:"f4"},F5:{label:"F5",value:"f5"},F6:{label:"F6",value:"f6"},F7:{label:"F7",value:"f7"},F8:{label:"F8",value:"f8"},F9:{label:"F9",value:"f9"},F10:{label:"F10",value:"f10"},F11:{label:"F11",value:"f11"},F12:{label:"F12",value:"f12"},0:{label:"0",value:"0"},1:{label:"1",value:"1"},2:{label:"2",value:"2"},3:{label:"3",value:"3"},4:{label:"4",value:"4"},5:{label:"5",value:"5"},6:{label:"6",value:"6"},7:{label:"7",value:"7"},8:{label:"8",value:"8"},9:{label:"9",value:"9"},A:{label:"A",value:"a"},B:{label:"B",value:"b"},C:{label:"C",value:"c"},D:{label:"D",value:"d"},E:{label:"E",value:"e"},F:{label:"F",value:"f"},G:{label:"G",value:"g"},H:{label:"H",value:"h"},I:{label:"I",value:"i"},J:{label:"J",value:"j"},K:{label:"K",value:"k"},L:{label:"L",value:"l"},M:{label:"M",value:"m"},N:{label:"N",value:"n"},O:{label:"O",value:"o"},P:{label:"P",value:"p"},Q:{label:"Q",value:"q"},R:{label:"R",value:"r"},S:{label:"S",value:"s"},T:{label:"T",value:"t"},U:{label:"U",value:"u"},V:{label:"V",value:"v"},W:{label:"W",value:"w"},X:{label:"X",value:"x"},Y:{label:"Y",value:"y"},Z:{label:"Z",value:"z"}};var Ko={EM_ESPERA:{id:"EM_ESPERA",label:"Esperando aprova\xE7\xE3o",color:"orange"},APROVADO:{id:"APROVADO",label:"Aprovado",color:"green"},BLOQUEADO:{id:"BLOQUEADO",label:"Bloqueado",color:"red"}};var S={1:{id:"1",order:1,label:"1\xBA Pr\xEAmio",labelShort:"1\xBA"},2:{id:"2",order:2,label:"2\xBA Pr\xEAmio",labelShort:"2\xBA"},3:{id:"3",order:3,label:"3\xBA Pr\xEAmio",labelShort:"3\xBA"},4:{id:"4",order:4,label:"4\xBA Pr\xEAmio",labelShort:"4\xBA"},5:{id:"5",order:5,label:"5\xBA Pr\xEAmio",labelShort:"5\xBA"},"1-5":{id:"1-5",order:6,label:"1\xBA ao 5\xBA Pr\xEAmio",labelShort:"1\xBA ao 5\xBA"}};var g=e=>({id:e?.id||"system",id_integer:e?.id_integer||"system",role:e?.role||"super_admin",name:e?.name||"Gerado automaticamente pelo sistema",login:e?.login||"system"});var Re={};U(Re,{clone:()=>N,combineDateTime:()=>je,dateToNumber:()=>c,delay:()=>mo,dividirArray:()=>co,formatterBRL:()=>ao,formatterPercentage:()=>uo,formatterPercentageDecimal:()=>fo,generateId:()=>k,getAllCombinations:()=>ce,getCodigoAuth:()=>me,getDataInicioFim:()=>to,getInitials:()=>po,matchNormalized:()=>lo,normalize:()=>W,numberToDate:()=>b,numbersSelectedFormated:()=>no,parserBRL:()=>io,parserPercentage:()=>go,parserPercentageDecimal:()=>yo,pegarHorarioSaoPaulo:()=>m,removerLetters:()=>To,showFormatDate:()=>I});import Yo from"clone-deep";var N=e=>Yo(e);import{isValid as Zo}from"date-fns";var c=e=>{if(!e||!Zo(e))return 0;let o=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),t=String(e.getDate()).padStart(2,"0"),a=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),s=String(e.getSeconds()).padStart(2,"0");return+`${o}${r}${t}${a}${n}${s}`};import{parse as er,isValid as or}from"date-fns";import jo from"moment-timezone";var m=()=>{let e=jo.tz(new Date,"America/Sao_Paulo").format("DD_MM_YYYY_HH_mm_ss_SSS"),[o,r,t,a,n,s,u]=e.split("_");return new Date(Number(t),Number(r)-1,Number(o),Number(a),Number(n),Number(s),Number(u))};var b=e=>{if(!e)return;let o=e.toString(),r=o.slice(0,4),t=o.slice(4,6),a=o.slice(6,8),n=o.slice(8,10),s=o.slice(10,12),u=o.slice(12,14),f=`${r}-${t}-${a} ${n}:${s}:${u}`,x=m(),p=er(f,"yyyy-MM-dd HH:mm:ss",x);return or(p)?p:void 0};var je=(e,o)=>{let r=b(e),t=b(o);if(!r||!t)return 0;let a=r.getFullYear(),n=r.getMonth(),s=r.getDate(),u=t.getHours(),f=t.getMinutes(),x=t.getSeconds(),p=new Date(a,n,s,u,f,x,0);return c(p)};import{setHours as eo,setMinutes as oo,setSeconds as ro}from"date-fns";var to=({dataAposta:e})=>{let o=ro(oo(eo(b(e)||m(),0),0),0),r=ro(oo(eo(b(e)||m(),23),59),59);return{dataInicio:c(o),dataFim:c(r)}};var ao=e=>{let o=e;return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(o||0)},io=e=>{let o=e;o=o.replace(/\D/g,"");let r=parseFloat(o||"0");return r/=100,r};var so=e=>{if(e.length===0)return[[]];let o=new Set;for(let r=0;r<e.length;r++){let t=e[r],a=[...e.slice(0,r),...e.slice(r+1)],n=so(a);for(let s of n)o.add([t,...s])}return Array.from(o)},ce=e=>{let o=e.toString().split(""),r=so(o),t=new Set(r.map(a=>a.join("")));return Array.from(t)};import{format as rr}from"date-fns";var I=(e,o)=>{if(!e)return"N/A";let r=b(e);return r?rr(r,o||"dd/MM/yyyy"):"N/A"};var no=e=>{let o=e.map(Number);if(o.length===0)return"";o.sort((n,s)=>n-s);let r="",t=o[0],a=t;for(let n=1;n<=o.length;n++)n<o.length&&o[n]===a+1?a=o[n]:(t===a?r+=t:r+=`${t} ao ${a}`,n<o.length&&(r+=", ",t=o[n],a=t));return r};var k=e=>{let o=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);return`${e?`${e}-`:""}${o()+o()}-${o()}-${o()}-${o()}-${o()}${o()}${o()}`};var me=(e,o)=>(e=Math.ceil(e),o=Math.floor(o),Math.floor(Math.random()*(o-e+1))+e);var co=(e,o=1e3)=>{let r=[];for(let t=0;t<e.length;t+=o){let a=e.slice(t,t+o);r.push(a)}return r};var mo=e=>new Promise(o=>setTimeout(o,e));var W=e=>e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"");var lo=(e,o)=>W(e).includes(W(o));var po=e=>e?e.trim().split(/\s+/).filter(t=>t.length>=2).slice(0,2).map(t=>t[0].toUpperCase()).join(""):"";var uo=e=>`${new Intl.NumberFormat("pt-BR",{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0}).format(e||0)} %`;var go=(e,o)=>(e=e.replace(/\D/g,""),o=o?.replace(/\D/g,""),o?(Number(o)===Number(e)&&(o=o.slice(0,-1)),Number(Number(o||"0").toFixed(2))):Number(Number(e||"0").toFixed(2)));var fo=e=>(e*=100,`${new Intl.NumberFormat("pt-BR",{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0}).format(e||0)} %`),yo=(e,o)=>(e=e.replace(/\D/g,""),o=o?.replace(/\D/g,""),o?(Number(o)===Number(e)&&(o=o.slice(0,-1)),Number(Number(o||"0").toFixed(2))/100):Number(Number(e||"0").toFixed(2))/100);var To=e=>e.replace(/[^0-9]/g,"");var K=e=>({id:e?.id||"",id_integer:e?.id_integer||"",horario:e?.horario||0,bloqueio:e?.bloqueio||0,bancaId:e?.bancaId||"",ativo:e?.ativo??!0,inativo_no_dia:e?.inativo_no_dia||[],description:e?.description||"",somente_no_feriado:e?.somente_no_feriado||0,createdBy:g(e?.createdBy),updated:e?.updated||c(m()),created:e?.created||c(m()),days:{0:e?.days?.[0]??!1,1:e?.days?.[1]??!1,2:e?.days?.[2]??!1,3:e?.days?.[3]??!1,4:e?.days?.[4]??!1,5:e?.days?.[5]??!1,6:e?.days?.[6]??!1}});var Ge={};U(Ge,{arredondarParaCima:()=>z,calculaValoresDosNumeros:()=>ge,calcularValorDeNumero:()=>pe,formatarNumero:()=>B,generateDescargas:()=>Ce,gerarDezenas:()=>ho,getCreatedBySystem:()=>g,getLimiteSimulado:()=>Po,getNumeroId:()=>de,getNumerosAcimaDoLimite:()=>vo,getPremioFormato:()=>ue,getPropsEnvioId:()=>fe,getPropsEnvioIdOld:()=>ye,getPropsPrefix:()=>Q,getPropsVP:()=>Te,getSomaEnvio:()=>le,getSomaProps:()=>bo,getSomaVP:()=>xo,getTiposJogos:()=>H,sortNumeros:()=>Do});var B=(e,o)=>{let r="",t=e.length-1,a=o.length-1;for(;a>=0;)o[a]==="#"?(r=e[t]+r,t--):o[a]==="-"&&(r="-"+r),a--;return r};var Ie=(e,o)=>{let r=o,t=e?.envioIds?.length>0?e.envioIds[e.envioIds.length-1]:"";return G({...e,id:r,premio:e.premio,amount:e.amount,numeros:[e.numero],amountEnviadoParaAssociacao:e.amountEnviadoParaAssociacao,valorAEnviarParaAssociacao:e.valorAEnviarParaAssociacao,envioId:t,dataAposta:e.dataAposta,bancaId:e.bancaId,valorArredondado:e.valorArredondado,limiteJogoReal:e.limiteJogoReal,limiteJogoSimulado:e.limiteJogoSimulado,valorJogo:e.valorJogo})};var Me=(e,o)=>{let r=o?z(Number(e[o])):z(e.amount);return`${e?.bancaId?`${e?.bancaId}_`:""}${e.dataAposta}_${e.tipo_jogo}_${e.premio}_${r}`};var Ce=(e,o)=>{let r={};return Object.entries(e).forEach(([,t])=>{let a=Me(t,o);r[a]?r[a].numeros.push(t.numero):r[a]=Ie(t,a)}),r};var ho=e=>{let o=[];e.forEach(a=>{let n=A[a.name];a.numbers.forEach(s=>{if(n.id==="dezena"){let x=s.split("-");for(let p of x){if(p.length<n.format.length)continue;let D=B(p,n.format);o.push(D)}return}let u=s.replaceAll("-","");if(u.length<n.format.replaceAll("-","").length)return;let f=B(u,n.format);o.push(f)})});let r=new Set(o);return Array.from(r)};var le=e=>{let o=0;return Object.entries(e).forEach(([r,t])=>{let a=r.split("_");a.includes("envio")&&!a.includes("old")&&typeof t=="number"&&(o+=t)}),o};var xo=e=>{let o=0,r=0;Object.entries(e).forEach(([a,n])=>{a.startsWith("vp_")&&typeof n=="number"&&(o+=n,n>0&&(r+=1))});let t=le(e);return o-=t,{soma:o,quantidadeDePulesMaiorQueZero:r,somaEnviadoParaAssociacao:t}};var de=e=>{let{dataAposta:o,jogo:r,numero:t,bancaId:a,premio:n,descarregado:s}=e,u=A[r],f=u.markAll?t:B(t,u.format),x=s?"true":"false";return(a?`${a}_`:"")+`${o}_${r}_${n}_${f}_${x}`};var H=e=>e.replaceAll(".invertida","").split("@");var pe=({quantidadeDeNumeros:e,tipoJogo:o,valorPremio:r,quantidadeDePremios:t})=>{let a=A[o],n=H(o),s=r/(n.length||1);return s/=e,a.markAll||(s/=t||1),t===0&&(s=0),s};var ue=e=>e===1?S[1].id:e===2?S[2].id:e===3?S[3].id:e===4?S[4].id:e===5?S[5].id:S["1-5"].id;var ge=e=>{let o={},r=m(),t=c(r);for(let a of e.bets){let n=H(a.name),s=a.numbers.length;for(let u of n)for(let f of a.numbers)for(let x of a.prizes)for(let p of x.prizes){let D=A[u],L=pe({valorPremio:x.value,tipoJogo:a.name,quantidadeDeNumeros:s,quantidadeDePremios:x.prizes.length}),R=ue(p),V=f;D.markAll?R="1-5":V=B(f,D.format);let h=de({numero:f,bancaId:e.bancaId,dataAposta:e.dateBet,jogo:u,premio:R});o?.[h]||(o[h]=O({id:h,numero:V,premio:R,created:t,bancaId:e.bancaId,amount:0,dataAposta:e.dateBet,tipo_jogo:u,[`${"vp_"}${e.id}`]:0})),D.markAll?o[h][`${"vp_"}${e.id}`]=Number(L.toFixed(3)):o[h][`${"vp_"}${e.id}`]+=Number(L.toFixed(3))}}return{numeros:o}};var Ao=2,vo=(e,o,r)=>e.map(t=>{let a=q.limite_jogos.getValorJogoPeloTipoJogo(o,t.tipo_jogo),n=Object.values(r).find(p=>p.type_game===t.tipo_jogo),s=q.limite_jogos.calcularValorJogoPeloLimite(n?.limit||0,a?.value||0),u=Number(t.amount.toFixed(Ao)),f=Number(s.toFixed(Ao)),x=u-f;return u>f?{numero:t,diferenca:x}:null}).filter(Boolean);var z=e=>{let o=Math.round(e*100),r=o%5;return r!==0&&(o+=5-r),o/100};var Do=e=>{let o=Object.values(e).sort((r,t)=>{let a=A[r.tipo_jogo].order,n=A[t.tipo_jogo].order;return a<n?-1:a>n?1:r.premio<t.premio?-1:r.premio>t.premio?1:r.amount>t.amount?-1:1});return Object.fromEntries(o.map(r=>[r.id,r]))};var fe=e=>{let o={};return Object.entries(e).forEach(([r,t])=>{let a=r.split("_");a.includes("envio")&&!a.includes("old")&&typeof t=="number"&&(o[r]=t)}),o};var ye=e=>{let o={};return Object.entries(e).forEach(([r,t])=>{let a=r.split("_");a.includes("envio")&&a.includes("old")&&typeof t=="number"&&(o[r]=t)}),o};var Te=e=>{let o={};return Object.entries(e).forEach(([r,t])=>{r.startsWith("vp_")&&typeof t=="number"&&(o[r]=t)}),o};var Q=e=>{let o={vp_:{},[w]:{},[M]:{}},r=N(Te(e)),t=N(fe(e)),a=N(ye(e));return o["vp_"]=N(r),o[w]=N(t),o[M]=N(a),o};var bo=e=>{let o=0;return Object.values(e).forEach(r=>{o+=r}),o};var he=(e,o)=>Object.values(e).find(r=>r.type_game===o);var Be={};U(Be,{calcularValorJogoPeloLimite:()=>Eo,getLimiteJogoPeloTipoJogo:()=>he,getValorJogoPeloTipoJogo:()=>xe});var Eo=(e,o)=>e/(o||1);var xe=(e,o)=>Object.values(e).find(r=>r.type_game===o);var Po=(e,o,r)=>{let t=xe(o,e);return(he(r,e)?.limit||0)/(t?.value||1)};var we={};U(we,{extracaoEstaAtivaBoolean:()=>Oo,extracaoEstaAtivaTryCatch:()=>be,getAvailableTimes:()=>Mo,pegarExtracoes:()=>Bo});import{format as Fe,getDay as sr}from"date-fns";var Oe={};U(Oe,{calculateAmount:()=>Ae,calculateAmountGame:()=>ve,fazerJogo:()=>No,formatPuleId:()=>_o,getBetDateToNumber:()=>F,getFormattedPuleId:()=>So,getGamesUnicosList:()=>Ro,getGamesUnicosObjeto:()=>Io,invertGame:()=>De});var Ae=e=>{let o=0;return e.forEach(r=>{o+=r.value}),o};var ve=e=>{let o=0;return e.forEach(r=>{o+=Ae(r.prizes)}),o};import{setHours as tr,setMinutes as ar,setSeconds as ir}from"date-fns";var F=(e,o)=>{let t=b(o),a=b(e);return!a||!t?0:(a=tr(a,t.getHours()),a=ar(a,t.getMinutes()),a=ir(a,0),c(a))};var _o=e=>e<1e3?e.toString().padStart(4,"0"):e.toString();var So=e=>{let o=e.split("-");return o[o.length-1]};var De=e=>{let o=N(e);for(let r=0;r<o.bets.length;r++){let t=o.bets[r];if(t.name==="milhar.invertida"||t.name==="centena.invertida"||t.name==="milhar.invertida@centena.invertida"){let a=t.numbers,n=[];for(let s of a){let u=ce(s);n.push(...u)}t={...t,numbers:N(n)},o.bets[r]=t}}return o};var No=(e,o,r,t,a)=>{let n=J({...e,id:a,creator:o,dateBet:F(r,t.horario),totalAmount:ve(e.bets),extracao:t}),s=De(n),{numeros:u}=ge(s);return{numeros:u,game:n}};var Ro=()=>Object.values(A).filter(e=>!e.id.includes("@")&&!e.id.includes("invertida")),Io=()=>Object.values(A).filter(r=>!r.id.includes("@")&&!r.id.includes("invertida")).reduce((r,t)=>(r[t.id]=t,r),{});var Mo=(e,o,r,t,a)=>{let n=F(o,20241001e6),s=e.filter(p=>p.ativo&&!p.inativo_no_dia.includes(n)),u=b(n),f=[],x=s.filter(p=>p.somente_no_feriado===n);return x.length>0?f=[...x]:f=s.filter(p=>u&&p.days[sr(u)]&&p.somente_no_feriado===0),r&&(f=[...s]),t&&u&&a&&Fe(a,"dd/MM/yyyy")===Fe(u,"dd/MM/yyyy")&&(f=f.filter(p=>Number(Fe(a,"HHmm"))<Number(I(p.bloqueio,"HHmm")))),f.sort((p,D)=>Number(I(p.horario,"HHmm"))<Number(I(D.horario,"HHmm"))?-1:1)};import{format as nr,getDay as cr}from"date-fns";var Bo=({extracoes:e,dataAposta:o=c(m()),dataAgora:r=c(m()),retornar:t="do_dia",pegar:a="bloqueio"})=>{let n=h=>a==="horario"?h.horario:a==="bloqueio"?h.bloqueio:0,s=F(o,20241001e6),u=F(r,20241001e6),f=b(s);if(!f)throw new Error("dataApostaDate \xE9 obrigat\xF3ria!");let x=e.filter(h=>h.ativo&&!h.inativo_no_dia.includes(s)),p=x.filter(h=>h.somente_no_feriado===s),D=p.length>0?p:x.filter(h=>h.days[cr(f)]&&h.somente_no_feriado===0);if(t==="do_dia")return D.sort(Co);let L=b(r);if(!L)throw new Error("dataAgoraDate \xE9 obrigat\xF3ria!");let R=Number(nr(L,"HHmm"));return(t==="proximas"?D.filter(h=>s===u?R<Number(I(n(h),"HHmm")):s>u):t==="anteriores"?D.filter(h=>u===s?R>=Number(I(n(h),"HHmm")):s<u):[]).sort(Co)},Co=(e,o)=>Number(I(e.horario,"HHmm"))-Number(I(o.horario,"HHmm"));import{getDay as Go}from"date-fns";var be=(e,o)=>{if(!o.ativo)throw new Error("Extra\xE7\xE3o n\xE3o est\xE1 ativa.");if(o.inativo_no_dia.includes(e))throw new Error("Extra\xE7\xE3o est\xE1 inativa no dia da aposta.");if(o.somente_no_feriado!==0&&o.somente_no_feriado!==e)throw new Error("Extra\xE7\xE3o n\xE3o funciona neste feriado.");let r=b(e);if(!r)throw new Error("Data da aposta inv\xE1lida.");if(!o.days[Go(r)]){let a=["domingo","segunda-feira","ter\xE7a-feira","quarta-feira","quinta-feira","sexta-feira","s\xE1bado"][Go(r)];throw new Error(`Extra\xE7\xE3o n\xE3o funciona neste dia da semana (${a}).`)}};var Oo=(e,o)=>{try{return be(e,o),!0}catch{return!1}};var Qe={};U(Qe,{getLimitsRest:()=>wo,getPermission:()=>Fo,isAdm:()=>Le,isAdmOrSubAdm:()=>ze,isAssociacao:()=>Ve,isCambista:()=>$e,isCambistaTalao:()=>Je,isDigitador:()=>He,isDigitadorAdm:()=>ke,isDigitadorOrDigitadorAdm:()=>qe,isSuperAdm:()=>Ue});var mr=["admin"],lr=["admin","sub_admin"],dr=["associacao"],pr=["super_admin"],ur=["cambista_talao"],gr=["cambista"],fr=["digitador_adm"],yr=["digitador"],Tr=["digitador","digitador_adm"],Le=e=>mr.includes(e.role),Ve=e=>dr.includes(e.role),Ue=e=>pr.includes(e.role),ze=e=>lr.includes(e.role),Je=e=>ur.includes(e.role),$e=e=>gr.includes(e.role),ke=e=>fr.includes(e.role),He=e=>yr.includes(e.role),qe=e=>Tr.includes(e.role),Fo={isAdm:Le,isAssociacao:Ve,isSuperAdm:Ue,isAdmOrSubAdm:ze,isCambistaTalao:Je,isCambista:$e,isDigitadorAdm:ke,isDigitador:He,isDigitadorOrDigitadorAdm:qe};var wo=e=>{let o=0,r=0;return Object.values(e.jogos.hoje).forEach(t=>o+=t),Object.values(e.jogos.pre).forEach(t=>r+=t),{hoje:o,pre:r}};var Xe={};U(Xe,{generateDescarga:()=>Ie,generateDescargas:()=>Ce,getDescargaIdPeloEnvio:()=>br,getDescargaIdPeloNumero:()=>Me,getDescargasAcimaDoLimite:()=>xr,getPropsEnvioId:()=>vr,getPropsEnvioIdOldDescarga:()=>Dr,getPropsVPDescarga:()=>Ar,sortDescargas:()=>hr});var hr=e=>{let o=Object.values(e).sort((r,t)=>{let a=A[r.tipo_jogo].order,n=A[t.tipo_jogo].order;return a<n?-1:a>n?1:r.premio<t.premio?-1:r.premio>t.premio?1:t.amount-r.amount});return Object.fromEntries(o.map(r=>[r.id,r]))};var Lo=2,xr=(e,o,r)=>e.map(t=>{let a=q.limite_jogos.getValorJogoPeloTipoJogo(o,t.tipo_jogo),n=Object.values(r).find(p=>p.type_game===t.tipo_jogo),s=q.limite_jogos.calcularValorJogoPeloLimite(n?.limit||0,a?.value||0),u=Number(t.amount.toFixed(Lo)),f=Number(s.toFixed(Lo)),x=u-f;return u>f?{descarga:t,diferenca:x}:null}).filter(Boolean);var Ar=e=>{let o={};return Object.entries(e).forEach(([r,t])=>{r.split("_").includes("vp_")&&typeof t=="number"&&(o[r]=t)}),o};var vr=e=>{let o={};return Object.entries(e).forEach(([r,t])=>{let a=r.split("_");a.includes("envio")&&!a.includes("old")&&typeof t=="number"&&(o[r]=t)}),o};var Dr=e=>{let o={};return Object.entries(e).forEach(([r,t])=>{let a=r.split("_");a.includes("envio")&&a.includes("old")&&typeof t=="number"&&(o[r]=t)}),o};var br=(e,o)=>{let r=`${M}${o}`,t=e[r];if(t==null)throw new Error(`Valor do envio '${o}' n\xE3o encontrado no n\xFAmero.`);if(typeof t!="number")throw new Error(`Valor do envio '${o}' deve ser um n\xFAmero.`);let a=z(t);return`${e?.bancaId?`${e?.bancaId}_`:""}${e.dataAposta}_${e.tipo_jogo}_${e.premio}_${a}_envio_${o}`};var q={numbers:Ge,extracao:we,descarga:Xe,games:Oe,users:Qe,limite_jogos:Be,utils:Re};var Y=e=>({id:e?.id||"",id_integer:e?.id_integer||"",extracaoIds:e?.extracaoIds||[],content:e?.content||"",visualizacao:e?.visualizacao||"jogo_hoje",bancaId:e?.bancaId||"",createdBy:g(e?.createdBy),date:{from:e?.date?.from||0,to:e?.date?.to||0},fixa:e?.date?.to===0||e?.date?.from===0,tipo:e?.tipo||[],updated:e?.updated||c(m()),created:e?.created||c(m())});var Z=e=>({id:e?.id||"",id_integer:e?.id_integer||"",createdBy:g(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m()),bancaId:e?.bancaId||"",extracao:{id:e?.extracao?.id||"",id_integer:e?.extracao?.id_integer||"",horario:e?.extracao?.horario||0,description:e?.extracao?.description||""},milhares:{1:e?.milhares?.[1]??"",2:e?.milhares?.[2]??"",3:e?.milhares?.[3]??"",4:e?.milhares?.[4]??"",5:e?.milhares?.[5]??""},grupos:{1:e?.grupos?.[1]??"",2:e?.grupos?.[2]??"",3:e?.grupos?.[3]??"",4:e?.grupos?.[4]??"",5:e?.grupos?.[5]??""},bichos:{1:e?.bichos?.[1]??"",2:e?.bichos?.[2]??"",3:e?.bichos?.[3]??"",4:e?.bichos?.[4]??"",5:e?.bichos?.[5]??""},liberado:e?.liberado??!1,dataSorteio:e?.dataSorteio||0});var j=e=>({id:e?.id||"",id_integer:e?.id_integer||"",comission:e?.comission??0,name:e?.name||"",responsible:e?.responsible||"",codigo_rota:e?.codigo_rota||"",tipo:e?.tipo||"cambista",bancaId:e?.bancaId||"",createdBy:g(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var X=e=>({id:e?.id??"",id_integer:e?.id_integer||"",active:e?.active??!0,bet_limit:e?.bet_limit??0,comission:e?.comission??0,bancaId:e?.bancaId||"",photoURL:e?.photoURL||"",name:e?.name||"",sessionId:e?.sessionId||"",codigo_cambista:e?.codigo_cambista||"",deviceId:e?.deviceId||"",role:e?.role||"cambista",pre_date_limit:e?.pre_date_limit||0,dispositivos:{dispositivoIdAtual:e?.dispositivos?.dispositivoIdAtual||"",listaDispositivosConectados:e?.dispositivos?.listaDispositivosConectados||[]},route:{id:e?.route?.id||"",name:e?.route?.name||"",tipo:e?.route?.tipo||"cambista"},type_games:e?.type_games?e?.type_games.filter(o=>A?.[o]?.id):[],login:e?.login||"",jogos:{hoje:e?.jogos?.hoje||{},pre:e?.jogos?.pre||{}},preferences:{pdfLegado:e?.preferences?.pdfLegado??!1},permissoes:{podeCancelarPule:e?.permissoes?.podeCancelarPule??!1,podeReservar:e?.permissoes?.podeReservar??!1,podeJogarSurpresinha:e?.permissoes?.podeJogarSurpresinha??!0},createdBy:g(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var ee=e=>({id:e?.id||"",id_integer:e?.id_integer||"",type_game:e?.type_game||"milhar",bancaId:e?.bancaId||"",value:e?.value??0,createdBy:g(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var J=(e={})=>({id:e?.id||"",id_integer:e?.id_integer||"",origem_pule_id:e?.origem_pule_id||"",bets:e.bets||[],creator:{id:e?.creator?.id||"",id_integer:e?.creator?.id_integer||"",codigo_cambista:e?.creator?.codigo_cambista||"",name:e?.creator?.name||"",role:e?.creator?.role||"cambista",login:e?.creator?.login||"",comission:e?.creator?.comission||0,route:{id:e?.creator?.route?.id||"",name:e?.creator?.route?.name||"",tipo:e?.creator?.route?.tipo||"cambista"}},createdBy:g(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m()),totalAmount:e?.totalAmount||0,bancaId:e?.bancaId||"",codigoAuth:e?.codigoAuth||me(1e5,999999).toString(),cancel:{canceled:e?.cancel?.canceled??!1,canceledAt:e?.cancel?.canceledAt||0,reason:e?.cancel?.reason||""},valorNumerosNaPule:e?.valorNumerosNaPule||{},infoJogos:e?.infoJogos||[],tiposJogos:e?.tiposJogos||{},reservada:e?.reservada||!1,dias_disponiveis:e?.dias_disponiveis||[],dateBet:e?.dateBet||0,status:e.status||Se.JOGADA.id,statusReason:e?.statusReason||"",extracao:{id:e?.extracao?.id||"",id_integer:e?.extracao?.id_integer||"",description:e?.extracao?.description||"",bloqueio:e?.extracao?.bloqueio||0,horario:e?.extracao?.horario||0}});var O=(e={})=>{let o=S[e?.premio||"1"].order,r=A[e?.tipo_jogo||"milhar"].order,t={id:e?.id||"",id_integer:e?.id_integer||"",envioIds:e?.envioIds||[],ordemPremioExibicao:o,ordemJogoExibicao:r,numero:e?.numero||"",amount:e?.amount||0,premio:e?.premio||"1",bancaId:e?.bancaId||"",valorArredondado:e?.valorArredondado||0,limiteJogoReal:e?.limiteJogoReal||0,limiteJogoSimulado:e?.limiteJogoSimulado||0,valorJogo:e?.valorJogo||0,amountEnviadoParaAssociacao:e?.amountEnviadoParaAssociacao||0,valorAEnviarParaAssociacao:e?.valorAEnviarParaAssociacao||0,tipo_jogo:e?.tipo_jogo||"milhar",createdBy:g(e?.createdBy),updated:e?.updated||c(m()),created:e?.created||c(m()),descarregado:e?.descarregado??!1,dataAposta:e?.dataAposta||0},a=Q(e);return t={...t,...a["vp_"],...a[w],...a[M]},t};var Er=(e={})=>({name:e?.name||"milhar",numbers:e?.numbers||[],prizes:e?.prizes||[]});var oe=(e={})=>({id:e?.id||"",id_integer:e?.id_integer||"",dataAposta:e?.dataAposta||0,bancaId:e?.bancaId||"",pule:{id:e?.pule?.id||"",id_integer:e?.pule?.id_integer||"",created:e?.pule?.created||0,cancel:{canceled:e?.pule?.cancel?.canceled||!1,canceledAt:e?.pule?.cancel?.canceledAt||0,reason:e?.pule?.cancel?.reason||""},createdBy:{id:e?.pule?.createdBy?.id||"",id_integer:e?.pule?.createdBy?.id_integer||"",role:e?.pule?.createdBy?.role||"cambista",name:e?.pule?.createdBy?.name||"",login:e?.pule?.createdBy?.login||""},creator:{id:e?.pule?.creator?.id||"",id_integer:e?.pule?.creator?.id_integer||"",codigo_cambista:e?.pule?.creator?.codigo_cambista||"",login:e?.pule?.creator?.login||"",name:e?.pule?.creator?.name||"",role:e?.pule?.creator?.role||"cambista",comission:e?.pule?.creator?.comission||0,route:{id:e?.pule?.creator?.route?.id||"",name:e?.pule?.creator?.route?.name||"",tipo:e?.pule?.creator?.route?.tipo||"cambista"}}},premiosItems:e?.premiosItems||[],valorTotalPremio:e?.valorTotalPremio||0,valorTotalPremioBanca:e?.valorTotalPremioBanca||0,valorTotalPremioAssociacao:e?.valorTotalPremioAssociacao||0,createdBy:g(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var $=(e={})=>({id:e?.id||"",id_integer:e?.id_integer||"",dataAposta:e?.dataAposta||0,descargas:e?.descargas||{},link_pdf:e?.link_pdf||"",bancaId:e.bancaId||"",visualizado:e?.visualizado||!1,createdBy:g(e?.createdBy),created:e?.created||0,updated:e?.updated||0});var re=(e={})=>({id:e?.id||"",nome:e?.nome||"",settings:{urlLogo:e?.settings?.urlLogo||"",urlLogoImpressao:e?.settings?.urlLogoImpressao||"",urlBackground:e?.settings?.urlBackground||"",backgroundColor:e?.settings?.backgroundColor||""},endereco:{cep:e?.endereco?.cep||"",logradouro:e?.endereco?.logradouro||"",numero:e?.endereco?.numero||"",bairro:e?.endereco?.bairro||"",cidade:e?.endereco?.cidade||"",estado:e?.endereco?.estado||""},createdBy:g(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var te=(e={})=>({id:e?.id||"",tipo:e?.tipo||"add",message:e?.message||"",colecao:e?.colecao||"",documentId:e?.documentId||"",author:g(e?.author),document:e?.document||{},updated:e?.updated||c(m()),created:e?.created||c(m())});var ae=e=>({id:e?.id||"",id_integer:e?.id_integer||"",type_game:e?.type_game||"milhar",bancaId:e?.bancaId||"",limit:e?.limit??0,createdBy:g(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var ie=e=>({id:e?.id||"",id_integer:e?.id_integer||"",visualizado:e?.visualizado||!1,banca:{id:e?.banca?.id||"",nome:e?.banca?.nome||""},dataAposta:e?.dataAposta||0,extracao:{id:e?.extracao?.id||"",id_integer:e?.extracao?.id_integer||"",description:e?.extracao?.description||"",bloqueio:e?.extracao?.bloqueio||0,horario:e?.extracao?.horario||0},devolvidoPor:{id:e?.devolvidoPor?.id||"",id_integer:e?.devolvidoPor?.id_integer||"",name:e?.devolvidoPor?.name||"",login:e?.devolvidoPor?.login||""},bancaId:e?.bancaId||"",description:e?.description||"",createdBy:g(e?.createdBy),updated:e?.updated||c(m()),created:e?.created||c(m()),status:e?.status||Ne.ENVIANDO.id,totalEnviados:e?.totalEnviados||0,totalRegistros:e?.totalRegistros||0,progresso:e?.progresso||0,mensagem:e?.mensagem||"",concluidoEm:e?.concluidoEm||0,ultimaAtualizacao:e?.ultimaAtualizacao||0,metricas:{tempoMinimo:e?.metricas?.tempoMinimo||0,tempoMaximo:e?.metricas?.tempoMaximo||0,tempoMedio:e?.metricas?.tempoMedio||0,duracaoTotal:e?.metricas?.duracaoTotal||0,tempoEstimado:e?.metricas?.tempoEstimado||0,velocidadeProcessamento:e?.metricas?.velocidadeProcessamento||0,textosFormatados:{duracaoTotalText:e?.metricas?.textosFormatados?.duracaoTotalText||"",tempoMinimoText:e?.metricas?.textosFormatados?.tempoMinimoText||"",tempoMaximoText:e?.metricas?.textosFormatados?.tempoMaximoText||"",tempoMedioText:e?.metricas?.textosFormatados?.tempoMedioText||"",tempoEstimadoText:e?.metricas?.textosFormatados?.tempoEstimadoText||""}},atualizadoEm:e?.atualizadoEm||0,erro:e?.erro||"",iniciadoEm:e?.iniciadoEm||0,user:{id:e?.user?.id||"",id_integer:e?.user?.id_integer||"",name:e?.user?.name||"",login:e?.user?.login||""},valoresJogos:e?.valoresJogos||{},limitesJogos:e?.limitesJogos||{}});var G=(e={})=>{let o=S[e?.premio||"1"].order,r=A[e?.tipo_jogo||"milhar"].order,t={id:e?.id||"",ordemJogoExibicao:r,ordemPremioExibicao:o,numeros:e?.numeros||[],quantidadeDeNumeros:e?.quantidadeDeNumeros||0,bancaId:e?.bancaId||"",amountEnviadoParaAssociacao:e?.amountEnviadoParaAssociacao||0,valorAEnviarParaAssociacao:e?.valorAEnviarParaAssociacao||0,envioId:e?.envioId||"",amount:e?.amount||0,limiteJogoReal:e?.limiteJogoReal||0,limiteJogoSimulado:e?.limiteJogoSimulado||0,valorJogo:e?.valorJogo||0,valorArredondado:e?.valorArredondado||0,dataAposta:e?.dataAposta||0,premio:e?.premio||"1",tipo_jogo:e?.tipo_jogo||"milhar",createdBy:g(e?.createdBy),updated:e?.updated||c(m()),created:e?.created||c(m())},a=Q(e);return t={...t,...a["vp_"],...a[w],...a[M]},t};var se=(e={})=>({id:e?.id||"",userId:e?.userId||"",createdBy:e?.createdBy||g(),created:e?.created||c(m()),updated:e?.updated||c(m()),deviceId:e?.deviceId||"",deviceName:e?.deviceName||"",status:e?.status||"EM_ESPERA",ultimoLogin:e?.ultimoLogin||0,plataforma:e?.plataforma||"mobile",ip:e?.ip||"",versaoApp:e?.versaoApp||""});var ne=(e={})=>({id:e?.id||"",id_integer:e?.id_integer||"",dataAposta:e?.dataAposta||0,bancaId:e?.bancaId||"",numero:e?.numero||"",premio:e?.premio||"",tipo_jogo:e?.tipo_jogo||"milhar",valorPremioAReceber:e?.valorPremioAReceber||0,valorEnviadoParaAssociacao:e?.valorEnviadoParaAssociacao||0,limiteTipoJogo:e?.limiteTipoJogo||0,valorTipoJogo:e?.valorTipoJogo||0,pulesGanhadoras:e?.pulesGanhadoras||{},createdBy:g(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var Pr={mensagens:Y,users:X,valores_jogos:ee,limites_jogos:ae,pules:J,extracoes:K,resultados:Z,rotas:j,envios_descarga:ie,numeros:O,numeros_enviados:O,descargas:G,descargas_associacao:G,premiacoes:oe,premiacoes_associacao:ne,pdf_descargas:$,pdf_descargas_associacao:$,bancas:re,auditLogs:te,dispositivos:se};var We=class{cache=new Map;ttl;maxSize;constructor(o=3e5,r=1e3){this.ttl=o,this.maxSize=r}get(o){let r=this.cache.get(o);return r?Date.now()-r.timestamp>this.ttl?(this.cache.delete(o),null):r.data:null}set(o,r){if(this.cache.size>=this.maxSize){let t=this.cache.keys().next().value;t&&this.cache.delete(t)}this.cache.set(o,{data:r,timestamp:Date.now()})}delete(o){this.cache.delete(o)}clear(){this.cache.clear()}};function v(e,o,r){let{collectionName:t,model:a,idSearchStrategy:n,isolation:s,cache:u,authorization:f,generateId:x}=r,p=u?.enabled?new We(u.ttl,u.maxSize):null,D=l=>{if(!f?.enabled)return;let d=f.getUserRole(),y=f.allowedRoles[l];if(!(!y||y.length===0)){if(!d)throw f.onUnauthorized?.(l,d),new Error(`\u274C N\xE3o autorizado: Opera\xE7\xE3o '${l}' requer autentica\xE7\xE3o na cole\xE7\xE3o '${t}'`);if(!y.includes(d))throw f.onUnauthorized?.(l,d),new Error(`\u274C N\xE3o autorizado: Role '${d}' n\xE3o tem permiss\xE3o para '${l}' na cole\xE7\xE3o '${t}'. Roles permitidas: ${y.join(", ")}`)}},L=()=>{if(!s?.enabled)return[];let l=s.getValue();return l?[{field:s.fieldName,operator:"==",value:l}]:[]},R=l=>{let d=[];L().forEach(({field:E,operator:_,value:C})=>{d.push(o.where(E.toString(),_,C))}),l?.where?.forEach(({field:E,operator:_,value:C})=>{d.push(o.where(E.toString(),_,C))}),l?.orderBy?.forEach(({field:E,direction:_})=>{d.push(o.orderBy(E.toString(),_))}),l?.limit&&d.push(o.limit(l.limit)),l?.startAfter!==void 0&&d.push(o.startAfter(l.startAfter)),l?.startAt!==void 0&&d.push(o.startAt(l.startAt)),l?.endBefore!==void 0&&d.push(o.endBefore(l.endBefore)),l?.endAt!==void 0&&d.push(o.endAt(l.endAt));let T=o.collection(e,t);return o.query(T,...d)},V=async l=>{switch(n.type){case"documentId":return o.doc(e,t,l);case"field":let d=R({where:[{field:n.fieldName,operator:"==",value:l}],limit:1}),y=await o.getDocs(d);if(y.empty)throw new Error(`Document not found with ${String(n.fieldName)}: ${l}`);return y.docs[0].ref;case"custom":return n.resolver(l);default:throw new Error(`Unknown idSearchStrategy: ${n.type}`)}},h=(l,...d)=>{let y=s?.enabled?`_${s.getValue()}`:"";return`${t}${y}_${l}_${JSON.stringify(d)}`};return{get:async l=>{try{if(D("read"),p){let T=h("get",l),E=p.get(T);if(E)return E}let d;if(n.type==="documentId"){let T=o.doc(e,t,l);d=await o.getDoc(T)}else if(n.type==="field"){let T=R({where:[{field:n.fieldName,operator:"==",value:l}],limit:1});d=(await o.getDocs(T)).docs[0]||null}else{let T=await V(l);d=await o.getDoc(T)}if(!d?.exists())return null;let y=a(d.data());if(p){let T=h("get",l);p.set(T,y)}return y}catch(d){return console.error(`Error getting document ${l}:`,d),null}},getAll:async l=>{try{D("read");let d=R(l),y=await o.getDocs(d),T={};return y.forEach(E=>{let _=a(E.data());T[_.id]=_}),T}catch(d){return console.error("Error getting all documents:",d),{}}},listen:(l,d)=>{D("read");let y=R(l);return o.onSnapshot(y,T=>{let E={};T.forEach(_=>{let C=a(_.data());E[C.id]=C}),d(E)})},add:async l=>{try{D("write");let d=l.id||x?.()||o.generateId(),y={...l,id:d};s?.enabled&&s.getValue()&&(y[s.fieldName]=s.getValue());let T=o.doc(e,t,d),E=a(y);return await o.setDoc(T,E),p&&p.delete(h("get",d)),d}catch(d){throw console.error("Error adding document:",d),d}},update:async(l,d)=>{try{D("write");let y=await V(l),T={...d};s?.enabled&&s.getValue()&&(T[s.fieldName]=s.getValue()),await o.updateDoc(y,T),p&&p.delete(h("get",l))}catch(y){throw console.error(`Error updating document ${l}:`,y),y}},remove:async l=>{try{D("delete");let d=await V(l);await o.deleteDoc(d),p&&p.delete(h("get",l))}catch(d){throw console.error(`Error removing document ${l}:`,d),d}},batch:async l=>{try{new Set(l.map(T=>T.operation)).forEach(T=>{D(T==="delete"?"delete":"write")});let y=o.writeBatch(e);for(let{id:T,data:E,operation:_}of l){let C=T||x?.()||o.generateId(),Pe=o.doc(e,t,C),_e={...E,id:C};s?.enabled&&s.getValue()&&(_e[s.fieldName]=s.getValue());let zo=a(_e);switch(_){case"add":o.batchSet(y,Pe,zo);break;case"update":o.batchUpdate(y,Pe,_e);break;case"delete":o.batchDelete(y,Pe);break}}await o.batchCommit(y),p&&p.clear()}catch(d){throw console.error("Error in batch operation:",d),d}},clearCache:()=>p?.clear(),getCacheSize:()=>p?.cache.size||0}}var Vo=e=>{try{return e&&typeof e.getFirestore=="function"||e&&typeof e.collection=="function"&&typeof e.doc=="function"&&typeof e.query=="function"&&typeof e.where=="function"?"v9-modular":e&&typeof e.firestore=="function"||e&&typeof e.collection=="function"&&typeof e.doc=="function"&&typeof e.batch=="function"?"v8":e&&e.initializeApp&&typeof e.initializeApp=="function"?"v9-modular":"unknown"}catch(o){return console.warn("Erro ao detectar vers\xE3o do Firebase:",o),"unknown"}},Uo=e=>({collection:(o,r)=>e.collection(o,r),doc:(o,r,...t)=>e.doc(o,r,...t),query:(o,...r)=>e.query(o,...r),where:(o,r,t)=>e.where(o,r,t),orderBy:(o,r="asc")=>e.orderBy(o,r),limit:o=>e.limit(o),startAfter:(...o)=>e.startAfter(...o),startAt:(...o)=>e.startAt(...o),endBefore:(...o)=>e.endBefore(...o),endAt:(...o)=>e.endAt(...o),getDocs:e.getDocs,getDoc:e.getDoc,setDoc:e.setDoc,updateDoc:e.updateDoc,deleteDoc:e.deleteDoc,writeBatch:e.writeBatch,batchSet:(o,r,t)=>o.set(r,t),batchUpdate:(o,r,t)=>o.update(r,t),batchDelete:(o,r)=>o.delete(r),batchCommit:o=>o.commit(),onSnapshot:e.onSnapshot,generateId:()=>k()}),Ke=()=>({collection:(e,o)=>e.collection(o),doc:(e,o,...r)=>e.collection(o).doc(r.join("/")),query:(e,...o)=>{let r=e;return o.forEach(t=>{t.type==="where"?r=r.where(t.field,t.opStr,t.value):t.type==="orderBy"?r=r.orderBy(t.field,t.direction):t.type==="limit"?r=r.limit(t.limit):t.type==="startAfter"?r=r.startAfter(...t.values):t.type==="startAt"?r=r.startAt(...t.values):t.type==="endBefore"?r=r.endBefore(...t.values):t.type==="endAt"&&(r=r.endAt(...t.values))}),r},where:(e,o,r)=>({type:"where",field:e,opStr:o,value:r}),orderBy:(e,o="asc")=>({type:"orderBy",field:e,direction:o}),limit:e=>({type:"limit",limit:e}),startAfter:(...e)=>({type:"startAfter",values:e}),startAt:(...e)=>({type:"startAt",values:e}),endBefore:(...e)=>({type:"endBefore",values:e}),endAt:(...e)=>({type:"endAt",values:e}),getDocs:e=>e.get(),getDoc:e=>e.get(),setDoc:(e,o,r)=>e.set(o,r),updateDoc:(e,o)=>e.update(o),deleteDoc:e=>e.delete(),writeBatch:e=>e.batch(),batchSet:(e,o,r)=>e.set(o,r),batchUpdate:(e,o,r)=>e.update(o,r),batchDelete:(e,o)=>e.delete(o),batchCommit:e=>e.commit(),onSnapshot:(e,o)=>e.onSnapshot(o),generateId:()=>k()}),Ee=e=>{let o=Vo(e);switch(console.log(`\u{1F525} Firebase version detected: ${o}`),o){case"v9-modular":return Uo(e);case"v8":return Ke();default:return console.warn("\u26A0\uFE0F Firebase version not detected, falling back to v8 adapter"),Ke()}},_r=(e,o,r)=>{let t=Ee(e);return v(o,t,r)},Ye=()=>({collection:(e,o)=>e.collection(o),doc:(e,o,...r)=>e.collection(o).doc(r.join("/")),query:(e,...o)=>{let r=e;return o.forEach(t=>{t.type==="where"?r=r.where(t.field,t.opStr,t.value):t.type==="orderBy"?r=r.orderBy(t.field,t.direction):t.type==="limit"?r=r.limit(t.limit):t.type==="startAfter"?r=r.startAfter(...t.values):t.type==="startAt"?r=r.startAt(...t.values):t.type==="endBefore"?r=r.endBefore(...t.values):t.type==="endAt"&&(r=r.endAt(...t.values))}),r},where:(e,o,r)=>({type:"where",field:e,opStr:o,value:r}),orderBy:(e,o="asc")=>({type:"orderBy",field:e,direction:o}),limit:e=>({type:"limit",limit:e}),startAfter:(...e)=>({type:"startAfter",values:e}),startAt:(...e)=>({type:"startAt",values:e}),endBefore:(...e)=>({type:"endBefore",values:e}),endAt:(...e)=>({type:"endAt",values:e}),getDocs:e=>e.get(),getDoc:e=>e.get(),setDoc:(e,o,r)=>e.set(o,r),updateDoc:(e,o)=>e.update(o),deleteDoc:e=>e.delete(),writeBatch:e=>e.batch(),batchSet:(e,o,r)=>e.set(o,r),batchUpdate:(e,o,r)=>e.update(o,r),batchDelete:(e,o)=>e.delete(o),batchCommit:e=>e.commit(),onSnapshot:(e,o)=>e.onSnapshot(o),generateId:()=>k()});var Sr=(e,o={enabled:!0,ttl:3e5,maxSize:1e3},r)=>{let t=n=>({...n,isolation:e?{enabled:!0,fieldName:"bancaId",getValue:e}:void 0,cache:o,authorization:r?.[n.collectionName]}),a=n=>({...n,cache:o,authorization:r?.[n.collectionName]});return{users_associacao:a({collectionName:"users",model:X,idSearchStrategy:{type:"documentId"}}),users:t({collectionName:"users",model:X,idSearchStrategy:{type:"documentId"}}),bancas:a({collectionName:"bancas",model:re,idSearchStrategy:{type:"documentId"}}),extracoes:t({collectionName:"extracoes",model:K,idSearchStrategy:{type:"documentId"}}),resultados:t({collectionName:"resultados",model:Z,idSearchStrategy:{type:"documentId"}}),mensagens:t({collectionName:"mensagens",model:Y,idSearchStrategy:{type:"documentId"}}),rotas:t({collectionName:"rotas",model:j,idSearchStrategy:{type:"documentId"}}),valores_jogos:t({collectionName:"valores_jogos",model:ee,idSearchStrategy:{type:"documentId"}}),limites_jogos:t({collectionName:"limites_jogos",model:ae,idSearchStrategy:{type:"documentId"}}),pules:t({collectionName:"pules",model:J,idSearchStrategy:{type:"documentId"}}),numeros:t({collectionName:"numeros",model:O,idSearchStrategy:{type:"documentId"}}),numeros_enviados:t({collectionName:"numeros_enviados",model:O,idSearchStrategy:{type:"documentId"}}),descargas:t({collectionName:"descargas",model:G,idSearchStrategy:{type:"documentId"}}),descargas_associacao:t({collectionName:"descargas_associacao",model:G,idSearchStrategy:{type:"documentId"}}),premiacoes:t({collectionName:"premiacoes",model:oe,idSearchStrategy:{type:"documentId"}}),premiacoes_associacao:t({collectionName:"premiacoes_associacao",model:ne,idSearchStrategy:{type:"documentId"}}),pdf_descargas:t({collectionName:"pdf_descargas",model:$,idSearchStrategy:{type:"documentId"}}),pdf_descargas_associacao:t({collectionName:"pdf_descargas_associacao",model:$,idSearchStrategy:{type:"documentId"}}),auditLogs:t({collectionName:"auditLogs",model:te,idSearchStrategy:{type:"documentId"}}),envios_descarga:t({collectionName:"envios_descarga",model:ie,idSearchStrategy:{type:"documentId"}}),dispositivos:t({collectionName:"dispositivos",model:se,idSearchStrategy:{type:"documentId"}})}};function Ze(e){let{db:o,adapter:r,getBancaId:t,cacheConfig:a,authorizationConfigs:n}=e,s=Sr(t,a,n);return{users_associacao:v(o,r,s.users_associacao),users:v(o,r,s.users),bancas:v(o,r,s.bancas),extracoes:v(o,r,s.extracoes),resultados:v(o,r,s.resultados),mensagens:v(o,r,s.mensagens),rotas:v(o,r,s.rotas),valores_jogos:v(o,r,s.valores_jogos),limites_jogos:v(o,r,s.limites_jogos),pules:v(o,r,s.pules),numeros:v(o,r,s.numeros),numeros_enviados:v(o,r,s.numeros_enviados),descargas:v(o,r,s.descargas),descargas_associacao:v(o,r,s.descargas_associacao),premiacoes:v(o,r,s.premiacoes),premiacoes_associacao:v(o,r,s.premiacoes_associacao),pdf_descargas:v(o,r,s.pdf_descargas),pdf_descargas_associacao:v(o,r,s.pdf_descargas_associacao),auditLogs:v(o,r,s.auditLogs),envios_descarga:v(o,r,s.envios_descarga),dispositivos:v(o,r,s.dispositivos)}}function Nr(e){return Ze({...e,adapter:Ee(e.firebaseInstance)})}function Rr(e){return Ze({...e,adapter:Ye()})}export{te as AuditLogModel,re as BancaModel,Er as BetModel,G as DescargaModel,se as DeviceModel,$o as EXTRACAO,ie as EnvioDescargaModel,K as ExtracaoModel,A as GAMES,ko as GRUPOS_BICHOS,J as GameModel,Wo as KEYBOARD,ae as LimitGameModel,Ho as MESSAGES,Y as MessageModel,O as NumberModel,$ as PDFModel,w as PREFIX_ENVIO,M as PREFIX_ENVIO_OLD,P as PREFIX_NUMBER,S as PREMIOS,ne as PremiacaoAssociacaoModel,oe as PremiacaoModel,qo as ROLES,Z as ResultadoModel,j as RouteModel,Ne as STATUS_DESCARGA,Ko as STATUS_DEVICE,Se as STATUS_PULE,Qo as TIPO_VISUALIZACAO,X as UserModel,Xo as VISUALIZACAO,ee as ValueGameModel,z as arredondarParaCima,ge as calculaValoresDosNumeros,pe as calcularValorDeNumero,Eo as calcularValorJogoPeloLimite,Ae as calculateAmount,ve as calculateAmountGame,N as clone,Pr as collections,je as combineDateTime,_r as createAutoRepo,v as createGenericRepo,Ye as createReactNativeAdapter,Rr as createReactNativeRepoFactory,Ze as createRepoFactory,Ke as createV8Adapter,Uo as createV9ModularAdapter,Ee as createWebAdapter,Nr as createWebRepoFactory,c as dateToNumber,mo as delay,Vo as detectFirebaseVersion,co as dividirArray,Oo as extracaoEstaAtivaBoolean,be as extracaoEstaAtivaTryCatch,No as fazerJogo,_o as formatPuleId,B as formatarNumero,ao as formatterBRL,uo as formatterPercentage,fo as formatterPercentageDecimal,q as functionsCore,Ce as generateDescargas,k as generateId,ho as gerarDezenas,ce as getAllCombinations,Mo as getAvailableTimes,F as getBetDateToNumber,me as getCodigoAuth,g as getCreatedBySystem,to as getDataInicioFim,So as getFormattedPuleId,Ro as getGamesUnicosList,Io as getGamesUnicosObjeto,po as getInitials,he as getLimiteJogoPeloTipoJogo,Po as getLimiteSimulado,wo as getLimitsRest,de as getNumeroId,vo as getNumerosAcimaDoLimite,Fo as getPermission,ue as getPremioFormato,fe as getPropsEnvioId,ye as getPropsEnvioIdOld,Q as getPropsPrefix,Te as getPropsVP,le as getSomaEnvio,bo as getSomaProps,xo as getSomaVP,H as getTiposJogos,xe as getValorJogoPeloTipoJogo,De as invertGame,Le as isAdm,ze as isAdmOrSubAdm,Ve as isAssociacao,$e as isCambista,Je as isCambistaTalao,He as isDigitador,ke as isDigitadorAdm,qe as isDigitadorOrDigitadorAdm,Ue as isSuperAdm,lo as matchNormalized,W as normalize,b as numberToDate,no as numbersSelectedFormated,io as parserBRL,go as parserPercentage,yo as parserPercentageDecimal,Bo as pegarExtracoes,m as pegarHorarioSaoPaulo,To as removerLetters,I as showFormatDate,Do as sortNumeros};
|
|
1
|
+
var ko=Object.defineProperty;var z=(e,o)=>{for(var r in o)ko(e,r,{get:o[r],enumerable:!0})};var qo=[13,16,19];var u={milhar:{id:"milhar",label:"Milhar",sigla:"M",format:"####",formatDigitar:"####",markAll:!1,max:0,order:1,showPerLine:6},centena:{id:"centena",label:"Centena",sigla:"C",format:"###",formatDigitar:"###",markAll:!1,max:0,order:2,showPerLine:7},dezena:{id:"dezena",label:"Dezena",sigla:"D",format:"##",formatDigitar:"##",markAll:!1,max:0,order:3,showPerLine:0},grupo:{id:"grupo",label:"Grupo",sigla:"G",max:25,format:"##",formatDigitar:"##",markAll:!1,order:4,showPerLine:0},"terno.dezena":{id:"terno.dezena",label:"Terno de Dezena",sigla:"TD",format:"##-##-##",formatDigitar:"######",markAll:!0,max:0,order:5,showPerLine:3},"terno.grupo":{id:"terno.grupo",label:"Terno de Grupo",sigla:"TG",max:25,format:"##-##-##",formatDigitar:"######",markAll:!0,order:6,showPerLine:3},"duque.dezena":{id:"duque.dezena",label:"Duque de Dezena",sigla:"DD",format:"##-##",formatDigitar:"####",markAll:!0,max:0,order:7,showPerLine:5},"duque.grupo":{id:"duque.grupo",label:"Duque de Grupo",sigla:"DG",max:25,format:"##-##",formatDigitar:"####",markAll:!0,order:8,showPerLine:5},"milhar.invertida":{id:"milhar.invertida",label:"Milhar Invertida",sigla:"MI",format:"####",formatDigitar:"####",markAll:!1,max:0,order:0,showPerLine:6},"centena.invertida":{id:"centena.invertida",label:"Centena Invertida",sigla:"CI",format:"###",formatDigitar:"###",markAll:!1,max:0,order:0,showPerLine:7},"milhar@centena":{id:"milhar@centena",label:"Milhar Centena",sigla:"MC",format:"####",formatDigitar:"####",markAll:!1,max:0,order:0,showPerLine:6},"milhar.invertida@centena.invertida":{id:"milhar.invertida@centena.invertida",label:"Milhar e Centena Invertidas",sigla:"MCI",format:"####",formatDigitar:"####",markAll:!1,max:0,order:0,showPerLine:6},"milhar@dezena":{id:"milhar@dezena",label:"Milhar e Dezena",sigla:"MD",format:"####",formatDigitar:"####",markAll:!1,max:0,order:0,showPerLine:6},"milhar@centena@dezena":{id:"milhar@centena@dezena",label:"Milhar, Centena e Dezena",sigla:"MCD",format:"####",formatDigitar:"####",markAll:!1,max:0,order:0,showPerLine:6},"centena@dezena":{id:"centena@dezena",label:"Centena Dezena",sigla:"CD",format:"###",formatDigitar:"###",markAll:!1,max:0,order:0,showPerLine:7}};var i={"01":"Avestruz","02":"\xC1guia","03":"Burro","04":"Borboleta","05":"Cachorro","06":"Cabra","07":"Carneiro","08":"Camelo","09":"Cobra",10:"Coelho",11:"Cavalo",12:"Elefante",13:"Galo",14:"Gato",15:"Jacar\xE9",16:"Le\xE3o",17:"Macaco",18:"Porco",19:"Pav\xE3o",20:"Peru",21:"Touro",22:"Tigre",23:"Urso",24:"Veado",25:"Vaca"},Ho={"01":{grupo:"01",bicho:i["01"]},"02":{grupo:"01",bicho:i["01"]},"03":{grupo:"01",bicho:i["01"]},"04":{grupo:"01",bicho:i["01"]},"05":{grupo:"02",bicho:i["02"]},"06":{grupo:"02",bicho:i["02"]},"07":{grupo:"02",bicho:i["02"]},"08":{grupo:"02",bicho:i["02"]},"09":{grupo:"03",bicho:i["03"]},10:{grupo:"03",bicho:i["03"]},11:{grupo:"03",bicho:i["03"]},12:{grupo:"03",bicho:i["03"]},13:{grupo:"04",bicho:i["04"]},14:{grupo:"04",bicho:i["04"]},15:{grupo:"04",bicho:i["04"]},16:{grupo:"04",bicho:i["04"]},17:{grupo:"05",bicho:i["05"]},18:{grupo:"05",bicho:i["05"]},19:{grupo:"05",bicho:i["05"]},20:{grupo:"05",bicho:i["05"]},21:{grupo:"06",bicho:i["06"]},22:{grupo:"06",bicho:i["06"]},23:{grupo:"06",bicho:i["06"]},24:{grupo:"06",bicho:i["06"]},25:{grupo:"07",bicho:i["07"]},26:{grupo:"07",bicho:i["07"]},27:{grupo:"07",bicho:i["07"]},28:{grupo:"07",bicho:i["07"]},29:{grupo:"08",bicho:i["08"]},30:{grupo:"08",bicho:i["08"]},31:{grupo:"08",bicho:i["08"]},32:{grupo:"08",bicho:i["08"]},33:{grupo:"09",bicho:i["09"]},34:{grupo:"09",bicho:i["09"]},35:{grupo:"09",bicho:i["09"]},36:{grupo:"09",bicho:i["09"]},37:{grupo:"10",bicho:i[10]},38:{grupo:"10",bicho:i[10]},39:{grupo:"10",bicho:i[10]},40:{grupo:"10",bicho:i[10]},41:{grupo:"11",bicho:i[11]},42:{grupo:"11",bicho:i[11]},43:{grupo:"11",bicho:i[11]},44:{grupo:"11",bicho:i[11]},45:{grupo:"12",bicho:i[12]},46:{grupo:"12",bicho:i[12]},47:{grupo:"12",bicho:i[12]},48:{grupo:"12",bicho:i[12]},49:{grupo:"13",bicho:i[13]},50:{grupo:"13",bicho:i[13]},51:{grupo:"13",bicho:i[13]},52:{grupo:"13",bicho:i[13]},53:{grupo:"14",bicho:i[14]},54:{grupo:"14",bicho:i[14]},55:{grupo:"14",bicho:i[14]},56:{grupo:"14",bicho:i[14]},57:{grupo:"15",bicho:i[15]},58:{grupo:"15",bicho:i[15]},59:{grupo:"15",bicho:i[15]},60:{grupo:"15",bicho:i[15]},61:{grupo:"16",bicho:i[16]},62:{grupo:"16",bicho:i[16]},63:{grupo:"16",bicho:i[16]},64:{grupo:"16",bicho:i[16]},65:{grupo:"17",bicho:i[17]},66:{grupo:"17",bicho:i[17]},67:{grupo:"17",bicho:i[17]},68:{grupo:"17",bicho:i[17]},69:{grupo:"18",bicho:i[18]},70:{grupo:"18",bicho:i[18]},71:{grupo:"18",bicho:i[18]},72:{grupo:"18",bicho:i[18]},73:{grupo:"19",bicho:i[19]},74:{grupo:"19",bicho:i[19]},75:{grupo:"19",bicho:i[19]},76:{grupo:"19",bicho:i[19]},77:{grupo:"20",bicho:i[20]},78:{grupo:"20",bicho:i[20]},79:{grupo:"20",bicho:i[20]},80:{grupo:"20",bicho:i[20]},81:{grupo:"21",bicho:i[21]},82:{grupo:"21",bicho:i[21]},83:{grupo:"21",bicho:i[21]},84:{grupo:"21",bicho:i[21]},85:{grupo:"22",bicho:i[22]},86:{grupo:"22",bicho:i[22]},87:{grupo:"22",bicho:i[22]},88:{grupo:"22",bicho:i[22]},89:{grupo:"23",bicho:i[23]},90:{grupo:"23",bicho:i[23]},91:{grupo:"23",bicho:i[23]},92:{grupo:"23",bicho:i[23]},93:{grupo:"24",bicho:i[24]},94:{grupo:"24",bicho:i[24]},95:{grupo:"24",bicho:i[24]},96:{grupo:"24",bicho:i[24]},97:{grupo:"25",bicho:i[25]},98:{grupo:"25",bicho:i[25]},99:{grupo:"25",bicho:i[25]},"00":{grupo:"25",bicho:i[25]}};var Qo={required:"Obrigat\xF3rio.",list_length_zero:"Selecione pelo menos um item.",incorrect_login:"Usu\xE1rio e/ou senha incorretos!",incorrect_password:"Senha incorreta.",email_already_in_use:"Este login j\xE1 est\xE1 sendo usado!",invalid_device:"Este login j\xE1 est\xE1 sendo usado em outro dispositivo!"};var Xo={super_admin:{id:"super_admin",label:"Super Administrador"},associacao:{id:"associacao",label:"Associa\xE7\xE3o"},admin:{id:"admin",label:"Administrador"},sub_admin:{id:"sub_admin",label:"Sub-administrador"},digitador_adm:{id:"digitador_adm",label:"Digitador Administrador"},digitador:{id:"digitador",label:"Digitador"},cambista_talao:{id:"cambista_talao",label:"Cambista de tal\xE3o"},cambista:{id:"cambista",label:"Cambista"}};var Pe={PROCESSANDO:{id:"PROCESSANDO",label:"PROCESSANDO",color:"green",showSite:!1,ordem:0},JOGADA:{id:"JOGADA",label:"PULES JOGADAS",color:"green",showSite:!0,ordem:1},AGUARDANDO_CANCELAMENTO:{id:"AGUARDANDO_CANCELAMENTO",label:"AGUARDANDO CANCELAMENTO",color:"yellow",showSite:!0,ordem:3},CANCELADA:{id:"CANCELADA",label:"CANCELADAS",color:"red",showSite:!0,ordem:4}};var Wo={notificacao:{id:"notificacao",label:"Notifica\xE7\xE3o"},impressao:{id:"impressao",label:"Impress\xE3o"}};var Ko={agora:{id:"agora",label:"Agora"},jogo_hoje:{id:"jogo_hoje",label:"Jogo Hoje"},jogo_pre_datado:{id:"jogo_pre_datado",label:"Jogo Pr\xE9-Datado"},resultado:{id:"resultado",label:"Resultado"}};var S="vp_";var C="envio_old_";var L="envio_";var Ne={ENVIANDO:{id:"ENVIANDO",labelBanca:"ENVIANDO",labelAssociacao:"RECEBENDO",color:"blue",showSite:!1,order:1},DEVOLVENDO:{id:"DEVOLVENDO",labelBanca:"RECEBENDO",labelAssociacao:"DEVOLVENDO",color:"blue",showSite:!1,order:1},ENVIADA:{id:"ENVIADA",labelBanca:"ENVIADA",labelAssociacao:"RECEBIDA",color:"green",showSite:!0,order:2},DEVOLVIDA:{id:"DEVOLVIDA",labelBanca:"DEVOLVIDA",labelAssociacao:"DEVOLVIDA",color:"orange",showSite:!0,order:3},ERRO:{id:"ERRO",labelBanca:"ERRO",labelAssociacao:"ERRO",color:"red",showSite:!1,order:4}};var Yo={Enter:{label:"Enter",value:"enter"},Ctrl:{label:"Ctrl",value:"ctrl"},Tab:{label:"Tab",value:"tab"},Space:{label:"\u23B5",value:"space"},Backspace:{label:"Backspace",value:"backspace"},Escape:{label:"Esc",value:"escape"},Delete:{label:"Del",value:"delete"},Backslash:{label:"\\",value:"backslash"},Semicolon:{label:";",value:"semicolon"},CapsLock:{label:"CapsLock",value:"capslock"},Quote:{label:"'",value:"quote"},Comma:{label:",",value:"decimal,comma"},Insert:{label:"Insert",value:"insert"},Home:{label:"Home",value:"home"},End:{label:"End",value:"end"},PageUp:{label:"Page Up",value:"pageup"},PageDown:{label:"Page Down",value:"pagedown"},ArrowUp:{label:"\u2191",value:"arrowup"},ArrowDown:{label:"\u2193",value:"arrowdown"},ArrowLeft:{label:"\u2190",value:"arrowleft"},ArrowRight:{label:"\u2192",value:"arrowright"},NumLock:{label:"Num Lock",value:"numlock"},Dot:{label:".",value:"period,comma"},Divide:{label:"/",value:"slash,divide"},Subtract:{label:"-",value:"minus,subtract"},Multiply:{label:"*",value:"multiply,shift+8"},Add:{label:"+",value:"add,shift+equal"},Equal:{id:"Equal",label:"=",value:"equal"},F1:{label:"F1",value:"f1"},F2:{label:"F2",value:"f2"},F3:{label:"F3",value:"f3"},F4:{label:"F4",value:"f4"},F5:{label:"F5",value:"f5"},F6:{label:"F6",value:"f6"},F7:{label:"F7",value:"f7"},F8:{label:"F8",value:"f8"},F9:{label:"F9",value:"f9"},F10:{label:"F10",value:"f10"},F11:{label:"F11",value:"f11"},F12:{label:"F12",value:"f12"},0:{label:"0",value:"0"},1:{label:"1",value:"1"},2:{label:"2",value:"2"},3:{label:"3",value:"3"},4:{label:"4",value:"4"},5:{label:"5",value:"5"},6:{label:"6",value:"6"},7:{label:"7",value:"7"},8:{label:"8",value:"8"},9:{label:"9",value:"9"},A:{label:"A",value:"a"},B:{label:"B",value:"b"},C:{label:"C",value:"c"},D:{label:"D",value:"d"},E:{label:"E",value:"e"},F:{label:"F",value:"f"},G:{label:"G",value:"g"},H:{label:"H",value:"h"},I:{label:"I",value:"i"},J:{label:"J",value:"j"},K:{label:"K",value:"k"},L:{label:"L",value:"l"},M:{label:"M",value:"m"},N:{label:"N",value:"n"},O:{label:"O",value:"o"},P:{label:"P",value:"p"},Q:{label:"Q",value:"q"},R:{label:"R",value:"r"},S:{label:"S",value:"s"},T:{label:"T",value:"t"},U:{label:"U",value:"u"},V:{label:"V",value:"v"},W:{label:"W",value:"w"},X:{label:"X",value:"x"},Y:{label:"Y",value:"y"},Z:{label:"Z",value:"z"}};var Zo={EM_ESPERA:{id:"EM_ESPERA",label:"Esperando aprova\xE7\xE3o",color:"orange"},APROVADO:{id:"APROVADO",label:"Aprovado",color:"green"},BLOQUEADO:{id:"BLOQUEADO",label:"Bloqueado",color:"red"}};var P={1:{id:"1",order:1,label:"1\xBA Pr\xEAmio",labelShort:"1\xBA"},2:{id:"2",order:2,label:"2\xBA Pr\xEAmio",labelShort:"2\xBA"},3:{id:"3",order:3,label:"3\xBA Pr\xEAmio",labelShort:"3\xBA"},4:{id:"4",order:4,label:"4\xBA Pr\xEAmio",labelShort:"4\xBA"},5:{id:"5",order:5,label:"5\xBA Pr\xEAmio",labelShort:"5\xBA"},"1-5":{id:"1-5",order:6,label:"1\xBA ao 5\xBA Pr\xEAmio",labelShort:"1\xBA ao 5\xBA"}};var Re={[u.milhar.id]:{id:u.milhar.id,label:u.milhar.label,order:1},[u.centena.id]:{id:u.centena.id,label:u.centena.label,order:2},[u.dezena.id]:{id:u.dezena.id,label:u.dezena.label,order:3},[u.grupo.id]:{id:u.grupo.id,label:u.grupo.label,order:4},[u["terno.dezena"].id]:{id:u["terno.dezena"].id,label:u["terno.dezena"].label,order:5},[u["terno.grupo"].id]:{id:u["terno.grupo"].id,label:u["terno.grupo"].label,order:6},[u["duque.dezena"].id]:{id:u["duque.dezena"].id,label:u["duque.dezena"].label,order:7},[u["duque.grupo"].id]:{id:u["duque.grupo"].id,label:u["duque.grupo"].label,order:8},restante:{id:"restante",label:"Restante",order:9}};var y=e=>({id:e?.id||"system",id_integer:e?.id_integer||"system",role:e?.role||"super_admin",name:e?.name||"Gerado automaticamente pelo sistema",login:e?.login||"system"});var Ie={};z(Ie,{clone:()=>N,combineDateTime:()=>eo,dateToNumber:()=>c,delay:()=>lo,dividirArray:()=>mo,formatterBRL:()=>io,formatterPercentage:()=>go,formatterPercentageDecimal:()=>yo,generateId:()=>k,getAllCombinations:()=>ce,getCodigoAuth:()=>me,getDataInicioFim:()=>ao,getInitials:()=>uo,matchNormalized:()=>po,normalize:()=>W,numberToDate:()=>b,numbersSelectedFormated:()=>co,parserBRL:()=>so,parserPercentage:()=>fo,parserPercentageDecimal:()=>To,pegarHorarioSaoPaulo:()=>m,removerLetters:()=>ho,showFormatDate:()=>I});import jo from"clone-deep";var N=e=>jo(e);import{isValid as er}from"date-fns";var c=e=>{if(!e||!er(e))return 0;let o=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),t=String(e.getDate()).padStart(2,"0"),a=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),s=String(e.getSeconds()).padStart(2,"0");return+`${o}${r}${t}${a}${n}${s}`};import{parse as rr,isValid as tr}from"date-fns";import or from"moment-timezone";var m=()=>{let e=or.tz(new Date,"America/Sao_Paulo").format("DD_MM_YYYY_HH_mm_ss_SSS"),[o,r,t,a,n,s,f]=e.split("_");return new Date(Number(t),Number(r)-1,Number(o),Number(a),Number(n),Number(s),Number(f))};var b=e=>{if(!e)return;let o=e.toString(),r=o.slice(0,4),t=o.slice(4,6),a=o.slice(6,8),n=o.slice(8,10),s=o.slice(10,12),f=o.slice(12,14),g=`${r}-${t}-${a} ${n}:${s}:${f}`,h=m(),d=rr(g,"yyyy-MM-dd HH:mm:ss",h);return tr(d)?d:void 0};var eo=(e,o)=>{let r=b(e),t=b(o);if(!r||!t)return 0;let a=r.getFullYear(),n=r.getMonth(),s=r.getDate(),f=t.getHours(),g=t.getMinutes(),h=t.getSeconds(),d=new Date(a,n,s,f,g,h,0);return c(d)};import{setHours as oo,setMinutes as ro,setSeconds as to}from"date-fns";var ao=({dataAposta:e})=>{let o=to(ro(oo(b(e)||m(),0),0),0),r=to(ro(oo(b(e)||m(),23),59),59);return{dataInicio:c(o),dataFim:c(r)}};var io=e=>{let o=e;return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(o||0)},so=e=>{let o=e;o=o.replace(/\D/g,"");let r=parseFloat(o||"0");return r/=100,r};var no=e=>{if(e.length===0)return[[]];let o=new Set;for(let r=0;r<e.length;r++){let t=e[r],a=[...e.slice(0,r),...e.slice(r+1)],n=no(a);for(let s of n)o.add([t,...s])}return Array.from(o)},ce=e=>{let o=e.toString().split(""),r=no(o),t=new Set(r.map(a=>a.join("")));return Array.from(t)};import{format as ar}from"date-fns";var I=(e,o)=>{if(!e)return"N/A";let r=b(e);return r?ar(r,o||"dd/MM/yyyy"):"N/A"};var co=e=>{let o=e.map(Number);if(o.length===0)return"";o.sort((n,s)=>n-s);let r="",t=o[0],a=t;for(let n=1;n<=o.length;n++)n<o.length&&o[n]===a+1?a=o[n]:(t===a?r+=t:r+=`${t} ao ${a}`,n<o.length&&(r+=", ",t=o[n],a=t));return r};var k=e=>{let o=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);return`${e?`${e}-`:""}${o()+o()}-${o()}-${o()}-${o()}-${o()}${o()}${o()}`};var me=(e,o)=>(e=Math.ceil(e),o=Math.floor(o),Math.floor(Math.random()*(o-e+1))+e);var mo=(e,o=1e3)=>{let r=[];for(let t=0;t<e.length;t+=o){let a=e.slice(t,t+o);r.push(a)}return r};var lo=e=>new Promise(o=>setTimeout(o,e));var W=e=>e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"");var po=(e,o)=>W(e).includes(W(o));var uo=e=>e?e.trim().split(/\s+/).filter(t=>t.length>=2).slice(0,2).map(t=>t[0].toUpperCase()).join(""):"";var go=e=>`${new Intl.NumberFormat("pt-BR",{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0}).format(e||0)} %`;var fo=(e,o)=>(e=e.replace(/\D/g,""),o=o?.replace(/\D/g,""),o?(Number(o)===Number(e)&&(o=o.slice(0,-1)),Number(Number(o||"0").toFixed(2))):Number(Number(e||"0").toFixed(2)));var yo=e=>(e*=100,`${new Intl.NumberFormat("pt-BR",{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0}).format(e||0)} %`),To=(e,o)=>(e=e.replace(/\D/g,""),o=o?.replace(/\D/g,""),o?(Number(o)===Number(e)&&(o=o.slice(0,-1)),Number(Number(o||"0").toFixed(2))/100):Number(Number(e||"0").toFixed(2))/100);var ho=e=>e.replace(/[^0-9]/g,"");var K=e=>({id:e?.id||"",id_integer:e?.id_integer||"",horario:e?.horario||0,bloqueio:e?.bloqueio||0,bancaId:e?.bancaId||"",ativo:e?.ativo??!0,inativo_no_dia:e?.inativo_no_dia||[],description:e?.description||"",somente_no_feriado:e?.somente_no_feriado||0,createdBy:y(e?.createdBy),updated:e?.updated||c(m()),created:e?.created||c(m()),days:{0:e?.days?.[0]??!1,1:e?.days?.[1]??!1,2:e?.days?.[2]??!1,3:e?.days?.[3]??!1,4:e?.days?.[4]??!1,5:e?.days?.[5]??!1,6:e?.days?.[6]??!1}});var Ge={};z(Ge,{arredondarParaCima:()=>U,calculaValoresDosNumeros:()=>ge,calcularValorDeNumero:()=>pe,formatarNumero:()=>B,generateDescargas:()=>Be,gerarDezenas:()=>xo,getCreatedBySystem:()=>y,getLimiteSimulado:()=>_o,getNumeroId:()=>de,getNumerosAcimaDoLimite:()=>Do,getPremioFormato:()=>ue,getPropsEnvioId:()=>fe,getPropsEnvioIdOld:()=>ye,getPropsPrefix:()=>Q,getPropsVP:()=>Te,getSomaEnvio:()=>le,getSomaProps:()=>Eo,getSomaVP:()=>Ao,getTiposJogos:()=>q,sortNumeros:()=>bo});var B=(e,o)=>{let r="",t=e.length-1,a=o.length-1;for(;a>=0;)o[a]==="#"?(r=e[t]+r,t--):o[a]==="-"&&(r="-"+r),a--;return r};var Ce=(e,o)=>{let r=o,t=e?.envioIds?.length>0?e.envioIds[e.envioIds.length-1]:"";return O({...e,id:r,premio:e.premio,amount:e.amount,numeros:[e.numero],amountEnviadoParaAssociacao:e.amountEnviadoParaAssociacao,valorAEnviarParaAssociacao:e.valorAEnviarParaAssociacao,envioId:t,dataAposta:e.dataAposta,bancaId:e.bancaId,valorArredondado:e.valorArredondado,limiteJogoReal:e.limiteJogoReal,limiteJogoSimulado:e.limiteJogoSimulado,valorJogo:e.valorJogo})};var Me=(e,o)=>{let r=o?U(Number(e[o])):U(e.amount);return`${e?.bancaId?`${e?.bancaId}_`:""}${e.dataAposta}_${e.tipo_jogo}_${e.premio}_${r}`};var Be=(e,o)=>{let r={};return Object.entries(e).forEach(([,t])=>{let a=Me(t,o);r[a]?r[a].numeros.push(t.numero):r[a]=Ce(t,a)}),r};var xo=e=>{let o=[];e.forEach(a=>{let n=u[a.name];a.numbers.forEach(s=>{if(n.id==="dezena"){let h=s.split("-");for(let d of h){if(d.length<n.format.length)continue;let D=B(d,n.format);o.push(D)}return}let f=s.replaceAll("-","");if(f.length<n.format.replaceAll("-","").length)return;let g=B(f,n.format);o.push(g)})});let r=new Set(o);return Array.from(r)};var le=e=>{let o=0;return Object.entries(e).forEach(([r,t])=>{let a=r.split("_");a.includes("envio")&&!a.includes("old")&&typeof t=="number"&&(o+=t)}),o};var Ao=e=>{let o=0,r=0;Object.entries(e).forEach(([a,n])=>{a.startsWith("vp_")&&typeof n=="number"&&(o+=n,n>0&&(r+=1))});let t=le(e);return o-=t,{soma:o,quantidadeDePulesMaiorQueZero:r,somaEnviadoParaAssociacao:t}};var de=e=>{let{dataAposta:o,jogo:r,numero:t,bancaId:a,premio:n,descarregado:s}=e,f=u[r],g=f.markAll?t:B(t,f.format),h=s?"true":"false";return(a?`${a}_`:"")+`${o}_${r}_${n}_${g}_${h}`};var q=e=>e.replaceAll(".invertida","").split("@");var pe=({quantidadeDeNumeros:e,tipoJogo:o,valorPremio:r,quantidadeDePremios:t})=>{let a=u[o],n=q(o),s=r/(n.length||1);return s/=e,a.markAll||(s/=t||1),t===0&&(s=0),s};var ue=e=>e===1?P[1].id:e===2?P[2].id:e===3?P[3].id:e===4?P[4].id:e===5?P[5].id:P["1-5"].id;var ge=e=>{let o={},r=m(),t=c(r);for(let a of e.bets){let n=q(a.name),s=a.numbers.length;for(let f of n)for(let g of a.numbers)for(let h of a.prizes)for(let d of h.prizes){let D=u[f],w=pe({valorPremio:h.value,tipoJogo:a.name,quantidadeDeNumeros:s,quantidadeDePremios:h.prizes.length}),R=ue(d),V=g;D.markAll?R="1-5":V=B(g,D.format);let A=de({numero:g,bancaId:e.bancaId,dataAposta:e.dateBet,jogo:f,premio:R});o?.[A]||(o[A]=G({id:A,numero:V,premio:R,created:t,bancaId:e.bancaId,amount:0,dataAposta:e.dateBet,tipo_jogo:f,[`${"vp_"}${e.id}`]:0})),D.markAll?o[A][`${"vp_"}${e.id}`]=Number(w.toFixed(3)):o[A][`${"vp_"}${e.id}`]+=Number(w.toFixed(3))}}return{numeros:o}};var vo=2,Do=(e,o,r)=>e.map(t=>{let a=H.limite_jogos.getValorJogoPeloTipoJogo(o,t.tipo_jogo),n=Object.values(r).find(d=>d.type_game===t.tipo_jogo),s=H.limite_jogos.calcularValorJogoPeloLimite(n?.limit||0,a?.value||0),f=Number(t.amount.toFixed(vo)),g=Number(s.toFixed(vo)),h=f-g;return f>g?{numero:t,diferenca:h}:null}).filter(Boolean);var U=e=>{let o=Math.round(e*100),r=o%5;return r!==0&&(o+=5-r),o/100};var bo=e=>{let o=Object.values(e).sort((r,t)=>{let a=u[r.tipo_jogo].order,n=u[t.tipo_jogo].order;return a<n?-1:a>n?1:r.premio<t.premio?-1:r.premio>t.premio?1:r.amount>t.amount?-1:1});return Object.fromEntries(o.map(r=>[r.id,r]))};var fe=e=>{let o={};return Object.entries(e).forEach(([r,t])=>{let a=r.split("_");a.includes("envio")&&!a.includes("old")&&typeof t=="number"&&(o[r]=t)}),o};var ye=e=>{let o={};return Object.entries(e).forEach(([r,t])=>{let a=r.split("_");a.includes("envio")&&a.includes("old")&&typeof t=="number"&&(o[r]=t)}),o};var Te=e=>{let o={};return Object.entries(e).forEach(([r,t])=>{r.startsWith("vp_")&&typeof t=="number"&&(o[r]=t)}),o};var Q=e=>{let o={vp_:{},[L]:{},[C]:{}},r=N(Te(e)),t=N(fe(e)),a=N(ye(e));return o["vp_"]=N(r),o[L]=N(t),o[C]=N(a),o};var Eo=e=>{let o=0;return Object.values(e).forEach(r=>{o+=r}),o};var he=(e,o)=>Object.values(e).find(r=>r.type_game===o);var Oe={};z(Oe,{calcularValorJogoPeloLimite:()=>So,getLimiteJogoPeloTipoJogo:()=>he,getValorJogoPeloTipoJogo:()=>xe});var So=(e,o)=>e/(o||1);var xe=(e,o)=>Object.values(e).find(r=>r.type_game===o);var _o=(e,o,r)=>{let t=xe(o,e);return(he(r,e)?.limit||0)/(t?.value||1)};var we={};z(we,{extracaoEstaAtivaBoolean:()=>Fo,extracaoEstaAtivaTryCatch:()=>be,getAvailableTimes:()=>Mo,pegarExtracoes:()=>Oo});import{format as Le,getDay as cr}from"date-fns";var Fe={};z(Fe,{calculateAmount:()=>Ae,calculateAmountGame:()=>ve,fazerJogo:()=>Ro,formatPuleId:()=>Po,getBetDateToNumber:()=>F,getFormattedPuleId:()=>No,getGamesUnicosList:()=>Io,getGamesUnicosObjeto:()=>Co,invertGame:()=>De});var Ae=e=>{let o=0;return e.forEach(r=>{o+=r.value}),o};var ve=e=>{let o=0;return e.forEach(r=>{o+=Ae(r.prizes)}),o};import{setHours as ir,setMinutes as sr,setSeconds as nr}from"date-fns";var F=(e,o)=>{let t=b(o),a=b(e);return!a||!t?0:(a=ir(a,t.getHours()),a=sr(a,t.getMinutes()),a=nr(a,0),c(a))};var Po=e=>e<1e3?e.toString().padStart(4,"0"):e.toString();var No=e=>{let o=e.split("-");return o[o.length-1]};var De=e=>{let o=N(e);for(let r=0;r<o.bets.length;r++){let t=o.bets[r];if(t.name==="milhar.invertida"||t.name==="centena.invertida"||t.name==="milhar.invertida@centena.invertida"){let a=t.numbers,n=[];for(let s of a){let f=ce(s);n.push(...f)}t={...t,numbers:N(n)},o.bets[r]=t}}return o};var Ro=(e,o,r,t,a)=>{let n=J({...e,id:a,creator:o,dateBet:F(r,t.horario),totalAmount:ve(e.bets),extracao:t}),s=De(n),{numeros:f}=ge(s);return{numeros:f,game:n}};var Io=()=>Object.values(u).filter(e=>!e.id.includes("@")&&!e.id.includes("invertida")),Co=()=>Object.values(u).filter(r=>!r.id.includes("@")&&!r.id.includes("invertida")).reduce((r,t)=>(r[t.id]=t,r),{});var Mo=(e,o,r,t,a)=>{let n=F(o,20241001e6),s=e.filter(d=>d.ativo&&!d.inativo_no_dia.includes(n)),f=b(n),g=[],h=s.filter(d=>d.somente_no_feriado===n);return h.length>0?g=[...h]:g=s.filter(d=>f&&d.days[cr(f)]&&d.somente_no_feriado===0),r&&(g=[...s]),t&&f&&a&&Le(a,"dd/MM/yyyy")===Le(f,"dd/MM/yyyy")&&(g=g.filter(d=>Number(Le(a,"HHmm"))<Number(I(d.bloqueio,"HHmm")))),g.sort((d,D)=>Number(I(d.horario,"HHmm"))<Number(I(D.horario,"HHmm"))?-1:1)};import{format as mr,getDay as lr}from"date-fns";var Oo=({extracoes:e,dataAposta:o=c(m()),dataAgora:r=c(m()),retornar:t="do_dia",pegar:a="bloqueio"})=>{let n=A=>a==="horario"?A.horario:a==="bloqueio"?A.bloqueio:0,s=F(o,20241001e6),f=F(r,20241001e6),g=b(s);if(!g)throw new Error("dataApostaDate \xE9 obrigat\xF3ria!");let h=e.filter(A=>A.ativo&&!A.inativo_no_dia.includes(s)),d=h.filter(A=>A.somente_no_feriado===s),D=d.length>0?d:h.filter(A=>A.days[lr(g)]&&A.somente_no_feriado===0);if(t==="do_dia")return D.sort(Bo);let w=b(r);if(!w)throw new Error("dataAgoraDate \xE9 obrigat\xF3ria!");let R=Number(mr(w,"HHmm"));return(t==="proximas"?D.filter(A=>s===f?R<Number(I(n(A),"HHmm")):s>f):t==="anteriores"?D.filter(A=>f===s?R>=Number(I(n(A),"HHmm")):s<f):[]).sort(Bo)},Bo=(e,o)=>Number(I(e.horario,"HHmm"))-Number(I(o.horario,"HHmm"));import{getDay as Go}from"date-fns";var be=(e,o)=>{if(!o.ativo)throw new Error("Extra\xE7\xE3o n\xE3o est\xE1 ativa.");if(o.inativo_no_dia.includes(e))throw new Error("Extra\xE7\xE3o est\xE1 inativa no dia da aposta.");if(o.somente_no_feriado!==0&&o.somente_no_feriado!==e)throw new Error("Extra\xE7\xE3o n\xE3o funciona neste feriado.");let r=b(e);if(!r)throw new Error("Data da aposta inv\xE1lida.");if(!o.days[Go(r)]){let a=["domingo","segunda-feira","ter\xE7a-feira","quarta-feira","quinta-feira","sexta-feira","s\xE1bado"][Go(r)];throw new Error(`Extra\xE7\xE3o n\xE3o funciona neste dia da semana (${a}).`)}};var Fo=(e,o)=>{try{return be(e,o),!0}catch{return!1}};var Xe={};z(Xe,{getLimitsRest:()=>wo,getPermission:()=>Lo,isAdm:()=>Ve,isAdmOrSubAdm:()=>Je,isAssociacao:()=>ze,isCambista:()=>ke,isCambistaTalao:()=>$e,isDigitador:()=>He,isDigitadorAdm:()=>qe,isDigitadorOrDigitadorAdm:()=>Qe,isSuperAdm:()=>Ue});var dr=["admin"],pr=["admin","sub_admin"],ur=["associacao"],gr=["super_admin"],fr=["cambista_talao"],yr=["cambista"],Tr=["digitador_adm"],hr=["digitador"],xr=["digitador","digitador_adm"],Ve=e=>dr.includes(e.role),ze=e=>ur.includes(e.role),Ue=e=>gr.includes(e.role),Je=e=>pr.includes(e.role),$e=e=>fr.includes(e.role),ke=e=>yr.includes(e.role),qe=e=>Tr.includes(e.role),He=e=>hr.includes(e.role),Qe=e=>xr.includes(e.role),Lo={isAdm:Ve,isAssociacao:ze,isSuperAdm:Ue,isAdmOrSubAdm:Je,isCambistaTalao:$e,isCambista:ke,isDigitadorAdm:qe,isDigitador:He,isDigitadorOrDigitadorAdm:Qe};var wo=e=>{let o=0,r=0;return Object.values(e.jogos.hoje).forEach(t=>o+=t),Object.values(e.jogos.pre).forEach(t=>r+=t),{hoje:o,pre:r}};var We={};z(We,{generateDescarga:()=>Ce,generateDescargas:()=>Be,getDescargaIdPeloEnvio:()=>Sr,getDescargaIdPeloNumero:()=>Me,getDescargasAcimaDoLimite:()=>vr,getPropsEnvioId:()=>br,getPropsEnvioIdOldDescarga:()=>Er,getPropsVPDescarga:()=>Dr,getTotalGeralDescarga:()=>_r,sortDescargas:()=>Ar});var Ar=e=>{let o=Object.values(e).sort((r,t)=>{let a=u[r.tipo_jogo].order,n=u[t.tipo_jogo].order;return a<n?-1:a>n?1:r.premio<t.premio?-1:r.premio>t.premio?1:t.amount-r.amount});return Object.fromEntries(o.map(r=>[r.id,r]))};var Vo=2,vr=(e,o,r)=>e.map(t=>{let a=H.limite_jogos.getValorJogoPeloTipoJogo(o,t.tipo_jogo),n=Object.values(r).find(d=>d.type_game===t.tipo_jogo),s=H.limite_jogos.calcularValorJogoPeloLimite(n?.limit||0,a?.value||0),f=Number(t.amount.toFixed(Vo)),g=Number(s.toFixed(Vo)),h=f-g;return f>g?{descarga:t,diferenca:h}:null}).filter(Boolean);var Dr=e=>{let o={};return Object.entries(e).forEach(([r,t])=>{r.split("_").includes("vp_")&&typeof t=="number"&&(o[r]=t)}),o};var br=e=>{let o={};return Object.entries(e).forEach(([r,t])=>{let a=r.split("_");a.includes("envio")&&!a.includes("old")&&typeof t=="number"&&(o[r]=t)}),o};var Er=e=>{let o={};return Object.entries(e).forEach(([r,t])=>{let a=r.split("_");a.includes("envio")&&a.includes("old")&&typeof t=="number"&&(o[r]=t)}),o};var Sr=(e,o)=>{let r=`${C}${o}`,t=e[r];if(t==null)throw new Error(`Valor do envio '${o}' n\xE3o encontrado no n\xFAmero.`);if(typeof t!="number")throw new Error(`Valor do envio '${o}' deve ser um n\xFAmero.`);let a=U(t);return`${e?.bancaId?`${e?.bancaId}_`:""}${e.dataAposta}_${e.tipo_jogo}_${e.premio}_${a}_envio_${o}`};var _r=(e,o)=>{let r={jogos:{},totalBruto:0,totalLiquido:0,totalComissao:0},t=Object.entries(e),a=Object.values(o),n=a.find(s=>s.type_game==="restante");for(let[s,f]of t){let g=f??0,h=a.find(d=>s===d.type_game);if(r.totalBruto+=g,h){let d=Re[s];r.jogos[s]={totalEnviado:g,ordem:d?.order||0,tipo:s,label:d?.label||s};let D=g*(h.porcentagem/100);r.totalLiquido+=g-D,r.totalComissao+=D}else if(r.jogos.restante||(r.jogos.restante={totalEnviado:0,ordem:9,tipo:"restante",label:"Restante"}),r.jogos.restante.totalEnviado+=g,n){let d=g*(n.porcentagem/100);r.totalLiquido+=g-d,r.totalComissao+=d}else r.totalLiquido+=g}return r};var H={numbers:Ge,extracao:we,descarga:We,games:Fe,users:Xe,limite_jogos:Oe,utils:Ie};var Y=e=>({id:e?.id||"",id_integer:e?.id_integer||"",extracaoIds:e?.extracaoIds||[],content:e?.content||"",visualizacao:e?.visualizacao||"jogo_hoje",bancaId:e?.bancaId||"",createdBy:y(e?.createdBy),date:{from:e?.date?.from||0,to:e?.date?.to||0},fixa:e?.date?.to===0||e?.date?.from===0,tipo:e?.tipo||[],updated:e?.updated||c(m()),created:e?.created||c(m())});var Z=e=>({id:e?.id||"",id_integer:e?.id_integer||"",createdBy:y(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m()),bancaId:e?.bancaId||"",extracao:{id:e?.extracao?.id||"",id_integer:e?.extracao?.id_integer||"",horario:e?.extracao?.horario||0,description:e?.extracao?.description||""},milhares:{1:e?.milhares?.[1]??"",2:e?.milhares?.[2]??"",3:e?.milhares?.[3]??"",4:e?.milhares?.[4]??"",5:e?.milhares?.[5]??""},grupos:{1:e?.grupos?.[1]??"",2:e?.grupos?.[2]??"",3:e?.grupos?.[3]??"",4:e?.grupos?.[4]??"",5:e?.grupos?.[5]??""},bichos:{1:e?.bichos?.[1]??"",2:e?.bichos?.[2]??"",3:e?.bichos?.[3]??"",4:e?.bichos?.[4]??"",5:e?.bichos?.[5]??""},liberado:e?.liberado??!1,dataSorteio:e?.dataSorteio||0});var j=e=>({id:e?.id||"",id_integer:e?.id_integer||"",comission:e?.comission??0,name:e?.name||"",responsible:e?.responsible||"",codigo_rota:e?.codigo_rota||"",tipo:e?.tipo||"cambista",bancaId:e?.bancaId||"",createdBy:y(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var X=e=>({id:e?.id??"",id_integer:e?.id_integer||"",active:e?.active??!0,bet_limit:e?.bet_limit??0,comission:e?.comission??0,bancaId:e?.bancaId||"",photoURL:e?.photoURL||"",name:e?.name||"",sessionId:e?.sessionId||"",codigo_cambista:e?.codigo_cambista||"",deviceId:e?.deviceId||"",role:e?.role||"cambista",pre_date_limit:e?.pre_date_limit||0,dispositivos:{dispositivoIdAtual:e?.dispositivos?.dispositivoIdAtual||"",listaDispositivosConectados:e?.dispositivos?.listaDispositivosConectados||[]},route:{id:e?.route?.id||"",name:e?.route?.name||"",tipo:e?.route?.tipo||"cambista"},type_games:e?.type_games?e?.type_games.filter(o=>u?.[o]?.id):[],login:e?.login||"",jogos:{hoje:e?.jogos?.hoje||{},pre:e?.jogos?.pre||{}},preferences:{pdfLegado:e?.preferences?.pdfLegado??!1},permissoes:{podeCancelarPule:e?.permissoes?.podeCancelarPule??!1,podeReservar:e?.permissoes?.podeReservar??!1,podeJogarSurpresinha:e?.permissoes?.podeJogarSurpresinha??!0},createdBy:y(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var ee=e=>({id:e?.id||"",id_integer:e?.id_integer||"",type_game:e?.type_game||"milhar",bancaId:e?.bancaId||"",value:e?.value??0,createdBy:y(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var J=(e={})=>({id:e?.id||"",id_integer:e?.id_integer||"",origem_pule_id:e?.origem_pule_id||"",bets:e.bets||[],creator:{id:e?.creator?.id||"",id_integer:e?.creator?.id_integer||"",codigo_cambista:e?.creator?.codigo_cambista||"",name:e?.creator?.name||"",role:e?.creator?.role||"cambista",login:e?.creator?.login||"",comission:e?.creator?.comission||0,route:{id:e?.creator?.route?.id||"",name:e?.creator?.route?.name||"",tipo:e?.creator?.route?.tipo||"cambista"}},createdBy:y(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m()),totalAmount:e?.totalAmount||0,bancaId:e?.bancaId||"",codigoAuth:e?.codigoAuth||me(1e5,999999).toString(),cancel:{canceled:e?.cancel?.canceled??!1,canceledAt:e?.cancel?.canceledAt||0,reason:e?.cancel?.reason||""},valorNumerosNaPule:e?.valorNumerosNaPule||{},infoJogos:e?.infoJogos||[],tiposJogos:e?.tiposJogos||{},reservada:e?.reservada||!1,dias_disponiveis:e?.dias_disponiveis||[],dateBet:e?.dateBet||0,status:e.status||Pe.JOGADA.id,statusReason:e?.statusReason||"",extracao:{id:e?.extracao?.id||"",id_integer:e?.extracao?.id_integer||"",description:e?.extracao?.description||"",bloqueio:e?.extracao?.bloqueio||0,horario:e?.extracao?.horario||0}});var G=(e={})=>{let o=P[e?.premio||"1"].order,r=u[e?.tipo_jogo||"milhar"].order,t={id:e?.id||"",id_integer:e?.id_integer||"",envioIds:e?.envioIds||[],ordemPremioExibicao:o,ordemJogoExibicao:r,numero:e?.numero||"",amount:e?.amount||0,premio:e?.premio||"1",bancaId:e?.bancaId||"",valorArredondado:e?.valorArredondado||0,limiteJogoReal:e?.limiteJogoReal||0,limiteJogoSimulado:e?.limiteJogoSimulado||0,valorJogo:e?.valorJogo||0,amountEnviadoParaAssociacao:e?.amountEnviadoParaAssociacao||0,valorAEnviarParaAssociacao:e?.valorAEnviarParaAssociacao||0,tipo_jogo:e?.tipo_jogo||"milhar",createdBy:y(e?.createdBy),updated:e?.updated||c(m()),created:e?.created||c(m()),descarregado:e?.descarregado??!1,dataAposta:e?.dataAposta||0},a=Q(e);return t={...t,...a["vp_"],...a[L],...a[C]},t};var Pr=(e={})=>({name:e?.name||"milhar",numbers:e?.numbers||[],prizes:e?.prizes||[]});var oe=(e={})=>({id:e?.id||"",id_integer:e?.id_integer||"",dataAposta:e?.dataAposta||0,bancaId:e?.bancaId||"",pule:{id:e?.pule?.id||"",id_integer:e?.pule?.id_integer||"",created:e?.pule?.created||0,cancel:{canceled:e?.pule?.cancel?.canceled||!1,canceledAt:e?.pule?.cancel?.canceledAt||0,reason:e?.pule?.cancel?.reason||""},createdBy:{id:e?.pule?.createdBy?.id||"",id_integer:e?.pule?.createdBy?.id_integer||"",role:e?.pule?.createdBy?.role||"cambista",name:e?.pule?.createdBy?.name||"",login:e?.pule?.createdBy?.login||""},creator:{id:e?.pule?.creator?.id||"",id_integer:e?.pule?.creator?.id_integer||"",codigo_cambista:e?.pule?.creator?.codigo_cambista||"",login:e?.pule?.creator?.login||"",name:e?.pule?.creator?.name||"",role:e?.pule?.creator?.role||"cambista",comission:e?.pule?.creator?.comission||0,route:{id:e?.pule?.creator?.route?.id||"",name:e?.pule?.creator?.route?.name||"",tipo:e?.pule?.creator?.route?.tipo||"cambista"}}},premiosItems:e?.premiosItems||[],valorTotalPremio:e?.valorTotalPremio||0,valorTotalPremioBanca:e?.valorTotalPremioBanca||0,valorTotalPremioAssociacao:e?.valorTotalPremioAssociacao||0,createdBy:y(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var $=(e={})=>({id:e?.id||"",id_integer:e?.id_integer||"",dataAposta:e?.dataAposta||0,descargas:e?.descargas||{},link_pdf:e?.link_pdf||"",bancaId:e.bancaId||"",visualizado:e?.visualizado||!1,createdBy:y(e?.createdBy),created:e?.created||0,updated:e?.updated||0});var re=(e={})=>({id:e?.id||"",nome:e?.nome||"",settings:{urlLogo:e?.settings?.urlLogo||"",urlLogoImpressao:e?.settings?.urlLogoImpressao||"",urlBackground:e?.settings?.urlBackground||"",backgroundColor:e?.settings?.backgroundColor||""},endereco:{cep:e?.endereco?.cep||"",logradouro:e?.endereco?.logradouro||"",numero:e?.endereco?.numero||"",bairro:e?.endereco?.bairro||"",cidade:e?.endereco?.cidade||"",estado:e?.endereco?.estado||""},createdBy:y(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var te=(e={})=>({id:e?.id||"",tipo:e?.tipo||"add",message:e?.message||"",colecao:e?.colecao||"",documentId:e?.documentId||"",author:y(e?.author),document:e?.document||{},updated:e?.updated||c(m()),created:e?.created||c(m())});var ae=e=>({id:e?.id||"",id_integer:e?.id_integer||"",type_game:e?.type_game||"milhar",bancaId:e?.bancaId||"",limit:e?.limit??0,createdBy:y(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var ie=e=>({id:e?.id||"",id_integer:e?.id_integer||"",visualizado:e?.visualizado||!1,banca:{id:e?.banca?.id||"",nome:e?.banca?.nome||""},dataAposta:e?.dataAposta||0,totalGeralJogos:{milhar:e?.totalGeralJogos?.milhar||0,centena:e?.totalGeralJogos?.centena||0,dezena:e?.totalGeralJogos?.dezena||0,grupo:e?.totalGeralJogos?.grupo||0,"terno.dezena":e?.totalGeralJogos?.["terno.dezena"]||0,"terno.grupo":e?.totalGeralJogos?.["terno.grupo"]||0,"duque.dezena":e?.totalGeralJogos?.["duque.dezena"]||0,"duque.grupo":e?.totalGeralJogos?.["duque.grupo"]||0},extracao:{id:e?.extracao?.id||"",id_integer:e?.extracao?.id_integer||"",description:e?.extracao?.description||"",bloqueio:e?.extracao?.bloqueio||0,horario:e?.extracao?.horario||0},devolvidoPor:{id:e?.devolvidoPor?.id||"",id_integer:e?.devolvidoPor?.id_integer||"",name:e?.devolvidoPor?.name||"",login:e?.devolvidoPor?.login||""},bancaId:e?.bancaId||"",description:e?.description||"",createdBy:y(e?.createdBy),updated:e?.updated||c(m()),created:e?.created||c(m()),status:e?.status||Ne.ENVIANDO.id,totalEnviados:e?.totalEnviados||0,totalRegistros:e?.totalRegistros||0,progresso:e?.progresso||0,mensagem:e?.mensagem||"",concluidoEm:e?.concluidoEm||0,ultimaAtualizacao:e?.ultimaAtualizacao||0,metricas:{tempoMinimo:e?.metricas?.tempoMinimo||0,tempoMaximo:e?.metricas?.tempoMaximo||0,tempoMedio:e?.metricas?.tempoMedio||0,duracaoTotal:e?.metricas?.duracaoTotal||0,tempoEstimado:e?.metricas?.tempoEstimado||0,velocidadeProcessamento:e?.metricas?.velocidadeProcessamento||0,textosFormatados:{duracaoTotalText:e?.metricas?.textosFormatados?.duracaoTotalText||"",tempoMinimoText:e?.metricas?.textosFormatados?.tempoMinimoText||"",tempoMaximoText:e?.metricas?.textosFormatados?.tempoMaximoText||"",tempoMedioText:e?.metricas?.textosFormatados?.tempoMedioText||"",tempoEstimadoText:e?.metricas?.textosFormatados?.tempoEstimadoText||""}},atualizadoEm:e?.atualizadoEm||0,erro:e?.erro||"",iniciadoEm:e?.iniciadoEm||0,user:{id:e?.user?.id||"",id_integer:e?.user?.id_integer||"",name:e?.user?.name||"",login:e?.user?.login||""},valoresJogos:e?.valoresJogos||{},limitesJogos:e?.limitesJogos||{}});var O=(e={})=>{let o=P[e?.premio||"1"].order,r=u[e?.tipo_jogo||"milhar"].order,t={id:e?.id||"",ordemJogoExibicao:r,ordemPremioExibicao:o,numeros:e?.numeros||[],quantidadeDeNumeros:e?.quantidadeDeNumeros||0,bancaId:e?.bancaId||"",amountEnviadoParaAssociacao:e?.amountEnviadoParaAssociacao||0,valorAEnviarParaAssociacao:e?.valorAEnviarParaAssociacao||0,envioId:e?.envioId||"",amount:e?.amount||0,limiteJogoReal:e?.limiteJogoReal||0,limiteJogoSimulado:e?.limiteJogoSimulado||0,valorJogo:e?.valorJogo||0,valorArredondado:e?.valorArredondado||0,dataAposta:e?.dataAposta||0,premio:e?.premio||"1",tipo_jogo:e?.tipo_jogo||"milhar",createdBy:y(e?.createdBy),updated:e?.updated||c(m()),created:e?.created||c(m())},a=Q(e);return t={...t,...a["vp_"],...a[L],...a[C]},t};var se=(e={})=>({id:e?.id||"",userId:e?.userId||"",createdBy:e?.createdBy||y(),created:e?.created||c(m()),updated:e?.updated||c(m()),deviceId:e?.deviceId||"",deviceName:e?.deviceName||"",status:e?.status||"EM_ESPERA",ultimoLogin:e?.ultimoLogin||0,plataforma:e?.plataforma||"mobile",ip:e?.ip||"",versaoApp:e?.versaoApp||""});var ne=(e={})=>({id:e?.id||"",id_integer:e?.id_integer||"",dataAposta:e?.dataAposta||0,bancaId:e?.bancaId||"",numero:e?.numero||"",premio:e?.premio||"",tipo_jogo:e?.tipo_jogo||"milhar",valorPremioAReceber:e?.valorPremioAReceber||0,valorEnviadoParaAssociacao:e?.valorEnviadoParaAssociacao||0,limiteTipoJogo:e?.limiteTipoJogo||0,valorTipoJogo:e?.valorTipoJogo||0,pulesGanhadoras:e?.pulesGanhadoras||{},createdBy:y(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var zo=(e={})=>({id:e?.id||"",id_integer:e?.id_integer||"",type_game:e?.type_game||"milhar",porcentagem:e?.porcentagem||0,createdBy:y(e?.createdBy),created:e?.created||c(m()),updated:e?.updated||c(m())});var Nr={mensagens:Y,users:X,valores_jogos:ee,limites_jogos:ae,pules:J,extracoes:K,resultados:Z,rotas:j,envios_descarga:ie,numeros:G,numeros_enviados:G,descargas:O,descargas_associacao:O,premiacoes:oe,premiacoes_associacao:ne,pdf_descargas:$,pdf_descargas_associacao:$,bancas:re,auditLogs:te,dispositivos:se,comissoes_descarga:zo};var Ke=class{cache=new Map;ttl;maxSize;constructor(o=3e5,r=1e3){this.ttl=o,this.maxSize=r}get(o){let r=this.cache.get(o);return r?Date.now()-r.timestamp>this.ttl?(this.cache.delete(o),null):r.data:null}set(o,r){if(this.cache.size>=this.maxSize){let t=this.cache.keys().next().value;t&&this.cache.delete(t)}this.cache.set(o,{data:r,timestamp:Date.now()})}delete(o){this.cache.delete(o)}clear(){this.cache.clear()}};function v(e,o,r){let{collectionName:t,model:a,idSearchStrategy:n,isolation:s,cache:f,authorization:g,generateId:h}=r,d=f?.enabled?new Ke(f.ttl,f.maxSize):null,D=l=>{if(!g?.enabled)return;let p=g.getUserRole(),T=g.allowedRoles[l];if(!(!T||T.length===0)){if(!p)throw g.onUnauthorized?.(l,p),new Error(`\u274C N\xE3o autorizado: Opera\xE7\xE3o '${l}' requer autentica\xE7\xE3o na cole\xE7\xE3o '${t}'`);if(!T.includes(p))throw g.onUnauthorized?.(l,p),new Error(`\u274C N\xE3o autorizado: Role '${p}' n\xE3o tem permiss\xE3o para '${l}' na cole\xE7\xE3o '${t}'. Roles permitidas: ${T.join(", ")}`)}},w=()=>{if(!s?.enabled)return[];let l=s.getValue();return l?[{field:s.fieldName,operator:"==",value:l}]:[]},R=l=>{let p=[];w().forEach(({field:E,operator:_,value:M})=>{p.push(o.where(E.toString(),_,M))}),l?.where?.forEach(({field:E,operator:_,value:M})=>{p.push(o.where(E.toString(),_,M))}),l?.orderBy?.forEach(({field:E,direction:_})=>{p.push(o.orderBy(E.toString(),_))}),l?.limit&&p.push(o.limit(l.limit)),l?.startAfter!==void 0&&p.push(o.startAfter(l.startAfter)),l?.startAt!==void 0&&p.push(o.startAt(l.startAt)),l?.endBefore!==void 0&&p.push(o.endBefore(l.endBefore)),l?.endAt!==void 0&&p.push(o.endAt(l.endAt));let x=o.collection(e,t);return o.query(x,...p)},V=async l=>{switch(n.type){case"documentId":return o.doc(e,t,l);case"field":let p=R({where:[{field:n.fieldName,operator:"==",value:l}],limit:1}),T=await o.getDocs(p);if(T.empty)throw new Error(`Document not found with ${String(n.fieldName)}: ${l}`);return T.docs[0].ref;case"custom":return n.resolver(l);default:throw new Error(`Unknown idSearchStrategy: ${n.type}`)}},A=(l,...p)=>{let T=s?.enabled?`_${s.getValue()}`:"";return`${t}${T}_${l}_${JSON.stringify(p)}`};return{get:async l=>{try{if(D("read"),d){let x=A("get",l),E=d.get(x);if(E)return E}let p;if(n.type==="documentId"){let x=o.doc(e,t,l);p=await o.getDoc(x)}else if(n.type==="field"){let x=R({where:[{field:n.fieldName,operator:"==",value:l}],limit:1});p=(await o.getDocs(x)).docs[0]||null}else{let x=await V(l);p=await o.getDoc(x)}if(!p?.exists())return null;let T=a(p.data());if(d){let x=A("get",l);d.set(x,T)}return T}catch(p){return console.error(`Error getting document ${l}:`,p),null}},getAll:async l=>{try{D("read");let p=R(l),T=await o.getDocs(p),x={};return T.forEach(E=>{let _=a(E.data());x[_.id]=_}),x}catch(p){return console.error("Error getting all documents:",p),{}}},listen:(l,p)=>{D("read");let T=R(l);return o.onSnapshot(T,x=>{let E={};x.forEach(_=>{let M=a(_.data());E[M.id]=M}),p(E)})},add:async l=>{try{D("write");let p=l.id||h?.()||o.generateId(),T={...l,id:p};s?.enabled&&s.getValue()&&(T[s.fieldName]=s.getValue());let x=o.doc(e,t,p),E=a(T);return await o.setDoc(x,E),d&&d.delete(A("get",p)),p}catch(p){throw console.error("Error adding document:",p),p}},update:async(l,p)=>{try{D("write");let T=await V(l),x={...p};s?.enabled&&s.getValue()&&(x[s.fieldName]=s.getValue()),await o.updateDoc(T,x),d&&d.delete(A("get",l))}catch(T){throw console.error(`Error updating document ${l}:`,T),T}},remove:async l=>{try{D("delete");let p=await V(l);await o.deleteDoc(p),d&&d.delete(A("get",l))}catch(p){throw console.error(`Error removing document ${l}:`,p),p}},batch:async l=>{try{new Set(l.map(x=>x.operation)).forEach(x=>{D(x==="delete"?"delete":"write")});let T=o.writeBatch(e);for(let{id:x,data:E,operation:_}of l){let M=x||h?.()||o.generateId(),Se=o.doc(e,t,M),_e={...E,id:M};s?.enabled&&s.getValue()&&(_e[s.fieldName]=s.getValue());let $o=a(_e);switch(_){case"add":o.batchSet(T,Se,$o);break;case"update":o.batchUpdate(T,Se,_e);break;case"delete":o.batchDelete(T,Se);break}}await o.batchCommit(T),d&&d.clear()}catch(p){throw console.error("Error in batch operation:",p),p}},clearCache:()=>d?.clear(),getCacheSize:()=>d?.cache.size||0}}var Uo=e=>{try{return e&&typeof e.getFirestore=="function"||e&&typeof e.collection=="function"&&typeof e.doc=="function"&&typeof e.query=="function"&&typeof e.where=="function"?"v9-modular":e&&typeof e.firestore=="function"||e&&typeof e.collection=="function"&&typeof e.doc=="function"&&typeof e.batch=="function"?"v8":e&&e.initializeApp&&typeof e.initializeApp=="function"?"v9-modular":"unknown"}catch(o){return console.warn("Erro ao detectar vers\xE3o do Firebase:",o),"unknown"}},Jo=e=>({collection:(o,r)=>e.collection(o,r),doc:(o,r,...t)=>e.doc(o,r,...t),query:(o,...r)=>e.query(o,...r),where:(o,r,t)=>e.where(o,r,t),orderBy:(o,r="asc")=>e.orderBy(o,r),limit:o=>e.limit(o),startAfter:(...o)=>e.startAfter(...o),startAt:(...o)=>e.startAt(...o),endBefore:(...o)=>e.endBefore(...o),endAt:(...o)=>e.endAt(...o),getDocs:e.getDocs,getDoc:e.getDoc,setDoc:e.setDoc,updateDoc:e.updateDoc,deleteDoc:e.deleteDoc,writeBatch:e.writeBatch,batchSet:(o,r,t)=>o.set(r,t),batchUpdate:(o,r,t)=>o.update(r,t),batchDelete:(o,r)=>o.delete(r),batchCommit:o=>o.commit(),onSnapshot:e.onSnapshot,generateId:()=>k()}),Ye=()=>({collection:(e,o)=>e.collection(o),doc:(e,o,...r)=>e.collection(o).doc(r.join("/")),query:(e,...o)=>{let r=e;return o.forEach(t=>{t.type==="where"?r=r.where(t.field,t.opStr,t.value):t.type==="orderBy"?r=r.orderBy(t.field,t.direction):t.type==="limit"?r=r.limit(t.limit):t.type==="startAfter"?r=r.startAfter(...t.values):t.type==="startAt"?r=r.startAt(...t.values):t.type==="endBefore"?r=r.endBefore(...t.values):t.type==="endAt"&&(r=r.endAt(...t.values))}),r},where:(e,o,r)=>({type:"where",field:e,opStr:o,value:r}),orderBy:(e,o="asc")=>({type:"orderBy",field:e,direction:o}),limit:e=>({type:"limit",limit:e}),startAfter:(...e)=>({type:"startAfter",values:e}),startAt:(...e)=>({type:"startAt",values:e}),endBefore:(...e)=>({type:"endBefore",values:e}),endAt:(...e)=>({type:"endAt",values:e}),getDocs:e=>e.get(),getDoc:e=>e.get(),setDoc:(e,o,r)=>e.set(o,r),updateDoc:(e,o)=>e.update(o),deleteDoc:e=>e.delete(),writeBatch:e=>e.batch(),batchSet:(e,o,r)=>e.set(o,r),batchUpdate:(e,o,r)=>e.update(o,r),batchDelete:(e,o)=>e.delete(o),batchCommit:e=>e.commit(),onSnapshot:(e,o)=>e.onSnapshot(o),generateId:()=>k()}),Ee=e=>{let o=Uo(e);switch(console.log(`\u{1F525} Firebase version detected: ${o}`),o){case"v9-modular":return Jo(e);case"v8":return Ye();default:return console.warn("\u26A0\uFE0F Firebase version not detected, falling back to v8 adapter"),Ye()}},Rr=(e,o,r)=>{let t=Ee(e);return v(o,t,r)},Ze=()=>({collection:(e,o)=>e.collection(o),doc:(e,o,...r)=>e.collection(o).doc(r.join("/")),query:(e,...o)=>{let r=e;return o.forEach(t=>{t.type==="where"?r=r.where(t.field,t.opStr,t.value):t.type==="orderBy"?r=r.orderBy(t.field,t.direction):t.type==="limit"?r=r.limit(t.limit):t.type==="startAfter"?r=r.startAfter(...t.values):t.type==="startAt"?r=r.startAt(...t.values):t.type==="endBefore"?r=r.endBefore(...t.values):t.type==="endAt"&&(r=r.endAt(...t.values))}),r},where:(e,o,r)=>({type:"where",field:e,opStr:o,value:r}),orderBy:(e,o="asc")=>({type:"orderBy",field:e,direction:o}),limit:e=>({type:"limit",limit:e}),startAfter:(...e)=>({type:"startAfter",values:e}),startAt:(...e)=>({type:"startAt",values:e}),endBefore:(...e)=>({type:"endBefore",values:e}),endAt:(...e)=>({type:"endAt",values:e}),getDocs:e=>e.get(),getDoc:e=>e.get(),setDoc:(e,o,r)=>e.set(o,r),updateDoc:(e,o)=>e.update(o),deleteDoc:e=>e.delete(),writeBatch:e=>e.batch(),batchSet:(e,o,r)=>e.set(o,r),batchUpdate:(e,o,r)=>e.update(o,r),batchDelete:(e,o)=>e.delete(o),batchCommit:e=>e.commit(),onSnapshot:(e,o)=>e.onSnapshot(o),generateId:()=>k()});var Ir=(e,o={enabled:!0,ttl:3e5,maxSize:1e3},r)=>{let t=n=>({...n,isolation:e?{enabled:!0,fieldName:"bancaId",getValue:e}:void 0,cache:o,authorization:r?.[n.collectionName]}),a=n=>({...n,cache:o,authorization:r?.[n.collectionName]});return{users_associacao:a({collectionName:"users",model:X,idSearchStrategy:{type:"documentId"}}),users:t({collectionName:"users",model:X,idSearchStrategy:{type:"documentId"}}),bancas:a({collectionName:"bancas",model:re,idSearchStrategy:{type:"documentId"}}),extracoes:t({collectionName:"extracoes",model:K,idSearchStrategy:{type:"documentId"}}),resultados:t({collectionName:"resultados",model:Z,idSearchStrategy:{type:"documentId"}}),mensagens:t({collectionName:"mensagens",model:Y,idSearchStrategy:{type:"documentId"}}),rotas:t({collectionName:"rotas",model:j,idSearchStrategy:{type:"documentId"}}),valores_jogos:t({collectionName:"valores_jogos",model:ee,idSearchStrategy:{type:"documentId"}}),limites_jogos:t({collectionName:"limites_jogos",model:ae,idSearchStrategy:{type:"documentId"}}),pules:t({collectionName:"pules",model:J,idSearchStrategy:{type:"documentId"}}),numeros:t({collectionName:"numeros",model:G,idSearchStrategy:{type:"documentId"}}),numeros_enviados:t({collectionName:"numeros_enviados",model:G,idSearchStrategy:{type:"documentId"}}),descargas:t({collectionName:"descargas",model:O,idSearchStrategy:{type:"documentId"}}),descargas_associacao:t({collectionName:"descargas_associacao",model:O,idSearchStrategy:{type:"documentId"}}),premiacoes:t({collectionName:"premiacoes",model:oe,idSearchStrategy:{type:"documentId"}}),premiacoes_associacao:t({collectionName:"premiacoes_associacao",model:ne,idSearchStrategy:{type:"documentId"}}),pdf_descargas:t({collectionName:"pdf_descargas",model:$,idSearchStrategy:{type:"documentId"}}),pdf_descargas_associacao:t({collectionName:"pdf_descargas_associacao",model:$,idSearchStrategy:{type:"documentId"}}),auditLogs:t({collectionName:"auditLogs",model:te,idSearchStrategy:{type:"documentId"}}),envios_descarga:t({collectionName:"envios_descarga",model:ie,idSearchStrategy:{type:"documentId"}}),dispositivos:t({collectionName:"dispositivos",model:se,idSearchStrategy:{type:"documentId"}})}};function je(e){let{db:o,adapter:r,getBancaId:t,cacheConfig:a,authorizationConfigs:n}=e,s=Ir(t,a,n);return{users_associacao:v(o,r,s.users_associacao),users:v(o,r,s.users),bancas:v(o,r,s.bancas),extracoes:v(o,r,s.extracoes),resultados:v(o,r,s.resultados),mensagens:v(o,r,s.mensagens),rotas:v(o,r,s.rotas),valores_jogos:v(o,r,s.valores_jogos),limites_jogos:v(o,r,s.limites_jogos),pules:v(o,r,s.pules),numeros:v(o,r,s.numeros),numeros_enviados:v(o,r,s.numeros_enviados),descargas:v(o,r,s.descargas),descargas_associacao:v(o,r,s.descargas_associacao),premiacoes:v(o,r,s.premiacoes),premiacoes_associacao:v(o,r,s.premiacoes_associacao),pdf_descargas:v(o,r,s.pdf_descargas),pdf_descargas_associacao:v(o,r,s.pdf_descargas_associacao),auditLogs:v(o,r,s.auditLogs),envios_descarga:v(o,r,s.envios_descarga),dispositivos:v(o,r,s.dispositivos)}}function Cr(e){return je({...e,adapter:Ee(e.firebaseInstance)})}function Mr(e){return je({...e,adapter:Ze()})}export{te as AuditLogModel,re as BancaModel,Pr as BetModel,Re as COMISSOES_PADRAO,O as DescargaModel,se as DeviceModel,qo as EXTRACAO,ie as EnvioDescargaModel,K as ExtracaoModel,u as GAMES,Ho as GRUPOS_BICHOS,J as GameModel,Yo as KEYBOARD,ae as LimitGameModel,Qo as MESSAGES,Y as MessageModel,G as NumberModel,$ as PDFModel,L as PREFIX_ENVIO,C as PREFIX_ENVIO_OLD,S as PREFIX_NUMBER,P as PREMIOS,ne as PremiacaoAssociacaoModel,oe as PremiacaoModel,Xo as ROLES,Z as ResultadoModel,j as RouteModel,Ne as STATUS_DESCARGA,Zo as STATUS_DEVICE,Pe as STATUS_PULE,Wo as TIPO_VISUALIZACAO,X as UserModel,Ko as VISUALIZACAO,ee as ValueGameModel,U as arredondarParaCima,ge as calculaValoresDosNumeros,pe as calcularValorDeNumero,So as calcularValorJogoPeloLimite,Ae as calculateAmount,ve as calculateAmountGame,N as clone,Nr as collections,eo as combineDateTime,Rr as createAutoRepo,v as createGenericRepo,Ze as createReactNativeAdapter,Mr as createReactNativeRepoFactory,je as createRepoFactory,Ye as createV8Adapter,Jo as createV9ModularAdapter,Ee as createWebAdapter,Cr as createWebRepoFactory,c as dateToNumber,lo as delay,Uo as detectFirebaseVersion,mo as dividirArray,Fo as extracaoEstaAtivaBoolean,be as extracaoEstaAtivaTryCatch,Ro as fazerJogo,Po as formatPuleId,B as formatarNumero,io as formatterBRL,go as formatterPercentage,yo as formatterPercentageDecimal,H as functionsCore,Be as generateDescargas,k as generateId,xo as gerarDezenas,ce as getAllCombinations,Mo as getAvailableTimes,F as getBetDateToNumber,me as getCodigoAuth,y as getCreatedBySystem,ao as getDataInicioFim,No as getFormattedPuleId,Io as getGamesUnicosList,Co as getGamesUnicosObjeto,uo as getInitials,he as getLimiteJogoPeloTipoJogo,_o as getLimiteSimulado,wo as getLimitsRest,de as getNumeroId,Do as getNumerosAcimaDoLimite,Lo as getPermission,ue as getPremioFormato,fe as getPropsEnvioId,ye as getPropsEnvioIdOld,Q as getPropsPrefix,Te as getPropsVP,le as getSomaEnvio,Eo as getSomaProps,Ao as getSomaVP,q as getTiposJogos,xe as getValorJogoPeloTipoJogo,De as invertGame,Ve as isAdm,Je as isAdmOrSubAdm,ze as isAssociacao,ke as isCambista,$e as isCambistaTalao,He as isDigitador,qe as isDigitadorAdm,Qe as isDigitadorOrDigitadorAdm,Ue as isSuperAdm,po as matchNormalized,W as normalize,b as numberToDate,co as numbersSelectedFormated,so as parserBRL,fo as parserPercentage,To as parserPercentageDecimal,Oo as pegarExtracoes,m as pegarHorarioSaoPaulo,ho as removerLetters,I as showFormatDate,bo as sortNumeros};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|