jp.ui.app.toolkit 1.0.20 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +163 -39
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/data/middleware/app/app-middleware.d.ts +1 -0
- package/dist/src/data/middleware/game-table-screen-move-button-click-middleware.d.ts +3 -0
- package/dist/src/data/middleware/index.d.ts +0 -8
- package/dist/src/data/middleware/menu/menu-screen-item-middleware.d.ts +1 -0
- package/dist/src/data/middleware/menu/menu-screen-middleware.d.ts +1 -0
- package/dist/src/data/middleware/shop/shop-screen-middleware.d.ts +1 -0
- package/dist/src/data/middleware/table/game-table-deactivate-screen-middleware.d.ts +3 -0
- package/dist/src/data/middleware/table/game-table-init-screen-middleware.d.ts +3 -0
- package/dist/src/data/middleware/table/game-table-screen-back-click-middleware.d.ts +3 -0
- package/dist/src/data/middleware/table/game-table-screen-move-button-click-middleware.d.ts +3 -0
- package/dist/src/data/middleware/tables/tables-screen-item-middleware.d.ts +1 -0
- package/dist/src/data/middleware/tables/tables-screen-middleware.d.ts +1 -0
- package/dist/src/data/middleware/ws/ws-connector-middleware.d.ts +1 -0
- package/dist/src/data/slices/game-table-screen-slice/actions/action-types.d.ts +12 -0
- package/dist/src/data/slices/game-table-screen-slice/actions/actions.d.ts +24 -0
- package/dist/src/data/slices/game-table-screen-slice/index.d.ts +8 -4
- package/dist/src/data/slices/game-table-screen-slice/reducer/reducer.d.ts +9 -0
- package/dist/src/data/slices/game-table-screen-slice/selectors/base-selectors.d.ts +889 -0
- package/dist/src/data/slices/game-table-screen-slice/selectors/cards-selectors.d.ts +330 -0
- package/dist/src/data/slices/game-table-screen-slice/selectors.d.ts +84 -0
- package/dist/src/data/slices/index.d.ts +2 -2
- package/dist/src/screens/index.d.ts +1 -0
- package/dist/src/screens/table/table-screen.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ import { AxiosResponse } from 'axios';
|
|
|
12
12
|
import { DictionaryItem } from 'jp.ui.app.ds/dist/just_poker/bottom-selection-panel/bottom-selection-panel';
|
|
13
13
|
import { NavigateFunction } from 'react-router';
|
|
14
14
|
import * as reselect from 'reselect';
|
|
15
|
-
import * as redux_thunk from 'redux-thunk';
|
|
16
15
|
|
|
17
16
|
type RouteType = {
|
|
18
17
|
route: string;
|
|
@@ -212,10 +211,12 @@ declare const appSlice: _reduxjs_toolkit.Slice<AppSlice, {
|
|
|
212
211
|
}>;
|
|
213
212
|
|
|
214
213
|
declare enum TableScreenSliceActionTypes {
|
|
214
|
+
INIT = "@tableScreenSlice/init",
|
|
215
|
+
DEACTIVATE = "@tableScreenSlice/deactivate",
|
|
216
|
+
BACK_CLICK = "@tableScreenSlice/backClick",
|
|
215
217
|
START = "@tableScreenSlice/start",
|
|
216
218
|
SUCCESS = "@tableScreenSlice/success",
|
|
217
219
|
ERROR = "@tableScreenSlice/error",
|
|
218
|
-
INIT = "@tableScreenSlice/init",
|
|
219
220
|
MOVE_BUTTON_CLICK = "@tableScreenSlice/moveButtonClick",
|
|
220
221
|
SET_WS_TABLE_STATE = "@tableScreenSlice/setWsTableState",
|
|
221
222
|
DECREMENT_PLAYERS_TURN_TIMEOUT_TIMER = "@tableScreenSlice/decrementPlayersTurnTimeoutTimer",
|
|
@@ -227,6 +228,8 @@ declare const actions: {
|
|
|
227
228
|
success: _reduxjs_toolkit.ActionCreatorWithPayload<IBaseTableGameState, string>;
|
|
228
229
|
error: _reduxjs_toolkit.ActionCreatorWithoutPayload<TableScreenSliceActionTypes.ERROR>;
|
|
229
230
|
init: _reduxjs_toolkit.ActionCreatorWithoutPayload<TableScreenSliceActionTypes.INIT>;
|
|
231
|
+
deactivate: _reduxjs_toolkit.ActionCreatorWithoutPayload<TableScreenSliceActionTypes.DEACTIVATE>;
|
|
232
|
+
backClick: _reduxjs_toolkit.ActionCreatorWithoutPayload<TableScreenSliceActionTypes.BACK_CLICK>;
|
|
230
233
|
moveButtonClick: _reduxjs_toolkit.ActionCreatorWithPayload<string, string>;
|
|
231
234
|
setWsTableState: _reduxjs_toolkit.ActionCreatorWithPayload<IBaseTableGameState, string>;
|
|
232
235
|
decrementPlayersTurnTimeoutTimer: _reduxjs_toolkit.ActionCreatorWithoutPayload<TableScreenSliceActionTypes.DECREMENT_PLAYERS_TURN_TIMEOUT_TIMER>;
|
|
@@ -236,7 +239,49 @@ declare const actions: {
|
|
|
236
239
|
declare const store: any;
|
|
237
240
|
type RootState = ReturnType<typeof store.getState>;
|
|
238
241
|
|
|
239
|
-
declare const
|
|
242
|
+
declare const baseSelectors: {
|
|
243
|
+
isError: ((state: any, ...params: any) => boolean) & {
|
|
244
|
+
clearCache: () => void;
|
|
245
|
+
resultsCount: () => number;
|
|
246
|
+
resetResultsCount: () => void;
|
|
247
|
+
} & {
|
|
248
|
+
resultFunc: (resultFuncArgs_0: IBaseTableScreenState) => boolean;
|
|
249
|
+
memoizedResultFunc: ((resultFuncArgs_0: IBaseTableScreenState) => boolean) & {
|
|
250
|
+
clearCache: () => void;
|
|
251
|
+
resultsCount: () => number;
|
|
252
|
+
resetResultsCount: () => void;
|
|
253
|
+
};
|
|
254
|
+
lastResult: () => boolean;
|
|
255
|
+
dependencies: [(state: RootState) => IBaseTableScreenState];
|
|
256
|
+
recomputations: () => number;
|
|
257
|
+
resetRecomputations: () => void;
|
|
258
|
+
dependencyRecomputations: () => number;
|
|
259
|
+
resetDependencyRecomputations: () => void;
|
|
260
|
+
} & {
|
|
261
|
+
argsMemoize: typeof reselect.weakMapMemoize;
|
|
262
|
+
memoize: typeof reselect.weakMapMemoize;
|
|
263
|
+
};
|
|
264
|
+
isLoading: ((state: any, ...params: any) => boolean) & {
|
|
265
|
+
clearCache: () => void;
|
|
266
|
+
resultsCount: () => number;
|
|
267
|
+
resetResultsCount: () => void;
|
|
268
|
+
} & {
|
|
269
|
+
resultFunc: (resultFuncArgs_0: IBaseTableScreenState) => boolean;
|
|
270
|
+
memoizedResultFunc: ((resultFuncArgs_0: IBaseTableScreenState) => boolean) & {
|
|
271
|
+
clearCache: () => void;
|
|
272
|
+
resultsCount: () => number;
|
|
273
|
+
resetResultsCount: () => void;
|
|
274
|
+
};
|
|
275
|
+
lastResult: () => boolean;
|
|
276
|
+
dependencies: [(state: RootState) => IBaseTableScreenState];
|
|
277
|
+
recomputations: () => number;
|
|
278
|
+
resetRecomputations: () => void;
|
|
279
|
+
dependencyRecomputations: () => number;
|
|
280
|
+
resetDependencyRecomputations: () => void;
|
|
281
|
+
} & {
|
|
282
|
+
argsMemoize: typeof reselect.weakMapMemoize;
|
|
283
|
+
memoize: typeof reselect.weakMapMemoize;
|
|
284
|
+
};
|
|
240
285
|
getRoomId: ((state: any, ...params: any) => string) & {
|
|
241
286
|
clearCache: () => void;
|
|
242
287
|
resultsCount: () => number;
|
|
@@ -565,18 +610,18 @@ declare const selectors: {
|
|
|
565
610
|
argsMemoize: typeof reselect.weakMapMemoize;
|
|
566
611
|
memoize: typeof reselect.weakMapMemoize;
|
|
567
612
|
};
|
|
568
|
-
|
|
613
|
+
getExtraButtons: ((state: any, ...params: any) => jp_common_models.IBaseTableGameStateExtraButtons | undefined) & {
|
|
569
614
|
clearCache: () => void;
|
|
570
615
|
resultsCount: () => number;
|
|
571
616
|
resetResultsCount: () => void;
|
|
572
617
|
} & {
|
|
573
|
-
resultFunc: (resultFuncArgs_0: IBaseTableGameState | undefined) => jp_common_models.
|
|
574
|
-
memoizedResultFunc: ((resultFuncArgs_0: IBaseTableGameState | undefined) => jp_common_models.
|
|
618
|
+
resultFunc: (resultFuncArgs_0: IBaseTableGameState | undefined) => jp_common_models.IBaseTableGameStateExtraButtons | undefined;
|
|
619
|
+
memoizedResultFunc: ((resultFuncArgs_0: IBaseTableGameState | undefined) => jp_common_models.IBaseTableGameStateExtraButtons | undefined) & {
|
|
575
620
|
clearCache: () => void;
|
|
576
621
|
resultsCount: () => number;
|
|
577
622
|
resetResultsCount: () => void;
|
|
578
623
|
};
|
|
579
|
-
lastResult: () => jp_common_models.
|
|
624
|
+
lastResult: () => jp_common_models.IBaseTableGameStateExtraButtons | undefined;
|
|
580
625
|
dependencies: [((state: any, ...params: any) => IBaseTableGameState | undefined) & {
|
|
581
626
|
clearCache: () => void;
|
|
582
627
|
resultsCount: () => number;
|
|
@@ -606,30 +651,33 @@ declare const selectors: {
|
|
|
606
651
|
argsMemoize: typeof reselect.weakMapMemoize;
|
|
607
652
|
memoize: typeof reselect.weakMapMemoize;
|
|
608
653
|
};
|
|
609
|
-
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
declare const cardsSelectors: {
|
|
657
|
+
getCardPlayers: ((state: any, ...params: any) => jp_common_models.ICardPlayerState[]) & {
|
|
610
658
|
clearCache: () => void;
|
|
611
659
|
resultsCount: () => number;
|
|
612
660
|
resetResultsCount: () => void;
|
|
613
661
|
} & {
|
|
614
|
-
resultFunc: (resultFuncArgs_0: IBaseTableGameState | undefined) => jp_common_models.
|
|
615
|
-
memoizedResultFunc: ((resultFuncArgs_0: IBaseTableGameState | undefined) => jp_common_models.
|
|
662
|
+
resultFunc: (resultFuncArgs_0: jp_common_models.IBaseTableGameState | undefined) => jp_common_models.ICardPlayerState[];
|
|
663
|
+
memoizedResultFunc: ((resultFuncArgs_0: jp_common_models.IBaseTableGameState | undefined) => jp_common_models.ICardPlayerState[]) & {
|
|
616
664
|
clearCache: () => void;
|
|
617
665
|
resultsCount: () => number;
|
|
618
666
|
resetResultsCount: () => void;
|
|
619
667
|
};
|
|
620
|
-
lastResult: () => jp_common_models.
|
|
621
|
-
dependencies: [((state: any, ...params: any) => IBaseTableGameState | undefined) & {
|
|
668
|
+
lastResult: () => jp_common_models.ICardPlayerState[];
|
|
669
|
+
dependencies: [((state: any, ...params: any) => jp_common_models.IBaseTableGameState | undefined) & {
|
|
622
670
|
clearCache: () => void;
|
|
623
671
|
resultsCount: () => number;
|
|
624
672
|
resetResultsCount: () => void;
|
|
625
673
|
} & {
|
|
626
|
-
resultFunc: (resultFuncArgs_0: IBaseTableScreenState) => IBaseTableGameState | undefined;
|
|
627
|
-
memoizedResultFunc: ((resultFuncArgs_0: IBaseTableScreenState) => IBaseTableGameState | undefined) & {
|
|
674
|
+
resultFunc: (resultFuncArgs_0: IBaseTableScreenState) => jp_common_models.IBaseTableGameState | undefined;
|
|
675
|
+
memoizedResultFunc: ((resultFuncArgs_0: IBaseTableScreenState) => jp_common_models.IBaseTableGameState | undefined) & {
|
|
628
676
|
clearCache: () => void;
|
|
629
677
|
resultsCount: () => number;
|
|
630
678
|
resetResultsCount: () => void;
|
|
631
679
|
};
|
|
632
|
-
lastResult: () => IBaseTableGameState | undefined;
|
|
680
|
+
lastResult: () => jp_common_models.IBaseTableGameState | undefined;
|
|
633
681
|
dependencies: [(state: RootState) => IBaseTableScreenState];
|
|
634
682
|
recomputations: () => number;
|
|
635
683
|
resetRecomputations: () => void;
|
|
@@ -647,30 +695,112 @@ declare const selectors: {
|
|
|
647
695
|
argsMemoize: typeof reselect.weakMapMemoize;
|
|
648
696
|
memoize: typeof reselect.weakMapMemoize;
|
|
649
697
|
};
|
|
650
|
-
|
|
698
|
+
getBaseCard: ((state: any, ...params: any) => jp_common_models.ICardState | undefined) & {
|
|
651
699
|
clearCache: () => void;
|
|
652
700
|
resultsCount: () => number;
|
|
653
701
|
resetResultsCount: () => void;
|
|
654
702
|
} & {
|
|
655
|
-
resultFunc: (resultFuncArgs_0: IBaseTableGameState | undefined) => jp_common_models.
|
|
656
|
-
memoizedResultFunc: ((resultFuncArgs_0: IBaseTableGameState | undefined) => jp_common_models.
|
|
703
|
+
resultFunc: (resultFuncArgs_0: jp_common_models.IBaseTableGameState | undefined) => jp_common_models.ICardState | undefined;
|
|
704
|
+
memoizedResultFunc: ((resultFuncArgs_0: jp_common_models.IBaseTableGameState | undefined) => jp_common_models.ICardState | undefined) & {
|
|
657
705
|
clearCache: () => void;
|
|
658
706
|
resultsCount: () => number;
|
|
659
707
|
resetResultsCount: () => void;
|
|
660
708
|
};
|
|
661
|
-
lastResult: () => jp_common_models.
|
|
662
|
-
dependencies: [((state: any, ...params: any) => IBaseTableGameState | undefined) & {
|
|
709
|
+
lastResult: () => jp_common_models.ICardState | undefined;
|
|
710
|
+
dependencies: [((state: any, ...params: any) => jp_common_models.IBaseTableGameState | undefined) & {
|
|
663
711
|
clearCache: () => void;
|
|
664
712
|
resultsCount: () => number;
|
|
665
713
|
resetResultsCount: () => void;
|
|
666
714
|
} & {
|
|
667
|
-
resultFunc: (resultFuncArgs_0: IBaseTableScreenState) => IBaseTableGameState | undefined;
|
|
668
|
-
memoizedResultFunc: ((resultFuncArgs_0: IBaseTableScreenState) => IBaseTableGameState | undefined) & {
|
|
715
|
+
resultFunc: (resultFuncArgs_0: IBaseTableScreenState) => jp_common_models.IBaseTableGameState | undefined;
|
|
716
|
+
memoizedResultFunc: ((resultFuncArgs_0: IBaseTableScreenState) => jp_common_models.IBaseTableGameState | undefined) & {
|
|
669
717
|
clearCache: () => void;
|
|
670
718
|
resultsCount: () => number;
|
|
671
719
|
resetResultsCount: () => void;
|
|
672
720
|
};
|
|
673
|
-
lastResult: () => IBaseTableGameState | undefined;
|
|
721
|
+
lastResult: () => jp_common_models.IBaseTableGameState | undefined;
|
|
722
|
+
dependencies: [(state: RootState) => IBaseTableScreenState];
|
|
723
|
+
recomputations: () => number;
|
|
724
|
+
resetRecomputations: () => void;
|
|
725
|
+
dependencyRecomputations: () => number;
|
|
726
|
+
resetDependencyRecomputations: () => void;
|
|
727
|
+
} & {
|
|
728
|
+
argsMemoize: typeof reselect.weakMapMemoize;
|
|
729
|
+
memoize: typeof reselect.weakMapMemoize;
|
|
730
|
+
}];
|
|
731
|
+
recomputations: () => number;
|
|
732
|
+
resetRecomputations: () => void;
|
|
733
|
+
dependencyRecomputations: () => number;
|
|
734
|
+
resetDependencyRecomputations: () => void;
|
|
735
|
+
} & {
|
|
736
|
+
argsMemoize: typeof reselect.weakMapMemoize;
|
|
737
|
+
memoize: typeof reselect.weakMapMemoize;
|
|
738
|
+
};
|
|
739
|
+
getGameCards: ((state: any, ...params: any) => jp_common_models.ICardState[]) & {
|
|
740
|
+
clearCache: () => void;
|
|
741
|
+
resultsCount: () => number;
|
|
742
|
+
resetResultsCount: () => void;
|
|
743
|
+
} & {
|
|
744
|
+
resultFunc: (resultFuncArgs_0: jp_common_models.IBaseTableGameState | undefined) => jp_common_models.ICardState[];
|
|
745
|
+
memoizedResultFunc: ((resultFuncArgs_0: jp_common_models.IBaseTableGameState | undefined) => jp_common_models.ICardState[]) & {
|
|
746
|
+
clearCache: () => void;
|
|
747
|
+
resultsCount: () => number;
|
|
748
|
+
resetResultsCount: () => void;
|
|
749
|
+
};
|
|
750
|
+
lastResult: () => jp_common_models.ICardState[];
|
|
751
|
+
dependencies: [((state: any, ...params: any) => jp_common_models.IBaseTableGameState | undefined) & {
|
|
752
|
+
clearCache: () => void;
|
|
753
|
+
resultsCount: () => number;
|
|
754
|
+
resetResultsCount: () => void;
|
|
755
|
+
} & {
|
|
756
|
+
resultFunc: (resultFuncArgs_0: IBaseTableScreenState) => jp_common_models.IBaseTableGameState | undefined;
|
|
757
|
+
memoizedResultFunc: ((resultFuncArgs_0: IBaseTableScreenState) => jp_common_models.IBaseTableGameState | undefined) & {
|
|
758
|
+
clearCache: () => void;
|
|
759
|
+
resultsCount: () => number;
|
|
760
|
+
resetResultsCount: () => void;
|
|
761
|
+
};
|
|
762
|
+
lastResult: () => jp_common_models.IBaseTableGameState | undefined;
|
|
763
|
+
dependencies: [(state: RootState) => IBaseTableScreenState];
|
|
764
|
+
recomputations: () => number;
|
|
765
|
+
resetRecomputations: () => void;
|
|
766
|
+
dependencyRecomputations: () => number;
|
|
767
|
+
resetDependencyRecomputations: () => void;
|
|
768
|
+
} & {
|
|
769
|
+
argsMemoize: typeof reselect.weakMapMemoize;
|
|
770
|
+
memoize: typeof reselect.weakMapMemoize;
|
|
771
|
+
}];
|
|
772
|
+
recomputations: () => number;
|
|
773
|
+
resetRecomputations: () => void;
|
|
774
|
+
dependencyRecomputations: () => number;
|
|
775
|
+
resetDependencyRecomputations: () => void;
|
|
776
|
+
} & {
|
|
777
|
+
argsMemoize: typeof reselect.weakMapMemoize;
|
|
778
|
+
memoize: typeof reselect.weakMapMemoize;
|
|
779
|
+
};
|
|
780
|
+
getGameCardsPair: ((state: any, ...params: any) => jp_common_models.ICardPairState[]) & {
|
|
781
|
+
clearCache: () => void;
|
|
782
|
+
resultsCount: () => number;
|
|
783
|
+
resetResultsCount: () => void;
|
|
784
|
+
} & {
|
|
785
|
+
resultFunc: (resultFuncArgs_0: jp_common_models.IBaseTableGameState | undefined) => jp_common_models.ICardPairState[];
|
|
786
|
+
memoizedResultFunc: ((resultFuncArgs_0: jp_common_models.IBaseTableGameState | undefined) => jp_common_models.ICardPairState[]) & {
|
|
787
|
+
clearCache: () => void;
|
|
788
|
+
resultsCount: () => number;
|
|
789
|
+
resetResultsCount: () => void;
|
|
790
|
+
};
|
|
791
|
+
lastResult: () => jp_common_models.ICardPairState[];
|
|
792
|
+
dependencies: [((state: any, ...params: any) => jp_common_models.IBaseTableGameState | undefined) & {
|
|
793
|
+
clearCache: () => void;
|
|
794
|
+
resultsCount: () => number;
|
|
795
|
+
resetResultsCount: () => void;
|
|
796
|
+
} & {
|
|
797
|
+
resultFunc: (resultFuncArgs_0: IBaseTableScreenState) => jp_common_models.IBaseTableGameState | undefined;
|
|
798
|
+
memoizedResultFunc: ((resultFuncArgs_0: IBaseTableScreenState) => jp_common_models.IBaseTableGameState | undefined) & {
|
|
799
|
+
clearCache: () => void;
|
|
800
|
+
resultsCount: () => number;
|
|
801
|
+
resetResultsCount: () => void;
|
|
802
|
+
};
|
|
803
|
+
lastResult: () => jp_common_models.IBaseTableGameState | undefined;
|
|
674
804
|
dependencies: [(state: RootState) => IBaseTableScreenState];
|
|
675
805
|
recomputations: () => number;
|
|
676
806
|
resetRecomputations: () => void;
|
|
@@ -693,7 +823,10 @@ declare const selectors: {
|
|
|
693
823
|
type GameTableScreenSliceType = {
|
|
694
824
|
actions: typeof actions;
|
|
695
825
|
reducer: typeof reducer;
|
|
696
|
-
selectors:
|
|
826
|
+
selectors: {
|
|
827
|
+
base: typeof baseSelectors;
|
|
828
|
+
cards: typeof cardsSelectors;
|
|
829
|
+
};
|
|
697
830
|
};
|
|
698
831
|
declare const gameTableScreenSlice: GameTableScreenSliceType;
|
|
699
832
|
|
|
@@ -836,20 +969,6 @@ declare function getBaseSlicesReducer(): {
|
|
|
836
969
|
};
|
|
837
970
|
};
|
|
838
971
|
|
|
839
|
-
declare const appListenerMiddleware: _reduxjs_toolkit.ListenerMiddlewareInstance<unknown, redux_thunk.ThunkDispatch<unknown, unknown, redux.UnknownAction>, unknown>;
|
|
840
|
-
|
|
841
|
-
declare const menuScreenListenerMiddleware: _reduxjs_toolkit.ListenerMiddlewareInstance<unknown, redux_thunk.ThunkDispatch<unknown, unknown, redux.UnknownAction>, unknown>;
|
|
842
|
-
|
|
843
|
-
declare const menuScreenItemListenerMiddleware: _reduxjs_toolkit.ListenerMiddlewareInstance<unknown, redux_thunk.ThunkDispatch<unknown, unknown, redux.UnknownAction>, unknown>;
|
|
844
|
-
|
|
845
|
-
declare const shopScreenListenerMiddleware: _reduxjs_toolkit.ListenerMiddlewareInstance<unknown, redux_thunk.ThunkDispatch<unknown, unknown, redux.UnknownAction>, unknown>;
|
|
846
|
-
|
|
847
|
-
declare const tablesScreenListenerMiddleware: _reduxjs_toolkit.ListenerMiddlewareInstance<unknown, redux_thunk.ThunkDispatch<unknown, unknown, redux.UnknownAction>, unknown>;
|
|
848
|
-
|
|
849
|
-
declare const tablesScreenItemListenerMiddleware: _reduxjs_toolkit.ListenerMiddlewareInstance<unknown, redux_thunk.ThunkDispatch<unknown, unknown, redux.UnknownAction>, unknown>;
|
|
850
|
-
|
|
851
|
-
declare const wsConnectorListenerMiddleware: _reduxjs_toolkit.ListenerMiddlewareInstance<unknown, redux_thunk.ThunkDispatch<unknown, unknown, redux.UnknownAction>, unknown>;
|
|
852
|
-
|
|
853
972
|
declare function getBaseMiddlewares(): any[];
|
|
854
973
|
|
|
855
974
|
type AuthResponse = {
|
|
@@ -889,6 +1008,11 @@ declare const ShopScreen: () => React.JSX.Element;
|
|
|
889
1008
|
|
|
890
1009
|
declare const TablesScreen: () => React.JSX.Element;
|
|
891
1010
|
|
|
1011
|
+
type TableScreenProps = {
|
|
1012
|
+
children: React.ReactNode;
|
|
1013
|
+
};
|
|
1014
|
+
declare const TableScreen: ({ children }: TableScreenProps) => React.JSX.Element;
|
|
1015
|
+
|
|
892
1016
|
type RaiseBottomSheetBlockProps = {
|
|
893
1017
|
items: Array<DictionaryItem>;
|
|
894
1018
|
itemClick: (item: DictionaryItem) => void;
|
|
@@ -1014,5 +1138,5 @@ declare class Navigator {
|
|
|
1014
1138
|
getParams(pathPattern: string): Record<string, string | undefined>;
|
|
1015
1139
|
}
|
|
1016
1140
|
|
|
1017
|
-
export { BaseApplication, GlobalStorage, GlobalStorageEnum, MenuScreen, Navigator, RaiseBottomSheetBlock, ReactionBottomSheetBlock, ShopScreen, TablesScreen, WSConnector,
|
|
1141
|
+
export { BaseApplication, GlobalStorage, GlobalStorageEnum, MenuScreen, Navigator, RaiseBottomSheetBlock, ReactionBottomSheetBlock, ShopScreen, TableScreen, TablesScreen, WSConnector, appSlice, authRequest, config_d as config, enterTheTableRequest, exitTheTableRequest, gameTableScreenSlice, getBaseMiddlewares, getBaseSlices, getBaseSlicesReducer, getClientInfo, getMenuRequest, getShopRequest, getTablesRequest, menuScreenSlice, moveOnTheTableRequest, playerCheckStateRequest, raiseBottomSheetBlockSlice, reactionBottomSheetBlockSlice, setDefaultRequestHeaders, shopScreenSlice, tablesScreenSlice, watchTheTableRequest, wsConnectorSlice };
|
|
1018
1142
|
export type { RouteType };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as t from"react";import e,{useCallback as n,Component as r}from"react";import{useDispatch as i,useSelector as o,Provider as c}from"react-redux";import{RoutesEnum as a}from"jp.common.view";import{createSlice as s,createAction as u,createReducer as l,createSelector as d,createListenerMiddleware as _}from"@reduxjs/toolkit";import f from"lodash.clonedeep";import{UniversalScreen as T,BottomSelectionPanel as E}from"jp.ui.app.ds";import p from"axios";import{io as L}from"socket.io-client";import m from"mobile-detect";import g from"dayjs";import{Routes as v,Route as h,MemoryRouter as C}from"react-router-dom";import{ThemeProvider as I}from"@emotion/react";import{getLightTheme as U,ColorSchema as A}from"jp.ui.theme";import{useNavigate as R}from"react-router";import{setPeriodicTimer as N}from"jp.common.utils";var S=function(t,e){return S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},S(t,e)};var y=function(){return y=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},y.apply(this,arguments)};function H(t,e,n,r){return new(n||(n=Promise))(function(i,o){function c(t){try{s(r.next(t))}catch(t){o(t)}}function a(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(c,a)}s((r=r.apply(t,e||[])).next())})}function B(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=a(0),c.throw=a(1),c.return=a(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function a(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}"function"==typeof SuppressedError&&SuppressedError;var O=s({name:"appSlice",initialState:{isLoading:!1,isError:!1,isInit:!1},reducers:{initApp:function(t){return y(y({},t),{isLoading:!0})},deactivateApp:function(t){return y(y({},t),{isInit:!1,isLoading:!1})},errorApp:function(t){return y(y({},t),{isLoading:!1,isInit:!0,isError:!0})},successApp:function(t){return y(y({},t),{isLoading:!1,isInit:!0})}},selectors:{isInit:function(t){return t.isInit},isLoading:function(t){return t.isLoading},isError:function(t){return t.isError}}});O.reducer;var b=s({name:"menuScreenSlice",initialState:{isError:!1,isLoading:!1,data:void 0},reducers:{start:function(t){return y(y({},t),{isLoading:!0,isError:null,data:null})},error:function(t){return y(y({},t),{isLoading:!1,isError:!0})},success:function(t,e){return y(y({},t),{isLoading:!1,isError:!1,data:e.payload})},init:function(t){return t},listItemClick:function(t,e){return t}},selectors:{getScreen:function(t){return t.data},isLoading:function(t){return t.isLoading},isError:function(t){return t.isError}}});b.reducer;var k=s({name:"shopScreenSlice",initialState:{isError:!1,isLoading:!1,data:void 0},reducers:{start:function(t){return y(y({},t),{isLoading:!0,isError:null,data:null})},error:function(t){return y(y({},t),{isLoading:!1,isError:!0})},success:function(t,e){return y(y({},t),{isLoading:!1,isError:!1,data:e.payload})},init:function(t){return t}},selectors:{getScreen:function(t){return t.data},isLoading:function(t){return t.isLoading},isError:function(t){return t.isError}}});k.reducer;var V=s({name:"tablesScreenSlice",initialState:{isError:!1,isLoading:!1,data:void 0},reducers:{start:function(t){return y(y({},t),{isLoading:!0,isError:null,data:null})},error:function(t){return y(y({},t),{isLoading:!1,isError:!0})},success:function(t,e){return y(y({},t),{isLoading:!1,isError:!1,data:e.payload})},init:function(t){return t},listItemClick:function(t,e){return t}},selectors:{getScreen:function(t){return t.data},isLoading:function(t){return t.isLoading},isError:function(t){return t.isError}}});V.reducer;var w=s({name:"raiseBottomSheetBlockSlice",initialState:{isOpen:!1},reducers:{open:function(t){return y(y({},t),{isOpen:!0})},close:function(t){return y(y({},t),{isOpen:!1})}},selectors:{getIsOpen:function(t){return t.isOpen}}});w.reducer;var P=s({name:"reactionBottomSheetBlockSlice",initialState:{isOpen:!1},reducers:{open:function(t){return y(y({},t),{isOpen:!0})},close:function(t){return y(y({},t),{isOpen:!1})}},selectors:{getIsOpen:function(t){return t.isOpen}}});P.reducer;var M,W=s({name:"wsConnectorSlice",initialState:{isConnected:!1,error:null},reducers:{connect:function(t){return y(y({},t),{isConnected:!1})},connected:function(t){return y(y({},t),{isConnected:!0})},disconnect:function(t,e){return y(y({},t),{isConnected:!1})},error:function(t,e){return t},message:function(t,e){return t}},selectors:{getIsConnected:function(t){return t.isConnected}}});W.reducer,function(t){t.START="@tableScreenSlice/start",t.SUCCESS="@tableScreenSlice/success",t.ERROR="@tableScreenSlice/error",t.INIT="@tableScreenSlice/init",t.MOVE_BUTTON_CLICK="@tableScreenSlice/moveButtonClick",t.SET_WS_TABLE_STATE="@tableScreenSlice/setWsTableState",t.DECREMENT_PLAYERS_TURN_TIMEOUT_TIMER="@tableScreenSlice/decrementPlayersTurnTimeoutTimer",t.DECREMENT_RESTART_TIMEOUT_TIMER="@tableScreenSlice/decrementRestartTimeoutTimer"}(M||(M={}));var G=u(M.START),K=u(M.SUCCESS),x=u(M.ERROR),D=u(M.INIT),j=u(M.MOVE_BUTTON_CLICK),Y=u(M.SET_WS_TABLE_STATE),z=u(M.DECREMENT_PLAYERS_TURN_TIMEOUT_TIMER),X=u(M.DECREMENT_RESTART_TIMEOUT_TIMER),q={start:G,success:K,error:x,init:D,moveButtonClick:j,setWsTableState:Y,decrementPlayersTurnTimeoutTimer:z,decrementRestartTimeoutTimer:X},F=l({isError:!1,isLoading:!1,data:void 0},function(t){return t.addCase(G,function(t){return y(y({},t),{isLoading:!0,isError:!1})}).addCase(K,function(t,e){return y(y({},t),{isLoading:!1,isError:!1,data:e.payload})}).addCase(x,function(t){return y(y({},t),{isLoading:!1,isError:!0})}).addCase(Y,function(t,e){return y(y({},t),{isLoading:!1,isError:!1,data:e.payload})}).addCase(z,function(t,e){var n,r=f(t);return(null===(n=r.data)||void 0===n?void 0:n.checkPlayersTurnTimerRemain)?(r.data.checkPlayersTurnTimerRemain-=1,r):t}).addCase(X,function(t,e){var n,r=f(t);return(null===(n=r.data)||void 0===n?void 0:n.restartTimerRemain)?(r.data.restartTimerRemain-=1,r):t})}),Z=d(function(t){return t.gameTableScreenSlice},function(t){return null==t?void 0:t.data}),J={actions:q,reducer:F,selectors:{getRoomId:d(Z,function(t){return null==t?void 0:t.roomId}),getTableId:d(Z,function(t){return null==t?void 0:t.tableId}),getGameId:d(Z,function(t){return null==t?void 0:t.gameId}),getTableSize:d(Z,function(t){return null==t?void 0:t.tableSize}),getCheckPlayersTurnTimerRemain:d(Z,function(t){return null==t?void 0:t.checkPlayersTurnTimerRemain}),getRestartTimerRemain:d(Z,function(t){return null==t?void 0:t.restartTimerRemain}),getYoursActions:d(Z,function(t){return null==t?void 0:t.yoursActions}),getYoursMessage:d(Z,function(t){return null==t?void 0:t.yoursMessage}),getPlayers:d(Z,function(t){return null==t?void 0:t.players}),getSummary:d(Z,function(t){return null==t?void 0:t.players}),getExtraButtons:d(Z,function(t){return null==t?void 0:t.extraButtons})}};function Q(){return[O,b,k,V,w,P,W]}function $(){return{appSlice:O.reducer,menuScreenSlice:b.reducer,shopScreenSlice:k.reducer,tablesScreenSlice:V.reducer,raiseBottomSheetBlockSlice:w.reducer,reactionBottomSheetBlockSlice:P.reducer,wsConnectorSlice:W.reducer,gameTableScreenSlice:J.reducer}}var tt=function(){var e=i(),r=o(b.selectors.getScreen),c=o(b.selectors.isLoading),a=o(b.selectors.isError),s=n(function(){return e(b.actions.init())},[]),u=n(function(t){return e(b.actions.listItemClick(t))},[]);return t.createElement(T,{screen:r,isLoading:c,isError:a,init:s,sectionHandlers:{listSectionClick:u}})},et=function(){var e=i(),r=o(k.selectors.getScreen),c=o(k.selectors.isLoading),a=o(k.selectors.isError),s=n(function(){return e(k.actions.init())},[]);return t.createElement(T,{screen:r,isLoading:c,isError:a,init:s})},nt=function(){var e=i(),r=o(V.selectors.getScreen),c=o(V.selectors.isLoading),a=o(V.selectors.isError),s=n(function(){return e(V.actions.init())},[]),u=n(function(t){return e(V.actions.listItemClick(t))},[]);return t.createElement(T,{screen:r,isLoading:c,isError:a,init:s,sectionHandlers:{listSectionClick:u}})};function rt(){return import.meta.env.PUBLIC_CLIENT_GAME}function it(){return import.meta.env.PUBLIC_CLIENT_CHANNEL}function ot(){return import.meta.env.PUBLIC_CLIENT_AUTH_VK_URL}function ct(){return import.meta.env.PUBLIC_CLIENT_AUTH_OK_URL}function at(){return import.meta.env.PUBLIC_CLIENT_AUTH_YA_URL}function st(){return import.meta.env.PUBLIC_CLIENT_AUTH_TG_URL}function ut(){return import.meta.env.PUBLIC_CLIENT_AUTH_WEB_URL}function lt(){return import.meta.env.PUBLIC_CLIENT_MENU_URL}function dt(){return import.meta.env.PUBLIC_CLIENT_SHOP_URL}function _t(){return import.meta.env.PUBLIC_CLIENT_TABLES_URL}function ft(){return import.meta.env.PUBLIC_CLIENT_ENTER_THE_TABLE_URL}function Tt(){return import.meta.env.PUBLIC_CLIENT_WATCH_THE_TABLE_URL}function Et(){return import.meta.env.PUBLIC_CLIENT_EXIT_THE_TABLE_URL}function pt(){return import.meta.env.PUBLIC_CLIENT_MOVE_ON_THE_TABLE_URL}function Lt(){return import.meta.env.PUBLIC_CLIENT_PLAYER_CHECK_STATE_URL}var mt=Object.freeze({__proto__:null,getClientAuthOKUrl:ct,getClientAuthTGUrl:st,getClientAuthVKUrl:ot,getClientAuthWEBUrl:ut,getClientAuthYAUrl:at,getClientChannel:it,getClientEnterTheTableUrl:ft,getClientExitTheTableUrl:Et,getClientGame:rt,getClientMenuUrl:lt,getClientMoveOnTheTableUrl:pt,getClientPlayerCheckStateUrl:Lt,getClientShopUrl:dt,getClientTablesUrl:_t,getClientWatchTheTableUrl:Tt});function gt(t,e,n){p.defaults.headers.common.client_auth_token=e,p.defaults.headers.common.client_language=n,p.defaults.headers.common.client_game=t.clientGame,p.defaults.headers.common.client_channel=t.clientChannel,p.defaults.headers.common.client_version=t.clientVersion}var vt,ht=function(){function t(){var t=this;this._openConnectionHandler=function(){t._listenerApi.dispatch(W.actions.connected())},this._closeConnectionHandler=function(e){t._listenerApi.dispatch(W.actions.disconnect(e))},this._messageHandler=function(e){t._listenerApi.dispatch(W.actions.message(e))},this._errorHandler=function(e){t._listenerApi.dispatch(W.actions.error(e.message))}}return t.getInstance=function(){return null!=t._instance||(t._instance=new t),t._instance},t.prototype.connect=function(t,e,n){this._socket=L(t,{auth:{token:e},reconnection:!0,reconnectionDelay:1e3}),this._listenerApi=n,this._authToken=e,this._socket.on("connect",this._openConnectionHandler),this._socket.on("message",this._messageHandler),this._socket.on("connection_error",this._errorHandler),this._socket.on("disconnect",this._closeConnectionHandler),this._listenerApi.dispatch(W.actions.connect())},t.prototype.sendMessage=function(t){var e,n,r=this;(null===(e=this._socket)||void 0===e?void 0:e.connected)?null===(n=this._socket)||void 0===n||n.send(JSON.stringify(t)):setTimeout(function(){r.sendMessage(t)},10)},t}(),Ct=function(){function t(){this.data={}}return t.get=function(){return null!=t.instance||(t.instance=new t),t.instance},t.prototype.getValue=function(t){var e;return null!==(e=this.data[t])&&void 0!==e?e:""},t.prototype.setValue=function(t,e){this.data[t]=e},t}();function It(t){var e,n,r;return null!==(r=null===(n=null===(e=null==t?void 0:t.document)||void 0===e?void 0:e.body)||void 0===n?void 0:n.clientWidth)&&void 0!==r?r:0}function Ut(t){var e,n,r;return null!==(r=null===(n=null===(e=null==t?void 0:t.document)||void 0===e?void 0:e.body)||void 0===n?void 0:n.clientHeight)&&void 0!==r?r:0}function At(){var t,e=new m(window.navigator.userAgent);return{clientVersion:"1.0.20",clientChannel:Ct.get().getValue(vt.CLIENT_CHANNEL),clientGame:Ct.get().getValue(vt.CLIENT_GAME),clientDevice:null!==(t=e.phone())&&void 0!==t?t:"",clientOS:e.os(),clientBrowser:"".concat(e.userAgent()),clientBrowserVersion:"".concat(e.version("Webkit")),clientDeviceWidth:It(window),clientDeviceHeight:Ut(window),clientTimeOffset:g().utcOffset()}}!function(t){t.BASE_HOST="BASE_HOST",t.CLIENT_CHANNEL="CLIENT_CHANNEL",t.CLIENT_GAME="CLIENT_GAME",t.CLIENT_AUTH_VK_URL="CLIENT_AUTH_VK_URL",t.CLIENT_AUTH_OK_URL="CLIENT_AUTH_OK_URL",t.CLIENT_AUTH_YA_URL="CLIENT_AUTH_YA_URL",t.CLIENT_AUTH_TG_URL="CLIENT_AUTH_TG_URL",t.CLIENT_AUTH_WEB_URL="CLIENT_AUTH_WEB_URL",t.CLIENT_MENU_URL="CLIENT_MENU_URL",t.CLIENT_SHOP_URL="CLIENT_SHOP_URL",t.CLIENT_TABLES_URL="CLIENT_TABLES_URL",t.CLIENT_WATCH_THE_TABLE_URL="CLIENT_WATCH_THE_TABLE_URL",t.CLIENT_ENTER_THE_TABLE_URL="CLIENT_ENTER_THE_TABLE_URL",t.CLIENT_EXIT_THE_TABLE_URL="CLIENT_EXIT_THE_TABLE_URL",t.CLIENT_MOVE_ON_THE_TABLE_URL="CLIENT_MOVE_ON_THE_TABLE_URL",t.CLIENT_PLAYER_CHECK_STATE_URL="CLIENT_PLAYER_CHECK_STATE_URL"}(vt||(vt={}));var Rt=function(){function t(e){t._navigate=e}return t.setNavigate=function(t){this._navigate=t},t.getInstance=function(){return this._instance||(this._instance=new t(t._navigate)),this._instance},t.prototype.redirect=function(e){t._currentPath=e,e.includes("http")?window.open(e,"_blank"):t._navigate(e)},t.prototype.redirectWithoutMem=function(e){t._currentPath=e,t._navigate(e,{replace:!0})},t.prototype.back=function(){t._navigate(-1)},t.prototype.getParams=function(e){return function(t,e){var n=t.split("/"),r=e.split("/"),i={};if(n.length!==r.length)return{};for(var o=0;o<n.length;o++)if(n[o].startsWith(":"))i[n[o].substring(1)]=r[o];else if(n[o]!==r[o])return{};return i}(e,t._currentPath)},t}();i.withTypes();var Nt,St=o.withTypes(),yt=function(e){return Rt.setNavigate(R()),St(O.selectors.isInit)?t.createElement(v,null,e.routes.map(function(e){var n=e.route,r=e.screen;return t.createElement(h,{key:n,path:n,element:r})})):t.createElement("div",null,"Loading")},Ht=function(t){var n=t.routes;return e.createElement(I,{theme:U(A.DEFAULT,{})},e.createElement(C,null,e.createElement(yt,{routes:n})))},Bt=function(t){function n(e,n){var r=t.call(this,e)||this;return r.store=n,r.init(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}S(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(n,t),n.prototype.init=function(){Ct.get().setValue(vt.CLIENT_CHANNEL,it()),Ct.get().setValue(vt.CLIENT_GAME,rt()),Ct.get().setValue(vt.CLIENT_AUTH_VK_URL,ot()),Ct.get().setValue(vt.CLIENT_AUTH_OK_URL,ct()),Ct.get().setValue(vt.CLIENT_AUTH_YA_URL,at()),Ct.get().setValue(vt.CLIENT_AUTH_TG_URL,st()),Ct.get().setValue(vt.CLIENT_AUTH_WEB_URL,ut()),Ct.get().setValue(vt.CLIENT_MENU_URL,lt()),Ct.get().setValue(vt.CLIENT_SHOP_URL,dt()),Ct.get().setValue(vt.CLIENT_TABLES_URL,_t()),Ct.get().setValue(vt.CLIENT_ENTER_THE_TABLE_URL,ft()),Ct.get().setValue(vt.CLIENT_WATCH_THE_TABLE_URL,Tt()),Ct.get().setValue(vt.CLIENT_EXIT_THE_TABLE_URL,Et()),Ct.get().setValue(vt.CLIENT_MOVE_ON_THE_TABLE_URL,pt()),Ct.get().setValue(vt.CLIENT_PLAYER_CHECK_STATE_URL,Lt())},n.prototype.componentDidMount=function(){this.store.dispatch(O.actions.initApp())},n.prototype.componentWillUnmount=function(){this.store.dispatch(O.actions.deactivateApp())},n.prototype.getRoutes=function(){return[{route:a.MENU,screen:e.createElement(tt,null)},{route:a.SHOP,screen:e.createElement(et,null)},{route:a.ROOMS,screen:e.createElement(nt,null)}]},n.prototype.render=function(){return e.createElement(c,{store:this.store},e.createElement(Ht,{routes:this.getRoutes()}))},n}(r);!function(t){t.VK="VK",t.YA="YA",t.OK="OK",t.WEB="WEB",t.AT="AT",t.VKIOS="VKIOS",t.TG="TG"}(Nt||(Nt={}));var Ot={uid:"581730373013",birthday:"2000-02-01",birthdaySet:!0,age:21,first_name:"Justpoker",last_name:"Online",location:{city:"Moscow",country:"RUSSIAN_FEDERATION",countryCode:"RU",countryName:"Russia"},pic128x128:"https://api.ok.ru/img/stub/user/male/128.png"};function bt(t){return H(this,void 0,void 0,function(){return B(this,function(e){return[2,p.post(Ct.get().getValue(vt.CLIENT_AUTH_OK_URL),{okUser:Ot,clientInfo:t})]})})}var kt={id:8426719,is_closed:!1,sex:2,photo_max_orig:"https://sun1-92.userapi.com/impf/c857536/v857536990/c1ae9/e3ikmioAt3s.jpg?size=400x0&quality=96&crop=0,315,750,750&sign=1edea0ff18f44079ee2c671d0eb649d3&c_uniq_tag=8UWvihf3P4Gaq7HDHZ36CnueaU45AM9n3r6FibqGRcM&ava=1",can_access_closed:!0,can_invite_to_chats:!1,first_name:"Dmitry",bdate:"21.8.1989",city:{id:1,title:"Moscow"},photo_200:"https://sun1-92.userapi.com/impf/c857536/v857536990/c1ae9/e3ikmioAt3s.jpg?size=200x0&quality=96&crop=0,315,750,750&sign=a810ed95c832aa59061a2e57b6aaf354&c_uniq_tag=1OW0lK2-rvjPjvZMTptmD5ebxiFqzXtj_-do3DSRUTc&ava=1",timezone:3,last_name:"Solovyov",photo_100:"https://sun1-92.userapi.com/impf/c857536/v857536990/c1ae9/e3ikmioAt3s.jpg?size=100x0&quality=96&crop=0,315,750,750&sign=11c3a81e646806e12d74ee5622cfe115&c_uniq_tag=PbYUyR-hU2L6m4K2iEMX6F2dwzooz0n8I5ZgD_J-GDs&ava=1",country:{id:1,title:"Russia"}};function Vt(t){return H(this,void 0,void 0,function(){return B(this,function(e){return[2,p.post(Ct.get().getValue(vt.CLIENT_AUTH_VK_URL),{vkUser:kt,clientInfo:t})]})})}var wt={userId:"r3103WLiktg7Ux4X92Gugz2Rl7sG1v/1DHjfnHgHk4I=",avatarUrl:"https://avatars.mds.yandex.net/get-yapic/40138/8Zy0NFhXokbxYIN3BzCtpAVYazw-1/islands-middle",language:"ru",fullName:"DMITRY S.",purchasesSignature:"GrDdbsa0srAqcrFqufY3Bm12+1sUveubZDLXzqCgRnI=.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImlzc3VlZEF0IjoxNjMyOTg0NDc3LCJyZXF1ZXN0UGF5bG9hZCI6IiIsImRhdGEiOltdfQ==",isGuest:!0,yandexUid:""};function Pt(t){return H(this,void 0,void 0,function(){return B(this,function(e){return[2,p.post(Ct.get().getValue(vt.CLIENT_AUTH_YA_URL),{yaUser:wt,clientInfo:t})]})})}var Mt={allowsWriteToPm:!0,firstName:"Dmitry",id:180352252,languageCode:"ru",lastName:"Solovev",photoUrl:"https://t.me/i/userpic/320/Afu-apjsWgxmkMI2hJD56Wt2w4D6pWwgssA3CeLYX_8.svg",username:"choochoochoo"};function Wt(t){return H(this,void 0,void 0,function(){return B(this,function(e){return[2,p.post(Ct.get().getValue(vt.CLIENT_AUTH_TG_URL),{tgUser:Mt,clientInfo:t})]})})}function Gt(t){return H(this,void 0,void 0,function(){return B(this,function(e){return[2,p.post(Ct.get().getValue(vt.CLIENT_AUTH_WEB_URL),{clientInfo:t})]})})}function Kt(){return H(this,void 0,void 0,function(){var t;return B(this,function(e){switch((t=At()).clientChannel){case Nt.VK:return[2,Vt(t)];case Nt.OK:return[2,bt(t)];case Nt.YA:return[2,Pt(t)];case Nt.TG:return[2,Wt(t)];case Nt.WEB:return[2,Gt(t)]}return[2]})})}function xt(){return p.create({baseURL:Ct.get().getValue(vt.BASE_HOST)})}function Dt(){return H(this,void 0,void 0,function(){return B(this,function(t){return[2,xt().get(Ct.get().getValue(vt.CLIENT_MENU_URL))]})})}function jt(){return H(this,void 0,void 0,function(){return B(this,function(t){return[2,xt().get(Ct.get().getValue(vt.CLIENT_SHOP_URL))]})})}function Yt(){return H(this,void 0,void 0,function(){return B(this,function(t){return[2,xt().get(Ct.get().getValue(vt.CLIENT_TABLES_URL))]})})}function zt(t){return H(this,void 0,void 0,function(){return B(this,function(e){return[2,xt().post("".concat(Ct.get().getValue(vt.CLIENT_ENTER_THE_TABLE_URL),"/").concat(t))]})})}function Xt(t){return H(this,void 0,void 0,function(){return B(this,function(e){return[2,xt().post("".concat(Ct.get().getValue(vt.CLIENT_WATCH_THE_TABLE_URL),"/").concat(t))]})})}function qt(t){return H(this,void 0,void 0,function(){return B(this,function(e){return[2,xt().post("".concat(Ct.get().getValue(vt.CLIENT_EXIT_THE_TABLE_URL),"/").concat(t))]})})}function Ft(t,e){return H(this,void 0,void 0,function(){return B(this,function(n){return[2,xt().post("".concat(Ct.get().getValue(vt.CLIENT_MOVE_ON_THE_TABLE_URL),"/").concat(t),e)]})})}function Zt(){return H(this,void 0,void 0,function(){return B(this,function(t){return[2,xt().get(Ct.get().getValue(vt.CLIENT_PLAYER_CHECK_STATE_URL))]})})}var Jt=_();Jt.startListening({actionCreator:O.actions.initApp,effect:function(t,e){return H(void 0,void 0,void 0,function(){var t,n;return B(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,Kt()];case 1:return t=r.sent(),(new ht).connect(t.data.wsAddress,t.data.token,e),Ct.get().setValue(vt.BASE_HOST,t.data.httpAddress),gt(At(),t.data.token,t.data.language),[4,Zt()];case 2:return n=r.sent(),Rt.getInstance().redirect(n.data.redirectUrl),[3,4];case 3:return r.sent(),e.dispatch(O.actions.errorApp()),[3,4];case 4:return e.dispatch(O.actions.successApp()),[2]}})})}});var Qt=_();Qt.startListening({actionCreator:b.actions.init,effect:function(t,e){return H(void 0,void 0,void 0,function(){var t;return B(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e.dispatch(b.actions.start()),[4,Dt()];case 1:return t=n.sent(),e.dispatch(b.actions.success(t.data.screen)),[3,3];case 2:return n.sent(),e.dispatch(b.actions.error()),[3,3];case 3:return[2]}})})}});var $t=_();$t.startListening({actionCreator:b.actions.listItemClick,effect:function(t,e){return H(void 0,void 0,void 0,function(){return B(this,function(e){return null!=t.payload.url&&Rt.getInstance().redirect(t.payload.url),[2]})})}});var te=_();te.startListening({actionCreator:k.actions.init,effect:function(t,e){return H(void 0,void 0,void 0,function(){var t;return B(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e.dispatch(k.actions.start()),[4,jt()];case 1:return t=n.sent(),e.dispatch(k.actions.success(t.data.screen)),[3,3];case 2:return n.sent(),e.dispatch(k.actions.error()),[3,3];case 3:return[2]}})})}});var ee=_();ee.startListening({actionCreator:V.actions.init,effect:function(t,e){return H(void 0,void 0,void 0,function(){var t;return B(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e.dispatch(V.actions.start()),[4,Yt()];case 1:return t=n.sent(),e.dispatch(V.actions.success(t.data.screen)),[3,3];case 2:return n.sent(),e.dispatch(V.actions.error()),[3,3];case 3:return[2]}})})}});var ne,re=_();re.startListening({actionCreator:V.actions.listItemClick,effect:function(t,e){return H(void 0,void 0,void 0,function(){return B(this,function(e){return null!=t.payload.url&&Rt.getInstance().redirect(t.payload.url),[2]})})}});var ie=_();ie.startListening({actionCreator:W.actions.message,effect:function(t,e){return H(void 0,void 0,void 0,function(){return B(this,function(n){return function(t,e){var n=t.payload.data.checkPlayersTurnTimerRemain;n&&n>0&&(ne=N(ne,n,function(){return e.dispatch(J.actions.decrementPlayersTurnTimeoutTimer())}))}(t,e),function(t,e){var n=t.payload.data.restartTimerRemain;n&&n>0&&(ne=N(ne,n,function(){return e.dispatch(J.actions.decrementRestartTimeoutTimer())}))}(t,e),e.dispatch(J.actions.setWsTableState(t.payload.data)),[2]})})}});var oe=function(t){return function(e){return function(n){return H(void 0,void 0,void 0,function(){var r,i;return B(this,function(o){switch(o.label){case 0:if(!J.actions.init.match(n))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),t.dispatch(J.actions.start()),[4,Xt(null!==(i=Rt.getInstance().getParams(a.TABLE).tableId)&&void 0!==i?i:"")];case 2:return r=o.sent(),t.dispatch(J.actions.success(r.data)),[3,4];case 3:return o.sent(),t.dispatch(J.actions.error()),[3,4];case 4:return[2,e(n)]}})})}}};function ce(){return[Jt.middleware,Qt.middleware,$t.middleware,te.middleware,ee.middleware,re.middleware,ie.middleware,oe]}var ae=function(e){var r=e.items,c=e.itemClick,a=e.title,s=e.closeTitle,u=i();if(!o(w.selectors.getIsOpen))return t.createElement("div",null);var l=n(function(){u(w.actions.close)},[]);return t.createElement(E,{items:r,onItemClick:c,title:a,onCloseButtonClick:l,closeButtonTitle:null!=s?s:""})},se=function(e){var r=e.items,c=e.itemClick,a=e.title,s=e.closeTitle,u=i();if(!o(w.selectors.getIsOpen))return t.createElement("div",null);var l=n(function(){u(w.actions.close)},[]);return t.createElement(E,{items:r,onItemClick:c,title:a,onCloseButtonClick:l,closeButtonTitle:null!=s?s:""})};export{Bt as BaseApplication,Ct as GlobalStorage,vt as GlobalStorageEnum,tt as MenuScreen,Rt as Navigator,ae as RaiseBottomSheetBlock,se as ReactionBottomSheetBlock,et as ShopScreen,nt as TablesScreen,ht as WSConnector,Jt as appListenerMiddleware,O as appSlice,Kt as authRequest,mt as config,zt as enterTheTableRequest,qt as exitTheTableRequest,J as gameTableScreenSlice,ce as getBaseMiddlewares,Q as getBaseSlices,$ as getBaseSlicesReducer,At as getClientInfo,Dt as getMenuRequest,jt as getShopRequest,Yt as getTablesRequest,$t as menuScreenItemListenerMiddleware,Qt as menuScreenListenerMiddleware,b as menuScreenSlice,Ft as moveOnTheTableRequest,Zt as playerCheckStateRequest,w as raiseBottomSheetBlockSlice,P as reactionBottomSheetBlockSlice,gt as setDefaultRequestHeaders,te as shopScreenListenerMiddleware,k as shopScreenSlice,re as tablesScreenItemListenerMiddleware,ee as tablesScreenListenerMiddleware,V as tablesScreenSlice,Xt as watchTheTableRequest,ie as wsConnectorListenerMiddleware,W as wsConnectorSlice};
|
|
1
|
+
import*as t from"react";import e,{useCallback as n,useEffect as r,Component as i}from"react";import{useDispatch as o,useSelector as c,Provider as a}from"react-redux";import{RoutesEnum as s}from"jp.common.view";import{createSlice as u,createAction as l,createReducer as d,createSelector as _,createListenerMiddleware as f}from"@reduxjs/toolkit";import T from"lodash.clonedeep";import{UniversalScreen as E,PageScreen as p,PlayerMoveButtons as m,BottomSelectionPanel as L}from"jp.ui.app.ds";import v from"axios";import{io as g}from"socket.io-client";import h from"mobile-detect";import C from"dayjs";import{Routes as I,Route as U,MemoryRouter as A}from"react-router-dom";import{ThemeProvider as R}from"@emotion/react";import{getLightTheme as N,ColorSchema as S}from"jp.ui.theme";import{useNavigate as y}from"react-router";import{setPeriodicTimer as B}from"jp.common.utils";import{BaseTablePlayerActionsEnum as b}from"jp.common.models";var H=function(t,e){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},H(t,e)};var O=function(){return O=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},O.apply(this,arguments)};function k(t,e,n,r){return new(n||(n=Promise))(function(i,o){function c(t){try{s(r.next(t))}catch(t){o(t)}}function a(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(c,a)}s((r=r.apply(t,e||[])).next())})}function V(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=a(0),c.throw=a(1),c.return=a(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function a(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}"function"==typeof SuppressedError&&SuppressedError;var w=u({name:"appSlice",initialState:{isLoading:!1,isError:!1,isInit:!1},reducers:{initApp:function(t){return O(O({},t),{isLoading:!0})},deactivateApp:function(t){return O(O({},t),{isInit:!1,isLoading:!1})},errorApp:function(t){return O(O({},t),{isLoading:!1,isInit:!0,isError:!0})},successApp:function(t){return O(O({},t),{isLoading:!1,isInit:!0})}},selectors:{isInit:function(t){return t.isInit},isLoading:function(t){return t.isLoading},isError:function(t){return t.isError}}});w.reducer;var P=u({name:"menuScreenSlice",initialState:{isError:!1,isLoading:!1,data:void 0},reducers:{start:function(t){return O(O({},t),{isLoading:!0,isError:null,data:null})},error:function(t){return O(O({},t),{isLoading:!1,isError:!0})},success:function(t,e){return O(O({},t),{isLoading:!1,isError:!1,data:e.payload})},init:function(t){return t},listItemClick:function(t,e){return t}},selectors:{getScreen:function(t){return t.data},isLoading:function(t){return t.isLoading},isError:function(t){return t.isError}}});P.reducer;var M=u({name:"shopScreenSlice",initialState:{isError:!1,isLoading:!1,data:void 0},reducers:{start:function(t){return O(O({},t),{isLoading:!0,isError:null,data:null})},error:function(t){return O(O({},t),{isLoading:!1,isError:!0})},success:function(t,e){return O(O({},t),{isLoading:!1,isError:!1,data:e.payload})},init:function(t){return t}},selectors:{getScreen:function(t){return t.data},isLoading:function(t){return t.isLoading},isError:function(t){return t.isError}}});M.reducer;var G=u({name:"tablesScreenSlice",initialState:{isError:!1,isLoading:!1,data:void 0},reducers:{start:function(t){return O(O({},t),{isLoading:!0,isError:null,data:null})},error:function(t){return O(O({},t),{isLoading:!1,isError:!0})},success:function(t,e){return O(O({},t),{isLoading:!1,isError:!1,data:e.payload})},init:function(t){return t},listItemClick:function(t,e){return t}},selectors:{getScreen:function(t){return t.data},isLoading:function(t){return t.isLoading},isError:function(t){return t.isError}}});G.reducer;var K=u({name:"raiseBottomSheetBlockSlice",initialState:{isOpen:!1},reducers:{open:function(t){return O(O({},t),{isOpen:!0})},close:function(t){return O(O({},t),{isOpen:!1})}},selectors:{getIsOpen:function(t){return t.isOpen}}});K.reducer;var W=u({name:"reactionBottomSheetBlockSlice",initialState:{isOpen:!1},reducers:{open:function(t){return O(O({},t),{isOpen:!0})},close:function(t){return O(O({},t),{isOpen:!1})}},selectors:{getIsOpen:function(t){return t.isOpen}}});W.reducer;var D,x=u({name:"wsConnectorSlice",initialState:{isConnected:!1,error:null},reducers:{connect:function(t){return O(O({},t),{isConnected:!1})},connected:function(t){return O(O({},t),{isConnected:!0})},disconnect:function(t,e){return O(O({},t),{isConnected:!1})},error:function(t,e){return t},message:function(t,e){return t}},selectors:{getIsConnected:function(t){return t.isConnected}}});x.reducer,function(t){t.INIT="@tableScreenSlice/init",t.DEACTIVATE="@tableScreenSlice/deactivate",t.BACK_CLICK="@tableScreenSlice/backClick",t.START="@tableScreenSlice/start",t.SUCCESS="@tableScreenSlice/success",t.ERROR="@tableScreenSlice/error",t.MOVE_BUTTON_CLICK="@tableScreenSlice/moveButtonClick",t.SET_WS_TABLE_STATE="@tableScreenSlice/setWsTableState",t.DECREMENT_PLAYERS_TURN_TIMEOUT_TIMER="@tableScreenSlice/decrementPlayersTurnTimeoutTimer",t.DECREMENT_RESTART_TIMEOUT_TIMER="@tableScreenSlice/decrementRestartTimeoutTimer"}(D||(D={}));var j=l(D.START),Y=l(D.SUCCESS),z=l(D.ERROR),X=l(D.INIT),q=l(D.DEACTIVATE),F=l(D.BACK_CLICK),Z=l(D.MOVE_BUTTON_CLICK),J=l(D.SET_WS_TABLE_STATE),Q=l(D.DECREMENT_PLAYERS_TURN_TIMEOUT_TIMER),$=l(D.DECREMENT_RESTART_TIMEOUT_TIMER),tt={start:j,success:Y,error:z,init:X,deactivate:q,backClick:F,moveButtonClick:Z,setWsTableState:J,decrementPlayersTurnTimeoutTimer:Q,decrementRestartTimeoutTimer:$},et=d({isError:!1,isLoading:!1,data:void 0},function(t){return t.addCase(j,function(t){return O(O({},t),{isLoading:!0,isError:!1})}).addCase(Y,function(t,e){return O(O({},t),{isLoading:!1,isError:!1,data:e.payload})}).addCase(z,function(t){return O(O({},t),{isLoading:!1,isError:!0})}).addCase(J,function(t,e){return O(O({},t),{isLoading:!1,isError:!1,data:e.payload})}).addCase(Q,function(t,e){var n,r=T(t);return(null===(n=r.data)||void 0===n?void 0:n.checkPlayersTurnTimerRemain)?(r.data.checkPlayersTurnTimerRemain-=1,r):t}).addCase($,function(t,e){var n,r=T(t);return(null===(n=r.data)||void 0===n?void 0:n.restartTimerRemain)?(r.data.restartTimerRemain-=1,r):t})}),nt=function(t){return t.gameTableScreenSlice},rt=_(nt,function(t){return null==t?void 0:t.data}),it=_(nt,function(t){return null==t?void 0:t.isLoading}),ot=_(nt,function(t){return null==t?void 0:t.isError}),ct=_(rt,function(t){return null==t?void 0:t.roomId}),at=_(rt,function(t){return null==t?void 0:t.tableId}),st=_(rt,function(t){return null==t?void 0:t.gameId}),ut=_(rt,function(t){return null==t?void 0:t.tableSize}),lt=_(rt,function(t){return null==t?void 0:t.checkPlayersTurnTimerRemain}),dt=_(rt,function(t){return null==t?void 0:t.restartTimerRemain}),_t=_(rt,function(t){return null==t?void 0:t.yoursActions}),ft=_(rt,function(t){return null==t?void 0:t.yoursMessage}),Tt=_(rt,function(t){return null==t?void 0:t.extraButtons});_(rt,function(t){return null==t?void 0:t.summary});var Et={actions:tt,reducer:et,selectors:{base:{isError:ot,isLoading:it,getRoomId:ct,getTableId:at,getGameId:st,getTableSize:ut,getCheckPlayersTurnTimerRemain:lt,getRestartTimerRemain:dt,getYoursActions:_t,getYoursMessage:ft,getExtraButtons:Tt},cards:{getCardPlayers:_(rt,function(t){return null==t?void 0:t.players}),getBaseCard:_(rt,function(t){return null==t?void 0:t.baseCard}),getGameCards:_(rt,function(t){return null==t?void 0:t.gameCards}),getGameCardsPair:_(rt,function(t){return null==t?void 0:t.gameCardsPair})}}};function pt(){return[w,P,M,G,K,W,x]}function mt(){return{appSlice:w.reducer,menuScreenSlice:P.reducer,shopScreenSlice:M.reducer,tablesScreenSlice:G.reducer,raiseBottomSheetBlockSlice:K.reducer,reactionBottomSheetBlockSlice:W.reducer,wsConnectorSlice:x.reducer,gameTableScreenSlice:Et.reducer}}var Lt=function(){var e=o(),r=c(P.selectors.getScreen),i=c(P.selectors.isLoading),a=c(P.selectors.isError),s=n(function(){return e(P.actions.init())},[]),u=n(function(t){return e(P.actions.listItemClick(t))},[]);return t.createElement(E,{screen:r,isLoading:i,isError:a,init:s,sectionHandlers:{listSectionClick:u}})},vt=function(){var e=o(),r=c(M.selectors.getScreen),i=c(M.selectors.isLoading),a=c(M.selectors.isError),s=n(function(){return e(M.actions.init())},[]);return t.createElement(E,{screen:r,isLoading:i,isError:a,init:s})},gt=function(){var e=o(),r=c(G.selectors.getScreen),i=c(G.selectors.isLoading),a=c(G.selectors.isError),s=n(function(){return e(G.actions.init())},[]),u=n(function(t){return e(G.actions.listItemClick(t))},[]);return t.createElement(E,{screen:r,isLoading:i,isError:a,init:s,sectionHandlers:{listSectionClick:u}})},ht=function(e){var i=e.children,a=o(),s=c(Et.selectors.base.getYoursActions);r(function(){return a(Et.actions.init()),function(){a(Et.actions.deactivate())}},[]);var u=n(function(){a(Et.actions.backClick())},[]),l=n(function(t){a(Et.actions.moveButtonClick(t))},[]);return t.createElement(p,{title:"title",errorButtonTitle:"errorButton",errorTitle:"error",leftButtonTitle:"back",onLeftButtonClick:u},i,t.createElement(m,{moves:null!=s?s:[],onMoveButtonClick:l}))};function Ct(){return import.meta.env.PUBLIC_CLIENT_GAME}function It(){return import.meta.env.PUBLIC_CLIENT_CHANNEL}function Ut(){return import.meta.env.PUBLIC_CLIENT_AUTH_VK_URL}function At(){return import.meta.env.PUBLIC_CLIENT_AUTH_OK_URL}function Rt(){return import.meta.env.PUBLIC_CLIENT_AUTH_YA_URL}function Nt(){return import.meta.env.PUBLIC_CLIENT_AUTH_TG_URL}function St(){return import.meta.env.PUBLIC_CLIENT_AUTH_WEB_URL}function yt(){return import.meta.env.PUBLIC_CLIENT_MENU_URL}function Bt(){return import.meta.env.PUBLIC_CLIENT_SHOP_URL}function bt(){return import.meta.env.PUBLIC_CLIENT_TABLES_URL}function Ht(){return import.meta.env.PUBLIC_CLIENT_ENTER_THE_TABLE_URL}function Ot(){return import.meta.env.PUBLIC_CLIENT_WATCH_THE_TABLE_URL}function kt(){return import.meta.env.PUBLIC_CLIENT_EXIT_THE_TABLE_URL}function Vt(){return import.meta.env.PUBLIC_CLIENT_MOVE_ON_THE_TABLE_URL}function wt(){return import.meta.env.PUBLIC_CLIENT_PLAYER_CHECK_STATE_URL}var Pt=Object.freeze({__proto__:null,getClientAuthOKUrl:At,getClientAuthTGUrl:Nt,getClientAuthVKUrl:Ut,getClientAuthWEBUrl:St,getClientAuthYAUrl:Rt,getClientChannel:It,getClientEnterTheTableUrl:Ht,getClientExitTheTableUrl:kt,getClientGame:Ct,getClientMenuUrl:yt,getClientMoveOnTheTableUrl:Vt,getClientPlayerCheckStateUrl:wt,getClientShopUrl:Bt,getClientTablesUrl:bt,getClientWatchTheTableUrl:Ot});function Mt(t,e,n){v.defaults.headers.common.client_auth_token=e,v.defaults.headers.common.client_language=n,v.defaults.headers.common.client_game=t.clientGame,v.defaults.headers.common.client_channel=t.clientChannel,v.defaults.headers.common.client_version=t.clientVersion}var Gt,Kt=function(){function t(){var t=this;this._openConnectionHandler=function(){t._listenerApi.dispatch(x.actions.connected())},this._closeConnectionHandler=function(e){t._listenerApi.dispatch(x.actions.disconnect(e))},this._messageHandler=function(e){t._listenerApi.dispatch(x.actions.message(e))},this._errorHandler=function(e){t._listenerApi.dispatch(x.actions.error(e.message))}}return t.getInstance=function(){return null!=t._instance||(t._instance=new t),t._instance},t.prototype.connect=function(t,e,n){this._socket=g(t,{auth:{token:e},reconnection:!0,reconnectionDelay:1e3}),this._listenerApi=n,this._authToken=e,this._socket.on("connect",this._openConnectionHandler),this._socket.on("message",this._messageHandler),this._socket.on("connection_error",this._errorHandler),this._socket.on("disconnect",this._closeConnectionHandler),this._listenerApi.dispatch(x.actions.connect())},t.prototype.sendMessage=function(t){var e,n,r=this;(null===(e=this._socket)||void 0===e?void 0:e.connected)?null===(n=this._socket)||void 0===n||n.send(JSON.stringify(t)):setTimeout(function(){r.sendMessage(t)},10)},t}(),Wt=function(){function t(){this.data={}}return t.get=function(){return null!=t.instance||(t.instance=new t),t.instance},t.prototype.getValue=function(t){var e;return null!==(e=this.data[t])&&void 0!==e?e:""},t.prototype.setValue=function(t,e){this.data[t]=e},t}();function Dt(t){var e,n,r;return null!==(r=null===(n=null===(e=null==t?void 0:t.document)||void 0===e?void 0:e.body)||void 0===n?void 0:n.clientWidth)&&void 0!==r?r:0}function xt(t){var e,n,r;return null!==(r=null===(n=null===(e=null==t?void 0:t.document)||void 0===e?void 0:e.body)||void 0===n?void 0:n.clientHeight)&&void 0!==r?r:0}function jt(){var t,e=new h(window.navigator.userAgent);return{clientVersion:"1.0.22",clientChannel:Wt.get().getValue(Gt.CLIENT_CHANNEL),clientGame:Wt.get().getValue(Gt.CLIENT_GAME),clientDevice:null!==(t=e.phone())&&void 0!==t?t:"",clientOS:e.os(),clientBrowser:"".concat(e.userAgent()),clientBrowserVersion:"".concat(e.version("Webkit")),clientDeviceWidth:Dt(window),clientDeviceHeight:xt(window),clientTimeOffset:C().utcOffset()}}!function(t){t.BASE_HOST="BASE_HOST",t.CLIENT_CHANNEL="CLIENT_CHANNEL",t.CLIENT_GAME="CLIENT_GAME",t.CLIENT_AUTH_VK_URL="CLIENT_AUTH_VK_URL",t.CLIENT_AUTH_OK_URL="CLIENT_AUTH_OK_URL",t.CLIENT_AUTH_YA_URL="CLIENT_AUTH_YA_URL",t.CLIENT_AUTH_TG_URL="CLIENT_AUTH_TG_URL",t.CLIENT_AUTH_WEB_URL="CLIENT_AUTH_WEB_URL",t.CLIENT_MENU_URL="CLIENT_MENU_URL",t.CLIENT_SHOP_URL="CLIENT_SHOP_URL",t.CLIENT_TABLES_URL="CLIENT_TABLES_URL",t.CLIENT_WATCH_THE_TABLE_URL="CLIENT_WATCH_THE_TABLE_URL",t.CLIENT_ENTER_THE_TABLE_URL="CLIENT_ENTER_THE_TABLE_URL",t.CLIENT_EXIT_THE_TABLE_URL="CLIENT_EXIT_THE_TABLE_URL",t.CLIENT_MOVE_ON_THE_TABLE_URL="CLIENT_MOVE_ON_THE_TABLE_URL",t.CLIENT_PLAYER_CHECK_STATE_URL="CLIENT_PLAYER_CHECK_STATE_URL"}(Gt||(Gt={}));var Yt=function(){function t(e){t._navigate=e}return t.setNavigate=function(t){this._navigate=t},t.getInstance=function(){return this._instance||(this._instance=new t(t._navigate)),this._instance},t.prototype.redirect=function(e){t._currentPath=e,e.includes("http")?window.open(e,"_blank"):t._navigate(e)},t.prototype.redirectWithoutMem=function(e){t._currentPath=e,t._navigate(e,{replace:!0})},t.prototype.back=function(){t._navigate(-1)},t.prototype.getParams=function(e){return function(t,e){var n=t.split("/"),r=e.split("/"),i={};if(n.length!==r.length)return{};for(var o=0;o<n.length;o++)if(n[o].startsWith(":"))i[n[o].substring(1)]=r[o];else if(n[o]!==r[o])return{};return i}(e,t._currentPath)},t}();o.withTypes();var zt,Xt=c.withTypes(),qt=function(e){return Yt.setNavigate(y()),Xt(w.selectors.isInit)?t.createElement(I,null,e.routes.map(function(e){var n=e.route,r=e.screen;return t.createElement(U,{key:n,path:n,element:r})})):t.createElement("div",null,"Loading")},Ft=function(t){var n=t.routes;return e.createElement(R,{theme:N(S.DEFAULT,{})},e.createElement(A,null,e.createElement(qt,{routes:n})))},Zt=function(t){function n(e,n){var r=t.call(this,e)||this;return r.store=n,r.init(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}H(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(n,t),n.prototype.init=function(){Wt.get().setValue(Gt.CLIENT_CHANNEL,It()),Wt.get().setValue(Gt.CLIENT_GAME,Ct()),Wt.get().setValue(Gt.CLIENT_AUTH_VK_URL,Ut()),Wt.get().setValue(Gt.CLIENT_AUTH_OK_URL,At()),Wt.get().setValue(Gt.CLIENT_AUTH_YA_URL,Rt()),Wt.get().setValue(Gt.CLIENT_AUTH_TG_URL,Nt()),Wt.get().setValue(Gt.CLIENT_AUTH_WEB_URL,St()),Wt.get().setValue(Gt.CLIENT_MENU_URL,yt()),Wt.get().setValue(Gt.CLIENT_SHOP_URL,Bt()),Wt.get().setValue(Gt.CLIENT_TABLES_URL,bt()),Wt.get().setValue(Gt.CLIENT_ENTER_THE_TABLE_URL,Ht()),Wt.get().setValue(Gt.CLIENT_WATCH_THE_TABLE_URL,Ot()),Wt.get().setValue(Gt.CLIENT_EXIT_THE_TABLE_URL,kt()),Wt.get().setValue(Gt.CLIENT_MOVE_ON_THE_TABLE_URL,Vt()),Wt.get().setValue(Gt.CLIENT_PLAYER_CHECK_STATE_URL,wt())},n.prototype.componentDidMount=function(){this.store.dispatch(w.actions.initApp())},n.prototype.componentWillUnmount=function(){this.store.dispatch(w.actions.deactivateApp())},n.prototype.getRoutes=function(){return[{route:s.MENU,screen:e.createElement(Lt,null)},{route:s.SHOP,screen:e.createElement(vt,null)},{route:s.ROOMS,screen:e.createElement(gt,null)}]},n.prototype.render=function(){return e.createElement(a,{store:this.store},e.createElement(Ft,{routes:this.getRoutes()}))},n}(i);!function(t){t.VK="VK",t.YA="YA",t.OK="OK",t.WEB="WEB",t.AT="AT",t.VKIOS="VKIOS",t.TG="TG"}(zt||(zt={}));var Jt={uid:"581730373013",birthday:"2000-02-01",birthdaySet:!0,age:21,first_name:"Justpoker",last_name:"Online",location:{city:"Moscow",country:"RUSSIAN_FEDERATION",countryCode:"RU",countryName:"Russia"},pic128x128:"https://api.ok.ru/img/stub/user/male/128.png"};function Qt(t){return k(this,void 0,void 0,function(){return V(this,function(e){return[2,v.post(Wt.get().getValue(Gt.CLIENT_AUTH_OK_URL),{okUser:Jt,clientInfo:t})]})})}var $t={id:8426719,is_closed:!1,sex:2,photo_max_orig:"https://sun1-92.userapi.com/impf/c857536/v857536990/c1ae9/e3ikmioAt3s.jpg?size=400x0&quality=96&crop=0,315,750,750&sign=1edea0ff18f44079ee2c671d0eb649d3&c_uniq_tag=8UWvihf3P4Gaq7HDHZ36CnueaU45AM9n3r6FibqGRcM&ava=1",can_access_closed:!0,can_invite_to_chats:!1,first_name:"Dmitry",bdate:"21.8.1989",city:{id:1,title:"Moscow"},photo_200:"https://sun1-92.userapi.com/impf/c857536/v857536990/c1ae9/e3ikmioAt3s.jpg?size=200x0&quality=96&crop=0,315,750,750&sign=a810ed95c832aa59061a2e57b6aaf354&c_uniq_tag=1OW0lK2-rvjPjvZMTptmD5ebxiFqzXtj_-do3DSRUTc&ava=1",timezone:3,last_name:"Solovyov",photo_100:"https://sun1-92.userapi.com/impf/c857536/v857536990/c1ae9/e3ikmioAt3s.jpg?size=100x0&quality=96&crop=0,315,750,750&sign=11c3a81e646806e12d74ee5622cfe115&c_uniq_tag=PbYUyR-hU2L6m4K2iEMX6F2dwzooz0n8I5ZgD_J-GDs&ava=1",country:{id:1,title:"Russia"}};function te(t){return k(this,void 0,void 0,function(){return V(this,function(e){return[2,v.post(Wt.get().getValue(Gt.CLIENT_AUTH_VK_URL),{vkUser:$t,clientInfo:t})]})})}var ee={userId:"r3103WLiktg7Ux4X92Gugz2Rl7sG1v/1DHjfnHgHk4I=",avatarUrl:"https://avatars.mds.yandex.net/get-yapic/40138/8Zy0NFhXokbxYIN3BzCtpAVYazw-1/islands-middle",language:"ru",fullName:"DMITRY S.",purchasesSignature:"GrDdbsa0srAqcrFqufY3Bm12+1sUveubZDLXzqCgRnI=.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImlzc3VlZEF0IjoxNjMyOTg0NDc3LCJyZXF1ZXN0UGF5bG9hZCI6IiIsImRhdGEiOltdfQ==",isGuest:!0,yandexUid:""};function ne(t){return k(this,void 0,void 0,function(){return V(this,function(e){return[2,v.post(Wt.get().getValue(Gt.CLIENT_AUTH_YA_URL),{yaUser:ee,clientInfo:t})]})})}var re={allowsWriteToPm:!0,firstName:"Dmitry",id:180352252,languageCode:"ru",lastName:"Solovev",photoUrl:"https://t.me/i/userpic/320/Afu-apjsWgxmkMI2hJD56Wt2w4D6pWwgssA3CeLYX_8.svg",username:"choochoochoo"};function ie(t){return k(this,void 0,void 0,function(){return V(this,function(e){return[2,v.post(Wt.get().getValue(Gt.CLIENT_AUTH_TG_URL),{tgUser:re,clientInfo:t})]})})}function oe(t){return k(this,void 0,void 0,function(){return V(this,function(e){return[2,v.post(Wt.get().getValue(Gt.CLIENT_AUTH_WEB_URL),{clientInfo:t})]})})}function ce(){return k(this,void 0,void 0,function(){var t;return V(this,function(e){switch((t=jt()).clientChannel){case zt.VK:return[2,te(t)];case zt.OK:return[2,Qt(t)];case zt.YA:return[2,ne(t)];case zt.TG:return[2,ie(t)];case zt.WEB:return[2,oe(t)]}return[2]})})}function ae(){return v.create({baseURL:Wt.get().getValue(Gt.BASE_HOST)})}function se(){return k(this,void 0,void 0,function(){return V(this,function(t){return[2,ae().get(Wt.get().getValue(Gt.CLIENT_MENU_URL))]})})}function ue(){return k(this,void 0,void 0,function(){return V(this,function(t){return[2,ae().get(Wt.get().getValue(Gt.CLIENT_SHOP_URL))]})})}function le(){return k(this,void 0,void 0,function(){return V(this,function(t){return[2,ae().get(Wt.get().getValue(Gt.CLIENT_TABLES_URL))]})})}function de(t){return k(this,void 0,void 0,function(){return V(this,function(e){return[2,ae().post("".concat(Wt.get().getValue(Gt.CLIENT_ENTER_THE_TABLE_URL),"/").concat(t))]})})}function _e(t){return k(this,void 0,void 0,function(){return V(this,function(e){return[2,ae().post("".concat(Wt.get().getValue(Gt.CLIENT_WATCH_THE_TABLE_URL),"/").concat(t))]})})}function fe(t){return k(this,void 0,void 0,function(){return V(this,function(e){return[2,ae().post("".concat(Wt.get().getValue(Gt.CLIENT_EXIT_THE_TABLE_URL),"/").concat(t))]})})}function Te(t,e){return k(this,void 0,void 0,function(){return V(this,function(n){return[2,ae().post("".concat(Wt.get().getValue(Gt.CLIENT_MOVE_ON_THE_TABLE_URL),"/").concat(t),e)]})})}function Ee(){return k(this,void 0,void 0,function(){return V(this,function(t){return[2,ae().get(Wt.get().getValue(Gt.CLIENT_PLAYER_CHECK_STATE_URL))]})})}var pe=f();pe.startListening({actionCreator:w.actions.initApp,effect:function(t,e){return k(void 0,void 0,void 0,function(){var t,n;return V(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,ce()];case 1:return t=r.sent(),(new Kt).connect(t.data.wsAddress,t.data.token,e),Wt.get().setValue(Gt.BASE_HOST,t.data.httpAddress),Mt(jt(),t.data.token,t.data.language),[4,Ee()];case 2:return n=r.sent(),Yt.getInstance().redirect(n.data.redirectUrl),[3,4];case 3:return r.sent(),e.dispatch(w.actions.errorApp()),[3,4];case 4:return e.dispatch(w.actions.successApp()),[2]}})})}});var me=f();me.startListening({actionCreator:P.actions.init,effect:function(t,e){return k(void 0,void 0,void 0,function(){var t;return V(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e.dispatch(P.actions.start()),[4,se()];case 1:return t=n.sent(),e.dispatch(P.actions.success(t.data.screen)),[3,3];case 2:return n.sent(),e.dispatch(P.actions.error()),[3,3];case 3:return[2]}})})}});var Le=f();Le.startListening({actionCreator:P.actions.listItemClick,effect:function(t,e){return k(void 0,void 0,void 0,function(){return V(this,function(e){return null!=t.payload.url&&Yt.getInstance().redirect(t.payload.url),[2]})})}});var ve=f();ve.startListening({actionCreator:M.actions.init,effect:function(t,e){return k(void 0,void 0,void 0,function(){var t;return V(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e.dispatch(M.actions.start()),[4,ue()];case 1:return t=n.sent(),e.dispatch(M.actions.success(t.data.screen)),[3,3];case 2:return n.sent(),e.dispatch(M.actions.error()),[3,3];case 3:return[2]}})})}});var ge=f();ge.startListening({actionCreator:G.actions.init,effect:function(t,e){return k(void 0,void 0,void 0,function(){var t;return V(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e.dispatch(G.actions.start()),[4,le()];case 1:return t=n.sent(),e.dispatch(G.actions.success(t.data.screen)),[3,3];case 2:return n.sent(),e.dispatch(G.actions.error()),[3,3];case 3:return[2]}})})}});var he,Ce=f();Ce.startListening({actionCreator:G.actions.listItemClick,effect:function(t,e){return k(void 0,void 0,void 0,function(){return V(this,function(e){return null!=t.payload.url&&Yt.getInstance().redirect(t.payload.url),[2]})})}});var Ie=f();Ie.startListening({actionCreator:x.actions.message,effect:function(t,e){return k(void 0,void 0,void 0,function(){return V(this,function(n){return function(t,e){var n=t.payload.data.checkPlayersTurnTimerRemain;n&&n>0&&(he=B(he,n,function(){return e.dispatch(Et.actions.decrementPlayersTurnTimeoutTimer())}))}(t,e),function(t,e){var n=t.payload.data.restartTimerRemain;n&&n>0&&(he=B(he,n,function(){return e.dispatch(Et.actions.decrementRestartTimeoutTimer())}))}(t,e),e.dispatch(Et.actions.setWsTableState(t.payload.data)),[2]})})}});var Ue=function(t){return function(e){return function(n){return k(void 0,void 0,void 0,function(){var r,i;return V(this,function(o){switch(o.label){case 0:if(!Et.actions.init.match(n))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),t.dispatch(Et.actions.start()),[4,_e(null!==(i=Yt.getInstance().getParams(s.TABLE).tableId)&&void 0!==i?i:"")];case 2:return r=o.sent(),t.dispatch(Et.actions.success(r.data)),[3,4];case 3:return o.sent(),t.dispatch(Et.actions.error()),[3,4];case 4:return[2,e(n)]}})})}}},Ae=function(t){return function(e){return function(n){return k(void 0,void 0,void 0,function(){var r,i;return V(this,function(o){switch(o.label){case 0:if(!Et.actions.deactivate.match(n))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),t.dispatch(Et.actions.start()),[4,fe(null!==(i=Yt.getInstance().getParams(s.TABLE).tableId)&&void 0!==i?i:"")];case 2:return r=o.sent(),t.dispatch(Et.actions.success(r.data)),[3,4];case 3:return o.sent(),t.dispatch(Et.actions.error()),[3,4];case 4:return[2,e(n)]}})})}}},Re=function(t){return function(t){return function(e){return k(void 0,void 0,void 0,function(){return V(this,function(n){return Et.actions.init.match(e)&&Yt.getInstance().back(),[2,t(e)]})})}}},Ne=function(t){return function(e){return function(n){return k(void 0,void 0,void 0,function(){var r,i,o;return V(this,function(c){switch(c.label){case 0:if(!Et.actions.moveButtonClick.match(n))return[3,8];c.label=1;case 1:switch(c.trys.push([1,7,,8]),r=null!==(o=Yt.getInstance().getParams(s.TABLE).tableId)&&void 0!==o?o:"",i=void 0,n.payload){case b.ACTION_ENTER_THE_TABLE:return[3,2];case b.ACTION_EXIT_THE_TABLE:return[3,4]}return[3,6];case 2:return[4,de(r)];case 3:return i=c.sent(),[3,6];case 4:return[4,fe(r)];case 5:return i=c.sent(),[3,6];case 6:return t.dispatch(Et.actions.success(i.data)),[3,8];case 7:return c.sent(),t.dispatch(Et.actions.error()),[3,8];case 8:return[2,e(n)]}})})}}};function Se(){return[pe.middleware,me.middleware,Le.middleware,ve.middleware,ge.middleware,Ce.middleware,Ie.middleware,Ue,Ae,Re,Ne]}var ye=function(e){var r=e.items,i=e.itemClick,a=e.title,s=e.closeTitle,u=o();if(!c(K.selectors.getIsOpen))return t.createElement("div",null);var l=n(function(){u(K.actions.close)},[]);return t.createElement(L,{items:r,onItemClick:i,title:a,onCloseButtonClick:l,closeButtonTitle:null!=s?s:""})},Be=function(e){var r=e.items,i=e.itemClick,a=e.title,s=e.closeTitle,u=o();if(!c(K.selectors.getIsOpen))return t.createElement("div",null);var l=n(function(){u(K.actions.close)},[]);return t.createElement(L,{items:r,onItemClick:i,title:a,onCloseButtonClick:l,closeButtonTitle:null!=s?s:""})};export{Zt as BaseApplication,Wt as GlobalStorage,Gt as GlobalStorageEnum,Lt as MenuScreen,Yt as Navigator,ye as RaiseBottomSheetBlock,Be as ReactionBottomSheetBlock,vt as ShopScreen,ht as TableScreen,gt as TablesScreen,Kt as WSConnector,w as appSlice,ce as authRequest,Pt as config,de as enterTheTableRequest,fe as exitTheTableRequest,Et as gameTableScreenSlice,Se as getBaseMiddlewares,pt as getBaseSlices,mt as getBaseSlicesReducer,jt as getClientInfo,se as getMenuRequest,ue as getShopRequest,le as getTablesRequest,P as menuScreenSlice,Te as moveOnTheTableRequest,Ee as playerCheckStateRequest,K as raiseBottomSheetBlockSlice,W as reactionBottomSheetBlockSlice,Mt as setDefaultRequestHeaders,M as shopScreenSlice,G as tablesScreenSlice,_e as watchTheTableRequest,x as wsConnectorSlice};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|