@scrabble-solver/scrabble-solver 2.15.11 → 2.15.13
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +16 -16
- package/.next/cache/.previewinfo +1 -0
- package/.next/cache/.rscinfo +1 -1
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/.next/diagnostics/framework.json +1 -1
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +4 -4
- package/.next/required-server-files.json +23 -12
- package/.next/routes-manifest.json +7 -3
- package/.next/server/chunks/106.js +1 -0
- package/.next/server/chunks/30.js +4 -4
- package/.next/server/chunks/318.js +1 -0
- package/.next/server/chunks/50.js +19 -0
- package/.next/server/chunks/812.js +1 -1
- package/.next/server/chunks/929.js +1 -0
- package/.next/server/chunks/974.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/_app.js +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/_error.js +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/api/dictionary/[locale]/[word].js +2 -2
- package/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
- package/.next/server/pages/api/dictionary/[locale].js +1 -1
- package/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
- package/.next/server/pages/api/solve.js +1 -1
- package/.next/server/pages/api/solve.js.nft.json +1 -1
- package/.next/server/pages/api/verify.js +1 -1
- package/.next/server/pages/api/verify.js.nft.json +1 -1
- package/.next/server/pages/api/visit.js +1 -1
- package/.next/server/pages/api/visit.js.nft.json +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/index.js +1 -1
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/index.json +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/server/webpack-api-runtime.js +1 -1
- package/.next/server/webpack-runtime.js +1 -1
- package/.next/static/{47JHul8F9NSWCNSEuahuL → MhrqAqLI9_L8obb7tgjvi}/_buildManifest.js +1 -1
- package/.next/static/chunks/framework-aad31c68dd0bb0ea.js +1 -0
- package/.next/static/chunks/main-eab5847b41f0af4a.js +1 -0
- package/.next/static/chunks/pages/{404-590e2a3839c1d9e0.js → 404-04457ede98c6b53e.js} +1 -1
- package/.next/static/chunks/pages/_app-bf81f201c021fdc1.js +1 -0
- package/.next/static/chunks/pages/{_error-7ea2d37f66343175.js → _error-a9800cedd835bcad.js} +1 -1
- package/.next/static/chunks/pages/index-79a390f3c2a2499f.js +1 -0
- package/.next/static/css/{6682db14f926d4c7.css → 04a3767982ec10e8.css} +1 -1
- package/.next/static/css/{d875648f38121a28.css → 1fae874a25934f54.css} +1 -1
- package/.next/trace +24 -23
- package/coverage/clover.xml +6 -0
- package/coverage/coverage-final.json +1 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +101 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +0 -0
- package/package.json +18 -18
- package/src/api/getServerLoggingData.ts +1 -1
- package/src/api/isBoardValid.ts +1 -1
- package/src/api/isCellValid.ts +1 -1
- package/src/api/isRowValid.ts +1 -1
- package/src/components/Alert/Alert.tsx +1 -1
- package/src/components/Badge/Badge.tsx +1 -1
- package/src/components/Board/Board.tsx +8 -8
- package/src/components/Board/BoardPure.tsx +11 -11
- package/src/components/Board/components/Actions/Actions.tsx +3 -3
- package/src/components/Board/components/Actions/lib.ts +3 -3
- package/src/components/Board/components/Cell/Cell.tsx +7 -7
- package/src/components/Board/components/InputPrompt/InputPrompt.tsx +2 -2
- package/src/components/Board/components/ToggleDirectionButton/ToggleDirectionButton.tsx +2 -2
- package/src/components/Board/hooks/useBackgroundImage.tsx +1 -1
- package/src/components/Board/hooks/useBoardStyle.ts +1 -1
- package/src/components/Board/hooks/useGrid.ts +13 -13
- package/src/components/Board/lib.ts +37 -0
- package/src/components/Board/selectors.ts +8 -0
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Button/Link.tsx +1 -1
- package/src/components/Dictionary/Dictionary.tsx +10 -3
- package/src/components/DictionaryInput/DictionaryInput.tsx +1 -1
- package/src/components/EmptyState/EmptyState.tsx +3 -3
- package/src/components/IconButton/IconButton.tsx +1 -1
- package/src/components/IconButton/Link.tsx +1 -1
- package/src/components/Key/Key.tsx +1 -1
- package/src/components/Keys/Arrows/Arrows.tsx +1 -1
- package/src/components/Keys/index.tsx +1 -1
- package/src/components/Loading/Loading.tsx +6 -8
- package/src/components/Logo/LogoBlueprint.tsx +1 -1
- package/src/components/Modal/Modal.tsx +4 -2
- package/src/components/Modal/components/Section/Section.tsx +1 -1
- package/src/components/NavButtons/NavButtons.tsx +4 -3
- package/src/components/NavButtons/selectors.ts +11 -0
- package/src/components/NotFound/NotFound.tsx +1 -1
- package/src/components/PlainTiles/PlainTiles.tsx +1 -1
- package/src/components/PlainTiles/Tile.tsx +1 -1
- package/src/components/PlainTiles/lib.ts +90 -0
- package/src/components/Progress/Progress.tsx +1 -1
- package/src/components/Rack/Rack.tsx +10 -26
- package/src/components/Rack/components/InputPrompt/InputPrompt.tsx +5 -8
- package/src/components/Rack/components/InputPrompt/lib.test.ts +27 -0
- package/src/components/Rack/components/InputPrompt/lib.ts +19 -0
- package/src/components/Rack/components/RackTile/RackTile.tsx +9 -9
- package/src/components/Rack/selectors.ts +9 -0
- package/src/components/Radio/Radio.tsx +1 -1
- package/src/components/Results/Cell.tsx +2 -2
- package/src/components/Results/Header.tsx +1 -1
- package/src/components/Results/HeaderButton.tsx +2 -2
- package/src/components/Results/Result.tsx +5 -6
- package/src/components/Results/Results.tsx +6 -6
- package/src/components/Results/SolveButton.tsx +3 -3
- package/src/components/Results/types.ts +2 -2
- package/src/components/ResultsInput/ResultsInput.tsx +1 -1
- package/src/components/SeoMessage/SeoMessage.tsx +1 -1
- package/src/components/Solver/Solver.tsx +4 -4
- package/src/components/Solver/components/InsertButton/InsertButton.tsx +1 -1
- package/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +5 -5
- package/src/components/Spinner/Spinner.tsx +1 -1
- package/src/components/Tile/Tile.tsx +7 -7
- package/src/components/Tile/TilePure.tsx +8 -8
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/Tooltip/TooltipContent.tsx +1 -1
- package/src/components/Tooltip/TooltipTrigger.tsx +1 -1
- package/src/components/Tooltip/context.ts +1 -1
- package/src/components/Tooltip/useTooltip.ts +1 -1
- package/src/hooks/useAppLayout.ts +1 -1
- package/src/hooks/useColumns.ts +28 -1
- package/src/hooks/useEffectOnce.ts +1 -1
- package/src/hooks/useLocalStorage.ts +8 -0
- package/src/i18n/constants.ts +1 -1
- package/src/i18n/i18n.ts +1 -1
- package/src/i18n/languages/english.json +3 -0
- package/src/i18n/languages/french.json +3 -0
- package/src/i18n/languages/german.json +3 -0
- package/src/i18n/languages/persian.json +3 -0
- package/src/i18n/languages/polish.json +3 -0
- package/src/i18n/languages/romanian.json +3 -0
- package/src/i18n/languages/spanish.json +3 -0
- package/src/i18n/languages/turkish.json +3 -0
- package/src/lib/createComparator.ts +1 -1
- package/src/lib/createKeyComparator.ts +1 -1
- package/src/lib/createKeyboardNavigation.ts +1 -1
- package/src/lib/createStringComparator.ts +1 -1
- package/src/lib/extractCharacters.test.ts +42 -15
- package/src/lib/extractCharacters.ts +27 -25
- package/src/lib/findCell.ts +1 -1
- package/src/lib/index.ts +2 -17
- package/src/lib/isCtrl.ts +1 -1
- package/src/lib/localeTransliterate.test.ts +14 -0
- package/src/lib/localeTransliterate.ts +18 -0
- package/src/lib/numberComparator.ts +1 -1
- package/src/lib/reverseComparator.ts +1 -1
- package/src/lib/zipCharactersAndTiles.ts +2 -2
- package/src/modals/DictionaryModal/DictionaryModal.tsx +1 -1
- package/src/modals/KeyMapModal/KeyMapModal.tsx +1 -1
- package/src/modals/KeyMapModal/components/Mapping/Mapping.tsx +1 -1
- package/src/modals/MenuModal/MenuModal.tsx +1 -1
- package/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +3 -2
- package/src/modals/RemainingTilesModal/components/Character/Character.tsx +2 -2
- package/src/{lib/getRemainingTilesGroups.ts → modals/RemainingTilesModal/lib.ts} +26 -9
- package/src/modals/RemainingTilesModal/selectors.ts +7 -0
- package/src/modals/ResultsModal/ResultsModal.tsx +4 -4
- package/src/modals/SettingsModal/SettingsModal.tsx +6 -1
- package/src/modals/SettingsModal/components/AutoGroupTilesSetting/AutoGroupTilesSetting.tsx +1 -1
- package/src/modals/SettingsModal/components/AutoGroupTilesSetting/lib.ts +1 -1
- package/src/modals/SettingsModal/components/ConfigSetting/ConfigSetting.tsx +1 -1
- package/src/modals/SettingsModal/components/ConfigSetting/lib.ts +1 -1
- package/src/modals/SettingsModal/components/InputModeSetting/InputModeSetting.tsx +1 -1
- package/src/modals/SettingsModal/components/InputModeSetting/lib.ts +1 -1
- package/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.tsx +2 -2
- package/src/modals/SettingsModal/components/RemoveCellFiltersSetting/RemoveCellFiltersSetting.module.scss +12 -0
- package/src/modals/SettingsModal/components/RemoveCellFiltersSetting/RemoveCellFiltersSetting.tsx +53 -0
- package/src/modals/SettingsModal/components/RemoveCellFiltersSetting/index.ts +1 -0
- package/src/modals/SettingsModal/components/RemoveCellFiltersSetting/lib.ts +13 -0
- package/src/modals/SettingsModal/components/ShowCoordinatesSetting/ShowCoordinatesSetting.tsx +2 -2
- package/src/modals/SettingsModal/components/index.ts +1 -0
- package/src/modals/WordsModal/WordsModal.tsx +4 -3
- package/src/pages/_app.tsx +2 -2
- package/src/pages/_document.tsx +1 -1
- package/src/pages/api/dictionary/[locale]/[word].ts +2 -2
- package/src/pages/api/dictionary/[locale]/index.ts +2 -2
- package/src/pages/api/solve.ts +11 -2
- package/src/pages/api/verify.ts +2 -2
- package/src/pages/api/visit.ts +1 -1
- package/src/pages/index.tsx +34 -43
- package/src/parameters/index.ts +1 -0
- package/src/sdk/findWordDefinitions.ts +1 -1
- package/src/sdk/getDictionary.ts +1 -1
- package/src/sdk/solve.ts +1 -1
- package/src/sdk/verify.ts +1 -1
- package/src/service-worker/dictionaries/getDictionary.ts +1 -1
- package/src/service-worker/dictionaries/getDictionaryUrl.ts +1 -1
- package/src/service-worker/dictionaries/revalidateDictionary.ts +1 -1
- package/src/service-worker/getTrie.ts +1 -1
- package/src/service-worker/routeSolveRequests.ts +2 -2
- package/src/service-worker/routeVerifyRequests.ts +1 -1
- package/src/state/board/index.ts +4 -0
- package/src/state/{slices/boardInitialState.ts → board/initialState.ts} +3 -6
- package/src/state/board/selectors.ts +3 -0
- package/src/state/{slices/boardSlice.ts → board/slice.ts} +5 -4
- package/src/state/board/types.ts +3 -0
- package/src/state/cellFilters/index.ts +4 -0
- package/src/state/cellFilters/initialState.ts +3 -0
- package/src/state/cellFilters/lib.ts +8 -0
- package/src/state/cellFilters/selectors.ts +13 -0
- package/src/state/{slices/cellFilterSlice.ts → cellFilters/slice.ts} +15 -14
- package/src/state/cellFilters/types.ts +3 -0
- package/src/state/dictionary/index.ts +4 -0
- package/src/state/dictionary/initialState.ts +8 -0
- package/src/state/dictionary/selectors.ts +16 -0
- package/src/state/{slices/dictionarySlice.ts → dictionary/slice.ts} +3 -3
- package/src/state/dictionary/types.ts +8 -0
- package/src/state/index.ts +12 -5
- package/src/{lib/getRemainingTiles.ts → state/lib.ts} +3 -4
- package/src/state/localStorage.ts +11 -2
- package/src/state/rack/index.ts +4 -0
- package/src/state/rack/initialState.ts +12 -0
- package/src/state/rack/selectors.ts +7 -0
- package/src/state/{slices/rackSlice.ts → rack/slice.ts} +4 -4
- package/src/state/rack/types.ts +3 -0
- package/src/state/results/index.ts +4 -0
- package/src/state/results/initialState.ts +13 -0
- package/src/state/results/lib.ts +96 -0
- package/src/state/results/selectors.ts +75 -0
- package/src/state/{slices/resultsSlice.ts → results/slice.ts} +4 -4
- package/src/state/results/types.ts +10 -0
- package/src/state/sagas.ts +22 -23
- package/src/state/selectors.ts +15 -235
- package/src/state/settings/index.ts +4 -0
- package/src/state/{slices/settingsInitialState.ts → settings/initialState.ts} +4 -11
- package/src/state/settings/lib.ts +42 -0
- package/src/state/settings/selectors.ts +69 -0
- package/src/state/{slices/settingsSlice.ts → settings/slice.ts} +9 -4
- package/src/state/settings/types.ts +12 -0
- package/src/state/solve/index.ts +4 -0
- package/src/state/solve/initialState.ts +12 -0
- package/src/state/solve/selectors.ts +14 -0
- package/src/state/{slices/solveSlice.ts → solve/slice.ts} +3 -3
- package/src/state/solve/types.ts +10 -0
- package/src/state/store.ts +9 -11
- package/src/state/types.ts +16 -18
- package/src/state/useTranslate.ts +2 -2
- package/src/state/useTypedSelector.ts +2 -2
- package/src/state/verify/index.ts +4 -0
- package/src/state/verify/initialState.ts +12 -0
- package/src/state/verify/selectors.ts +9 -0
- package/src/state/{slices/verifySlice.ts → verify/slice.ts} +3 -3
- package/src/state/verify/types.ts +10 -0
- package/src/styles/global.scss +5 -0
- package/src/types/api.ts +1 -1
- package/src/types/index.ts +8 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/.eslintrc.js +0 -10
- package/.next/server/chunks/60.js +0 -1
- package/.next/server/chunks/968.js +0 -1
- package/.next/static/chunks/framework-288d1abd95de88d9.js +0 -1
- package/.next/static/chunks/main-016492249b3393e2.js +0 -1
- package/.next/static/chunks/pages/_app-0e951de0aebb6505.js +0 -1
- package/.next/static/chunks/pages/index-c1d5a66d0f4794a6.js +0 -1
- package/src/components/Board/lib/getBonusColor.ts +0 -16
- package/src/components/Board/lib/getPositionInGrid.ts +0 -13
- package/src/components/Board/lib/index.ts +0 -2
- package/src/components/PlainTiles/lib/createPlainTile.ts +0 -41
- package/src/components/PlainTiles/lib/createPlainTiles.ts +0 -25
- package/src/components/PlainTiles/lib/getViewbox.ts +0 -17
- package/src/components/PlainTiles/lib/getX.ts +0 -5
- package/src/components/PlainTiles/lib/getY.ts +0 -5
- package/src/components/PlainTiles/lib/index.ts +0 -6
- package/src/components/PlainTiles/lib/randomize.ts +0 -1
- package/src/lib/createArray.ts +0 -1
- package/src/lib/createGridOf.ts +0 -9
- package/src/lib/detectLocale.ts +0 -27
- package/src/lib/extractCharactersByCase.test.ts +0 -29
- package/src/lib/extractCharactersByCase.ts +0 -29
- package/src/lib/getCellSize.ts +0 -10
- package/src/lib/getCoordinates.ts +0 -16
- package/src/lib/getRemainingTilesCount.ts +0 -11
- package/src/lib/getTotalRemainingTilesCount.ts +0 -11
- package/src/lib/groupResults.ts +0 -35
- package/src/lib/guessLocale.ts +0 -20
- package/src/lib/isUpperCase.ts +0 -5
- package/src/lib/resultMatchesCellFilter.ts +0 -21
- package/src/lib/sortGroupedResults.ts +0 -21
- package/src/lib/sortResults.ts +0 -41
- package/src/state/slices/cellFilterInitialState.ts +0 -5
- package/src/state/slices/dictionaryInitialState.ts +0 -15
- package/src/state/slices/index.ts +0 -16
- package/src/state/slices/rackInitialState.ts +0 -9
- package/src/state/slices/resultsInitialState.ts +0 -20
- package/src/state/slices/solveInitialState.ts +0 -21
- package/src/state/slices/verifyInitialState.ts +0 -19
- /package/.next/static/{47JHul8F9NSWCNSEuahuL → MhrqAqLI9_L8obb7tgjvi}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{300:e=>{e.exports={mapping:"Mapping_mapping__Ua6wj",description:"Mapping_description__nSNia",keys:"Mapping_keys__KmIcZ",group:"Mapping_group__MlkmV",slash:"Mapping_slash__hulS4",plus:"Mapping_plus__KE_ml"}},778:e=>{e.exports={content:"ResultsModal_content__vzX7N",results:"ResultsModal_results__FDN3k",dictionary:"ResultsModal_dictionary__o3cpd"}},1274:e=>{e.exports={character:"Character_character__Xry5W",finished:"Character_finished__Ee5Eu",overused:"Character_overused__WV6tJ",tile:"Character_tile__Ledy0",remaining:"Character_remaining__DFxBl",count:"Character_count__Bl6_O"}},1804:(e,n,t)=>{"use strict";t.r(n),t.d(n,{__N_SSG:()=>eC,default:()=>eS});var a=t(6029),i=t(5729),r=t(6341),s=t.n(r),l=t(9276),o=t(1911),c=t(1420),d=t(2216),u=t(71),h=t(4046),p=t.n(h);let g=(0,i.memo)(e=>{let{className:n,isOpen:t,onClose:i}=e,r=(0,u.WD)();return(0,a.jsx)(o.aF,{className:n,isOpen:t,title:r("dictionary"),onClose:i,children:(0,a.jsxs)("div",{className:p().content,children:[(0,a.jsx)(o.bT,{className:p().dictionary}),(0,a.jsx)(o.$s,{className:p().dictionaryInput})]})})});var v=t(2988),m=t.n(v),x=t(300),b=t.n(x);let j=e=>{let{className:n,description:t,mapping:r}=e;return(0,a.jsxs)("div",{className:m()(b().mapping,n),children:[(0,a.jsx)("h3",{className:b().description,children:t}),(0,a.jsx)("div",{className:b().keys,children:r.map((e,n)=>(0,a.jsxs)(i.Fragment,{children:[(0,a.jsx)("div",{className:b().group,children:Array.isArray(e)?(0,a.jsxs)(a.Fragment,{children:[e[0],(0,a.jsx)("span",{className:b().plus,children:"+"}),e[1]]}):e}),r.length>1&&n<r.length-1&&(0,a.jsx)("span",{className:b().slash,children:"/"})]},n))})]})},f=(0,i.memo)(e=>{let{className:n,isOpen:t,onClose:i}=e,r=(0,u.WD)(),s=(0,u.N4)(u.zg);return(0,a.jsxs)(o.aF,{className:n,isOpen:t,title:r("keyMap"),onClose:i,children:[(0,a.jsxs)(o.aF.Section,{label:r("keyMap.board-and-rack"),title:r("keyMap.board-and-rack"),children:[(0,a.jsx)(j,{description:r("keyMap.board-and-rack.navigate"),mapping:[(0,a.jsx)(o.TG,{},"arrows")]}),(0,a.jsx)(j,{description:r("keyMap.board-and-rack.remove-tile"),mapping:[(0,a.jsx)(o.A_,{},"del"),(0,a.jsx)(o.Er,{},"backspace")]}),(0,a.jsx)(j,{description:r("keyMap.board-and-rack.submit"),mapping:[(0,a.jsx)(o.xy,{},"del")]}),s.twoCharacterTiles.length>0&&(0,a.jsx)(j,{description:r("keyMap.board-and-rack.insert-two-letter-tile"),mapping:[[(0,a.jsx)(o.cx,{},"ctrl"),(0,a.jsx)(a.Fragment,{children:s.twoCharacterTiles.map(e=>{let[n]=e;return(0,a.jsx)(o.Uz,{children:n.toUpperCase()},n)})})]]})]}),(0,a.jsxs)(o.aF.Section,{label:r("keyMap.board"),title:r("keyMap.board"),children:[(0,a.jsx)(j,{description:r("keyMap.board.toggle-direction"),mapping:[(0,a.jsx)(o.TG,{},"arrows")]}),(0,a.jsx)(j,{description:r("keyMap.board.toggle-blank"),mapping:[(0,a.jsx)(o.$x,{},"space")]}),(0,a.jsx)(j,{description:r("keyMap.board.toggle-cell-filter"),mapping:[[(0,a.jsx)(o.cx,{},"ctrl"),(0,a.jsx)(o.Uz,{children:"G"},"g")]]})]}),(0,a.jsx)(o.aF.Section,{label:r("keyMap.rack"),title:r("keyMap.rack"),children:(0,a.jsx)(j,{description:r("keyMap.rack.insert-blank"),mapping:[(0,a.jsx)(o.$x,{},"space")]})})]})});var w=t(4516),y=t(4637),N=t(6838),k=t.n(N);let C=(0,i.memo)(e=>{let{className:n,isOpen:t,onClose:i,onShowDictionary:r,onShowRemainingTiles:s,onShowSettings:l,onShowWords:c}=e,h=(0,u.WD)(),p=(0,u.N4)(u.JV),{Icon:g}=d.x[p];return(0,a.jsxs)(o.aF,{className:n,isOpen:t,title:h("menu"),onClose:i,children:[(0,a.jsx)(o.$n,{"aria-label":h("remaining-tiles"),className:k().button,Icon:w.LK,wide:!0,onClick:s,children:h("remaining-tiles")}),(0,a.jsx)(o.$n,{"aria-label":h("words"),className:k().button,Icon:w.Pv,wide:!0,onClick:c,children:h("words")}),(0,a.jsx)(o.$n,{"aria-label":h("dictionary"),className:k().button,Icon:w.rl,wide:!0,onClick:r,children:h("dictionary")}),(0,a.jsx)(o.$n.Link,{"aria-label":h("github"),className:k().button,href:y.g,Icon:w.Cp,rel:"noopener noreferrer",target:"_blank",wide:!0,children:h("github")}),(0,a.jsx)(o.$n,{"aria-label":h("settings"),className:k().button,Icon:w.mg,wide:!0,onClick:l,children:(0,a.jsxs)("div",{className:k().settings,children:[(0,a.jsx)("div",{className:k().settingsLabel,children:h("settings")}),(0,a.jsx)(g,{"aria-hidden":"true",className:k().flag,role:"img"})]})})]})});var S=t(1839),M=t(900),E=t(1274),L=t.n(E);let W=e=>{let{tile:n}=e,t=(0,u.N4)(u.JV),{direction:i}=d.x[t],{character:r,count:s,usedCount:l}=n;if(void 0===s)throw Error("Remaining tiles not supported for this config");let c=s-l,h=(0,u.N4)(e=>(0,u.fy)(e,r)),p="ltr"===i?c:s,g="ltr"===i?s:c;return(0,a.jsxs)("div",{className:m()(L().character,{[L().finished]:c<=0,[L().overused]:c<0}),children:[(0,a.jsx)(o.FA,{"aria-label":r,character:r,className:L().tile,disabled:!0,isBlank:r===M.BLANK,isValid:c>=0,points:h,raised:!0,size:y.AM}),(0,a.jsx)(o.ke,{className:L().remaining,max:s,style:{width:y.AM},value:c}),(0,a.jsxs)("div",{className:L().count,children:[p.toLocaleString(t)," / ",g.toLocaleString(t)]})]})};var I=t(6334),T=t.n(I);let O=(0,i.memo)(e=>{let{className:n,isOpen:t,onClose:i}=e,r=(0,u.WD)(),s=(0,u.N4)(u.JV),l=(0,u.N4)(u.g1),{tileFontSize:c}=(0,S.HS)(y.AM),{direction:h}=d.x[s];return(0,a.jsx)(o.aF,{className:n,isOpen:t,title:r("remaining-tiles"),onClose:i,children:l.map(e=>{let{remainingCount:n,tiles:t,translationKey:i,totalCount:l}=e;return(0,a.jsx)(o.aF.Section,{label:r(i),title:(0,a.jsxs)("span",{className:T().title,children:[(0,a.jsx)("span",{children:r(i)}),(0,a.jsxs)(o.Ex,{className:T().badge,children:[("ltr"===h?n:l).toLocaleString(s)," / ",("ltr"===h?l:n).toLocaleString(s)]})]}),children:(0,a.jsx)("div",{className:T().content,style:{fontSize:c},children:t.map(e=>(0,a.jsx)("div",{className:T().character,children:(0,a.jsx)(W,{tile:e})},e.character))})},i)})})});var P=t(778),A=t.n(P);let F=(0,i.memo)(e=>{let{className:n,isOpen:t,onClose:r}=e,s=(0,l.wA)(),d=(0,u.WD)(),{showResultsInModal:h}=(0,c.rP)(),p=(0,u.N4)(u.B6),g=(0,u.N4)(u.jt),v=p?p.findIndex(e=>e.id===(null==g?void 0:g.id)):-1,m=(0,i.useMemo)(()=>({onClick:e=>{e===g?r():s(u.NQ.actions.changeResultCandidate(e))}}),[s,r,g]);return(0,i.useEffect)(()=>{t&&!h&&r()},[t,r,h]),(0,a.jsx)(o.aF,{className:n,footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.$n,{"aria-label":d("results.insert"),disabled:!g,Icon:w.Jl,tooltip:d("results.insert"),variant:"primary",onClick:()=>{g&&s(u.NQ.actions.applyResult(g)),r()},children:d("results.insert")}),(0,a.jsx)(o.$n,{"aria-label":d("results.preview"),disabled:!g,Icon:w.fy,tooltip:d("results.preview"),onClick:()=>{r()},children:d("results.preview")})]}),isOpen:t,title:d("results"),onClose:r,children:(0,a.jsxs)("div",{className:A().content,children:[(0,a.jsx)(o.nB,{callbacks:m,className:A().results,highlightedIndex:-1===v?void 0:v}),(0,a.jsx)(o.bT,{className:A().dictionary})]})})});var R=t(8186),G=t.n(R);let D="null",V=e=>{if("left"===e||"right"===e)return e;if(e===D)return null;throw Error('"'.concat(e,'" is not valid. Should be "left", "right", or "').concat(D,'"'))},U=e=>{let{className:n,disabled:t}=e,i=(0,l.wA)(),r=(0,u.WD)(),s=(0,u.N4)(u.up),c=[{label:r("settings.autoGroupTiles.left"),value:"left"},{label:r("settings.autoGroupTiles.right"),value:"right"},{label:r("settings.autoGroupTiles.null"),value:D}],d=e=>{let n=V(e.target.value);i(u.sI.actions.changeAutoGroupTiles(n))};return(0,a.jsx)("div",{className:n,children:c.map(e=>(0,a.jsx)(o.sx,{checked:s===V(e.value),className:G().option,disabled:t,name:"autoGroupTiles",value:e.value,onChange:d,children:(0,a.jsx)("div",{className:G().label,children:e.label})},e.value))})};var J=t(9604),$=t(4566),z=t.n($),K=t(1790);let B=e=>{let n=Object.values(K.games),t=Object.values(K.languages);return n.map(n=>{var a;let i=t.find(t=>t.game===n.game&&t.locale===e);return{disabled:!(0,K.hasConfig)(n.game,e),label:null!==(a=null==i?void 0:i.config.name)&&void 0!==a?a:n.name,value:n.game}})},X=e=>{let{className:n,disabled:t}=e,r=(0,l.wA)(),s=(0,u.N4)(u.Vv),c=(0,u.N4)(u.JV),d=(0,i.useMemo)(()=>B(c),[c]),h=e=>{(0,J.isGame)(e.target.value)&&r(u.sI.actions.changeGame(e.target.value))};return(0,a.jsx)("div",{className:n,children:d.map(e=>(0,a.jsx)(o.sx,{checked:s===e.value,className:z().option,disabled:t||e.disabled,name:"game",value:e.value,onChange:h,children:(0,a.jsx)("div",{className:z().label,children:e.label})},e.value))})};var H=t(4538),Q=t.n(H);let Y=e=>{if("keyboard"===e)return"keyboard";if("touchscreen"===e)return"touchscreen";throw Error('"'.concat(e,'" is not valid. Should be "keyboard" or "touchscreen"'))},Z=e=>{let{className:n,disabled:t}=e,i=(0,l.wA)(),r=(0,u.WD)(),s=(0,u.N4)(u.QN),c=[{label:r("settings.inputMode.keyboard"),value:"keyboard"},{label:r("settings.inputMode.touchscreen"),value:"touchscreen"}],d=e=>{let n=Y(e.target.value);i(u.sI.actions.changeInputMode(n))};return(0,a.jsx)("div",{className:n,children:c.map(e=>(0,a.jsx)(o.sx,{checked:s===e.value,className:Q().option,disabled:t,name:"inputMode",value:e.value,onChange:d,children:(0,a.jsx)("div",{className:Q().label,children:e.label})},e.value))})};var q=t(3758),ee=t.n(q);let en=Object.values(d.x).sort((e,n)=>e.name.localeCompare(n.name)),et=e=>{let{className:n,disabled:t}=e,i=(0,l.wA)(),r=(0,u.N4)(u.JV),s=e=>{let n=e.target.value;i(u.sI.actions.changeLocale(n))};return(0,a.jsx)("div",{className:n,children:en.map(e=>{let{Icon:i,...l}=e;return(0,a.jsx)(o.sx,{checked:r===l.locale,className:m()(ee().option,n,{[ee().checked]:r===l.locale}),disabled:t,name:"locale",value:l.locale,onChange:s,children:(0,a.jsxs)("span",{className:ee().label,children:[(0,a.jsx)(i,{"aria-hidden":"true",className:ee().flag,role:"img"}),(0,a.jsx)("span",{children:l.label})]})},l.locale)})})};var ea=t(6176),ei=t.n(ea);let er=e=>{let{className:n,disabled:t}=e,i=(0,l.wA)(),r=(0,u.WD)(),s=(0,u.N4)(u.hN),c=[{label:r("settings.showCoordinates.hidden"),value:"hidden"},{label:r("settings.showCoordinates.original"),value:"original"},{label:r("settings.showCoordinates.alternative"),value:"alternative"}],d=e=>{let n=e.target.value;i(u.sI.actions.changeShowCoordinates(n))};return(0,a.jsx)("div",{className:n,children:c.map(e=>(0,a.jsx)(o.sx,{checked:String(s)===e.value,className:ei().option,disabled:t,name:"showCoordinates",value:e.value,onChange:d,children:(0,a.jsx)("div",{className:ei().label,children:e.label})},e.value))})},es=(0,i.memo)(e=>{let{className:n,isOpen:t,onClose:i}=e,r=(0,u.WD)(),s=(0,c.Ju)();return(0,a.jsxs)(o.aF,{className:n,isOpen:t,title:r("settings"),onClose:i,children:[(0,a.jsx)(o.aF.Section,{label:r("settings.game"),title:r("settings.game"),children:(0,a.jsx)(X,{disabled:!t})}),(0,a.jsx)(o.aF.Section,{label:r("settings.language"),title:r("settings.language"),children:(0,a.jsx)(et,{disabled:!t})}),(0,a.jsx)(o.aF.Section,{label:r("settings.showCoordinates"),title:r("settings.showCoordinates"),children:(0,a.jsx)(er,{disabled:!t})}),!s&&(0,a.jsx)(o.aF.Section,{label:r("settings.inputMode"),title:r("settings.inputMode"),children:(0,a.jsx)(Z,{disabled:!t})}),(0,a.jsx)(o.aF.Section,{label:r("settings.autoGroupTiles"),title:r("settings.autoGroupTiles"),children:(0,a.jsx)(U,{disabled:!t})})]})});var el=t(9184),eo=t.n(el);let ec=(0,i.memo)(e=>{let{className:n,isOpen:t,onClose:i}=e,r=(0,u.WD)(),s=(0,u.N4)(u.JV),{invalidWords:l,validWords:c}=(0,u.N4)(u.ei);return(0,a.jsxs)(o.aF,{className:n,isOpen:t,title:r("words"),onClose:i,children:[(0,a.jsx)(o.aF.Section,{label:r("words.invalid"),title:(0,a.jsxs)("span",{className:eo().title,children:[(0,a.jsx)("span",{children:r("words.invalid")}),(0,a.jsx)(o.Ex,{className:eo().badge,children:l.length.toLocaleString(s)})]}),children:l.map((e,n)=>(0,a.jsxs)("div",{className:eo().word,children:[(0,a.jsx)(w.FB,{"aria-hidden":"true",className:m()(eo().icon,eo().invalid),role:"img"})," ",e]},n))}),(0,a.jsx)(o.aF.Section,{label:r("words.valid"),title:(0,a.jsxs)("span",{className:eo().title,children:[(0,a.jsx)("span",{children:r("words.valid")}),(0,a.jsx)(o.Ex,{className:eo().badge,children:c.length.toLocaleString(s)})]}),children:c.map((e,n)=>(0,a.jsxs)("div",{className:eo().word,children:[(0,a.jsx)(w.Jl,{"aria-hidden":"true",className:m()(eo().icon,eo().valid),role:"img"})," ",e]},n))})]})});try{self["workbox:window:7.2.0"]&&_()}catch(e){}function ed(e,n){return new Promise(function(t){var a=new MessageChannel;a.port1.onmessage=function(e){t(e.data)},e.postMessage(n,[a.port2])})}function eu(e,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,n||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(a.key),a)}}function eh(e,n){return(eh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e})(e,n)}function ep(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=Array(n);t<n;t++)a[t]=e[t];return a}try{self["workbox:core:7.2.0"]&&_()}catch(e){}var eg=function(){var e=this;this.promise=new Promise(function(n,t){e.resolve=n,e.reject=t})};function ev(e,n){var t=location.href;return new URL(e,t).href===new URL(n,t).href}var em=function(e,n){this.type=e,Object.assign(this,n)};function e_(e,n,t){return t?n?n(e):e:(e&&e.then||(e=Promise.resolve(e)),n?e.then(n):e)}function ex(){}var eb={type:"SKIP_WAITING"};function ej(e,n){if(!n)return e&&e.then?e.then(ex):Promise.resolve()}var ef=function(e){function n(n,t){var a,i;return void 0===t&&(t={}),(a=e.call(this)||this).nn={},a.tn=0,a.rn=new eg,a.en=new eg,a.on=new eg,a.un=0,a.an=new Set,a.cn=function(){var e=a.fn,n=e.installing;a.tn>0||!ev(n.scriptURL,a.sn.toString())||performance.now()>a.un+6e4?(a.vn=n,e.removeEventListener("updatefound",a.cn)):(a.hn=n,a.an.add(n),a.rn.resolve(n)),++a.tn,n.addEventListener("statechange",a.ln)},a.ln=function(e){var n=a.fn,t=e.target,i=t.state,r=t===a.vn,s={sw:t,isExternal:r,originalEvent:e};!r&&a.mn&&(s.isUpdate=!0),a.dispatchEvent(new em(i,s)),"installed"===i?a.wn=self.setTimeout(function(){"installed"===i&&n.waiting===t&&a.dispatchEvent(new em("waiting",s))},200):"activating"===i&&(clearTimeout(a.wn),r||a.en.resolve(t))},a.yn=function(e){var n=a.hn,t=n!==navigator.serviceWorker.controller;a.dispatchEvent(new em("controlling",{isExternal:t,originalEvent:e,sw:n,isUpdate:a.mn})),t||a.on.resolve(n)},i=function(e){var n=e.data,t=e.ports,i=e.source;return e_(a.getSW(),function(){a.an.has(i)&&a.dispatchEvent(new em("message",{data:n,originalEvent:e,ports:t,sw:i}))})},a.gn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(i.apply(this,e))}catch(e){return Promise.reject(e)}},a.sn=n,a.nn=t,navigator.serviceWorker.addEventListener("message",a.gn),a}n.prototype=Object.create(e.prototype),n.prototype.constructor=n,eh(n,e);var t,a=n.prototype;return a.register=function(e){var n=(void 0===e?{}:e).immediate,t=void 0!==n&&n;try{var a,i,r=this;return e_((a=function(){return r.mn=!!navigator.serviceWorker.controller,r.dn=r.pn(),e_(r.bn(),function(e){r.fn=e,r.dn&&(r.hn=r.dn,r.en.resolve(r.dn),r.on.resolve(r.dn),r.dn.addEventListener("statechange",r.ln,{once:!0}));var n=r.fn.waiting;return n&&ev(n.scriptURL,r.sn.toString())&&(r.hn=n,Promise.resolve().then(function(){r.dispatchEvent(new em("waiting",{sw:n,wasWaitingBeforeRegister:!0}))}).then(function(){})),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener("updatefound",r.cn),navigator.serviceWorker.addEventListener("controllerchange",r.yn),r.fn})},(i=function(){if(!t&&"complete"!==document.readyState)return ej(new Promise(function(e){return window.addEventListener("load",e)}))}())&&i.then?i.then(a):a(i)))}catch(e){return Promise.reject(e)}},a.update=function(){try{return this.fn?e_(ej(this.fn.update())):e_()}catch(e){return Promise.reject(e)}},a.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},a.messageSW=function(e){try{return e_(this.getSW(),function(n){return ed(n,e)})}catch(e){return Promise.reject(e)}},a.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&ed(this.fn.waiting,eb)},a.pn=function(){var e=navigator.serviceWorker.controller;return e&&ev(e.scriptURL,this.sn.toString())?e:void 0},a.bn=function(){try{var e=this;return e_(function(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}(function(){return e_(navigator.serviceWorker.register(e.sn,e.nn),function(n){return e.un=performance.now(),n})},function(e){throw e}))}catch(e){return Promise.reject(e)}},eu(n.prototype,[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}]),t&&eu(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(function(){function e(){this.Pn=new Map}var n=e.prototype;return n.addEventListener=function(e,n){this.jn(e).add(n)},n.removeEventListener=function(e,n){this.jn(e).delete(n)},n.dispatchEvent=function(e){e.target=this;for(var n,t=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return ep(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ep(e,void 0):void 0}}(e))){t&&(e=t);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.jn(e.type));!(n=t()).done;)(0,n.value)(e)},n.jn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}());let ew=null,ey=async()=>{globalThis.navigator&&"serviceWorker"in globalThis.navigator&&(ew=new ef("/service-worker.js"),await ew.register({immediate:!0}))};var eN=t(7271),ek=t.n(eN);s().setAppElement("#__next");var eC=!0;let eS=e=>{let{version:n}=e,t=(0,l.wA)(),r=(0,u.N4)(u.zg),s=(0,u.N4)(u.JV),[h,p]=(0,i.useState)(!1),[v,m]=(0,i.useState)(!1),[x,b]=(0,i.useState)(!1),[j,w]=(0,i.useState)(!1),[y,N]=(0,i.useState)(!1),[k,S]=(0,i.useState)(!1),[M,E]=(0,i.useState)(!1),[L,W]=(0,i.useState)(!1),I=(0,i.useCallback)(()=>N(!0),[]),T=(0,i.useCallback)(()=>t((0,u.cL)()),[t]),P=(0,i.useCallback)(()=>p(!1),[]),A=(0,i.useCallback)(()=>m(!1),[]),R=(0,i.useCallback)(()=>b(!1),[]),G=(0,i.useCallback)(()=>w(!1),[]),D=(0,i.useCallback)(()=>N(!1),[]),V=(0,i.useCallback)(()=>S(!1),[]),U=(0,i.useCallback)(()=>E(!1),[]),J=(0,i.useCallback)(()=>p(!0),[]),$=(0,i.useCallback)(()=>m(!0),[]),z=(0,i.useCallback)(()=>b(!0),[]),K=(0,i.useCallback)(()=>w(!0),[]),B=(0,i.useCallback)(()=>S(!0),[]),X=(0,i.useCallback)(()=>E(!0),[]);return((0,c.jH)(d.x[s].direction),(0,c.ok)(s),(0,c.Mj)(),(0,c.Su)(()=>{ey(),W(!0),t((0,u.n_)())}),L)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("nav",{className:ek().nav,children:(0,a.jsxs)("div",{className:ek().navContent,children:[(0,a.jsx)("div",{className:ek().navLogo,children:(0,a.jsx)("a",{className:ek().logoContainer,href:"/",title:n,children:(0,a.jsx)(o.gu,{className:ek().logo})})}),(0,a.jsx)(o.tf,{onClear:T,onShowKeyMap:$,onShowMenu:z,onShowRemainingTiles:K,onShowSettings:B,onShowWords:X})]})}),(0,a.jsx)(o.Ox,{className:ek().solver,onShowResults:I}),(0,a.jsx)(C,{isOpen:x,onClose:R,onShowDictionary:J,onShowRemainingTiles:K,onShowSettings:B,onShowWords:X}),(0,a.jsx)(es,{isOpen:k,onClose:V}),(0,a.jsx)(f,{isOpen:v,onClose:A}),(0,a.jsx)(ec,{isOpen:M,onClose:U}),r.supportsRemainingTiles&&(0,a.jsx)(O,{isOpen:j,onClose:G}),(0,a.jsx)(F,{isOpen:y,onClose:D}),(0,a.jsx)(g,{isOpen:h,onClose:P})]}):null}},3758:e=>{e.exports={option:"LocaleSetting_option__3uVpq",label:"LocaleSetting_label__VqJH9",flag:"LocaleSetting_flag__cnMgQ"}},4046:e=>{e.exports={content:"DictionaryModal_content___jXD2",dictionary:"DictionaryModal_dictionary__Eu9Sx",dictionaryInput:"DictionaryModal_dictionaryInput__CKiX5"}},4538:e=>{e.exports={option:"InputModeSetting_option__9tdaY",label:"InputModeSetting_label__al6kL"}},4566:e=>{e.exports={option:"ConfigSetting_option__pvmMK",label:"ConfigSetting_label__CeZI1"}},6176:e=>{e.exports={option:"ShowCoordinatesSetting_option__teifi",label:"ShowCoordinatesSetting_label__h0REI"}},6334:e=>{e.exports={title:"RemainingTilesModal_title__4rcbk",content:"RemainingTilesModal_content__NrmXd",badge:"RemainingTilesModal_badge__vZkrc",character:"RemainingTilesModal_character__16pGR"}},6838:e=>{e.exports={button:"MenuModal_button__x3zTR",settings:"MenuModal_settings__XE_P3",settingsLabel:"MenuModal_settingsLabel__xYRLv",flag:"MenuModal_flag__NGaHf"}},7271:e=>{e.exports={nav:"index_nav__oayCy",navContent:"index_navContent__puCTa",navLogo:"index_navLogo__iI_za",logoContainer:"index_logoContainer__YyxQp",logo:"index_logo__jZUto",solver:"index_solver__wz8VS"}},7703:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(1804)}])},8186:e=>{e.exports={option:"AutoGroupTilesSetting_option__dp8CH",label:"AutoGroupTilesSetting_label__MIKlN"}},9184:e=>{e.exports={title:"WordsModal_title__UGHtI",badge:"WordsModal_badge__Ay_8V",word:"WordsModal_word__sCI06",invalid:"WordsModal_invalid__jgYeh",valid:"WordsModal_valid__JW5lM",icon:"WordsModal_icon___HWi4"}}},e=>{var n=n=>e(e.s=n);e.O(0,[593,636,792],()=>n(7703)),_N_E=e.O()}]);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BONUS_WORD } from '@scrabble-solver/constants';
|
|
2
|
-
import { Bonus } from '@scrabble-solver/types';
|
|
3
|
-
|
|
4
|
-
import { COLOR_BONUS_CHARACTER, COLOR_BONUS_CHARACTER_MULTIPLIER, COLOR_BONUS_WORD } from 'parameters';
|
|
5
|
-
|
|
6
|
-
export const getBonusColor = (bonus: Bonus): string => {
|
|
7
|
-
if (bonus.type === BONUS_WORD) {
|
|
8
|
-
return COLOR_BONUS_WORD[bonus.multiplier];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (bonus.score) {
|
|
12
|
-
return COLOR_BONUS_CHARACTER[bonus.score];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return COLOR_BONUS_CHARACTER_MULTIPLIER[bonus.multiplier];
|
|
16
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Point } from 'types';
|
|
2
|
-
|
|
3
|
-
export const getPositionInGrid = <T>(grid: T[][], constraint: (value: T) => boolean): Point | undefined => {
|
|
4
|
-
for (let y = 0; y < grid.length; ++y) {
|
|
5
|
-
for (let x = 0; x < grid[0].length; ++x) {
|
|
6
|
-
if (constraint(grid[y][x])) {
|
|
7
|
-
return { x, y };
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return undefined;
|
|
13
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { getConfig } from '@scrabble-solver/configs';
|
|
2
|
-
import { Game, Locale } from '@scrabble-solver/types';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
PLAIN_TILES_COLOR_DEFAULT,
|
|
6
|
-
PLAIN_TILES_POINTS_COLORS,
|
|
7
|
-
PLAIN_TILES_TILE_MAX_ROTATE,
|
|
8
|
-
PLAIN_TILES_TILE_MAX_SCATTER,
|
|
9
|
-
PLAIN_TILES_TILE_SIZE,
|
|
10
|
-
} from 'parameters';
|
|
11
|
-
|
|
12
|
-
import { CreatePlainTileOptions, PlainTile } from '../types';
|
|
13
|
-
|
|
14
|
-
import { getX } from './getX';
|
|
15
|
-
import { getY } from './getY';
|
|
16
|
-
import { randomize } from './randomize';
|
|
17
|
-
|
|
18
|
-
export const createPlainTile = ({
|
|
19
|
-
cellIndex,
|
|
20
|
-
character,
|
|
21
|
-
color,
|
|
22
|
-
rowIndex,
|
|
23
|
-
showPoints,
|
|
24
|
-
}: CreatePlainTileOptions): PlainTile => {
|
|
25
|
-
const configPoints = getConfig(Game.Literaki, Locale.EN_US).getCharacterPoints(character.toLowerCase());
|
|
26
|
-
const points = showPoints ? configPoints : undefined;
|
|
27
|
-
const defaultColor =
|
|
28
|
-
typeof configPoints === 'number' ? PLAIN_TILES_POINTS_COLORS[configPoints] : PLAIN_TILES_COLOR_DEFAULT;
|
|
29
|
-
const x = getX(cellIndex) + PLAIN_TILES_TILE_SIZE / 2;
|
|
30
|
-
const y = getY(0) + PLAIN_TILES_TILE_SIZE / 2;
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
character,
|
|
34
|
-
color: color || defaultColor,
|
|
35
|
-
points,
|
|
36
|
-
size: PLAIN_TILES_TILE_SIZE,
|
|
37
|
-
transform: `rotate(${randomize(0, PLAIN_TILES_TILE_MAX_ROTATE)}, ${x}, ${y})`,
|
|
38
|
-
x: randomize(getX(cellIndex), PLAIN_TILES_TILE_MAX_SCATTER),
|
|
39
|
-
y: randomize(getY(rowIndex), PLAIN_TILES_TILE_MAX_SCATTER),
|
|
40
|
-
};
|
|
41
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CreatePlainTilesOptions, PlainTile } from '../types';
|
|
2
|
-
|
|
3
|
-
import { createPlainTile } from './createPlainTile';
|
|
4
|
-
|
|
5
|
-
export const createPlainTiles = ({ color, content, showPoints }: CreatePlainTilesOptions): PlainTile[] => {
|
|
6
|
-
const rows = content.map((words, rowIndex) => {
|
|
7
|
-
return words.map((word, wordIndex) => {
|
|
8
|
-
const cellOffset = words.slice(0, wordIndex).reduce((result, { length }) => result + length + ' '.length, 0);
|
|
9
|
-
const characters = word.split('');
|
|
10
|
-
|
|
11
|
-
return characters.map((character, cellIndex) => {
|
|
12
|
-
return createPlainTile({
|
|
13
|
-
cellIndex: cellOffset + cellIndex,
|
|
14
|
-
character,
|
|
15
|
-
color,
|
|
16
|
-
rowIndex,
|
|
17
|
-
showPoints,
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const tiles = rows.flat(2);
|
|
24
|
-
return tiles;
|
|
25
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PLAIN_TILES_TILE_MARGIN, PLAIN_TILES_TILE_SIZE } from 'parameters';
|
|
2
|
-
|
|
3
|
-
export const getViewbox = (content: string[][]): string => {
|
|
4
|
-
const longestRowLength = content.reduce((result, words) => {
|
|
5
|
-
const wordsLength = words.reduce((sum, word) => sum + word.length, 0);
|
|
6
|
-
const rowLength = wordsLength + Math.max(words.length - 1, 0);
|
|
7
|
-
return Math.max(result, rowLength);
|
|
8
|
-
}, 0);
|
|
9
|
-
const width =
|
|
10
|
-
longestRowLength * (PLAIN_TILES_TILE_SIZE + PLAIN_TILES_TILE_MARGIN) -
|
|
11
|
-
(longestRowLength === 0 ? 0 : PLAIN_TILES_TILE_MARGIN);
|
|
12
|
-
const height =
|
|
13
|
-
content.length * (PLAIN_TILES_TILE_SIZE + PLAIN_TILES_TILE_MARGIN) -
|
|
14
|
-
(content.length === 0 ? 0 : PLAIN_TILES_TILE_MARGIN);
|
|
15
|
-
|
|
16
|
-
return `0 0 ${width} ${height}`;
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const randomize = (value: number, maxChange: number): number => value + maxChange * 2 * (0.5 - Math.random());
|
package/src/lib/createArray.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const createArray = <T>(length: number): T[] => Array.from({ length });
|
package/src/lib/createGridOf.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createArray } from './createArray';
|
|
2
|
-
|
|
3
|
-
export const createGridOf = <T>(width: number, height: number, getInitialValue: (x: number, y: number) => T): T[][] => {
|
|
4
|
-
return createArray(height).map((_row, y) => {
|
|
5
|
-
return createArray(width).map((_cell, x) => {
|
|
6
|
-
return getInitialValue(x, y);
|
|
7
|
-
});
|
|
8
|
-
});
|
|
9
|
-
};
|
package/src/lib/detectLocale.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Locale } from '@scrabble-solver/types';
|
|
2
|
-
|
|
3
|
-
export const detectLocale = (): Locale => {
|
|
4
|
-
const languages = window.navigator.languages;
|
|
5
|
-
|
|
6
|
-
if (languages.includes('pl') || languages.includes('pl-PL')) {
|
|
7
|
-
return Locale.PL_PL;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
if (languages.includes('en-GB')) {
|
|
11
|
-
return Locale.EN_GB;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (languages.includes('fa') || languages.includes('fa-IR')) {
|
|
15
|
-
return Locale.FA_IR;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (languages.includes('fr-FR')) {
|
|
19
|
-
return Locale.FR_FR;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (languages.includes('ro') || languages.includes('ro-RO')) {
|
|
23
|
-
return Locale.RO_RO;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return Locale.EN_US;
|
|
27
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { getConfig } from '@scrabble-solver/configs';
|
|
2
|
-
import { BLANK } from '@scrabble-solver/constants';
|
|
3
|
-
import { Game, Locale } from '@scrabble-solver/types';
|
|
4
|
-
|
|
5
|
-
import { extractCharactersByCase } from './extractCharactersByCase';
|
|
6
|
-
|
|
7
|
-
const tests = [
|
|
8
|
-
{ input: 'ab ', expected: ['a', 'b', BLANK] },
|
|
9
|
-
{ input: 'śćźa', expected: ['a'] },
|
|
10
|
-
{ input: 'bueno', expected: ['b', 'u', 'e', 'n', 'o'] },
|
|
11
|
-
{ input: 'bellas', expected: ['b', 'e', 'l', 'l', 'a', 's'] },
|
|
12
|
-
{ input: 'churro', expected: ['c', 'h', 'u', 'r', 'r', 'o'] },
|
|
13
|
-
{ input: 'challulla', expected: ['c', 'h', 'a', 'l', 'l', 'u', 'l', 'l', 'a'] },
|
|
14
|
-
{ input: 'beLlas', expected: ['b', 'e', 'l', 'l', 'a', 's'] },
|
|
15
|
-
{ input: 'belLas', expected: ['b', 'e', 'l', 'l', 'a', 's'] },
|
|
16
|
-
{ input: 'beLLas', expected: ['b', 'e', 'll', 'a', 's'] },
|
|
17
|
-
{ input: 'chuRRo', expected: ['c', 'h', 'u', 'rr', 'o'] },
|
|
18
|
-
{ input: 'CHuRRo', expected: ['ch', 'u', 'rr', 'o'] },
|
|
19
|
-
{ input: 'CHaLLuLLa', expected: ['ch', 'a', 'll', 'u', 'll', 'a'] },
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
describe('extractCharactersByCase', () => {
|
|
23
|
-
const locale = Locale.ES_ES;
|
|
24
|
-
const config = getConfig(Game.Scrabble, locale);
|
|
25
|
-
|
|
26
|
-
it.each(tests)(`[${locale}] "$input"`, ({ input, expected }) => {
|
|
27
|
-
expect(extractCharactersByCase(config, input)).toEqual(expected);
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { BLANK } from '@scrabble-solver/constants';
|
|
2
|
-
import { Config } from '@scrabble-solver/types';
|
|
3
|
-
|
|
4
|
-
import { isUpperCase } from './isUpperCase';
|
|
5
|
-
|
|
6
|
-
export const extractCharactersByCase = (config: Config, value: string): string[] => {
|
|
7
|
-
let index = 0;
|
|
8
|
-
const characters: string[] = [];
|
|
9
|
-
|
|
10
|
-
while (index < value.length) {
|
|
11
|
-
const character = value[index];
|
|
12
|
-
const characterLowercase = value[index].toLocaleLowerCase(config.locale);
|
|
13
|
-
const nextCharacter = value[index + 1];
|
|
14
|
-
const digraph = `${character}${nextCharacter}`;
|
|
15
|
-
const digraphLowercase = digraph.toLocaleLowerCase(config.locale);
|
|
16
|
-
|
|
17
|
-
if (isUpperCase(config.locale, digraph) && config.twoCharacterTiles.includes(digraphLowercase)) {
|
|
18
|
-
characters.push(digraphLowercase);
|
|
19
|
-
index += digraphLowercase.length;
|
|
20
|
-
} else if (config.hasCharacter(characterLowercase) || characterLowercase === BLANK) {
|
|
21
|
-
characters.push(characterLowercase);
|
|
22
|
-
++index;
|
|
23
|
-
} else {
|
|
24
|
-
++index;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return characters;
|
|
29
|
-
};
|
package/src/lib/getCellSize.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Config } from '@scrabble-solver/types';
|
|
2
|
-
|
|
3
|
-
import { BOARD_CELL_BORDER_WIDTH, BOARD_TILE_SIZE_MAX } from 'parameters';
|
|
4
|
-
|
|
5
|
-
export const getCellSize = (config: Config, width: number, height: number): number => {
|
|
6
|
-
const maxWidth = (width - BOARD_CELL_BORDER_WIDTH) / config.boardWidth - BOARD_CELL_BORDER_WIDTH;
|
|
7
|
-
const maxHeight = (height - BOARD_CELL_BORDER_WIDTH) / config.boardHeight - BOARD_CELL_BORDER_WIDTH;
|
|
8
|
-
const cellSize = Math.min(maxWidth, maxHeight);
|
|
9
|
-
return Math.floor(Math.min(cellSize, BOARD_TILE_SIZE_MAX));
|
|
10
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Result, ShowCoordinates } from '@scrabble-solver/types';
|
|
2
|
-
|
|
3
|
-
import { getCoordinate } from './getCoordinate';
|
|
4
|
-
|
|
5
|
-
export const getCoordinates = (result: Result, showCoordinates: ShowCoordinates): string => {
|
|
6
|
-
if (showCoordinates === 'hidden') {
|
|
7
|
-
return '';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const firstCell = result.cells[0];
|
|
11
|
-
const isHorizontal = firstCell.x !== result.cells[1].x;
|
|
12
|
-
const x = getCoordinate(firstCell.x, showCoordinates === 'original' ? 'letter' : 'number');
|
|
13
|
-
const y = getCoordinate(firstCell.y, showCoordinates === 'original' ? 'number' : 'letter');
|
|
14
|
-
|
|
15
|
-
return isHorizontal ? `${y}${x}` : `${x}${y}`;
|
|
16
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { RemainingTile } from 'types';
|
|
2
|
-
|
|
3
|
-
export const getRemainingTilesCount = (remainingTiles: RemainingTile[]): number => {
|
|
4
|
-
return remainingTiles.reduce((sum, { count, usedCount }) => {
|
|
5
|
-
if (typeof count === 'undefined') {
|
|
6
|
-
return sum;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return sum + count - usedCount;
|
|
10
|
-
}, 0);
|
|
11
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { RemainingTile } from 'types';
|
|
2
|
-
|
|
3
|
-
export const getTotalRemainingTilesCount = (remainingTiles: RemainingTile[]): number => {
|
|
4
|
-
return remainingTiles.reduce((sum, { count }) => {
|
|
5
|
-
if (typeof count === 'undefined') {
|
|
6
|
-
return sum;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return sum + count;
|
|
10
|
-
}, 0);
|
|
11
|
-
};
|
package/src/lib/groupResults.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Result } from '@scrabble-solver/types';
|
|
2
|
-
|
|
3
|
-
import { CellFilterEntry, GroupedResults } from 'types';
|
|
4
|
-
|
|
5
|
-
import { createRegExp } from './createRegExp';
|
|
6
|
-
import { resultMatchesCellFilter } from './resultMatchesCellFilter';
|
|
7
|
-
|
|
8
|
-
export const groupResults = (
|
|
9
|
-
results: Result[] | undefined,
|
|
10
|
-
query: string,
|
|
11
|
-
cellFilter: CellFilterEntry[],
|
|
12
|
-
): GroupedResults | undefined => {
|
|
13
|
-
if (typeof results === 'undefined') {
|
|
14
|
-
return results;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const regExp = createRegExp(query);
|
|
18
|
-
|
|
19
|
-
const { matching, other } = results.reduce<GroupedResults>(
|
|
20
|
-
(groupedResults, result) => {
|
|
21
|
-
const matchesQuery = () => Boolean(result.word.match(regExp));
|
|
22
|
-
|
|
23
|
-
if (resultMatchesCellFilter(result, cellFilter) && matchesQuery()) {
|
|
24
|
-
groupedResults.matching.push(result);
|
|
25
|
-
} else {
|
|
26
|
-
groupedResults.other.push(result);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return groupedResults;
|
|
30
|
-
},
|
|
31
|
-
{ matching: [], other: [] },
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
return { matching, other };
|
|
35
|
-
};
|
package/src/lib/guessLocale.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Locale } from '@scrabble-solver/types';
|
|
2
|
-
|
|
3
|
-
export const guessLocale = (): Locale => {
|
|
4
|
-
if (!globalThis.navigator) {
|
|
5
|
-
return Locale.EN_US;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const locales = Object.values(Locale);
|
|
9
|
-
const exactMatch = locales.find((locale) => globalThis.navigator.language === String(locale));
|
|
10
|
-
|
|
11
|
-
if (exactMatch) {
|
|
12
|
-
return exactMatch;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const partialMatch = locales.find((locale) => {
|
|
16
|
-
return globalThis.navigator.language === locale.substring(0, 2);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
return partialMatch || Locale.EN_US;
|
|
20
|
-
};
|
package/src/lib/isUpperCase.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Result } from '@scrabble-solver/types';
|
|
2
|
-
|
|
3
|
-
import { CellFilterEntry } from 'types';
|
|
4
|
-
|
|
5
|
-
export const resultMatchesCellFilter = (result: Result, cellFilter: CellFilterEntry[]) => {
|
|
6
|
-
const excludeFilters = cellFilter.filter((filter) => filter.type === 'exclude');
|
|
7
|
-
const matchesExcludeFilters = excludeFilters.every(({ x, y }) => {
|
|
8
|
-
return result.cells.every((cell) => cell.x !== x || cell.y !== y);
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
if (!matchesExcludeFilters) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const includeFilter = cellFilter.filter((filter) => filter.type === 'include');
|
|
16
|
-
const matchesIncludeFilters = includeFilter.every(({ x, y }) => {
|
|
17
|
-
return result.cells.some((cell) => cell.x === x && cell.y === y);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return matchesExcludeFilters && matchesIncludeFilters;
|
|
21
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Locale, ShowCoordinates } from '@scrabble-solver/types';
|
|
2
|
-
|
|
3
|
-
import { GroupedResults, Sort } from 'types';
|
|
4
|
-
|
|
5
|
-
import { sortResults } from './sortResults';
|
|
6
|
-
|
|
7
|
-
export const sortGroupedResults = (
|
|
8
|
-
results: GroupedResults | undefined,
|
|
9
|
-
sort: Sort,
|
|
10
|
-
locale: Locale,
|
|
11
|
-
showCoordinates: ShowCoordinates,
|
|
12
|
-
): GroupedResults | undefined => {
|
|
13
|
-
if (typeof results === 'undefined') {
|
|
14
|
-
return results;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
matching: sortResults(results.matching, sort, locale, showCoordinates) ?? [],
|
|
19
|
-
other: sortResults(results.other, sort, locale, showCoordinates) ?? [],
|
|
20
|
-
};
|
|
21
|
-
};
|
package/src/lib/sortResults.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Result, ShowCoordinates } from '@scrabble-solver/types';
|
|
2
|
-
|
|
3
|
-
import { Comparator, ResultColumnId, Sort, SortDirection } from 'types';
|
|
4
|
-
|
|
5
|
-
import { createKeyComparator } from './createKeyComparator';
|
|
6
|
-
import { createStringComparator } from './createStringComparator';
|
|
7
|
-
import { getCoordinates } from './getCoordinates';
|
|
8
|
-
import { reverseComparator } from './reverseComparator';
|
|
9
|
-
|
|
10
|
-
const comparators: Record<ResultColumnId, (locale: string, showCoordinates: ShowCoordinates) => Comparator<Result>> = {
|
|
11
|
-
[ResultColumnId.BlanksCount]: (locale: string) => createKeyComparator('blanksCount', locale),
|
|
12
|
-
[ResultColumnId.ConsonantsCount]: (locale: string) => createKeyComparator('consonantsCount', locale),
|
|
13
|
-
[ResultColumnId.Coordinates]: (locale: string, showCoordinates: ShowCoordinates) => (a, b) => {
|
|
14
|
-
const stringComparator = createStringComparator(locale);
|
|
15
|
-
const aValue = getCoordinates(a, showCoordinates);
|
|
16
|
-
const bValue = getCoordinates(b, showCoordinates);
|
|
17
|
-
return stringComparator(aValue, bValue);
|
|
18
|
-
},
|
|
19
|
-
[ResultColumnId.Points]: (locale: string) => createKeyComparator('points', locale),
|
|
20
|
-
[ResultColumnId.TilesCount]: (locale: string) => createKeyComparator('tilesCount', locale),
|
|
21
|
-
[ResultColumnId.VowelsCount]: (locale: string) => createKeyComparator('vowelsCount', locale),
|
|
22
|
-
[ResultColumnId.Word]: (locale: string) => createKeyComparator('word', locale),
|
|
23
|
-
[ResultColumnId.WordsCount]: (locale: string) => createKeyComparator('wordsCount', locale),
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const sortResults = (
|
|
27
|
-
results: Result[] | undefined,
|
|
28
|
-
sort: Sort,
|
|
29
|
-
locale: string,
|
|
30
|
-
showCoordinates: ShowCoordinates,
|
|
31
|
-
): Result[] | undefined => {
|
|
32
|
-
if (typeof results === 'undefined') {
|
|
33
|
-
return results;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const createComparator = comparators[sort.column];
|
|
37
|
-
const comparator = createComparator(locale, showCoordinates);
|
|
38
|
-
const finalComparator = sort.direction === SortDirection.Descending ? reverseComparator(comparator) : comparator;
|
|
39
|
-
const sortedResults = [...results].sort(finalComparator);
|
|
40
|
-
return sortedResults;
|
|
41
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { WordDefinition } from '@scrabble-solver/types';
|
|
2
|
-
|
|
3
|
-
export interface DictionaryState {
|
|
4
|
-
error: unknown;
|
|
5
|
-
input: string;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
results: WordDefinition[];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const dictionaryInitialState: DictionaryState = {
|
|
11
|
-
error: undefined,
|
|
12
|
-
input: '',
|
|
13
|
-
isLoading: false,
|
|
14
|
-
results: [],
|
|
15
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export { boardInitialState } from './boardInitialState';
|
|
2
|
-
export { boardSlice } from './boardSlice';
|
|
3
|
-
export { cellFilterInitialState } from './cellFilterInitialState';
|
|
4
|
-
export { cellFilterSlice } from './cellFilterSlice';
|
|
5
|
-
export { dictionaryInitialState } from './dictionaryInitialState';
|
|
6
|
-
export { dictionarySlice } from './dictionarySlice';
|
|
7
|
-
export { rackInitialState } from './rackInitialState';
|
|
8
|
-
export { rackSlice } from './rackSlice';
|
|
9
|
-
export { resultsInitialState } from './resultsInitialState';
|
|
10
|
-
export { resultsSlice } from './resultsSlice';
|
|
11
|
-
export { settingsInitialState } from './settingsInitialState';
|
|
12
|
-
export { settingsSlice } from './settingsSlice';
|
|
13
|
-
export { solveInitialState } from './solveInitialState';
|
|
14
|
-
export { solveSlice } from './solveSlice';
|
|
15
|
-
export { verifyInitialState } from './verifyInitialState';
|
|
16
|
-
export { verifySlice } from './verifySlice';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Rack } from 'types';
|
|
2
|
-
|
|
3
|
-
import { localStorage } from '../localStorage';
|
|
4
|
-
|
|
5
|
-
export type RackState = Rack;
|
|
6
|
-
|
|
7
|
-
export const rackDefaultState: RackState = [null, null, null, null, null, null, null];
|
|
8
|
-
|
|
9
|
-
export const rackInitialState: RackState = localStorage.getRack() || rackDefaultState;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Result } from '@scrabble-solver/types';
|
|
2
|
-
|
|
3
|
-
import { ResultColumnId, Sort, SortDirection } from 'types';
|
|
4
|
-
|
|
5
|
-
export interface ResultsState {
|
|
6
|
-
candidate: Result | null;
|
|
7
|
-
query: string;
|
|
8
|
-
results: Result[] | undefined;
|
|
9
|
-
sort: Sort;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const resultsInitialState: ResultsState = {
|
|
13
|
-
candidate: null,
|
|
14
|
-
query: '',
|
|
15
|
-
results: undefined,
|
|
16
|
-
sort: {
|
|
17
|
-
column: ResultColumnId.Points,
|
|
18
|
-
direction: SortDirection.Descending,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Board } from '@scrabble-solver/types';
|
|
2
|
-
|
|
3
|
-
import { boardInitialState } from './boardInitialState';
|
|
4
|
-
|
|
5
|
-
export interface SolveState {
|
|
6
|
-
error: unknown;
|
|
7
|
-
isLoading: boolean;
|
|
8
|
-
lastSolvedParameters: {
|
|
9
|
-
board: Board;
|
|
10
|
-
characters: string[];
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const solveInitialState: SolveState = {
|
|
15
|
-
error: undefined,
|
|
16
|
-
isLoading: false,
|
|
17
|
-
lastSolvedParameters: {
|
|
18
|
-
board: boardInitialState,
|
|
19
|
-
characters: [],
|
|
20
|
-
},
|
|
21
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { boardInitialState, BoardState } from './boardInitialState';
|
|
2
|
-
|
|
3
|
-
export interface VerifyState {
|
|
4
|
-
isLoading: boolean;
|
|
5
|
-
lastSolvedParameters: {
|
|
6
|
-
board: BoardState;
|
|
7
|
-
};
|
|
8
|
-
invalidWords: string[];
|
|
9
|
-
validWords: string[];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const verifyInitialState: VerifyState = {
|
|
13
|
-
isLoading: false,
|
|
14
|
-
lastSolvedParameters: {
|
|
15
|
-
board: boardInitialState,
|
|
16
|
-
},
|
|
17
|
-
invalidWords: [],
|
|
18
|
-
validWords: [],
|
|
19
|
-
};
|
|
File without changes
|