bb-api-platforma 0.1.243 → 0.1.245

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.
@@ -640,8 +640,8 @@ export interface RedisPrematchSearchParams {
640
640
  locale?: string;
641
641
  searchString?: string | null;
642
642
  negativeString?: string | null;
643
- sportId?: number | null;
644
- tournamentId?: number | null;
643
+ sportId?: number | number[] | null;
644
+ tournamentId?: number | number[] | null;
645
645
  LIMIT?: {
646
646
  from: number;
647
647
  size: number;
@@ -778,6 +778,95 @@ export type RedisDictionaryParams = {
778
778
  /** Применяется только для справочников */
779
779
  minutes?: number;
780
780
  };
781
+ export type TBetslipOddsList = {
782
+ ErrorMessage: number;
783
+ Min: number;
784
+ Max: number;
785
+ MinCurrencyUnit: number;
786
+ IsRound: boolean;
787
+ IsReinvested: boolean;
788
+ MinAdd: number;
789
+ MaxAdd: number;
790
+ Odds: number;
791
+ IsLive: boolean;
792
+ Amount?: number;
793
+ LinesID?: number;
794
+ HandSize?: string | number | null;
795
+ BetVarID?: number;
796
+ Add1?: number | null;
797
+ Add2?: number | null;
798
+ Score?: string;
799
+ OddsOld?: number;
800
+ HandSizeOld?: number;
801
+ NameSport?: string;
802
+ NameCountry?: string;
803
+ NameTurnir?: string;
804
+ NameTeam1?: string;
805
+ NameTeam2?: string;
806
+ PriceNum?: number;
807
+ DateEvent?: string | null;
808
+ NameBetShort?: string;
809
+ NameBetLong?: string;
810
+ Comment?: string;
811
+ SportId?: number;
812
+ DateEventLive?: string | null;
813
+ BonusType?: number;
814
+ BetIdentifier?: string | null;
815
+ };
816
+ export type TBetslipResponse = {
817
+ Bets: TBetslipOddsList[];
818
+ Limitations: {
819
+ Min: number | null;
820
+ Max: number | null;
821
+ MaxOddForMulty: number;
822
+ };
823
+ BetslipType: EBetslipType;
824
+ };
825
+ /** Одна позиция ставки в купоне */
826
+ export interface ICouponOdd {
827
+ ErrorMessage: number;
828
+ Min: number;
829
+ Max: number;
830
+ MinCurrencyUnit: number;
831
+ IsRound: boolean;
832
+ IsReinvested: boolean;
833
+ MinAdd: number;
834
+ MaxAdd: number;
835
+ Odds: number;
836
+ IsLive: boolean;
837
+ Amount?: number;
838
+ LinesID?: number;
839
+ HandSize?: number | null;
840
+ BetVarID?: number;
841
+ Add1?: number | null;
842
+ Add2?: number | null;
843
+ Score?: string;
844
+ OddsOld?: number;
845
+ HandSizeOld?: number;
846
+ NameSport?: string;
847
+ NameCountry?: string;
848
+ NameTurnir?: string;
849
+ NameTeam1?: string;
850
+ NameTeam2?: string;
851
+ PriceNum?: number;
852
+ /** Дата события в формате ISO 8601 с часовым поясом, например "2026-04-07T22:00:00+03:00" */
853
+ DateEvent?: string;
854
+ NameBetShort?: string;
855
+ NameBetLong?: string;
856
+ Comment?: string;
857
+ SportId?: number;
858
+ DateEventLive?: string | null;
859
+ BonusType?: number;
860
+ BetIdentifier?: string | null;
861
+ }
862
+ /** Входящий запрос на сохранение купона */
863
+ export interface ICouponRequest {
864
+ odds: ICouponOdd[];
865
+ domain: string;
866
+ partner: string;
867
+ id?: number;
868
+ code?: string;
869
+ }
781
870
  export declare function routeNameId(id: number | string, text?: string): string;
782
871
  export declare function clearPhone(draftPhoneNumber: number | string, prefix?: string, suffix?: string): string;
783
872
  export declare class BetBoosterApi {
@@ -2046,16 +2135,66 @@ export declare class BetBoosterApi {
2046
2135
  statusText: string;
2047
2136
  }>;
2048
2137
  /**
2049
- * Searches for prematch events using the NV20 API.
2138
+ * Поиск премятч-событий через NV20 API.
2139
+ *
2140
+ * Из `searchString` автоматически удаляются однобуквенные слова и слова,
2141
+ * содержащие только цифры. Это поведение можно обойти, передав
2142
+ * `options.searchString` — тогда будет использована переданная строка как есть.
2143
+ *
2144
+ * @param searchString - Строка поискового запроса.
2145
+ * @param options - Необязательные параметры для уточнения поиска.
2146
+ * @param options.searchString - Если передан, заменяет `searchString` без фильтрации.
2147
+ * @param options.LIMIT - Пагинация результатов. По умолчанию `{ from: 0, size: 30 }`.
2148
+ * @param options.negativeString - Исключает результаты, содержащие указанную строку.
2149
+ * @param options.sportId - Фильтр по ID вида спорта. Может быть числом или массивом чисел.
2150
+ * @param options.tournamentId - Фильтр по ID турнира. Может быть числом или массивом чисел.
2151
+ * @returns Промис с результатами поиска или `null` при ошибке запроса.
2050
2152
  *
2051
- * @param searchString - The search string to query events.
2052
- * (Note: that all words containing cvr and words with one letter are removed from the searchString)
2053
- * @param options - Optional parameters to refine the search.
2054
- * @param options.LIMIT - Specifies the number of results to return. Defaults to `{ from: 0, size: 30 }` if not provided.
2055
- * @param options.negativeString - Excludes results containing this string.
2056
- * @param options.sportId - Filters events by the specified sport ID.
2057
- * @param options.tournamentId - Filters events by the specified tournament ID.
2058
- * @returns A promise that resolves with the search results or `null` if the request fails.
2153
+ * @remarks
2154
+ * **Endpoint:** `POST /stats/pm/search` (NV20)
2155
+ *
2156
+ * @example
2157
+ * ```typescript
2158
+ * // Простой поиск
2159
+ * const results = await api.searchPrematchEventsNv20('Arsenal');
2160
+ *
2161
+ * // Поиск с фильтром по одному виду спорта и турниру
2162
+ * const results = await api.searchPrematchEventsNv20('Arsenal', {
2163
+ * sportId: 1,
2164
+ * tournamentId: 127,
2165
+ * LIMIT: { from: 0, size: 10 }
2166
+ * });
2167
+ *
2168
+ * // Поиск с фильтром по нескольким видам спорта и турнирам
2169
+ * const results = await api.searchPrematchEventsNv20('Arsenal', {
2170
+ * sportId: [1, 2],
2171
+ * tournamentId: [127, 255, 512]
2172
+ * });
2173
+ * ```
2174
+ *
2175
+ * @example
2176
+ * ```json
2177
+ * // Payload запроса
2178
+ * {
2179
+ * "locale": "uk",
2180
+ * "searchString": "Arsenal",
2181
+ * "LIMIT": { "from": 0, "size": 30 },
2182
+ * "sportId": [1, 2],
2183
+ * "tournamentId": 127
2184
+ * }
2185
+ *
2186
+ * // Ответ
2187
+ * {
2188
+ * "searchString": "Arsenal",
2189
+ * "from": 0,
2190
+ * "size": 30,
2191
+ * "total": 2,
2192
+ * "results": [
2193
+ * { "eventId": 12345, "name": "Arsenal - Chelsea", ... },
2194
+ * { "eventId": 12346, "name": "Arsenal - Liverpool", ... }
2195
+ * ]
2196
+ * }
2197
+ * ```
2059
2198
  */
2060
2199
  searchPrematchEventsNv20(searchString: string, options?: RedisPrematchSearchParams): Promise<{
2061
2200
  data: any;
@@ -2699,6 +2838,186 @@ export declare class BetBoosterApi {
2699
2838
  status: number;
2700
2839
  statusText: string;
2701
2840
  }>;
2841
+ /**
2842
+ * Copies (clones) an existing betslip with the given list of odds items
2843
+ * and returns updated betslip data from the server, including actual odds,
2844
+ * limitations, and betslip type.
2845
+ *
2846
+ * @param oddsList - Array of betslip odds items to clone.
2847
+ *
2848
+ * @remarks
2849
+ * Endpoint: `POST /betting/CopyBetslip` (API v2)
2850
+ *
2851
+ * @example
2852
+ * **Request payload:**
2853
+ * ```json
2854
+ * {
2855
+ * "Bets": [
2856
+ * {
2857
+ * "ErrorMessage": 0,
2858
+ * "Min": 0,
2859
+ * "Max": 0,
2860
+ * "MinCurrencyUnit": 0.01,
2861
+ * "IsRound": false,
2862
+ * "IsReinvested": false,
2863
+ * "MinAdd": 0,
2864
+ * "MaxAdd": 0,
2865
+ * "Odds": 3.07,
2866
+ * "IsLive": false,
2867
+ * "LinesID": 2970079,
2868
+ * "BetVarID": 1,
2869
+ * "HandSize": null,
2870
+ * "Add1": null,
2871
+ * "Add2": null,
2872
+ * "Score": "",
2873
+ * "NameSport": "Football",
2874
+ * "NameCountry": "Europe",
2875
+ * "NameTurnir": "UEFA Champions League",
2876
+ * "NameTeam1": "Real Madrid",
2877
+ * "NameTeam2": "Bayern Munich",
2878
+ * "DateEvent": "2026-04-07T22:00:00+03:00",
2879
+ * "NameBetShort": "1",
2880
+ * "NameBetLong": "Team 1 wins",
2881
+ * "SportId": 5
2882
+ * }
2883
+ * ],
2884
+ * "Culture": "en-US"
2885
+ * }
2886
+ * ```
2887
+ *
2888
+ * **Response:**
2889
+ * ```json
2890
+ * {
2891
+ * "Ok": true,
2892
+ * "Error": null,
2893
+ * "Data": {
2894
+ * "Bets": [
2895
+ * {
2896
+ * "LinesID": 2970079,
2897
+ * "Odds": 3.07,
2898
+ * "OddsOld": 3.05,
2899
+ * "ErrorMessage": 0,
2900
+ * "IsLive": false
2901
+ * }
2902
+ * ],
2903
+ * "Limitations": {
2904
+ * "Min": null,
2905
+ * "Max": null,
2906
+ * "MaxOddForMulty": 250
2907
+ * },
2908
+ * "BetslipType": 0
2909
+ * }
2910
+ * }
2911
+ * ```
2912
+ */
2913
+ cloneStoredBetslip(oddsList: TBetslipOddsList[]): Promise<{
2914
+ data: TBetslipResponse | null;
2915
+ error: string | null;
2916
+ status: number;
2917
+ statusText: string;
2918
+ }>;
2919
+ /**
2920
+ * Получает сохранённый купон по его идентификатору.
2921
+ *
2922
+ * @param savedCouponId - Уникальный числовой идентификатор сохранённого купона.
2923
+ * @returns Данные сохранённого купона.
2924
+ *
2925
+ * @remarks
2926
+ * Endpoint: `GET /portfolio/getcoupon/:savedCouponId` (NV20)
2927
+ *
2928
+ * @example
2929
+ * ```ts
2930
+ * // Запрос
2931
+ * const coupon = await api.getSavedCoupon(12345);
2932
+ *
2933
+ * // Ответ (строка с данными купона)
2934
+ * // "{ ... serialized coupon data ... }"
2935
+ * ```
2936
+ */
2937
+ getSavedCoupon(savedCouponId: number): Promise<{
2938
+ data: any;
2939
+ error: string | null;
2940
+ status: number;
2941
+ statusText: string;
2942
+ }>;
2943
+ /**
2944
+ * Создаёт новый сохранённый купон на основе переданных данных и списка кодов.
2945
+ *
2946
+ * @param couponData - Объект {@link I.ICouponRequest} с данными купона (коэффициенты, домен, партнёр и т.д.).
2947
+ * @param savedCodesList - Массив строковых кодов, привязываемых к купону.
2948
+ * @returns Результат создания купона.
2949
+ *
2950
+ * @remarks
2951
+ * Endpoint: `POST /portfolio/createcoupon` (NV20)
2952
+ *
2953
+ * @example
2954
+ * ```ts
2955
+ * // Payload запроса
2956
+ * const payload = {
2957
+ * data: {
2958
+ * odds: [
2959
+ * {
2960
+ * ErrorMessage: 0,
2961
+ * Min: 10,
2962
+ * Max: 1000,
2963
+ * MinCurrencyUnit: 1,
2964
+ * IsRound: false,
2965
+ * IsReinvested: false,
2966
+ * MinAdd: 0,
2967
+ * MaxAdd: 0,
2968
+ * Odds: 1.85,
2969
+ * IsLive: false,
2970
+ * LinesID: 456789,
2971
+ * BetVarID: 1,
2972
+ * NameSport: "Football",
2973
+ * NameTeam1: "Team A",
2974
+ * NameTeam2: "Team B",
2975
+ * NameBetShort: "1"
2976
+ * }
2977
+ * ],
2978
+ * domain: "example.com",
2979
+ * partner: "partner1"
2980
+ * },
2981
+ * codes: ["ABC123", "DEF456"]
2982
+ * };
2983
+ *
2984
+ * const result = await api.createSavedCoupon(payload.data, payload.codes);
2985
+ * ```
2986
+ */
2987
+ createSavedCoupon(couponData: ICouponRequest, savedCodesList: string[]): Promise<{
2988
+ data: any;
2989
+ error: string | null;
2990
+ status: number;
2991
+ statusText: string;
2992
+ }>;
2993
+ /**
2994
+ * Получает список сохранённых купонов по массиву кодов.
2995
+ *
2996
+ * @param savedCodesList - Массив строковых кодов для поиска соответствующих купонов.
2997
+ * @returns Массив найденных купонов.
2998
+ *
2999
+ * @remarks
3000
+ * Endpoint: `POST /portfolio/getcoupons` (NV20)
3001
+ *
3002
+ * @example
3003
+ * ```ts
3004
+ * // Payload запроса
3005
+ * const payload = {
3006
+ * codes: ["ABC123", "DEF456"]
3007
+ * };
3008
+ *
3009
+ * const coupons = await api.getCoupons(["ABC123", "DEF456"]);
3010
+ *
3011
+ * // Ответ — массив объектов купонов
3012
+ * // [{ id: 1, odds: [...], domain: "example.com", ... }, ...]
3013
+ * ```
3014
+ */
3015
+ getCoupons(savedCodesList: string[]): Promise<{
3016
+ data: any;
3017
+ error: string | null;
3018
+ status: number;
3019
+ statusText: string;
3020
+ }>;
2702
3021
  }
2703
3022
 
2704
3023
  export {};
@@ -1,2 +1,2 @@
1
- import{api}from"./Types.js";const locales={ar:"en-US",en:"en-US",de:"en-US",pt:"en-US",fr:"fr-FR",ht:"fr-FR",es:"en-US",tr:"tr-TR",tk:"tr-TR",az:"tr-TR",uk:"en-US",cr:"fr-FR",ru:"ru-RU"},languageIdsRemote={en:1,pt:1,fr:4,es:1,tr:5,az:5,uk:1,cr:1,ru:0},MAX_TIME_EXECUTION_MS=25e3,stringify=t=>JSON.stringify(t,null,2);function convertBasketToPost(t){return{a1:t.Add1,a2:t.Add2,bId:t.BetVarID,eId:t.LinesID,fs:t.HandSize,isLive:t.IsLive,r:t.Odds}}export function routeNameId(t,e=""){return null!=e||(e=""),`${e.replace(/[\s\.\,\(\)\[\]\\\/\-\~\`\"\']+/g," ").trim().replace(/\s+/g,"-").toLowerCase()}~${t}`}export function clearPhone(t,e="",s=""){return e+(String(t).match(/\d+/g)||[]).join("")+s}let IS_DEV_MODE=!1;export class BetBoosterApi{constructor(t,e,s="en",a=15e3,i=!1){this._srv_tag="19",this._locale="en-EN",this._locales=locales,this._languageIdsRemote=languageIdsRemote,this.EXIST_LANGUAGES=Object.keys(locales),this._languageId=1,this._lang="en",this._USER_DATA={},this.LANG_DEFAULT="en",this.LOCALE_DEFAULT="en-EN",this.LANG_ID_DEFAULT=1,this.maxTimeExecutionMs=25e3,this.liveTimestamp=0,this._liveTimestampReset=!1,this.liveRecivedIsFullPackage=!1,this.isNotActive=!1,this.primarySports=[5,1,3,4,8,6,263,265,2,16,17,18],this.priorityCountries={1:[14,8,54],5:[8,14,1,2,5,4,3,43,44,42,11,54],6:[14,8,54],8:[8,14,54],27:[45,187]},this.priorityTournaments={5:[201,361,199,410,200,423,1141,1142,47,2408,1688,2511,129,193,919,1693,1134,2157,147,212,1,185,2,2379,286,1216,99,1266,4,290,735,1059,1100,1268,5,292,1210,1366,700,1217,3,186,2209,2431,288,1410,6,540,1062,1223,1061,1237,40,1235,2230,2370,209,1278,470,1373,35,1386,2229,2373,737,1383,1412,1857,1505,1858,11,1853,2231,742,1382,49,1236,1060,2364,624,15,1896,1409,1493,1918,1925,2283,1612,86,149,2337,8,1213,19,1387]},IS_DEV_MODE=i,this.maxTimeExecutionMs=a,this.axi=t,this.setBaseUrl(e),this.setLanguage(s)}get locale(){return this._locale}get isSinged(){return void 0!==this.user&&void 0!==this.user.UserId&&this.user.UserId>0}get user(){return this._USER_DATA}get userMain(){var t,e,s,a,i,n,r,l,o,u,c,d,h,g;return[`uid: ${null!==(e=null===(t=this._USER_DATA)||void 0===t?void 0:t.UserId)&&void 0!==e?e:"--"}`,`unm: ${null!==(a=null===(s=this._USER_DATA)||void 0===s?void 0:s.UserName)&&void 0!==a?a:"--"}`,`pid: ${null!==(n=null===(i=this._USER_DATA)||void 0===i?void 0:i.PointId)&&void 0!==n?n:"--"}`,`ptp: ${null!==(l=null===(r=this._USER_DATA)||void 0===r?void 0:r.PlayerType)&&void 0!==l?l:"--"}`,`gid: ${null!==(u=null===(o=this._USER_DATA)||void 0===o?void 0:o.GroupID)&&void 0!==u?u:"--"}`,`bal: ${null!==(d=null===(c=this._USER_DATA)||void 0===c?void 0:c.Amount)&&void 0!==d?d:"--"}`,`cur: ${null!==(g=null===(h=this._USER_DATA)||void 0===h?void 0:h.CurrencyName)&&void 0!==g?g:"--"}`]}set user(t){this._USER_DATA=t}get lang(){return this._lang}get languageId(){return this._languageId}get srvTag(){return this._srv_tag}set srvTag(t){this._srv_tag=String(t)}setServerTag(t){this._srv_tag=String(t)}get token(){var t;return null!==(t=this._TOKEN)&&void 0!==t?t:void 0}set token(t){this._TOKEN="string"==typeof t?t.split(/\s*,\s*/)[0]:void 0}responseHandlerData(t,e,s){var a,i,n;let r=null;void 0!==(null===(a=null==t?void 0:t.Data)||void 0===a?void 0:a.Data)?r=t.Data.Data:void 0!==(null===(i=null==t?void 0:t.Data)||void 0===i?void 0:i._isSuccessful)?r=t.Data._isSuccessful:void 0!==(null==t?void 0:t.Data)?r=t.Data:void 0!==t&&(r=t);const l=(null===(n=null==t?void 0:t.Data)||void 0===n?void 0:n.Error)||(null==t?void 0:t.Error)||(e>=300?s:null)||(!r&&e>=300?"Unknown error":null);return"Object reference not set to an instance of an object."===l&&console.log("!!!!!!!!!!! Object reference not set to an instance of an object."),{data:r,error:l,status:e,statusText:s}}responseHandlerDataData(t,e,s){var a,i,n,r;let l=null;void 0!==(null===(a=null==t?void 0:t.Data)||void 0===a?void 0:a.Data)&&void 0!==(null==t?void 0:t.Data)?l=t.Data:void 0!==(null===(i=null==t?void 0:t.Data)||void 0===i?void 0:i.Data)?l=t.Data.Data:void 0!==(null===(n=null==t?void 0:t.Data)||void 0===n?void 0:n._isSuccessful)?l=t.Data._isSuccessful:void 0!==(null==t?void 0:t.Data)?l=t.Data:void 0!==t&&(l=t);const o=(null===(r=null==t?void 0:t.Data)||void 0===r?void 0:r.Error)||(null==t?void 0:t.Error)||(e>=300?s:null)||(!l&&e>=300?"Unknown error":null);return"Object reference not set to an instance of an object."===o&&console.log("!!!!!!!!!!! Object reference not set to an instance of an object."),{data:l,error:o,status:e,statusText:s}}convertDataData(t){var e;if(void 0!==(null===(e=null==t?void 0:t.Data)||void 0===e?void 0:e.Data)){const e=Object.keys(t.Data);if(e.length>0){const s={};return e.forEach((e=>{var a;s[e.toLowerCase()]=null!==(a=t.Data[e])&&void 0!==a?a:null})),s}}return t}setDevMode(t){IS_DEV_MODE=void 0===t||t}addLocalesConverters(t){this._locales=Object.assign(Object.assign({},this._locales),t);const e=new Set([...this.EXIST_LANGUAGES,...Object.keys(this._locales)]);this.EXIST_LANGUAGES=Array.from(e)}checkLanguage(t="en"){try{const e=t.substring(0,2)||this.LANG_DEFAULT;return this.EXIST_LANGUAGES.includes(e)?e:this.LANG_DEFAULT}catch(t){return this.LANG_DEFAULT}}setLanguage(t="en"){var e,s;return this._lang=this.checkLanguage(t),this._locale=null!==(e=this._locales[this._lang])&&void 0!==e?e:this.LOCALE_DEFAULT,this._languageId=null!==(s=this._languageIdsRemote[this._lang])&&void 0!==s?s:this.LANG_ID_DEFAULT,this._lang}async setLanguageRemoteLocale(t="en"){if(this.setLanguage(t),this.isSinged){const t=this.url("/account/SetLanguage",api.LBC);return await this.POST(t,{culture:this.locale})||!1}}setBaseUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),this._baseUrl=t,this._baseUrl}statusHandler(t,e){401===t&&(this.user={},this.token=void 0,IS_DEV_MODE&&console.log("Status:",t,e))}queryStringHandler(t={}){return Object.keys(t).forEach((e=>{null===t[e]?t[e]="null":!0===t[e]?t[e]="true":!1===t[e]?t[e]="false":void 0===t[e]&&(t[e]="")})),t}responseHandler(t){var e,s,a,i;const n=null!==(s=null!==(e=null==t?void 0:t.headers["x-token"])&&void 0!==e?e:null==t?void 0:t.headers["X-token"])&&void 0!==s?s:null;IS_DEV_MODE&&(null===(a=null==t?void 0:t.request)||void 0===a?void 0:a.path)&&console.log(null===(i=null==t?void 0:t.request)||void 0===i?void 0:i.path),n&&(this.token=n,IS_DEV_MODE&&console.log("isSinged:",this.isSinged+"\nX-Token:",n))}axiosErrorHandler(t){var e,s,a,i,n,r,l,o;let u,c=null!==(s=null===(e=t.response)||void 0===e?void 0:e.status)&&void 0!==s?s:null,d=null!==(i=null===(a=t.response)||void 0===a?void 0:a.statusText)&&void 0!==i?i:null;const h=null!==(n=t.response)&&void 0!==n?n:null;if(h){if(u=[...c?[c]:[],...d?[d]:[],...(null===(r=null==h?void 0:h.data)||void 0===r?void 0:r.Message)?[h.data.Message]:[],...(null===(l=null==h?void 0:h.data)||void 0===l?void 0:l.MessageDetail)?[h.data.MessageDetail]:[]].join(" > "),IS_DEV_MODE){const t=(null!==(o=h.config.method)&&void 0!==o?o:"").toUpperCase(),e=h.config.url,s=h.config.data;console.log("```"),console.log("ERROR:",t,e),console.log("DATA:",s),console.log("RESPONCE:",null==h?void 0:h.data),console.log("```")}}else t.request?(u="Error: No response received",c=503,d="Service Unavailable"):(u=`Error: ${null==t?void 0:t.message}`,c=601,d=(null==t?void 0:t.message)||"Unknown error");return console.error("Axios request error:",u),{data:null,status:c,statusText:u||d||"Unknown error"}}url(t,e){if(t.toLowerCase().startsWith("http"))return t;switch(e){case api.V2:return`${this._baseUrl}/v2/bsw/api${t}`;case api.NV20:return`${this._baseUrl}/nv20${t}`;case api.LBC:return`${this._baseUrl}/v2/lbc/api${t}`;case api.DIRECT:return`${this._baseUrl}${t}`;case api.V1:default:return`${this._baseUrl}/api${t}`}}sortDataByPriority(t,e,s){const a=new Map;return e.forEach(((t,e)=>{a.set(t,e)})),t.slice().sort(((t,e)=>(a.has(t[s])?a.get(t[s]):1/0)-(a.has(e[s])?a.get(e[s]):1/0)))}sortArrayByPriority(t,e){const s=new Map;return e.forEach(((t,e)=>{s.set(t,e)})),t.slice().sort(((t,e)=>(s.has(t)?s.get(t):1/0)-(s.has(e)?s.get(e):1/0)))}request(t){const e=this.queryStringHandler,s=this.axi,a=this.axiosErrorHandler,i=(t,e)=>{401===t&&(this.user={},this.token=void 0,IS_DEV_MODE&&console.log("Status:",t,e))},n=async t=>{var e,s;try{console.error(t);const a=["undefined"!=typeof window?window.location.href:"url: unknown",`Error: ${(null==t?void 0:t.error)||"Unknown error"}`,...this.userMain].filter(Boolean).join("\n");let i="";try{i=null!==(e=JSON.stringify(t,null,2))&&void 0!==e?e:"Unknown error"}catch(e){i=null!==(s=null==t?void 0:t.error)&&void 0!==s?s:"Unknown error"}await this.sendErrInfo(a,i)}catch(t){}},r=t=>{var e,s,a,i,r,l,o,u,c,d,h,g,v,p;const m=null!==(e=null==t?void 0:t.headers["x-token"])&&void 0!==e?e:null,T=null!==(a=null===(s=null==t?void 0:t.request)||void 0===s?void 0:s.path)&&void 0!==a?a:null;if(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.Error){const e=(null!==(l=null===(r=null==t?void 0:t.config)||void 0===r?void 0:r.method)&&void 0!==l?l:"").toUpperCase(),s=Object.assign(Object.assign(Object.assign({method:e,url:(null===(o=null==t?void 0:t.config)||void 0===o?void 0:o.url)||""},(null===(u=null==t?void 0:t.config)||void 0===u?void 0:u.params)?{params:null!==(d=null===(c=null==t?void 0:t.config)||void 0===c?void 0:c.params)&&void 0!==d?d:""}:{}),(null===(h=null==t?void 0:t.config)||void 0===h?void 0:h.data)?{POST:null!==(v=null===(g=null==t?void 0:t.config)||void 0===g?void 0:g.data)&&void 0!==v?v:""}:{}),{error:null===(p=null==t?void 0:t.data)||void 0===p?void 0:p.Error});n(s)}IS_DEV_MODE&&T&&console.log(T),m&&(this.token=m,IS_DEV_MODE&&console.log("isSinged:",this.isSinged+"\nX-Token:",m))},l=Date.now()+Math.random(),o=t=>{var e;const s=null!==(e=null!=t?t:this.maxTimeExecutionMs)&&void 0!==e?e:25e3,a=new AbortController,i=setTimeout((()=>{a.signal.aborted||a.abort()}),s);return a.signal.addEventListener("abort",(()=>{clearTimeout(i)}),{once:!0}),{signal:a.signal,clearSignal:()=>clearTimeout(i),get isAborted(){return a.signal.aborted}}};let{signal:u,clearSignal:c}=o(this.maxTimeExecutionMs);const d={url:t,method:"GET",params:{_:l},headers:Object.assign({"X-Tag":this.srvTag},this.token?{"X-Token":this.token}:{}),responseType:"json",timeoutErrorMessage:`Request timed out after ${this.maxTimeExecutionMs} ms`,signal:u};return{query(t={}){const s=e(t);return d.params=Object.assign(Object.assign({},s),d.params),this},headers(t={}){return d.headers=Object.assign(Object.assign({},d.headers),t),this},deleteAllHeaders(){return delete d.headers,this},setTimeout(t=25e3){return c(),({signal:u,clearSignal:c}=o(t)),d.timeoutErrorMessage=`Request timed out after ${t} ms`,d.signal=u,d.withXSRFToken=!0,this},GET(){return d.method="GET",this},POST(t={}){return d.method="POST",d.data=t,this},PUT(t={}){return d.method="PUT",d.data=t,this},DELETE(t={}){return d.method="DELETE",d.data=t,this},async exec(){"GET"!==d.method&&delete d.params._;const t=s.request(d).then((t=>(r(t),t))).catch(a).finally((()=>c())),{data:e,status:n,statusText:l}=await t;return i(n,l),{data:e,status:n,statusText:l}},async value(){const{data:t}=await this.exec();await t}}}async GET(t,e={},s={}){const a=new AbortController,i=setTimeout((()=>{a.abort()}),this.maxTimeExecutionMs),n={params:this.queryStringHandler(e),headers:Object.assign(Object.assign({},this.token?{"X-Token":this.token}:{}),null!=s?s:{}),responseType:"json",signal:a.signal},r=this.axi.get(t,n).then((t=>(this.responseHandler(t),t))).catch(this.axiosErrorHandler).finally((()=>clearTimeout(i))),{data:l,status:o,statusText:u}=await r;return this.statusHandler(o,u),l}async POST(t,e={},s={},a={}){const i=new AbortController,n=setTimeout((()=>{i.abort()}),this.maxTimeExecutionMs),r={params:this.queryStringHandler(s),headers:Object.assign(Object.assign({},this.token?{"X-Token":this.token}:{}),null!=a?a:{}),responseType:"json",signal:i.signal},l=this.axi.post(t,e,r).then((t=>(this.responseHandler(t),t))).catch(this.axiosErrorHandler).finally((()=>clearTimeout(n))),o=await l,{data:u,status:c,statusText:d}=o;return this.statusHandler(c,d),u}async DELETE(t,e={},s={},a={}){const i=new AbortController,n=setTimeout((()=>{i.abort()}),this.maxTimeExecutionMs),r={params:this.queryStringHandler(s),headers:Object.assign(Object.assign({},this.token?{"X-Token":this.token}:{}),null!=a?a:{}),responseType:"json",signal:i.signal,data:e},l=this.axi.delete(t,r).then((t=>(this.responseHandler(t),t))).catch(this.axiosErrorHandler).finally((()=>clearTimeout(n))),{data:o,status:u,statusText:c}=await l;return this.statusHandler(u,c),o}async PUT(t,e={},s={},a={}){const i=new AbortController,n=setTimeout((()=>{i.abort()}),this.maxTimeExecutionMs),r={params:this.queryStringHandler(s),headers:Object.assign(Object.assign({},this.token?{"X-Token":this.token}:{}),null!=a?a:{}),responseType:"json",signal:i.signal},l=this.axi.put(t,e,r).then((t=>(this.responseHandler(t),t))).catch(this.axiosErrorHandler).finally((()=>clearTimeout(n))),{data:o,status:u,statusText:c}=await l;return this.statusHandler(u,c),o}async getLineSports(t=0){var e;const s=+t>0?this.url(`/line/${this.locale}/sports/${t}`):this.url(`/line/${this.locale}/allSports`);return null!==(e=await this.GET(s,{},{}))&&void 0!==e?e:[]}async getHotEvents(){var t;const e=this.url(`/line/${this.locale}/hotevents`);return null!==(t=await this.GET(e,{},{}))&&void 0!==t?t:[]}async getCountriesList(t,e=0){var s;const a=this.url(`/line/${this.locale}/countries/sport${t}/${e}`);return null!==(s=await this.GET(a,{},{}))&&void 0!==s?s:[]}async getPrematchTournaments(t,e,s=0){var a;const i=this.url(`/line/${this.locale}/tournaments/sport${t}/country${e}/${s}`);return null!==(a=await this.GET(i,{},{}))&&void 0!==a?a:[]}async getPrematchTournamentsByMinutes(t=0,e=0){var s;const a=this.url(`/line/${this.locale}/events/full/sport${t}/${e}`);return(null!==(s=await this.GET(a,{},{}))&&void 0!==s?s:[]).filter((t=>{var e;return(null!==(e=null==t?void 0:t.EventsHeaders)&&void 0!==e?e:[]).length>0}))}async getPrematchTournamentsHeadersByMinutes(t,e=0){var s;const a=this.url(`/line/${this.locale}/tournaments/headers/sport${t}/${e}`);return null!==(s=await this.GET(a,{},{}))&&void 0!==s?s:[]}async getPrematchEvents(t,e,s,a){var i;const n=this.url(`/line/${this.locale}/events/sport${t}/country${e}/tourney${s}/${a}`);return null!==(i=await this.GET(n,{},{}))&&void 0!==i?i:[]}liveTimestampReset(t=!0){this._liveTimestampReset=t}async getLive(t=!1,e=[]){var s;let a=!1;(t||!0===this._liveTimestampReset)&&(this.liveTimestamp=0,this.liveTimestampReset(!1));const i=this.url(`/live/${this.locale}/full/${this.liveTimestamp}/0`),{data:n,status:r}=await this.request(i).GET().query({events:e}).exec(),{TimeStamp:l,LEvents:o,IsChanges:u}=null!=n?n:{};return a=!1===u,this.liveTimestamp=200===r&&null!==(s=null!=l?l:this.liveTimestamp)&&void 0!==s?s:0,{ts:+this.liveTimestamp,events:null!=o?o:[],isFullPackage:a}}async getFullLiveWithoutSaveTimeStamp(){var t;const e=this.url(`/live/${this.locale}/full/0/0`),s=null!==(t=await this.GET(e,{},{}))&&void 0!==t?t:{},{LEvents:a}=null!=s?s:{};return null!=a?a:[]}async getLiveEventsAndFullEvent(t){var e;const s=this.url(`/live/${this.locale}/bets/${t}`);return[null!==(e=await this.GET(s,{},{}))&&void 0!==e?e:{}]}async getLiveEventFull(t){const e=this.url(`/live/${this.locale}/bets/${t}`),{data:s}=await this.request(e).exec();return null!=s?s:null}async getEventPrematch(t){var e;const s=this.url(`/line/${this.locale}/event/${t}`);return null!==(e=await this.GET(s,{},{}))&&void 0!==e?e:{}}async verifyEmail(t){var e;const s=this.url(`/account/userActivationByEmail/${t}/${this.locale}`);return null!==(e=await this.GET(s,{},{}))&&void 0!==e?e:{}}async signUp(t){Object.assign(t,{Culture:this.locale});const e=this.url(`/account/${this.locale}/registration`);return await this.POST(e,t)}async signUpViaEmail(t){if(t.CurrencyId){const e=t.CurrencyId;t.PointId=e,delete t.CurrencyId}Object.assign(t,{Culture:this.locale});const e=this.url(`/account/${this.locale}/registrationNewEmail`);return await this.POST(e,t)}async signUpDirect(t){if(t.CurrencyId){const e=t.CurrencyId;t.PointId=e,delete t.CurrencyId}Object.assign(t,{Culture:this.locale});const e=this.url(`/account/${this.locale}/registrationNewWhithOutEmail`);return await this.POST(e,t)}async createInternetUser(t){var e,s;if(t.CurrencyId){const e=t.CurrencyId;t.PointId=e,delete t.CurrencyId}if(!(null==(t=Object.assign({},t,{Culture:this.locale}))?void 0:t.PointId))return{created:null,error:"parametersError",status:200,statusText:""};t.PointId&&t.PointId<1e4&&(t.PointId=t.PointId+1e4);const a=this.url(`/account/${this.locale}/registrationNewWhithOutEmail`),{data:i,status:n,statusText:r}=await this.request(a).POST(t).exec();return{created:null!==(s=null===(e=null==i?void 0:i.Data)||void 0===e?void 0:e._isSuccessful)&&void 0!==s?s:null,error:(null==i?void 0:i.Error)||null,status:n,statusText:r}}async getResultsSports(t,e){const s=this.url(`/results/${this.locale}/sports/0/${t}/${e}`);return await this.GET(s,{},{})}async getResultsTournamentsBySportId(t,e,s){const a=this.url(`/results/${this.locale}/tournaments/sport${t}/0/${e}/${s}`);return await this.GET(a,{},{})}async getResultsGrid(t,e,s,a,i){const n=this.url(`/results/${this.locale}/sport${t}/country${e}/tournament${s}/0/${a}/${i}`),r=await this.GET(n,{},{});return null!=r?r:[]}async getGamesProvidersTopGames(){const t=this.url("/slotintegrator-service/topGameByProvider"),e=await this.GET(t,{},{});return null!=e?e:[]}async getGamesTopProviders(){const t=this.url("/slotintegrator-service/topProviders"),e=await this.GET(t,{},{});return null!=e?e:[]}async getSlotsList(){const t=this.url("/slotintegrator-service/gamelist"),{items:e}=await this.GET(t,{},{});return null!=e?e:[]}async createSlotOutcome(t){return{}}async createSlotIntegratorDemo(t){const e=this.locale||"en";try{t.language=e.substring(0,2);const s=this.url("/slotintegrator-service/InitDemoGames"),a=await this.POST(s,t);return JSON.parse(a)}catch(t){return{}}}async createSlotIntegratorReal(t){try{const e=this.url("/slotintegrator-service/InitRealGames"),s=await this.POST(e,t);return JSON.parse(s)}catch(t){return{}}}async getSlotIntegratorProvidersHeaders(){try{const t=this.url("/slotintegrator-service/ProviderHeaders"),e=(await this.GET(t)||[]).map((t=>Object.assign(Object.assign({},t),{ProviderName:t.Provider,Games:[]})));return null!=e?e:[]}catch(t){return[]}}async getSlotIntegratorProviderAllGames(t){const e=this.url(`/slotintegrator-service/searchGameByProvider/${t}`),s=await this.GET(e);return null!=s?s:[]}async getSlotIntegratorFilteredGames(t){const e=this.url(`/slotintegrator-service/searchGameByName/${t}`),s=await this.GET(e);return null!=s?s:[]}async login({login:t,password:e}){this.token=void 0;const s=this.url("/account/LogIn",api.LBC),a={Login:t,Password:e,Culture:this.locale},i=await this.POST(s,a),{Data:n}=null!=i?i:{};return!n&&IS_DEV_MODE&&console.log("\n```\n/account/LogIn:\n",i,"\n```\n"),n&&n.UserId>0&&n["X-Token"]?(this.token=n["X-Token"],this.user=n,this.user):(this.user={},this.user)}async getUserData_OLD(){const t=this.url("/account/GetUserData",api.LBC),e=await this.GET(t);return(null==e?void 0:e.UserId)>0?(this.user=e,e):(this.user={},null)}async getUserData(){const t=this.url("/account/GetUserData",api.LBC),{data:e,status:s,statusText:a}=await this.request(t).exec();return this.user=(null==e?void 0:e.UserId)>0?e:{},this.responseHandlerData(e,s,a)}async getUserFullData(){return await this.getUserData()}async logout(){const t=this.url("/account/LogOut",api.LBC),e=await this.POST(t),s=!1===e;return this.user={},this.token=void 0,{ok:s,isLogged:!!s&&e}}async balance(){if(this.isSinged){const t=this.url("/account/GetUserBalance",api.LBC),e=await this.GET(t);return null!=e?e:{}}return{}}async getBalance(){const t=this.url("/account/GetUserBalance",api.LBC),{data:e,status:s,statusText:a}=await this.request(t).exec();return this.responseHandlerData(e,s,a)}async changePassword(t){var e;if(this.isSinged){t.userData.Gmt=(new Date).getTimezoneOffset()/60,t.userData.Language=this.languageId;const s=this.url("/account/ChangeUserPassword",api.LBC),a=await this.POST(s,t);return console.log(a),{ok:!a.IsError||!1,status:null!==(e=a.ErrorCode)&&void 0!==e?e:5001}}return{ok:!1,status:5001}}longToGuid(t){const e=new ArrayBuffer(16);new DataView(e).setUint32(0,t,!0);const s=Array.from(new Uint8Array(e));return[s.slice(0,4).reverse(),s.slice(4,6).reverse(),s.slice(6,8).reverse(),s.slice(8,10),s.slice(10,16)].map((t=>t.map((t=>t.toString(16).padStart(2,"0"))).join(""))).join("-")}async getSportsEventsSearch(t){var e,s;if(!t)return[];const a=this.url("/line/SearchFullByCulture",api.V2),i={culture:this.locale,searchText:t},[n,r]=await Promise.all([null!==(e=this.GET(a,i))&&void 0!==e?e:[],null!==(s=this.getFullLiveWithoutSaveTimeStamp())&&void 0!==s?s:[]]),l=n.filter((t=>t.Type>1)).map((t=>{var e;const s=new Date(null!==(e=null==t?void 0:t.Date)&&void 0!==e?e:"").toLocaleDateString(this.locale,{weekday:"short",day:"2-digit",month:"long",hour:"2-digit",minute:"2-digit"}).replace(",","");return Object.assign(t,{Date:s,to:{name:"eventprematch",params:{prEventId:routeNameId(t.Id,t.Name)}},t1:t.Name.split(/\s*\-\s*/)[0],t2:t.Name.split(/\s*\-\s*/)[1]})})),o=t.toLowerCase();return[...r.filter((t=>t.Description.NameTeam1.toLowerCase().includes(o)||t.Description.NameTeam2.toLowerCase().includes(o)||t.Description.TName.toLowerCase().includes(o))).map((t=>{const e=`${t.Description.NameTeam1} vs ${t.Description.NameTeam2} ${t.Description.SportName}`,s=new Date(t.Description.Date).toLocaleDateString(this.locale,{weekday:"short",day:"2-digit",month:"long",hour:"2-digit",minute:"2-digit"}).replace(",","");return{CountryId:t.Description.CountryId,Date:s,Id:+t.Id,Name:e,PriceNum:t.Description.PriceNum,SportId:t.Description.SportId,SportName:t.Description.SportName,TournamentId:t.Description.TournamentId,TournamentName:t.Description.TName,Type:3,isLive:!0,to:{name:"eventinplay",params:{prEventId:routeNameId(t.Id,e)}},t1:t.Description.NameTeam1,t2:t.Description.NameTeam2}})),...l]}async getFavorites(){if(this.isSinged){const t=this.url("/favorites/GetFavorites",api.V2),e=await this.GET(t,{culture:this.locale});return null!=e?e:[]}return[]}async addFavorite(t,e){if(this.isSinged){const s=this.url("/favorites/AddToFavorites",api.V2),a=await this.POST(s,{},{id:t,type:e});return null!=a&&a}return!1}async removeFavorite(t){if(this.isSinged){const e=this.url("/favorites/RemoveFromFavorites",api.V2),s=await this.POST(e,{id:t});return null!=s&&s}return!1}async getPurses(t=5){if(this.isSinged){const e=this.url("/account/GetPurses",api.V2),s={psType:t},a=await this.GET(e,s);return null!=a?a:[]}return[]}async sendWithdrawal(t,e){}async sendWithdrawalAgent(t){if(this.isSinged){const e={securityCode:"",secAnswer:"",additionalParams:{}};Object.assign(e,t);const s=this.url("/payment/CreateOrderWithdraw",api.LBC),a=await this.POST(s,e);if(isNaN(parseFloat(a)))return{ok:!1,status:a};{const t=await this.getOrderedTransactions();return{ok:!0,balance:parseFloat(a),userOrders:t}}}return{ok:!1,status:10016}}async cancelOrderedTransaction(t){if(this.isSinged){const e=this.url("/payment/CancelOrderedTransaction",api.LBC),s=await this.POST(e,t);if(-1===s)return{ok:!1,status:103};if(isNaN(parseFloat(s)))return{ok:!1,status:103};{const t=await this.getOrderedTransactions();return{ok:!0,balance:parseFloat(s),userOrders:t}}}return{ok:!1,status:10016}}async getMovementOfMoney(t){var e;if(this.isSinged){Object.assign(t,{culture:this.locale});const s=this.url("/account/GetAccountTransactions",api.V2),a=await this.GET(s,t),i=(null!==(e=null==a?void 0:a.TransactionsDataList)&&void 0!==e?e:[]).map((t=>{var e;return{income:null!==(e=t.IsAddition)&&void 0!==e&&e,sign:t.IsAddition?"+":"-",id:t.Id,typeId:t.TransactionType,typeName:t.TransactionDescription,date:t.TransactionDate,value:t.Amount,amount:t.Amount,bonus:t.Bonus,balance:t.Balance}}));return{result:i}}return{result:[]}}async getOrderedTransactions(){if(this.isSinged){const t=this.url("/account/GetOrderedTransactions",api.V2);return await this.GET(t)}return[]}async getBetContent(t){const e={id:t,culture:this.locale};if(this.isSinged){const t=this.url("/account/GetBetContent",api.V2);return await this.GET(t,e)}return{}}async getBetContentV2(t){if(this.isSinged){const e={id:t,culture:this.locale},s=this.url("/account/GetBetContentNew",api.V2),{data:a,status:i,statusText:n}=await this.request(s).query(e).exec();return this.responseHandlerData(a,i,n)}return{}}async getUserBets(t){if(Object.assign(t,{culture:this.locale}),this.isSinged){const e=this.url("/account/GetUserBets",api.V2);return await this.GET(e,t)}}async getUserBetsV2(t){if(this.isSinged){t=Object.assign(Object.assign({},t),{culture:this.locale});const e=this.url("/account/GetUserBetsNew",api.V2),{data:s,status:a,statusText:i}=await this.request(e).query(t).exec();return{data:null!=s?s:null,error:200!==a?i:null,status:a,statusText:i}}return{data:null,error:"Unauthorized",status:401,statusText:"Unauthorized"}}async getUserBets02(t){if(Object.assign(t,{culture:this.locale}),this.isSinged){const e=this.url("/account/GetUserBets",api.V2),{data:s,status:a,statusText:i}=await this.request(e).query(t).exec();return{data:null!=s?s:null,error:200!==a?i:null,status:a,statusText:i}}return{data:null,error:"Unauthorized",status:401,statusText:"Unauthorized"}}async getOddsForEdit(t){const e=this.url("/betting/GetBetForChange",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec(),n=this.convertDataData(s);return this.responseHandlerData(n,a,i)}async placeCouponEdited(t){const e=this.url("/betting/ChangeBet",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec(),n=this.convertDataData(s);return this.responseHandlerData(n,a,i)}async getUserBetsCashout(t){const e=this.url("/betting/CheckCashoutForBets",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST({BetIds:t}).exec();return this.responseHandlerData(s,a,i)}async getUserBetsStatuses(t){const e=this.url("/betting/CheckBetsStatuses",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST({BetIds:t}).exec();return this.responseHandlerData(s,a,i)}async cashoutHandler(){var t,e;const s=null!==(e=null===(t=this.user)||void 0===t?void 0:t.UserId)&&void 0!==e?e:0,a=this.url(`/stats/cashout/${s}`,api.NV20),{data:i,status:n,statusText:r}=await this.request(a).GET().setTimeout(6500).exec(),l=this.convertDataData(i);return this.responseHandlerData(l,n,r)}async returnCashoutBet(t){const e=this.url("/betting/CashOutReturnBet",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec(),n=this.convertDataData(s);return this.responseHandlerData(n,a,i)}createCoupon(t,e,s,a=-1){var i,n,r,l,o;const u={betAmount:e,doAcceptOddsChanges:s,statuses:{},systemIndex:a};for(let e=0;e<t.length;e++){const s=t[e],a=[null!==(i=s.LinesID)&&void 0!==i?i:"null",null!==(n=s.BetVarID)&&void 0!==n?n:"null",null!==(r=s.HandSize)&&void 0!==r?r:"null",null!==(l=s.Add1)&&void 0!==l?l:"null",null!==(o=s.Add2)&&void 0!==o?o:"null"].join("_");u.statuses[a]=!0}return u}async placeCoupon(t){if(this.isSinged){const e=this.url("/betting/PlaceBet",api.LBC);return await this.POST(e,t)}}async placeCouponConditional(t){if(this.isSinged){const e=this.url("/betting/PutReinvestedBet",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec();return this.responseHandlerData(s,a,i)}}async placeCouponBetShop(t){if(this.isSinged){const e=this.url("/betting/PlaceBetSubCashier",api.LBC);return await this.POST(e,t)}}async getBetShopCouponByCode(t){if(this.isSinged){const e=this.url("/betting/GetBetSubCashier",api.LBC),s={code:t,culture:this.locale},{data:a,status:i,statusText:n}=await this.request(e).query(s).exec();return this.responseHandlerData(a,i,n)}}async loginIsExist(t){const e=this.url("/account/IsUserExists",api.LBC);return await this.GET(e,{userName:t})}async emailIsExist(t){const e=this.url("/account/IsEmailExists",api.LBC);return await this.GET(e,{email:t})}async changePersonalData(t){if(this.isSinged){const e=this.url("/account/ChangePersonalData",api.LBC);return await this.POST(e,t)||!1}return!1}async getMessagesAll({page:t,pageSize:e}){if(this.isSinged){const s=this.url("/messages/GetAllMessages",api.LBC),a=await this.GET(s,{page:t,pageSize:e});return null!=a?a:[]}return[]}async getMessageById(t){var e;if(this.isSinged){const s=this.url("/messages/GetMessagesById",api.LBC);return null!==(e=(await this.GET(s,{id:t}))[0])&&void 0!==e?e:{}}return{}}async sensMessage({ToUserId:t,Text:e,Subject:s,ParentId:a}){if(this.isSinged){const i=this.url("/messages/SendMessage",api.LBC),n=await this.POST(i,{ToUserId:t,Text:e,Subject:s,ParentId:a});return null!=n?n:null}return null}async markMessageAsRead({MessageId:t,MessageTypeId:e}){if(this.isSinged){const s=this.url("/messages/MarkMessageAsRead",api.LBC),a=await this.POST(s,{MessageId:t,MessageTypeId:e});return null!=a?a:null}return null}async deleteMessage({MessageId:t,MessageTypeId:e}){if(this.isSinged){const s=this.url("/messages/DeleteMessage",api.LBC),a=await this.POST(s,{MessageId:t,MessageTypeId:e});return null!=a?a:null}return null}async deleteMessagesAll(){if(this.isSinged){const t=this.url("/messages/DeleteAllMessages",api.LBC),e=await this.POST(t,{});return null!=e?e:null}return null}async getMessagesCount(){if(this.isSinged){const t=this.url("/messages/GetMessagesCount",api.LBC),e=await this.GET(t,{});return null!=e?e:null}return null}async getMessagesUnreadCount(){if(this.isSinged){const t=this.url("/messages/GetCountUnreadMessages",api.LBC),e=await this.GET(t,{});return null!=e?e:null}return null}async isUserTempExist(t){const e=this.url("/account/IsUserExistsInTemp",api.LBC),{data:s}=await this.request(e).query({userName:t}).exec();return null!=s?s:null}async createUserTemp(t){var e,s;const a=this.url(`/account/${this.locale}/UserRegistrationOnlyInTepm`),{data:i}=await this.request(a).POST(t).exec(),n=null!==(s=null===(e=null==i?void 0:i.Data)||void 0===e?void 0:e._isSuccessful)&&void 0!==s?s:null;return null!=n?n:null}async getGamesListGR(t={platforms:"desktop"}){const e=this.url("/Softquo/GetGamesList",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec();return this.responseHandlerData(s,a,i)}async getGameFrameUrlGR(t){const e=this.url("/Softquo/InitGame",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).query(t).exec();return this.responseHandlerData(s,a,i)}async pingApi(){const t=this.url("/account/Ping",api.LBC),{data:e,status:s,statusText:a}=await this.request(t).exec();return this.responseHandlerData(e,s,a)}async intgrGetGamesList(t){const e=this.url("/Games/GetGamesList",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec();return this.responseHandlerData(s,a,i)}async intgrGetGameTypes(t){const e=this.url("/Games/GetGameTypes",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).POST().query({groupId:t}).exec();return this.responseHandlerData(s,a,i)}async intgrGetProvidersList(t){const e=this.url("/Games/GetGameProviders",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).POST().query({groupId:t}).exec();return this.responseHandlerData(s,a,i)}async intgrGetTopGames(t){const e=this.url("/Games/GetTopGames",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).POST().query({groupId:t}).exec();return this.responseHandlerData(s,a,i)}async intgrInitGame(t){const e=this.url("/Games/InitGame",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).query(t).exec();return this.responseHandlerData(s,a,i)}async checkPromocode(t){}async activatePromocode(t){}async sendSms(t){}async signUpPhone(t){}async passwordRecoveryRequest(t){}async passwordRecoveryEmail(t){}async passwordSetNewByPhone(t){}async passwordSetNewByEmail(t){}async signUpEmail(t){}async getUserPersonalInfo(){}async sendPayment(t,e){}async setUserPersonalInfo(t){}async getGamesToken(t){}async getProviderHedlines(t){}async createTempSignUp({login:t,password:e}){}async setRemoteLanguage(t){return null!=t||(t=this.lang),await this.setLanguageRemoteLocale(t)}convertBonuses(t){let e=[];return Object.keys(t).forEach((s=>{const a=s.match(/B_Koef(\d)_Value/);if(a){const s=a[1];e.push(["Koef",t[`B_Koef${s}`],t[`B_Koef${s}_Value`]])}const i=s.match(/B_Kolvo(\d)_Value/);if(i){const s=i[1];e.push(["Kolvo",t[`B_Kolvo${s}`],t[`B_Kolvo${s}_Value`]])}"B_Perestavka_Value"===s&&e.push(["Perestavka",!0,t.B_Perestavka_Value]),"B_MinOdds"===s&&e.push(["MinOdds",!0,t.B_MinOdds])})),e}async getBetslip_OLD(){var t,e;const s=this.url("/betting/GetBetslip",api.LBC),a=await this.GET(s,{});return a.bonuses=this.convertBonuses(null!==(t=null==a?void 0:a.Bonus)&&void 0!==t?t:{}),null!==(e=a.Bets)&&void 0!==e||(a.Bets=[]),delete a.Bonus,null!=a?a:{}}async getBetslip(){var t,e;const s=this.url("/betting/GetBetslip",api.LBC);let{data:a,status:i,statusText:n}=await this.request(s).exec();return null!=a||(a={}),a.bonuses=this.convertBonuses(null!==(t=null==a?void 0:a.Bonus)&&void 0!==t?t:{}),null!==(e=a.Bets)&&void 0!==e||(a.Bets=[]),delete a.Bonus,a}async clearBetslip(){const t=this.url("/betting/ClearBetslip",api.LBC),e=await this.POST(t);return null!=e&&e}async changeBetslipType(t){const e=this.url("/betting/ChangeBetslipType",api.LBC),s=await this.POST(e,{},{betslipType:t});return null!=s&&s}async setBetslipSettings(t){if(this.isSinged){const e=this.url("/betting/SetBetslipSettings",api.LBC),s=await this.POST(e,t);return null!=s?s:[]}return[]}async addToBetslip(t){t.culture=this.locale;const e=this.url("/betting/AddToBetslip",api.LBC),s=await this.POST(e,t);return null!=s?s:null}async addToBetslipV2(t){t.culture=this.locale;const e=this.url("/betting/AddToBetslipNew",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec();return this.responseHandlerDataData(s,a,i)}async removeFromBetslipV2(t){const e=this.url("/betting/RemoveFromBetslipNew",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec();return this.responseHandlerDataData(s,a,i)}async removeFromBetslip(t){t.culture=this.locale;const e=this.url("/betting/RemoveFromBetslip",api.LBC);return await this.POST(e,t)||!1}async removeBonus(){const t=this.url("/betting/DeleteBonus",api.LBC),e=await this.POST(t);return null!=e&&e}async addBonus(t){const e=this.url("/betting/AddBonus",api.LBC),s=await this.POST(e,{},{odd:t});return null!=s?s:null}async updateBet(t){t.culture=this.locale;const e=this.url("/betting/UpdateBet",api.LBC);return null===await this.POST(e,t)}async getBetsLimits(){if(this.isSinged){const t=this.url("/betting/GetLimitations",api.LBC),e=await this.GET(t);return null!=e?e:{Min:0,Max:0}}return{Min:0,Max:0}}async getBetsLimitsNew(){if(this.isSinged){const t=this.url("/betting/GetLimitations",api.LBC),{data:e,status:s,statusText:a}=await this.request(t).exec(),{Min:i=null,Max:n=null,MaxOddForMulty:r=250}=null!=e?e:{},l={Min:i,Max:n,MaxOddForMulty:r};return this.responseHandlerData(l,s,a)}return{data:{Min:null,Max:null,MaxOddForMulty:250},status:200,statusText:"OK"}}async getCurrencies(){if(this.isSinged){const t=this.url("/location/GetCurrencies",api.V2),e=await this.GET(t);return null!=e?e:[]}return null}async getCountries(){if(this.isSinged){const t=this.url("/location/GetCountries",api.V2),e=await this.GET(t);return null!=e?e:[]}return null}async getAllKeys(t){const e=this.url("/info/GetAllKeys",api.LBC),s=await this.GET(e,{key:t,culture:this.locale});return null!=s?s:[]}async getSlides(t){null!=t||(t="https://f004.backblazeb2.com/file/betroute/slides.json");const e=this.url(t),{data:s,status:a,statusText:i}=await this.request(e).deleteAllHeaders().exec();return this.responseHandlerData(s,a,i)}async getSiteSlidesSections(t){null!=t||(t="https://f004.backblazeb2.com/file/betroute/slides.json");const e=this.url(t),{data:s,status:a,statusText:i}=await this.request(e).deleteAllHeaders().exec();return this.responseHandlerData(s,a,i)}async getEventStatisticData(t){const e=this.url(`/stats/data/${t}/${this.locale}`,api.NV20),{data:s,status:a,statusText:i}=await this.request(e).exec();return this.responseHandlerData(s,a,i)}async getEventStatisticPage(t){const e=this.url(`/stats/page/${t}/${this.locale}`,api.NV20),{data:s,status:a,statusText:i}=await this.request(e).exec();return this.responseHandlerData(s,a,i)}async searchPrematchEventsNv20(t,e={}){var s;const a=this.url("/stats/pm/search",api.NV20);t=null!==(s=null==e?void 0:e.searchString)&&void 0!==s?s:t.split(/\s+/).filter((t=>!0!==/\d/.test(t)&&t.length>1)).join(" ").trim();const i=Object.assign(Object.assign(Object.assign(Object.assign({locale:this.locale,searchString:t},(null==e?void 0:e.LIMIT)?{LIMIT:e.LIMIT}:{LIMIT:{from:0,size:30}}),(null==e?void 0:e.negativeString)?{negativeString:e.negativeString}:{}),(null==e?void 0:e.sportId)?{sportId:e.sportId}:{}),(null==e?void 0:e.tournamentId)?{tournamentId:e.tournamentId}:{}),{data:n,status:r,statusText:l}=await this.request(a).POST(i).exec();return n.searchString=t,n.from=i.LIMIT.from,n.size=i.LIMIT.size,this.responseHandlerData(n,r,l)}async searchPrematchEventsIdsNv20(t){var e,s;const a=this.url("/stats/pm/search/ids",api.NV20);null!==(e=t.locale)&&void 0!==e||(t.locale=this.locale),null!==(s=t.LIMIT)&&void 0!==s||(t.LIMIT={from:0,size:30});const{data:i,status:n,statusText:r}=await this.request(a).POST(t).exec();return i.from=t.LIMIT.from,i.size=t.LIMIT.size,this.responseHandlerData(i,n,r)}async getPrematchEventsByIds(t,e=!0){const s=this.url("/stats/pm/getlocalesevents",api.NV20),a={eventIds:t,locales:[this.locale],noslice:e},{data:i,status:n,statusText:r}=await this.request(s).POST(a).exec();return this.responseHandlerData(i,n,r)}async getDictionaryNv20(t){var e,s,a,i,n;const r=this.url("/stats/pm/dictionary",api.NV20);null!==(e=t.locale)&&void 0!==e||(t.locale=this.locale);const{data:l,status:o,statusText:u}=await this.request(r).POST(t).exec();return l.from=null!==(a=null===(s=null==t?void 0:t.LIMIT)||void 0===s?void 0:s.from)&&void 0!==a?a:null,l.size=null!==(n=null===(i=null==t?void 0:t.LIMIT)||void 0===i?void 0:i.size)&&void 0!==n?n:null,this.responseHandlerData(l,o,u)}async getLineSportsNv20(t=0,e=25e3){var s;const a=this.url("/stats/pm/dictionary",api.NV20),i=Object.assign({locale:this.locale,dictionary:"sport"},t>0?{minutes:t}:{}),{data:n,status:r,statusText:l}=await this.request(a).POST(i).setTimeout(e).exec(),o=this.responseHandlerData(n,r,l),u=(Array.isArray(null===(s=null==o?void 0:o.data)||void 0===s?void 0:s.results)?o.data.results:[]).filter((t=>!!(null==t?void 0:t.sName))).map((t=>({ID:+t.sport,Name:t.sName,cnt:+t.cnt})));return this.sortDataByPriority(u,this.primarySports,"ID")}async getLineSportsMain(t=0,e=1500){let s=await this.getLineSportsNv20(t,e);return 0===s.length&&(s=await this.getLineSports(t)),s}async getCountriesBySportNv20(t,e=0,s=25e3){var a;try{const i=this.url("/stats/pm/dictionary",api.NV20),n=Object.assign({locale:this.locale,sportId:t,dictionary:"country"},e>0?{minutes:e}:{}),{data:r,status:l,statusText:o}=await this.request(i).POST(n).setTimeout(s).exec(),u=this.responseHandlerData(r,l,o),c=(Array.isArray(null===(a=null==u?void 0:u.data)||void 0===a?void 0:a.results)?u.data.results:[]).filter((t=>!!(null==t?void 0:t.cName))).sort(((t,e)=>{var s;return null===(s=null==t?void 0:t.cName)||void 0===s?void 0:s.localeCompare(null==e?void 0:e.cName)})).map((t=>({ID:+t.country,Name:t.cName,cnt:+t.cnt}))),d=this.priorityCountries[t];return d?this.sortDataByPriority(c,d,"ID"):c}catch(t){return[]}}async getCountriesListMain(t,e=0,s=3e3){let a=await this.getCountriesBySportNv20(t,e,s);return 0===a.length&&(a=await this.getCountriesList(t,e)),a}async getPrematchTournamentsNv20(t,e,s=0,a=25e3){var i,n;const r=this.url("/stats/pm/dictionary",api.NV20),l=Object.assign(Object.assign(Object.assign({locale:this.locale,sportId:t},e?{countryId:e}:{}),{dictionary:"tournament"}),s>0?{minutes:s}:{}),{data:o,status:u,statusText:c}=await this.request(r).POST(l).setTimeout(a).exec(),d=this.responseHandlerData(o,u,c),h=(Array.isArray(null===(i=null==d?void 0:d.data)||void 0===i?void 0:i.results)?d.data.results:[]).filter((t=>!!(null==t?void 0:t.tName))).sort(((t,e)=>null==t?void 0:t.tName.localeCompare(null==e?void 0:e.tName))).map((t=>({Id:+t.tournament,Name:t.tName,cnt:+t.cnt,sId:+t.sport,sName:t.sName,CountryId:+t.country,cName:t.cName}))),g=null!==(n=this.priorityTournaments[t])&&void 0!==n?n:null;return g?this.sortDataByPriority(h,g,"Id"):h}async getPrematchTournamentsMain(t,e,s=0,a=3e3){let i=await this.getPrematchTournamentsNv20(t,e,s,a);return 0===i.length&&(i=await this.getPrematchTournaments(t,e,s)),i}async getPrematchTournamentsHeadersMain(t,e=0,s=3e3){let a=await this.getPrematchTournamentsNv20(t,null,e,s);return 0===a.length&&(a=await this.getPrematchTournamentsHeadersByMinutes(t,e)),a}async searchPrematchTournametsEventsNv20(t,e={}){var s,a,i;const{data:n,status:r,statusText:l}=await this.searchPrematchEventsNv20(t,e),o=(null!==(s=null==n?void 0:n.documents)&&void 0!==s?s:[]).reduce(((t,e)=>{const s=e.EventKeys.TurnirID;return t[s]||(t[s]=[]),t[s].push(e),t}),{}),u={tournaments:Object.entries(o).map((([t,e])=>({Id:t,Name:e[0].TourneyName.trim(),SportName:e[0].SportName,SportID:e[0].EventKeys.SportID,EventsHeaders:e}))),total:null!==(a=null==n?void 0:n.total)&&void 0!==a?a:0,searchString:null!==(i=null==n?void 0:n.searchString)&&void 0!==i?i:""};return this.responseHandlerData(u,r,l)}async sendErrInfo(t,e){const s=this.url("/err/send/front",api.NV20),{data:a,status:i,statusText:n}=await this.request(s).POST({text:t,code:e}).exec();return this.responseHandlerData(null==a?void 0:a.ok,i,n)}async cloneBetCoupon(t){var e,s;const a=this.url("/betting/TryGetBetCopy",api.LBC);null!==(e=t.betId)&&void 0!==e||(t.betId=null),null!==(s=t.code)&&void 0!==s||(t.code=null),t.culture=this.locale;const{data:i,status:n,statusText:r}=await this.request(a).query(t).exec();return this.responseHandlerData(i,n,r)}async getAllBanners(){const t=this.url("/info/GetAllBanners",api.LBC),e=await this.GET(t,{culture:this.locale});return null!=e?e:[]}async getCdnSlidesData(t,e,s){var a,i;const n={};if(s&&s.length>0&&(n["slider-main"]=s),!t||0===e.length)return n;let r=await Promise.all(e.map((t=>{const e=this.url(`/stats/slides/${t}`,api.NV20);return this.request(e).deleteAllHeaders().exec()})));for(const t of r)for(const[e,s]of Object.entries(null!==(a=null==t?void 0:t.data)&&void 0!==a?a:{})){null!==(i=n[e])&&void 0!==i||(n[e]=[]);for(const t of s)n[e].push(t)}return n}async getCdnSlidesDataV2(t,e=[],s=[]){var a,i;const n={};if(s.length>0&&(n["slider-main"]=s),0===e.length)return n;let r=await Promise.all(e.map((t=>{const e=this.url(`/stats/slides/${t}`,api.NV20);return this.request(e).deleteAllHeaders().exec()})));for(const e of r)for(const[s,r]of Object.entries(null!==(a=null==e?void 0:e.data)&&void 0!==a?a:{})){null!==(i=n[s])&&void 0!==i||(n[s]=[]);for(const e of r){if(t&&(null==e?void 0:e.url_image)){const s=`${t}${new URL(e.url_image).pathname}`;e.url_image=s}n[s].push(e)}}return n}async depositBetKiosk(t){const e=this.url("/betting/DepositMoneyBetshopPlayer",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).query({sum:t}).exec();return this.responseHandlerData(s,a,i)}async depositBetKioskV2(t){const e=this.url("/betting/DepositMoneyBetshopPlayer",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).query({sum:t}).exec();return this.responseHandlerDataData(s,a,i)}async depositBetKioskFromCheck(t){const e=Object.entries(t).reduce(((t,[e,s])=>(("ID"===e||"TransactionID"===e&&"number"==typeof s&&s>0||"BetCode"===e&&"string"==typeof s&&""!==s.trim())&&(t[e]=s),t)),{}),s=this.url("/betting/DepositBetshopPlayerFromCheck",api.LBC),{data:a,status:i,statusText:n}=await this.request(s).POST(e).exec();return this.responseHandlerDataData(a,i,n)}async getWithdrawalTransactionDetail(t){var e,s;const a=null!==(s=null===(e=this.user)||void 0===e?void 0:e.UserId)&&void 0!==s?s:null;if(!a){const t={Data:{Data:null,ReasonMessage:"WithdrawalOrderNotFound",ReasonId:89}};return this.responseHandlerDataData(t,204,"No Content")}const i=this.url("/betting/GetWithdrawalTransBetshopPlayer",api.LBC),{data:n,status:r,statusText:l}=await this.request(i).query({transactionId:t,userId:a}).exec();return this.responseHandlerDataData(n,r,l)}async getFaq(){}async getFlatpagesList(){}async test3(){return"test3 Ok"}async sellBet(t){}convertBasketToPost(t){return{a1:t.Add1,a2:t.Add2,bId:t.BetVarID,eId:t.LinesID,fs:t.HandSize,isLive:t.IsLive,r:t.Odds}}async getSiteLocation(t,e){const s=this.url(`/sitelocation/${t}/${e}/${this.lang}`,api.NV20),{data:a,status:i,statusText:n}=await this.request(s).exec();return this.responseHandlerData(a,i,n)}async getMTrackerEvent(t){const e=this.url(`/mt/event/${t}`,api.NV20),{data:s,status:a,statusText:i}=await this.request(e).exec();return this.responseHandlerDataData(s,a,i)}async getMTrackerLive(){const t=this.url("/mt/live",api.NV20),{data:e,status:s,statusText:a}=await this.request(t).exec();return this.responseHandlerDataData(e,s,a)}async getApkDownloadUrl(t){var e;if(!t)return this.responseHandlerDataData(null,204,"No Content");const s=this.url(t,api.DIRECT),{data:a,status:i,statusText:n}=await this.request(s).exec(),r=null!==(e=null==a?void 0:a.url)&&void 0!==e?e:null;if(!r)return this.responseHandlerDataData(null,204,"No Content");const l=t.includes("?")?t.trim().split(/\/*\?.*$/)[0]:t.trim().split(/\/*$/)[0],o=this.url(`${l}/${r}`,api.DIRECT);return this.responseHandlerDataData(o,i,n)}}
1
+ import{api}from"./Types.js";const locales={ar:"en-US",en:"en-US",de:"en-US",pt:"en-US",fr:"fr-FR",ht:"fr-FR",es:"en-US",tr:"tr-TR",tk:"tr-TR",az:"tr-TR",uk:"en-US",cr:"fr-FR",ru:"ru-RU"},languageIdsRemote={en:1,pt:1,fr:4,es:1,tr:5,az:5,uk:1,cr:1,ru:0},MAX_TIME_EXECUTION_MS=25e3,stringify=t=>JSON.stringify(t,null,2);function convertBasketToPost(t){return{a1:t.Add1,a2:t.Add2,bId:t.BetVarID,eId:t.LinesID,fs:t.HandSize,isLive:t.IsLive,r:t.Odds}}export function routeNameId(t,e=""){return null!=e||(e=""),`${e.replace(/[\s\.\,\(\)\[\]\\\/\-\~\`\"\']+/g," ").trim().replace(/\s+/g,"-").toLowerCase()}~${t}`}export function clearPhone(t,e="",s=""){return e+(String(t).match(/\d+/g)||[]).join("")+s}let IS_DEV_MODE=!1;export class BetBoosterApi{constructor(t,e,s="en",a=15e3,i=!1){this._srv_tag="19",this._locale="en-EN",this._locales=locales,this._languageIdsRemote=languageIdsRemote,this.EXIST_LANGUAGES=Object.keys(locales),this._languageId=1,this._lang="en",this._USER_DATA={},this.LANG_DEFAULT="en",this.LOCALE_DEFAULT="en-EN",this.LANG_ID_DEFAULT=1,this.maxTimeExecutionMs=25e3,this.liveTimestamp=0,this._liveTimestampReset=!1,this.liveRecivedIsFullPackage=!1,this.isNotActive=!1,this.primarySports=[5,1,3,4,8,6,263,265,2,16,17,18],this.priorityCountries={1:[14,8,54],5:[8,14,1,2,5,4,3,43,44,42,11,54],6:[14,8,54],8:[8,14,54],27:[45,187]},this.priorityTournaments={5:[201,361,199,410,200,423,1141,1142,47,2408,1688,2511,129,193,919,1693,1134,2157,147,212,1,185,2,2379,286,1216,99,1266,4,290,735,1059,1100,1268,5,292,1210,1366,700,1217,3,186,2209,2431,288,1410,6,540,1062,1223,1061,1237,40,1235,2230,2370,209,1278,470,1373,35,1386,2229,2373,737,1383,1412,1857,1505,1858,11,1853,2231,742,1382,49,1236,1060,2364,624,15,1896,1409,1493,1918,1925,2283,1612,86,149,2337,8,1213,19,1387]},IS_DEV_MODE=i,this.maxTimeExecutionMs=a,this.axi=t,this.setBaseUrl(e),this.setLanguage(s)}get locale(){return this._locale}get isSinged(){return void 0!==this.user&&void 0!==this.user.UserId&&this.user.UserId>0}get user(){return this._USER_DATA}get userMain(){var t,e,s,a,i,n,r,l,o,u,c,d,h,g;return[`uid: ${null!==(e=null===(t=this._USER_DATA)||void 0===t?void 0:t.UserId)&&void 0!==e?e:"--"}`,`unm: ${null!==(a=null===(s=this._USER_DATA)||void 0===s?void 0:s.UserName)&&void 0!==a?a:"--"}`,`pid: ${null!==(n=null===(i=this._USER_DATA)||void 0===i?void 0:i.PointId)&&void 0!==n?n:"--"}`,`ptp: ${null!==(l=null===(r=this._USER_DATA)||void 0===r?void 0:r.PlayerType)&&void 0!==l?l:"--"}`,`gid: ${null!==(u=null===(o=this._USER_DATA)||void 0===o?void 0:o.GroupID)&&void 0!==u?u:"--"}`,`bal: ${null!==(d=null===(c=this._USER_DATA)||void 0===c?void 0:c.Amount)&&void 0!==d?d:"--"}`,`cur: ${null!==(g=null===(h=this._USER_DATA)||void 0===h?void 0:h.CurrencyName)&&void 0!==g?g:"--"}`]}set user(t){this._USER_DATA=t}get lang(){return this._lang}get languageId(){return this._languageId}get srvTag(){return this._srv_tag}set srvTag(t){this._srv_tag=String(t)}setServerTag(t){this._srv_tag=String(t)}get token(){var t;return null!==(t=this._TOKEN)&&void 0!==t?t:void 0}set token(t){this._TOKEN="string"==typeof t?t.split(/\s*,\s*/)[0]:void 0}responseHandlerData(t,e,s){var a,i,n;let r=null;void 0!==(null===(a=null==t?void 0:t.Data)||void 0===a?void 0:a.Data)?r=t.Data.Data:void 0!==(null===(i=null==t?void 0:t.Data)||void 0===i?void 0:i._isSuccessful)?r=t.Data._isSuccessful:void 0!==(null==t?void 0:t.Data)?r=t.Data:void 0!==t&&(r=t);const l=(null===(n=null==t?void 0:t.Data)||void 0===n?void 0:n.Error)||(null==t?void 0:t.Error)||(e>=300?s:null)||(!r&&e>=300?"Unknown error":null);return"Object reference not set to an instance of an object."===l&&console.log("!!!!!!!!!!! Object reference not set to an instance of an object."),{data:r,error:l,status:e,statusText:s}}responseHandlerDataData(t,e,s){var a,i,n,r;let l=null;void 0!==(null===(a=null==t?void 0:t.Data)||void 0===a?void 0:a.Data)&&void 0!==(null==t?void 0:t.Data)?l=t.Data:void 0!==(null===(i=null==t?void 0:t.Data)||void 0===i?void 0:i.Data)?l=t.Data.Data:void 0!==(null===(n=null==t?void 0:t.Data)||void 0===n?void 0:n._isSuccessful)?l=t.Data._isSuccessful:void 0!==(null==t?void 0:t.Data)?l=t.Data:void 0!==t&&(l=t);const o=(null===(r=null==t?void 0:t.Data)||void 0===r?void 0:r.Error)||(null==t?void 0:t.Error)||(e>=300?s:null)||(!l&&e>=300?"Unknown error":null);return"Object reference not set to an instance of an object."===o&&console.log("!!!!!!!!!!! Object reference not set to an instance of an object."),{data:l,error:o,status:e,statusText:s}}convertDataData(t){var e;if(void 0!==(null===(e=null==t?void 0:t.Data)||void 0===e?void 0:e.Data)){const e=Object.keys(t.Data);if(e.length>0){const s={};return e.forEach((e=>{var a;s[e.toLowerCase()]=null!==(a=t.Data[e])&&void 0!==a?a:null})),s}}return t}setDevMode(t){IS_DEV_MODE=void 0===t||t}addLocalesConverters(t){this._locales=Object.assign(Object.assign({},this._locales),t);const e=new Set([...this.EXIST_LANGUAGES,...Object.keys(this._locales)]);this.EXIST_LANGUAGES=Array.from(e)}checkLanguage(t="en"){try{const e=t.substring(0,2)||this.LANG_DEFAULT;return this.EXIST_LANGUAGES.includes(e)?e:this.LANG_DEFAULT}catch(t){return this.LANG_DEFAULT}}setLanguage(t="en"){var e,s;return this._lang=this.checkLanguage(t),this._locale=null!==(e=this._locales[this._lang])&&void 0!==e?e:this.LOCALE_DEFAULT,this._languageId=null!==(s=this._languageIdsRemote[this._lang])&&void 0!==s?s:this.LANG_ID_DEFAULT,this._lang}async setLanguageRemoteLocale(t="en"){if(this.setLanguage(t),this.isSinged){const t=this.url("/account/SetLanguage",api.LBC);return await this.POST(t,{culture:this.locale})||!1}}setBaseUrl(t){return t.endsWith("/")&&(t=t.slice(0,-1)),this._baseUrl=t,this._baseUrl}statusHandler(t,e){401===t&&(this.user={},this.token=void 0,IS_DEV_MODE&&console.log("Status:",t,e))}queryStringHandler(t={}){return Object.keys(t).forEach((e=>{null===t[e]?t[e]="null":!0===t[e]?t[e]="true":!1===t[e]?t[e]="false":void 0===t[e]&&(t[e]="")})),t}responseHandler(t){var e,s,a,i;const n=null!==(s=null!==(e=null==t?void 0:t.headers["x-token"])&&void 0!==e?e:null==t?void 0:t.headers["X-token"])&&void 0!==s?s:null;IS_DEV_MODE&&(null===(a=null==t?void 0:t.request)||void 0===a?void 0:a.path)&&console.log(null===(i=null==t?void 0:t.request)||void 0===i?void 0:i.path),n&&(this.token=n,IS_DEV_MODE&&console.log("isSinged:",this.isSinged+"\nX-Token:",n))}axiosErrorHandler(t){var e,s,a,i,n,r,l,o;let u,c=null!==(s=null===(e=t.response)||void 0===e?void 0:e.status)&&void 0!==s?s:null,d=null!==(i=null===(a=t.response)||void 0===a?void 0:a.statusText)&&void 0!==i?i:null;const h=null!==(n=t.response)&&void 0!==n?n:null;if(h){if(u=[...c?[c]:[],...d?[d]:[],...(null===(r=null==h?void 0:h.data)||void 0===r?void 0:r.Message)?[h.data.Message]:[],...(null===(l=null==h?void 0:h.data)||void 0===l?void 0:l.MessageDetail)?[h.data.MessageDetail]:[]].join(" > "),IS_DEV_MODE){const t=(null!==(o=h.config.method)&&void 0!==o?o:"").toUpperCase(),e=h.config.url,s=h.config.data;console.log("```"),console.log("ERROR:",t,e),console.log("DATA:",s),console.log("RESPONCE:",null==h?void 0:h.data),console.log("```")}}else t.request?(u="Error: No response received",c=503,d="Service Unavailable"):(u=`Error: ${null==t?void 0:t.message}`,c=601,d=(null==t?void 0:t.message)||"Unknown error");return console.error("Axios request error:",u),{data:null,status:c,statusText:u||d||"Unknown error"}}url(t,e){if(t.toLowerCase().startsWith("http"))return t;switch(e){case api.V2:return`${this._baseUrl}/v2/bsw/api${t}`;case api.NV20:return`${this._baseUrl}/nv20${t}`;case api.LBC:return`${this._baseUrl}/v2/lbc/api${t}`;case api.DIRECT:return`${this._baseUrl}${t}`;case api.V1:default:return`${this._baseUrl}/api${t}`}}sortDataByPriority(t,e,s){const a=new Map;return e.forEach(((t,e)=>{a.set(t,e)})),t.slice().sort(((t,e)=>(a.has(t[s])?a.get(t[s]):1/0)-(a.has(e[s])?a.get(e[s]):1/0)))}sortArrayByPriority(t,e){const s=new Map;return e.forEach(((t,e)=>{s.set(t,e)})),t.slice().sort(((t,e)=>(s.has(t)?s.get(t):1/0)-(s.has(e)?s.get(e):1/0)))}request(t){const e=this.queryStringHandler,s=this.axi,a=this.axiosErrorHandler,i=(t,e)=>{401===t&&(this.user={},this.token=void 0,IS_DEV_MODE&&console.log("Status:",t,e))},n=async t=>{var e,s;try{console.error(t);const a=["undefined"!=typeof window?window.location.href:"url: unknown",`Error: ${(null==t?void 0:t.error)||"Unknown error"}`,...this.userMain].filter(Boolean).join("\n");let i="";try{i=null!==(e=JSON.stringify(t,null,2))&&void 0!==e?e:"Unknown error"}catch(e){i=null!==(s=null==t?void 0:t.error)&&void 0!==s?s:"Unknown error"}await this.sendErrInfo(a,i)}catch(t){}},r=t=>{var e,s,a,i,r,l,o,u,c,d,h,g,v,p;const T=null!==(e=null==t?void 0:t.headers["x-token"])&&void 0!==e?e:null,m=null!==(a=null===(s=null==t?void 0:t.request)||void 0===s?void 0:s.path)&&void 0!==a?a:null;if(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.Error){const e=(null!==(l=null===(r=null==t?void 0:t.config)||void 0===r?void 0:r.method)&&void 0!==l?l:"").toUpperCase(),s=Object.assign(Object.assign(Object.assign({method:e,url:(null===(o=null==t?void 0:t.config)||void 0===o?void 0:o.url)||""},(null===(u=null==t?void 0:t.config)||void 0===u?void 0:u.params)?{params:null!==(d=null===(c=null==t?void 0:t.config)||void 0===c?void 0:c.params)&&void 0!==d?d:""}:{}),(null===(h=null==t?void 0:t.config)||void 0===h?void 0:h.data)?{POST:null!==(v=null===(g=null==t?void 0:t.config)||void 0===g?void 0:g.data)&&void 0!==v?v:""}:{}),{error:null===(p=null==t?void 0:t.data)||void 0===p?void 0:p.Error});n(s)}IS_DEV_MODE&&m&&console.log(m),T&&(this.token=T,IS_DEV_MODE&&console.log("isSinged:",this.isSinged+"\nX-Token:",T))},l=Date.now()+Math.random(),o=t=>{var e;const s=null!==(e=null!=t?t:this.maxTimeExecutionMs)&&void 0!==e?e:25e3,a=new AbortController,i=setTimeout((()=>{a.signal.aborted||a.abort()}),s);return a.signal.addEventListener("abort",(()=>{clearTimeout(i)}),{once:!0}),{signal:a.signal,clearSignal:()=>clearTimeout(i),get isAborted(){return a.signal.aborted}}};let{signal:u,clearSignal:c}=o(this.maxTimeExecutionMs);const d={url:t,method:"GET",params:{_:l},headers:Object.assign({"X-Tag":this.srvTag},this.token?{"X-Token":this.token}:{}),responseType:"json",timeoutErrorMessage:`Request timed out after ${this.maxTimeExecutionMs} ms`,signal:u};return{query(t={}){const s=e(t);return d.params=Object.assign(Object.assign({},s),d.params),this},headers(t={}){return d.headers=Object.assign(Object.assign({},d.headers),t),this},deleteAllHeaders(){return delete d.headers,this},setTimeout(t=25e3){return c(),({signal:u,clearSignal:c}=o(t)),d.timeoutErrorMessage=`Request timed out after ${t} ms`,d.signal=u,d.withXSRFToken=!0,this},GET(){return d.method="GET",this},POST(t={}){return d.method="POST",d.data=t,this},PUT(t={}){return d.method="PUT",d.data=t,this},DELETE(t={}){return d.method="DELETE",d.data=t,this},async exec(){"GET"!==d.method&&delete d.params._;const t=s.request(d).then((t=>(r(t),t))).catch(a).finally((()=>c())),{data:e,status:n,statusText:l}=await t;return i(n,l),{data:e,status:n,statusText:l}},async value(){const{data:t}=await this.exec();await t}}}async GET(t,e={},s={}){const a=new AbortController,i=setTimeout((()=>{a.abort()}),this.maxTimeExecutionMs),n={params:this.queryStringHandler(e),headers:Object.assign(Object.assign({},this.token?{"X-Token":this.token}:{}),null!=s?s:{}),responseType:"json",signal:a.signal},r=this.axi.get(t,n).then((t=>(this.responseHandler(t),t))).catch(this.axiosErrorHandler).finally((()=>clearTimeout(i))),{data:l,status:o,statusText:u}=await r;return this.statusHandler(o,u),l}async POST(t,e={},s={},a={}){const i=new AbortController,n=setTimeout((()=>{i.abort()}),this.maxTimeExecutionMs),r={params:this.queryStringHandler(s),headers:Object.assign(Object.assign({},this.token?{"X-Token":this.token}:{}),null!=a?a:{}),responseType:"json",signal:i.signal},l=this.axi.post(t,e,r).then((t=>(this.responseHandler(t),t))).catch(this.axiosErrorHandler).finally((()=>clearTimeout(n))),o=await l,{data:u,status:c,statusText:d}=o;return this.statusHandler(c,d),u}async DELETE(t,e={},s={},a={}){const i=new AbortController,n=setTimeout((()=>{i.abort()}),this.maxTimeExecutionMs),r={params:this.queryStringHandler(s),headers:Object.assign(Object.assign({},this.token?{"X-Token":this.token}:{}),null!=a?a:{}),responseType:"json",signal:i.signal,data:e},l=this.axi.delete(t,r).then((t=>(this.responseHandler(t),t))).catch(this.axiosErrorHandler).finally((()=>clearTimeout(n))),{data:o,status:u,statusText:c}=await l;return this.statusHandler(u,c),o}async PUT(t,e={},s={},a={}){const i=new AbortController,n=setTimeout((()=>{i.abort()}),this.maxTimeExecutionMs),r={params:this.queryStringHandler(s),headers:Object.assign(Object.assign({},this.token?{"X-Token":this.token}:{}),null!=a?a:{}),responseType:"json",signal:i.signal},l=this.axi.put(t,e,r).then((t=>(this.responseHandler(t),t))).catch(this.axiosErrorHandler).finally((()=>clearTimeout(n))),{data:o,status:u,statusText:c}=await l;return this.statusHandler(u,c),o}async getLineSports(t=0){var e;const s=+t>0?this.url(`/line/${this.locale}/sports/${t}`):this.url(`/line/${this.locale}/allSports`);return null!==(e=await this.GET(s,{},{}))&&void 0!==e?e:[]}async getHotEvents(){var t;const e=this.url(`/line/${this.locale}/hotevents`);return null!==(t=await this.GET(e,{},{}))&&void 0!==t?t:[]}async getCountriesList(t,e=0){var s;const a=this.url(`/line/${this.locale}/countries/sport${t}/${e}`);return null!==(s=await this.GET(a,{},{}))&&void 0!==s?s:[]}async getPrematchTournaments(t,e,s=0){var a;const i=this.url(`/line/${this.locale}/tournaments/sport${t}/country${e}/${s}`);return null!==(a=await this.GET(i,{},{}))&&void 0!==a?a:[]}async getPrematchTournamentsByMinutes(t=0,e=0){var s;const a=this.url(`/line/${this.locale}/events/full/sport${t}/${e}`);return(null!==(s=await this.GET(a,{},{}))&&void 0!==s?s:[]).filter((t=>{var e;return(null!==(e=null==t?void 0:t.EventsHeaders)&&void 0!==e?e:[]).length>0}))}async getPrematchTournamentsHeadersByMinutes(t,e=0){var s;const a=this.url(`/line/${this.locale}/tournaments/headers/sport${t}/${e}`);return null!==(s=await this.GET(a,{},{}))&&void 0!==s?s:[]}async getPrematchEvents(t,e,s,a){var i;const n=this.url(`/line/${this.locale}/events/sport${t}/country${e}/tourney${s}/${a}`);return null!==(i=await this.GET(n,{},{}))&&void 0!==i?i:[]}liveTimestampReset(t=!0){this._liveTimestampReset=t}async getLive(t=!1,e=[]){var s;let a=!1;(t||!0===this._liveTimestampReset)&&(this.liveTimestamp=0,this.liveTimestampReset(!1));const i=this.url(`/live/${this.locale}/full/${this.liveTimestamp}/0`),{data:n,status:r}=await this.request(i).GET().query({events:e}).exec(),{TimeStamp:l,LEvents:o,IsChanges:u}=null!=n?n:{};return a=!1===u,this.liveTimestamp=200===r&&null!==(s=null!=l?l:this.liveTimestamp)&&void 0!==s?s:0,{ts:+this.liveTimestamp,events:null!=o?o:[],isFullPackage:a}}async getFullLiveWithoutSaveTimeStamp(){var t;const e=this.url(`/live/${this.locale}/full/0/0`),s=null!==(t=await this.GET(e,{},{}))&&void 0!==t?t:{},{LEvents:a}=null!=s?s:{};return null!=a?a:[]}async getLiveEventsAndFullEvent(t){var e;const s=this.url(`/live/${this.locale}/bets/${t}`);return[null!==(e=await this.GET(s,{},{}))&&void 0!==e?e:{}]}async getLiveEventFull(t){const e=this.url(`/live/${this.locale}/bets/${t}`),{data:s}=await this.request(e).exec();return null!=s?s:null}async getEventPrematch(t){var e;const s=this.url(`/line/${this.locale}/event/${t}`);return null!==(e=await this.GET(s,{},{}))&&void 0!==e?e:{}}async verifyEmail(t){var e;const s=this.url(`/account/userActivationByEmail/${t}/${this.locale}`);return null!==(e=await this.GET(s,{},{}))&&void 0!==e?e:{}}async signUp(t){Object.assign(t,{Culture:this.locale});const e=this.url(`/account/${this.locale}/registration`);return await this.POST(e,t)}async signUpViaEmail(t){if(t.CurrencyId){const e=t.CurrencyId;t.PointId=e,delete t.CurrencyId}Object.assign(t,{Culture:this.locale});const e=this.url(`/account/${this.locale}/registrationNewEmail`);return await this.POST(e,t)}async signUpDirect(t){if(t.CurrencyId){const e=t.CurrencyId;t.PointId=e,delete t.CurrencyId}Object.assign(t,{Culture:this.locale});const e=this.url(`/account/${this.locale}/registrationNewWhithOutEmail`);return await this.POST(e,t)}async createInternetUser(t){var e,s;if(t.CurrencyId){const e=t.CurrencyId;t.PointId=e,delete t.CurrencyId}if(!(null==(t=Object.assign({},t,{Culture:this.locale}))?void 0:t.PointId))return{created:null,error:"parametersError",status:200,statusText:""};t.PointId&&t.PointId<1e4&&(t.PointId=t.PointId+1e4);const a=this.url(`/account/${this.locale}/registrationNewWhithOutEmail`),{data:i,status:n,statusText:r}=await this.request(a).POST(t).exec();return{created:null!==(s=null===(e=null==i?void 0:i.Data)||void 0===e?void 0:e._isSuccessful)&&void 0!==s?s:null,error:(null==i?void 0:i.Error)||null,status:n,statusText:r}}async getResultsSports(t,e){const s=this.url(`/results/${this.locale}/sports/0/${t}/${e}`);return await this.GET(s,{},{})}async getResultsTournamentsBySportId(t,e,s){const a=this.url(`/results/${this.locale}/tournaments/sport${t}/0/${e}/${s}`);return await this.GET(a,{},{})}async getResultsGrid(t,e,s,a,i){const n=this.url(`/results/${this.locale}/sport${t}/country${e}/tournament${s}/0/${a}/${i}`),r=await this.GET(n,{},{});return null!=r?r:[]}async getGamesProvidersTopGames(){const t=this.url("/slotintegrator-service/topGameByProvider"),e=await this.GET(t,{},{});return null!=e?e:[]}async getGamesTopProviders(){const t=this.url("/slotintegrator-service/topProviders"),e=await this.GET(t,{},{});return null!=e?e:[]}async getSlotsList(){const t=this.url("/slotintegrator-service/gamelist"),{items:e}=await this.GET(t,{},{});return null!=e?e:[]}async createSlotOutcome(t){return{}}async createSlotIntegratorDemo(t){const e=this.locale||"en";try{t.language=e.substring(0,2);const s=this.url("/slotintegrator-service/InitDemoGames"),a=await this.POST(s,t);return JSON.parse(a)}catch(t){return{}}}async createSlotIntegratorReal(t){try{const e=this.url("/slotintegrator-service/InitRealGames"),s=await this.POST(e,t);return JSON.parse(s)}catch(t){return{}}}async getSlotIntegratorProvidersHeaders(){try{const t=this.url("/slotintegrator-service/ProviderHeaders"),e=(await this.GET(t)||[]).map((t=>Object.assign(Object.assign({},t),{ProviderName:t.Provider,Games:[]})));return null!=e?e:[]}catch(t){return[]}}async getSlotIntegratorProviderAllGames(t){const e=this.url(`/slotintegrator-service/searchGameByProvider/${t}`),s=await this.GET(e);return null!=s?s:[]}async getSlotIntegratorFilteredGames(t){const e=this.url(`/slotintegrator-service/searchGameByName/${t}`),s=await this.GET(e);return null!=s?s:[]}async login({login:t,password:e}){this.token=void 0;const s=this.url("/account/LogIn",api.LBC),a={Login:t,Password:e,Culture:this.locale},i=await this.POST(s,a),{Data:n}=null!=i?i:{};return!n&&IS_DEV_MODE&&console.log("\n```\n/account/LogIn:\n",i,"\n```\n"),n&&n.UserId>0&&n["X-Token"]?(this.token=n["X-Token"],this.user=n,this.user):(this.user={},this.user)}async getUserData_OLD(){const t=this.url("/account/GetUserData",api.LBC),e=await this.GET(t);return(null==e?void 0:e.UserId)>0?(this.user=e,e):(this.user={},null)}async getUserData(){const t=this.url("/account/GetUserData",api.LBC),{data:e,status:s,statusText:a}=await this.request(t).exec();return this.user=(null==e?void 0:e.UserId)>0?e:{},this.responseHandlerData(e,s,a)}async getUserFullData(){return await this.getUserData()}async logout(){const t=this.url("/account/LogOut",api.LBC),e=await this.POST(t),s=!1===e;return this.user={},this.token=void 0,{ok:s,isLogged:!!s&&e}}async balance(){if(this.isSinged){const t=this.url("/account/GetUserBalance",api.LBC),e=await this.GET(t);return null!=e?e:{}}return{}}async getBalance(){const t=this.url("/account/GetUserBalance",api.LBC),{data:e,status:s,statusText:a}=await this.request(t).exec();return this.responseHandlerData(e,s,a)}async changePassword(t){var e;if(this.isSinged){t.userData.Gmt=(new Date).getTimezoneOffset()/60,t.userData.Language=this.languageId;const s=this.url("/account/ChangeUserPassword",api.LBC),a=await this.POST(s,t);return console.log(a),{ok:!a.IsError||!1,status:null!==(e=a.ErrorCode)&&void 0!==e?e:5001}}return{ok:!1,status:5001}}longToGuid(t){const e=new ArrayBuffer(16);new DataView(e).setUint32(0,t,!0);const s=Array.from(new Uint8Array(e));return[s.slice(0,4).reverse(),s.slice(4,6).reverse(),s.slice(6,8).reverse(),s.slice(8,10),s.slice(10,16)].map((t=>t.map((t=>t.toString(16).padStart(2,"0"))).join(""))).join("-")}async getSportsEventsSearch(t){var e,s;if(!t)return[];const a=this.url("/line/SearchFullByCulture",api.V2),i={culture:this.locale,searchText:t},[n,r]=await Promise.all([null!==(e=this.GET(a,i))&&void 0!==e?e:[],null!==(s=this.getFullLiveWithoutSaveTimeStamp())&&void 0!==s?s:[]]),l=n.filter((t=>t.Type>1)).map((t=>{var e;const s=new Date(null!==(e=null==t?void 0:t.Date)&&void 0!==e?e:"").toLocaleDateString(this.locale,{weekday:"short",day:"2-digit",month:"long",hour:"2-digit",minute:"2-digit"}).replace(",","");return Object.assign(t,{Date:s,to:{name:"eventprematch",params:{prEventId:routeNameId(t.Id,t.Name)}},t1:t.Name.split(/\s*\-\s*/)[0],t2:t.Name.split(/\s*\-\s*/)[1]})})),o=t.toLowerCase();return[...r.filter((t=>t.Description.NameTeam1.toLowerCase().includes(o)||t.Description.NameTeam2.toLowerCase().includes(o)||t.Description.TName.toLowerCase().includes(o))).map((t=>{const e=`${t.Description.NameTeam1} vs ${t.Description.NameTeam2} ${t.Description.SportName}`,s=new Date(t.Description.Date).toLocaleDateString(this.locale,{weekday:"short",day:"2-digit",month:"long",hour:"2-digit",minute:"2-digit"}).replace(",","");return{CountryId:t.Description.CountryId,Date:s,Id:+t.Id,Name:e,PriceNum:t.Description.PriceNum,SportId:t.Description.SportId,SportName:t.Description.SportName,TournamentId:t.Description.TournamentId,TournamentName:t.Description.TName,Type:3,isLive:!0,to:{name:"eventinplay",params:{prEventId:routeNameId(t.Id,e)}},t1:t.Description.NameTeam1,t2:t.Description.NameTeam2}})),...l]}async getFavorites(){if(this.isSinged){const t=this.url("/favorites/GetFavorites",api.V2),e=await this.GET(t,{culture:this.locale});return null!=e?e:[]}return[]}async addFavorite(t,e){if(this.isSinged){const s=this.url("/favorites/AddToFavorites",api.V2),a=await this.POST(s,{},{id:t,type:e});return null!=a&&a}return!1}async removeFavorite(t){if(this.isSinged){const e=this.url("/favorites/RemoveFromFavorites",api.V2),s=await this.POST(e,{id:t});return null!=s&&s}return!1}async getPurses(t=5){if(this.isSinged){const e=this.url("/account/GetPurses",api.V2),s={psType:t},a=await this.GET(e,s);return null!=a?a:[]}return[]}async sendWithdrawal(t,e){}async sendWithdrawalAgent(t){if(this.isSinged){const e={securityCode:"",secAnswer:"",additionalParams:{}};Object.assign(e,t);const s=this.url("/payment/CreateOrderWithdraw",api.LBC),a=await this.POST(s,e);if(isNaN(parseFloat(a)))return{ok:!1,status:a};{const t=await this.getOrderedTransactions();return{ok:!0,balance:parseFloat(a),userOrders:t}}}return{ok:!1,status:10016}}async cancelOrderedTransaction(t){if(this.isSinged){const e=this.url("/payment/CancelOrderedTransaction",api.LBC),s=await this.POST(e,t);if(-1===s)return{ok:!1,status:103};if(isNaN(parseFloat(s)))return{ok:!1,status:103};{const t=await this.getOrderedTransactions();return{ok:!0,balance:parseFloat(s),userOrders:t}}}return{ok:!1,status:10016}}async getMovementOfMoney(t){var e;if(this.isSinged){Object.assign(t,{culture:this.locale});const s=this.url("/account/GetAccountTransactions",api.V2),a=await this.GET(s,t),i=(null!==(e=null==a?void 0:a.TransactionsDataList)&&void 0!==e?e:[]).map((t=>{var e;return{income:null!==(e=t.IsAddition)&&void 0!==e&&e,sign:t.IsAddition?"+":"-",id:t.Id,typeId:t.TransactionType,typeName:t.TransactionDescription,date:t.TransactionDate,value:t.Amount,amount:t.Amount,bonus:t.Bonus,balance:t.Balance}}));return{result:i}}return{result:[]}}async getOrderedTransactions(){if(this.isSinged){const t=this.url("/account/GetOrderedTransactions",api.V2);return await this.GET(t)}return[]}async getBetContent(t){const e={id:t,culture:this.locale};if(this.isSinged){const t=this.url("/account/GetBetContent",api.V2);return await this.GET(t,e)}return{}}async getBetContentV2(t){if(this.isSinged){const e={id:t,culture:this.locale},s=this.url("/account/GetBetContentNew",api.V2),{data:a,status:i,statusText:n}=await this.request(s).query(e).exec();return this.responseHandlerData(a,i,n)}return{}}async getUserBets(t){if(Object.assign(t,{culture:this.locale}),this.isSinged){const e=this.url("/account/GetUserBets",api.V2);return await this.GET(e,t)}}async getUserBetsV2(t){if(this.isSinged){t=Object.assign(Object.assign({},t),{culture:this.locale});const e=this.url("/account/GetUserBetsNew",api.V2),{data:s,status:a,statusText:i}=await this.request(e).query(t).exec();return{data:null!=s?s:null,error:200!==a?i:null,status:a,statusText:i}}return{data:null,error:"Unauthorized",status:401,statusText:"Unauthorized"}}async getUserBets02(t){if(Object.assign(t,{culture:this.locale}),this.isSinged){const e=this.url("/account/GetUserBets",api.V2),{data:s,status:a,statusText:i}=await this.request(e).query(t).exec();return{data:null!=s?s:null,error:200!==a?i:null,status:a,statusText:i}}return{data:null,error:"Unauthorized",status:401,statusText:"Unauthorized"}}async getOddsForEdit(t){const e=this.url("/betting/GetBetForChange",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec(),n=this.convertDataData(s);return this.responseHandlerData(n,a,i)}async placeCouponEdited(t){const e=this.url("/betting/ChangeBet",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec(),n=this.convertDataData(s);return this.responseHandlerData(n,a,i)}async getUserBetsCashout(t){const e=this.url("/betting/CheckCashoutForBets",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST({BetIds:t}).exec();return this.responseHandlerData(s,a,i)}async getUserBetsStatuses(t){const e=this.url("/betting/CheckBetsStatuses",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST({BetIds:t}).exec();return this.responseHandlerData(s,a,i)}async cashoutHandler(){var t,e;const s=null!==(e=null===(t=this.user)||void 0===t?void 0:t.UserId)&&void 0!==e?e:0,a=this.url(`/stats/cashout/${s}`,api.NV20),{data:i,status:n,statusText:r}=await this.request(a).GET().setTimeout(6500).exec(),l=this.convertDataData(i);return this.responseHandlerData(l,n,r)}async returnCashoutBet(t){const e=this.url("/betting/CashOutReturnBet",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec(),n=this.convertDataData(s);return this.responseHandlerData(n,a,i)}createCoupon(t,e,s,a=-1){var i,n,r,l,o;const u={betAmount:e,doAcceptOddsChanges:s,statuses:{},systemIndex:a};for(let e=0;e<t.length;e++){const s=t[e],a=[null!==(i=s.LinesID)&&void 0!==i?i:"null",null!==(n=s.BetVarID)&&void 0!==n?n:"null",null!==(r=s.HandSize)&&void 0!==r?r:"null",null!==(l=s.Add1)&&void 0!==l?l:"null",null!==(o=s.Add2)&&void 0!==o?o:"null"].join("_");u.statuses[a]=!0}return u}async placeCoupon(t){if(this.isSinged){const e=this.url("/betting/PlaceBet",api.LBC);return await this.POST(e,t)}}async placeCouponConditional(t){if(this.isSinged){const e=this.url("/betting/PutReinvestedBet",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec();return this.responseHandlerData(s,a,i)}}async placeCouponBetShop(t){if(this.isSinged){const e=this.url("/betting/PlaceBetSubCashier",api.LBC);return await this.POST(e,t)}}async getBetShopCouponByCode(t){if(this.isSinged){const e=this.url("/betting/GetBetSubCashier",api.LBC),s={code:t,culture:this.locale},{data:a,status:i,statusText:n}=await this.request(e).query(s).exec();return this.responseHandlerData(a,i,n)}}async loginIsExist(t){const e=this.url("/account/IsUserExists",api.LBC);return await this.GET(e,{userName:t})}async emailIsExist(t){const e=this.url("/account/IsEmailExists",api.LBC);return await this.GET(e,{email:t})}async changePersonalData(t){if(this.isSinged){const e=this.url("/account/ChangePersonalData",api.LBC);return await this.POST(e,t)||!1}return!1}async getMessagesAll({page:t,pageSize:e}){if(this.isSinged){const s=this.url("/messages/GetAllMessages",api.LBC),a=await this.GET(s,{page:t,pageSize:e});return null!=a?a:[]}return[]}async getMessageById(t){var e;if(this.isSinged){const s=this.url("/messages/GetMessagesById",api.LBC);return null!==(e=(await this.GET(s,{id:t}))[0])&&void 0!==e?e:{}}return{}}async sensMessage({ToUserId:t,Text:e,Subject:s,ParentId:a}){if(this.isSinged){const i=this.url("/messages/SendMessage",api.LBC),n=await this.POST(i,{ToUserId:t,Text:e,Subject:s,ParentId:a});return null!=n?n:null}return null}async markMessageAsRead({MessageId:t,MessageTypeId:e}){if(this.isSinged){const s=this.url("/messages/MarkMessageAsRead",api.LBC),a=await this.POST(s,{MessageId:t,MessageTypeId:e});return null!=a?a:null}return null}async deleteMessage({MessageId:t,MessageTypeId:e}){if(this.isSinged){const s=this.url("/messages/DeleteMessage",api.LBC),a=await this.POST(s,{MessageId:t,MessageTypeId:e});return null!=a?a:null}return null}async deleteMessagesAll(){if(this.isSinged){const t=this.url("/messages/DeleteAllMessages",api.LBC),e=await this.POST(t,{});return null!=e?e:null}return null}async getMessagesCount(){if(this.isSinged){const t=this.url("/messages/GetMessagesCount",api.LBC),e=await this.GET(t,{});return null!=e?e:null}return null}async getMessagesUnreadCount(){if(this.isSinged){const t=this.url("/messages/GetCountUnreadMessages",api.LBC),e=await this.GET(t,{});return null!=e?e:null}return null}async isUserTempExist(t){const e=this.url("/account/IsUserExistsInTemp",api.LBC),{data:s}=await this.request(e).query({userName:t}).exec();return null!=s?s:null}async createUserTemp(t){var e,s;const a=this.url(`/account/${this.locale}/UserRegistrationOnlyInTepm`),{data:i}=await this.request(a).POST(t).exec(),n=null!==(s=null===(e=null==i?void 0:i.Data)||void 0===e?void 0:e._isSuccessful)&&void 0!==s?s:null;return null!=n?n:null}async getGamesListGR(t={platforms:"desktop"}){const e=this.url("/Softquo/GetGamesList",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec();return this.responseHandlerData(s,a,i)}async getGameFrameUrlGR(t){const e=this.url("/Softquo/InitGame",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).query(t).exec();return this.responseHandlerData(s,a,i)}async pingApi(){const t=this.url("/account/Ping",api.LBC),{data:e,status:s,statusText:a}=await this.request(t).exec();return this.responseHandlerData(e,s,a)}async intgrGetGamesList(t){const e=this.url("/Games/GetGamesList",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec();return this.responseHandlerData(s,a,i)}async intgrGetGameTypes(t){const e=this.url("/Games/GetGameTypes",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).POST().query({groupId:t}).exec();return this.responseHandlerData(s,a,i)}async intgrGetProvidersList(t){const e=this.url("/Games/GetGameProviders",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).POST().query({groupId:t}).exec();return this.responseHandlerData(s,a,i)}async intgrGetTopGames(t){const e=this.url("/Games/GetTopGames",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).POST().query({groupId:t}).exec();return this.responseHandlerData(s,a,i)}async intgrInitGame(t){const e=this.url("/Games/InitGame",api.DIRECT),{data:s,status:a,statusText:i}=await this.request(e).query(t).exec();return this.responseHandlerData(s,a,i)}async checkPromocode(t){}async activatePromocode(t){}async sendSms(t){}async signUpPhone(t){}async passwordRecoveryRequest(t){}async passwordRecoveryEmail(t){}async passwordSetNewByPhone(t){}async passwordSetNewByEmail(t){}async signUpEmail(t){}async getUserPersonalInfo(){}async sendPayment(t,e){}async setUserPersonalInfo(t){}async getGamesToken(t){}async getProviderHedlines(t){}async createTempSignUp({login:t,password:e}){}async setRemoteLanguage(t){return null!=t||(t=this.lang),await this.setLanguageRemoteLocale(t)}convertBonuses(t){let e=[];return Object.keys(t).forEach((s=>{const a=s.match(/B_Koef(\d)_Value/);if(a){const s=a[1];e.push(["Koef",t[`B_Koef${s}`],t[`B_Koef${s}_Value`]])}const i=s.match(/B_Kolvo(\d)_Value/);if(i){const s=i[1];e.push(["Kolvo",t[`B_Kolvo${s}`],t[`B_Kolvo${s}_Value`]])}"B_Perestavka_Value"===s&&e.push(["Perestavka",!0,t.B_Perestavka_Value]),"B_MinOdds"===s&&e.push(["MinOdds",!0,t.B_MinOdds])})),e}async getBetslip_OLD(){var t,e;const s=this.url("/betting/GetBetslip",api.LBC),a=await this.GET(s,{});return a.bonuses=this.convertBonuses(null!==(t=null==a?void 0:a.Bonus)&&void 0!==t?t:{}),null!==(e=a.Bets)&&void 0!==e||(a.Bets=[]),delete a.Bonus,null!=a?a:{}}async getBetslip(){var t,e;const s=this.url("/betting/GetBetslip",api.LBC);let{data:a,status:i,statusText:n}=await this.request(s).exec();return null!=a||(a={}),a.bonuses=this.convertBonuses(null!==(t=null==a?void 0:a.Bonus)&&void 0!==t?t:{}),null!==(e=a.Bets)&&void 0!==e||(a.Bets=[]),delete a.Bonus,a}async clearBetslip(){const t=this.url("/betting/ClearBetslip",api.LBC),e=await this.POST(t);return null!=e&&e}async changeBetslipType(t){const e=this.url("/betting/ChangeBetslipType",api.LBC),s=await this.POST(e,{},{betslipType:t});return null!=s&&s}async setBetslipSettings(t){if(this.isSinged){const e=this.url("/betting/SetBetslipSettings",api.LBC),s=await this.POST(e,t);return null!=s?s:[]}return[]}async addToBetslip(t){t.culture=this.locale;const e=this.url("/betting/AddToBetslip",api.LBC),s=await this.POST(e,t);return null!=s?s:null}async addToBetslipV2(t){t.culture=this.locale;const e=this.url("/betting/AddToBetslipNew",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec();return this.responseHandlerDataData(s,a,i)}async removeFromBetslipV2(t){const e=this.url("/betting/RemoveFromBetslipNew",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).POST(t).exec();return this.responseHandlerDataData(s,a,i)}async removeFromBetslip(t){t.culture=this.locale;const e=this.url("/betting/RemoveFromBetslip",api.LBC);return await this.POST(e,t)||!1}async removeBonus(){const t=this.url("/betting/DeleteBonus",api.LBC),e=await this.POST(t);return null!=e&&e}async addBonus(t){const e=this.url("/betting/AddBonus",api.LBC),s=await this.POST(e,{},{odd:t});return null!=s?s:null}async updateBet(t){t.culture=this.locale;const e=this.url("/betting/UpdateBet",api.LBC);return null===await this.POST(e,t)}async getBetsLimits(){if(this.isSinged){const t=this.url("/betting/GetLimitations",api.LBC),e=await this.GET(t);return null!=e?e:{Min:0,Max:0}}return{Min:0,Max:0}}async getBetsLimitsNew(){if(this.isSinged){const t=this.url("/betting/GetLimitations",api.LBC),{data:e,status:s,statusText:a}=await this.request(t).exec(),{Min:i=null,Max:n=null,MaxOddForMulty:r=250}=null!=e?e:{},l={Min:i,Max:n,MaxOddForMulty:r};return this.responseHandlerData(l,s,a)}return{data:{Min:null,Max:null,MaxOddForMulty:250},status:200,statusText:"OK"}}async getCurrencies(){if(this.isSinged){const t=this.url("/location/GetCurrencies",api.V2),e=await this.GET(t);return null!=e?e:[]}return null}async getCountries(){if(this.isSinged){const t=this.url("/location/GetCountries",api.V2),e=await this.GET(t);return null!=e?e:[]}return null}async getAllKeys(t){const e=this.url("/info/GetAllKeys",api.LBC),s=await this.GET(e,{key:t,culture:this.locale});return null!=s?s:[]}async getSlides(t){null!=t||(t="https://f004.backblazeb2.com/file/betroute/slides.json");const e=this.url(t),{data:s,status:a,statusText:i}=await this.request(e).deleteAllHeaders().exec();return this.responseHandlerData(s,a,i)}async getSiteSlidesSections(t){null!=t||(t="https://f004.backblazeb2.com/file/betroute/slides.json");const e=this.url(t),{data:s,status:a,statusText:i}=await this.request(e).deleteAllHeaders().exec();return this.responseHandlerData(s,a,i)}async getEventStatisticData(t){const e=this.url(`/stats/data/${t}/${this.locale}`,api.NV20),{data:s,status:a,statusText:i}=await this.request(e).exec();return this.responseHandlerData(s,a,i)}async getEventStatisticPage(t){const e=this.url(`/stats/page/${t}/${this.locale}`,api.NV20),{data:s,status:a,statusText:i}=await this.request(e).exec();return this.responseHandlerData(s,a,i)}async searchPrematchEventsNv20(t,e={}){var s;const a=this.url("/stats/pm/search",api.NV20);t=null!==(s=null==e?void 0:e.searchString)&&void 0!==s?s:t.split(/\s+/).filter((t=>!0!==/\d/.test(t)&&t.length>1)).join(" ").trim();const i=Object.assign(Object.assign(Object.assign(Object.assign({locale:this.locale,searchString:t},(null==e?void 0:e.LIMIT)?{LIMIT:e.LIMIT}:{LIMIT:{from:0,size:30}}),(null==e?void 0:e.negativeString)?{negativeString:e.negativeString}:{}),(null==e?void 0:e.sportId)?{sportId:e.sportId}:{}),(null==e?void 0:e.tournamentId)?{tournamentId:e.tournamentId}:{}),{data:n,status:r,statusText:l}=await this.request(a).POST(i).exec();return n.searchString=t,n.from=i.LIMIT.from,n.size=i.LIMIT.size,this.responseHandlerData(n,r,l)}async searchPrematchEventsIdsNv20(t){var e,s;const a=this.url("/stats/pm/search/ids",api.NV20);null!==(e=t.locale)&&void 0!==e||(t.locale=this.locale),null!==(s=t.LIMIT)&&void 0!==s||(t.LIMIT={from:0,size:30});const{data:i,status:n,statusText:r}=await this.request(a).POST(t).exec();return i.from=t.LIMIT.from,i.size=t.LIMIT.size,this.responseHandlerData(i,n,r)}async getPrematchEventsByIds(t,e=!0){const s=this.url("/stats/pm/getlocalesevents",api.NV20),a={eventIds:t,locales:[this.locale],noslice:e},{data:i,status:n,statusText:r}=await this.request(s).POST(a).exec();return this.responseHandlerData(i,n,r)}async getDictionaryNv20(t){var e,s,a,i,n;const r=this.url("/stats/pm/dictionary",api.NV20);null!==(e=t.locale)&&void 0!==e||(t.locale=this.locale);const{data:l,status:o,statusText:u}=await this.request(r).POST(t).exec();return l.from=null!==(a=null===(s=null==t?void 0:t.LIMIT)||void 0===s?void 0:s.from)&&void 0!==a?a:null,l.size=null!==(n=null===(i=null==t?void 0:t.LIMIT)||void 0===i?void 0:i.size)&&void 0!==n?n:null,this.responseHandlerData(l,o,u)}async getLineSportsNv20(t=0,e=25e3){var s;const a=this.url("/stats/pm/dictionary",api.NV20),i=Object.assign({locale:this.locale,dictionary:"sport"},t>0?{minutes:t}:{}),{data:n,status:r,statusText:l}=await this.request(a).POST(i).setTimeout(e).exec(),o=this.responseHandlerData(n,r,l),u=(Array.isArray(null===(s=null==o?void 0:o.data)||void 0===s?void 0:s.results)?o.data.results:[]).filter((t=>!!(null==t?void 0:t.sName))).map((t=>({ID:+t.sport,Name:t.sName,cnt:+t.cnt})));return this.sortDataByPriority(u,this.primarySports,"ID")}async getLineSportsMain(t=0,e=1500){let s=await this.getLineSportsNv20(t,e);return 0===s.length&&(s=await this.getLineSports(t)),s}async getCountriesBySportNv20(t,e=0,s=25e3){var a;try{const i=this.url("/stats/pm/dictionary",api.NV20),n=Object.assign({locale:this.locale,sportId:t,dictionary:"country"},e>0?{minutes:e}:{}),{data:r,status:l,statusText:o}=await this.request(i).POST(n).setTimeout(s).exec(),u=this.responseHandlerData(r,l,o),c=(Array.isArray(null===(a=null==u?void 0:u.data)||void 0===a?void 0:a.results)?u.data.results:[]).filter((t=>!!(null==t?void 0:t.cName))).sort(((t,e)=>{var s;return null===(s=null==t?void 0:t.cName)||void 0===s?void 0:s.localeCompare(null==e?void 0:e.cName)})).map((t=>({ID:+t.country,Name:t.cName,cnt:+t.cnt}))),d=this.priorityCountries[t];return d?this.sortDataByPriority(c,d,"ID"):c}catch(t){return[]}}async getCountriesListMain(t,e=0,s=3e3){let a=await this.getCountriesBySportNv20(t,e,s);return 0===a.length&&(a=await this.getCountriesList(t,e)),a}async getPrematchTournamentsNv20(t,e,s=0,a=25e3){var i,n;const r=this.url("/stats/pm/dictionary",api.NV20),l=Object.assign(Object.assign(Object.assign({locale:this.locale,sportId:t},e?{countryId:e}:{}),{dictionary:"tournament"}),s>0?{minutes:s}:{}),{data:o,status:u,statusText:c}=await this.request(r).POST(l).setTimeout(a).exec(),d=this.responseHandlerData(o,u,c),h=(Array.isArray(null===(i=null==d?void 0:d.data)||void 0===i?void 0:i.results)?d.data.results:[]).filter((t=>!!(null==t?void 0:t.tName))).sort(((t,e)=>null==t?void 0:t.tName.localeCompare(null==e?void 0:e.tName))).map((t=>({Id:+t.tournament,Name:t.tName,cnt:+t.cnt,sId:+t.sport,sName:t.sName,CountryId:+t.country,cName:t.cName}))),g=null!==(n=this.priorityTournaments[t])&&void 0!==n?n:null;return g?this.sortDataByPriority(h,g,"Id"):h}async getPrematchTournamentsMain(t,e,s=0,a=3e3){let i=await this.getPrematchTournamentsNv20(t,e,s,a);return 0===i.length&&(i=await this.getPrematchTournaments(t,e,s)),i}async getPrematchTournamentsHeadersMain(t,e=0,s=3e3){let a=await this.getPrematchTournamentsNv20(t,null,e,s);return 0===a.length&&(a=await this.getPrematchTournamentsHeadersByMinutes(t,e)),a}async searchPrematchTournametsEventsNv20(t,e={}){var s,a,i;const{data:n,status:r,statusText:l}=await this.searchPrematchEventsNv20(t,e),o=(null!==(s=null==n?void 0:n.documents)&&void 0!==s?s:[]).reduce(((t,e)=>{const s=e.EventKeys.TurnirID;return t[s]||(t[s]=[]),t[s].push(e),t}),{}),u={tournaments:Object.entries(o).map((([t,e])=>({Id:t,Name:e[0].TourneyName.trim(),SportName:e[0].SportName,SportID:e[0].EventKeys.SportID,EventsHeaders:e}))),total:null!==(a=null==n?void 0:n.total)&&void 0!==a?a:0,searchString:null!==(i=null==n?void 0:n.searchString)&&void 0!==i?i:""};return this.responseHandlerData(u,r,l)}async sendErrInfo(t,e){const s=this.url("/err/send/front",api.NV20),{data:a,status:i,statusText:n}=await this.request(s).POST({text:t,code:e}).exec();return this.responseHandlerData(null==a?void 0:a.ok,i,n)}async cloneBetCoupon(t){var e,s;const a=this.url("/betting/TryGetBetCopy",api.LBC);null!==(e=t.betId)&&void 0!==e||(t.betId=null),null!==(s=t.code)&&void 0!==s||(t.code=null),t.culture=this.locale;const{data:i,status:n,statusText:r}=await this.request(a).query(t).exec();return this.responseHandlerData(i,n,r)}async getAllBanners(){const t=this.url("/info/GetAllBanners",api.LBC),e=await this.GET(t,{culture:this.locale});return null!=e?e:[]}async getCdnSlidesData(t,e,s){var a,i;const n={};if(s&&s.length>0&&(n["slider-main"]=s),!t||0===e.length)return n;let r=await Promise.all(e.map((t=>{const e=this.url(`/stats/slides/${t}`,api.NV20);return this.request(e).deleteAllHeaders().exec()})));for(const t of r)for(const[e,s]of Object.entries(null!==(a=null==t?void 0:t.data)&&void 0!==a?a:{})){null!==(i=n[e])&&void 0!==i||(n[e]=[]);for(const t of s)n[e].push(t)}return n}async getCdnSlidesDataV2(t,e=[],s=[]){var a,i;const n={};if(s.length>0&&(n["slider-main"]=s),0===e.length)return n;let r=await Promise.all(e.map((t=>{const e=this.url(`/stats/slides/${t}`,api.NV20);return this.request(e).deleteAllHeaders().exec()})));for(const e of r)for(const[s,r]of Object.entries(null!==(a=null==e?void 0:e.data)&&void 0!==a?a:{})){null!==(i=n[s])&&void 0!==i||(n[s]=[]);for(const e of r){if(t&&(null==e?void 0:e.url_image)){const s=`${t}${new URL(e.url_image).pathname}`;e.url_image=s}n[s].push(e)}}return n}async depositBetKiosk(t){const e=this.url("/betting/DepositMoneyBetshopPlayer",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).query({sum:t}).exec();return this.responseHandlerData(s,a,i)}async depositBetKioskV2(t){const e=this.url("/betting/DepositMoneyBetshopPlayer",api.LBC),{data:s,status:a,statusText:i}=await this.request(e).query({sum:t}).exec();return this.responseHandlerDataData(s,a,i)}async depositBetKioskFromCheck(t){const e=Object.entries(t).reduce(((t,[e,s])=>(("ID"===e||"TransactionID"===e&&"number"==typeof s&&s>0||"BetCode"===e&&"string"==typeof s&&""!==s.trim())&&(t[e]=s),t)),{}),s=this.url("/betting/DepositBetshopPlayerFromCheck",api.LBC),{data:a,status:i,statusText:n}=await this.request(s).POST(e).exec();return this.responseHandlerDataData(a,i,n)}async getWithdrawalTransactionDetail(t){var e,s;const a=null!==(s=null===(e=this.user)||void 0===e?void 0:e.UserId)&&void 0!==s?s:null;if(!a){const t={Data:{Data:null,ReasonMessage:"WithdrawalOrderNotFound",ReasonId:89}};return this.responseHandlerDataData(t,204,"No Content")}const i=this.url("/betting/GetWithdrawalTransBetshopPlayer",api.LBC),{data:n,status:r,statusText:l}=await this.request(i).query({transactionId:t,userId:a}).exec();return this.responseHandlerDataData(n,r,l)}async getFaq(){}async getFlatpagesList(){}async test3(){return"test3 Ok"}async sellBet(t){}convertBasketToPost(t){return{a1:t.Add1,a2:t.Add2,bId:t.BetVarID,eId:t.LinesID,fs:t.HandSize,isLive:t.IsLive,r:t.Odds}}async getSiteLocation(t,e){const s=this.url(`/sitelocation/${t}/${e}/${this.lang}`,api.NV20),{data:a,status:i,statusText:n}=await this.request(s).exec();return this.responseHandlerData(a,i,n)}async getMTrackerEvent(t){const e=this.url(`/mt/event/${t}`,api.NV20),{data:s,status:a,statusText:i}=await this.request(e).exec();return this.responseHandlerDataData(s,a,i)}async getMTrackerLive(){const t=this.url("/mt/live",api.NV20),{data:e,status:s,statusText:a}=await this.request(t).exec();return this.responseHandlerDataData(e,s,a)}async getApkDownloadUrl(t){var e;if(!t)return this.responseHandlerDataData(null,204,"No Content");const s=this.url(t,api.DIRECT),{data:a,status:i,statusText:n}=await this.request(s).exec(),r=null!==(e=null==a?void 0:a.url)&&void 0!==e?e:null;if(!r)return this.responseHandlerDataData(null,204,"No Content");const l=t.includes("?")?t.trim().split(/\/*\?.*$/)[0]:t.trim().split(/\/*$/)[0],o=this.url(`${l}/${r}`,api.DIRECT);return this.responseHandlerDataData(o,i,n)}async cloneStoredBetslip(t){const e=this.url("/betting/CopyBetslip",api.LBC),s={Bets:t,Culture:this.locale},{data:a,status:i,statusText:n}=await this.request(e).POST(s).exec();return this.responseHandlerDataData(a,i,n)}async getSavedCoupon(t){const e=this.url(`/portfolio/getcoupon/:${t}`,api.NV20),{data:s,status:a,statusText:i}=await this.request(e).exec();return this.responseHandlerDataData(s,a,i)}async createSavedCoupon(t,e){const s=this.url("/portfolio/createcoupon",api.NV20),a={data:t,codes:e},{data:i,status:n,statusText:r}=await this.request(s).POST(a).exec();return this.responseHandlerDataData(i,n,r)}async getCoupons(t){const e=this.url("/portfolio/getcoupons",api.NV20),s={codes:t},{data:a,status:i,statusText:n}=await this.request(e).POST(s).exec();return this.responseHandlerDataData(a,i,n)}}
2
2
  //# sourceMappingURL=BetBoosterApi.min.js.map