@scrabble-solver/scrabble-solver 2.11.7 → 2.11.9

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.
Files changed (122) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +7 -7
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/eslint/.cache_8dgz12 +1 -1
  5. package/.next/cache/next-server.js.nft.json +1 -1
  6. package/.next/cache/webpack/client-production/0.pack +0 -0
  7. package/.next/cache/webpack/client-production/index.pack +0 -0
  8. package/.next/cache/webpack/edge-server-production/0.pack +0 -0
  9. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  10. package/.next/cache/webpack/server-production/0.pack +0 -0
  11. package/.next/cache/webpack/server-production/index.pack +0 -0
  12. package/.next/next-server.js.nft.json +1 -1
  13. package/.next/prerender-manifest.json +1 -1
  14. package/.next/routes-manifest.json +1 -1
  15. package/.next/server/chunks/131.js +153 -115
  16. package/.next/server/chunks/277.js +1430 -691
  17. package/.next/server/chunks/44.js +3 -0
  18. package/.next/server/chunks/50.js +20 -78
  19. package/.next/server/chunks/865.js +153 -115
  20. package/.next/server/chunks/911.js +14 -14
  21. package/.next/server/middleware-build-manifest.js +1 -1
  22. package/.next/server/pages/404.html +1 -1
  23. package/.next/server/pages/404.js.nft.json +1 -1
  24. package/.next/server/pages/500.html +1 -1
  25. package/.next/server/pages/_app.js +8 -0
  26. package/.next/server/pages/_app.js.nft.json +1 -1
  27. package/.next/server/pages/api/solve.js +44 -11
  28. package/.next/server/pages/index.html +1 -1
  29. package/.next/server/pages/index.js +169 -15
  30. package/.next/server/pages/index.js.nft.json +1 -1
  31. package/.next/server/pages/index.json +1 -1
  32. package/.next/static/9oRWxnZ1xFLSs55FJtiYi/_buildManifest.js +1 -0
  33. package/.next/static/chunks/pages/{404-ca203fa27afc37d8.js → 404-b4b5ce15153d4825.js} +1 -1
  34. package/.next/static/chunks/pages/_app-b0231bed954dd413.js +28 -0
  35. package/.next/static/chunks/pages/index-4e8566409753e1c3.js +1 -0
  36. package/.next/static/css/60e8258da7362a1a.css +1 -0
  37. package/.next/static/css/fcc46fec97b11afc.css +2 -0
  38. package/.next/trace +52 -50
  39. package/package.json +14 -13
  40. package/src/components/Board/Board.module.scss +18 -4
  41. package/src/components/Board/Board.tsx +145 -76
  42. package/src/components/Board/BoardPure.tsx +32 -40
  43. package/src/components/Board/components/Actions/Actions.module.scss +6 -17
  44. package/src/components/Board/components/Actions/Actions.tsx +36 -18
  45. package/src/components/Board/components/Cell/Cell.module.scss +12 -13
  46. package/src/components/Board/components/Cell/Cell.tsx +53 -3
  47. package/src/components/Board/components/InputPrompt/InputPrompt.module.scss +47 -0
  48. package/src/components/Board/components/InputPrompt/InputPrompt.tsx +81 -0
  49. package/src/components/Board/components/InputPrompt/index.ts +1 -0
  50. package/src/components/Board/components/ToggleDirectionButton/ToggleDirectionButton.module.scss +21 -0
  51. package/src/components/Board/components/ToggleDirectionButton/ToggleDirectionButton.tsx +34 -0
  52. package/src/components/Board/components/ToggleDirectionButton/index.ts +1 -0
  53. package/src/components/Board/components/index.ts +2 -0
  54. package/src/components/Board/hooks/index.ts +4 -0
  55. package/src/components/Board/hooks/useBackgroundImage.tsx +13 -9
  56. package/src/components/Board/hooks/useBoardStyle.ts +27 -0
  57. package/src/components/Board/hooks/useFloatingActions.ts +22 -0
  58. package/src/components/Board/hooks/useFloatingFocus.ts +10 -0
  59. package/src/components/Board/hooks/useFloatingInputPrompt.ts +19 -0
  60. package/src/components/Board/hooks/useGrid.ts +19 -2
  61. package/src/components/Key/Key.module.scss +7 -11
  62. package/src/components/NavButtons/NavButtons.tsx +2 -2
  63. package/src/components/Rack/Rack.module.scss +6 -6
  64. package/src/components/Rack/Rack.tsx +102 -24
  65. package/src/components/Rack/components/InputPrompt/InputPrompt.module.scss +22 -0
  66. package/src/components/Rack/components/InputPrompt/InputPrompt.tsx +89 -0
  67. package/src/components/Rack/components/InputPrompt/index.ts +1 -0
  68. package/src/components/Rack/components/RackTile/RackTile.module.scss +11 -0
  69. package/src/components/Rack/{RackTile.tsx → components/RackTile/RackTile.tsx} +59 -9
  70. package/src/components/Rack/components/RackTile/index.ts +1 -0
  71. package/src/components/Rack/components/index.ts +2 -0
  72. package/src/components/Radio/Radio.module.scss +0 -8
  73. package/src/components/Solver/Solver.module.scss +0 -20
  74. package/src/components/Solver/Solver.tsx +2 -4
  75. package/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +2 -10
  76. package/src/components/Solver/components/index.ts +0 -1
  77. package/src/components/Tile/Tile.module.scss +5 -0
  78. package/src/components/Tile/Tile.tsx +8 -6
  79. package/src/components/Tile/TilePure.tsx +8 -0
  80. package/src/hooks/useAppLayout.ts +3 -1
  81. package/src/hooks/useLocalStorage.ts +8 -0
  82. package/src/i18n/de.json +6 -1
  83. package/src/i18n/en.json +6 -1
  84. package/src/i18n/es.json +6 -1
  85. package/src/i18n/fa.json +6 -1
  86. package/src/i18n/fr.json +6 -1
  87. package/src/i18n/pl.json +6 -1
  88. package/src/icons/Keyboard.svg +4 -3
  89. package/src/icons/KeyboardFill.svg +4 -0
  90. package/src/icons/index.ts +1 -0
  91. package/src/lib/extractCharacters.test.ts +26 -0
  92. package/src/lib/extractCharacters.ts +11 -9
  93. package/src/lib/extractCharactersByCase.test.ts +31 -0
  94. package/src/lib/extractCharactersByCase.ts +31 -0
  95. package/src/lib/index.ts +4 -1
  96. package/src/lib/isCtrl.ts +7 -0
  97. package/src/lib/isUpperCase.ts +7 -0
  98. package/src/modals/KeyMapModal/KeyMapModal.tsx +20 -4
  99. package/src/modals/KeyMapModal/components/Mapping/Mapping.module.scss +10 -4
  100. package/src/modals/SettingsModal/SettingsModal.tsx +5 -1
  101. package/src/modals/SettingsModal/components/InputModeSetting/InputModeSetting.module.scss +12 -0
  102. package/src/modals/SettingsModal/components/InputModeSetting/InputModeSetting.tsx +55 -0
  103. package/src/modals/SettingsModal/components/InputModeSetting/index.ts +1 -0
  104. package/src/modals/SettingsModal/components/InputModeSetting/lib.ts +13 -0
  105. package/src/modals/SettingsModal/components/InputModeSetting/types.ts +7 -0
  106. package/src/modals/SettingsModal/components/index.ts +1 -0
  107. package/src/state/localStorage.ts +10 -1
  108. package/src/state/selectors.ts +2 -0
  109. package/src/state/slices/settingsInitialState.ts +4 -1
  110. package/src/state/slices/settingsSlice.ts +6 -1
  111. package/src/styles/mixins.scss +1 -0
  112. package/src/styles/variables.scss +2 -0
  113. package/src/types/index.ts +7 -0
  114. package/.next/static/chunks/pages/_app-e89a3c225b87516a.js +0 -28
  115. package/.next/static/chunks/pages/index-58744f49bf6b891f.js +0 -1
  116. package/.next/static/css/34adfcf12a7d9bb6.css +0 -1
  117. package/.next/static/css/edaeaa48321b4cf2.css +0 -2
  118. package/.next/static/uhB6d-q63uRC6RubwepLq/_buildManifest.js +0 -1
  119. package/src/components/Solver/components/FloatingSolveButton/FloatingSolveButton.module.scss +0 -7
  120. package/src/components/Solver/components/FloatingSolveButton/FloatingSolveButton.tsx +0 -53
  121. package/src/components/Solver/components/FloatingSolveButton/index.ts +0 -1
  122. /package/.next/static/{uhB6d-q63uRC6RubwepLq → 9oRWxnZ1xFLSs55FJtiYi}/_ssgManifest.js +0 -0
@@ -742,6 +742,9 @@ class Config {
742
742
  get boardWidth() {
743
743
  return this.config.boardWidth;
744
744
  }
745
+ get locale() {
746
+ return this.config.locale;
747
+ }
745
748
  get twoCharacterTiles() {
746
749
  return this.config.tiles.filter((tile) => tile.character.length === 2).map((tile) => tile.character);
747
750
  }
@@ -7254,67 +7254,15 @@ module.exports = stringify
7254
7254
 
7255
7255
  // eslint-disable-next-line no-control-regex
7256
7256
  const strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/
7257
- const strEscapeSequencesReplacer = new RegExp(strEscapeSequencesRegExp, 'g')
7258
-
7259
- // Escaped special characters. Use empty strings to fill up unused entries.
7260
- const meta = [
7261
- '\\u0000', '\\u0001', '\\u0002', '\\u0003', '\\u0004',
7262
- '\\u0005', '\\u0006', '\\u0007', '\\b', '\\t',
7263
- '\\n', '\\u000b', '\\f', '\\r', '\\u000e',
7264
- '\\u000f', '\\u0010', '\\u0011', '\\u0012', '\\u0013',
7265
- '\\u0014', '\\u0015', '\\u0016', '\\u0017', '\\u0018',
7266
- '\\u0019', '\\u001a', '\\u001b', '\\u001c', '\\u001d',
7267
- '\\u001e', '\\u001f', '', '', '\\"',
7268
- '', '', '', '', '', '', '', '', '', '',
7269
- '', '', '', '', '', '', '', '', '', '',
7270
- '', '', '', '', '', '', '', '', '', '',
7271
- '', '', '', '', '', '', '', '', '', '',
7272
- '', '', '', '', '', '', '', '', '', '',
7273
- '', '', '', '', '', '', '', '\\\\'
7274
- ]
7275
-
7276
- function escapeFn (str) {
7277
- if (str.length === 2) {
7278
- const charCode = str.charCodeAt(1)
7279
- return `${str[0]}\\u${charCode.toString(16)}`
7280
- }
7281
- const charCode = str.charCodeAt(0)
7282
- return meta.length > charCode
7283
- ? meta[charCode]
7284
- : `\\u${charCode.toString(16)}`
7285
- }
7286
7257
 
7287
7258
  // Escape C0 control characters, double quotes, the backslash and every code
7288
7259
  // unit with a numeric value in the inclusive range 0xD800 to 0xDFFF.
7289
7260
  function strEscape (str) {
7290
7261
  // Some magic numbers that worked out fine while benchmarking with v8 8.0
7291
7262
  if (str.length < 5000 && !strEscapeSequencesRegExp.test(str)) {
7292
- return str
7263
+ return `"${str}"`
7293
7264
  }
7294
- if (str.length > 100) {
7295
- return str.replace(strEscapeSequencesReplacer, escapeFn)
7296
- }
7297
- let result = ''
7298
- let last = 0
7299
- for (let i = 0; i < str.length; i++) {
7300
- const point = str.charCodeAt(i)
7301
- if (point === 34 || point === 92 || point < 32) {
7302
- result += `${str.slice(last, i)}${meta[point]}`
7303
- last = i + 1
7304
- } else if (point >= 0xd800 && point <= 0xdfff) {
7305
- if (point <= 0xdbff && i + 1 < str.length) {
7306
- const nextPoint = str.charCodeAt(i + 1)
7307
- if (nextPoint >= 0xdc00 && nextPoint <= 0xdfff) {
7308
- i++
7309
- continue
7310
- }
7311
- }
7312
- result += `${str.slice(last, i)}\\u${point.toString(16)}`
7313
- last = i + 1
7314
- }
7315
- }
7316
- result += str.slice(last)
7317
- return result
7265
+ return JSON.stringify(str)
7318
7266
  }
7319
7267
 
7320
7268
  function insertSort (array) {
@@ -7470,7 +7418,7 @@ function configure (options) {
7470
7418
 
7471
7419
  switch (typeof value) {
7472
7420
  case 'string':
7473
- return `"${strEscape(value)}"`
7421
+ return strEscape(value)
7474
7422
  case 'object': {
7475
7423
  if (value === null) {
7476
7424
  return 'null'
@@ -7499,11 +7447,11 @@ function configure (options) {
7499
7447
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth)
7500
7448
  let i = 0
7501
7449
  for (; i < maximumValuesToStringify - 1; i++) {
7502
- const tmp = stringifyFnReplacer(i, value, stack, replacer, spacer, indentation)
7450
+ const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)
7503
7451
  res += tmp !== undefined ? tmp : 'null'
7504
7452
  res += join
7505
7453
  }
7506
- const tmp = stringifyFnReplacer(i, value, stack, replacer, spacer, indentation)
7454
+ const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)
7507
7455
  res += tmp !== undefined ? tmp : 'null'
7508
7456
  if (value.length - 1 > maximumBreadth) {
7509
7457
  const removedKeys = value.length - maximumBreadth - 1
@@ -7531,14 +7479,8 @@ function configure (options) {
7531
7479
  join = `,\n${indentation}`
7532
7480
  whitespace = ' '
7533
7481
  }
7534
- let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)
7535
- if (isTypedArrayWithEntries(value)) {
7536
- res += stringifyTypedArray(value, join, maximumBreadth)
7537
- keys = keys.slice(value.length)
7538
- maximumPropertiesToStringify -= value.length
7539
- separator = join
7540
- }
7541
- if (deterministic) {
7482
+ const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)
7483
+ if (deterministic && !isTypedArrayWithEntries(value)) {
7542
7484
  keys = insertSort(keys)
7543
7485
  }
7544
7486
  stack.push(value)
@@ -7546,7 +7488,7 @@ function configure (options) {
7546
7488
  const key = keys[i]
7547
7489
  const tmp = stringifyFnReplacer(key, value, stack, replacer, spacer, indentation)
7548
7490
  if (tmp !== undefined) {
7549
- res += `${separator}"${strEscape(key)}":${whitespace}${tmp}`
7491
+ res += `${separator}${strEscape(key)}:${whitespace}${tmp}`
7550
7492
  separator = join
7551
7493
  }
7552
7494
  }
@@ -7584,7 +7526,7 @@ function configure (options) {
7584
7526
 
7585
7527
  switch (typeof value) {
7586
7528
  case 'string':
7587
- return `"${strEscape(value)}"`
7529
+ return strEscape(value)
7588
7530
  case 'object': {
7589
7531
  if (value === null) {
7590
7532
  return 'null'
@@ -7613,11 +7555,11 @@ function configure (options) {
7613
7555
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth)
7614
7556
  let i = 0
7615
7557
  for (; i < maximumValuesToStringify - 1; i++) {
7616
- const tmp = stringifyArrayReplacer(i, value[i], stack, replacer, spacer, indentation)
7558
+ const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)
7617
7559
  res += tmp !== undefined ? tmp : 'null'
7618
7560
  res += join
7619
7561
  }
7620
- const tmp = stringifyArrayReplacer(i, value[i], stack, replacer, spacer, indentation)
7562
+ const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)
7621
7563
  res += tmp !== undefined ? tmp : 'null'
7622
7564
  if (value.length - 1 > maximumBreadth) {
7623
7565
  const removedKeys = value.length - maximumBreadth - 1
@@ -7640,7 +7582,7 @@ function configure (options) {
7640
7582
  for (const key of replacer) {
7641
7583
  const tmp = stringifyArrayReplacer(key, value[key], stack, replacer, spacer, indentation)
7642
7584
  if (tmp !== undefined) {
7643
- res += `${separator}"${strEscape(key)}":${whitespace}${tmp}`
7585
+ res += `${separator}${strEscape(key)}:${whitespace}${tmp}`
7644
7586
  separator = join
7645
7587
  }
7646
7588
  }
@@ -7669,7 +7611,7 @@ function configure (options) {
7669
7611
  function stringifyIndent (key, value, stack, spacer, indentation) {
7670
7612
  switch (typeof value) {
7671
7613
  case 'string':
7672
- return `"${strEscape(value)}"`
7614
+ return strEscape(value)
7673
7615
  case 'object': {
7674
7616
  if (value === null) {
7675
7617
  return 'null'
@@ -7703,11 +7645,11 @@ function configure (options) {
7703
7645
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth)
7704
7646
  let i = 0
7705
7647
  for (; i < maximumValuesToStringify - 1; i++) {
7706
- const tmp = stringifyIndent(i, value[i], stack, spacer, indentation)
7648
+ const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)
7707
7649
  res += tmp !== undefined ? tmp : 'null'
7708
7650
  res += join
7709
7651
  }
7710
- const tmp = stringifyIndent(i, value[i], stack, spacer, indentation)
7652
+ const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)
7711
7653
  res += tmp !== undefined ? tmp : 'null'
7712
7654
  if (value.length - 1 > maximumBreadth) {
7713
7655
  const removedKeys = value.length - maximumBreadth - 1
@@ -7745,7 +7687,7 @@ function configure (options) {
7745
7687
  const key = keys[i]
7746
7688
  const tmp = stringifyIndent(key, value[key], stack, spacer, indentation)
7747
7689
  if (tmp !== undefined) {
7748
- res += `${separator}"${strEscape(key)}": ${tmp}`
7690
+ res += `${separator}${strEscape(key)}: ${tmp}`
7749
7691
  separator = join
7750
7692
  }
7751
7693
  }
@@ -7779,7 +7721,7 @@ function configure (options) {
7779
7721
  function stringifySimple (key, value, stack) {
7780
7722
  switch (typeof value) {
7781
7723
  case 'string':
7782
- return `"${strEscape(value)}"`
7724
+ return strEscape(value)
7783
7725
  case 'object': {
7784
7726
  if (value === null) {
7785
7727
  return 'null'
@@ -7811,11 +7753,11 @@ function configure (options) {
7811
7753
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth)
7812
7754
  let i = 0
7813
7755
  for (; i < maximumValuesToStringify - 1; i++) {
7814
- const tmp = stringifySimple(i, value[i], stack)
7756
+ const tmp = stringifySimple(String(i), value[i], stack)
7815
7757
  res += tmp !== undefined ? tmp : 'null'
7816
7758
  res += ','
7817
7759
  }
7818
- const tmp = stringifySimple(i, value[i], stack)
7760
+ const tmp = stringifySimple(String(i), value[i], stack)
7819
7761
  res += tmp !== undefined ? tmp : 'null'
7820
7762
  if (value.length - 1 > maximumBreadth) {
7821
7763
  const removedKeys = value.length - maximumBreadth - 1
@@ -7849,7 +7791,7 @@ function configure (options) {
7849
7791
  const key = keys[i]
7850
7792
  const tmp = stringifySimple(key, value[key], stack)
7851
7793
  if (tmp !== undefined) {
7852
- res += `${separator}"${strEscape(key)}":${tmp}`
7794
+ res += `${separator}${strEscape(key)}:${tmp}`
7853
7795
  separator = ','
7854
7796
  }
7855
7797
  }
@@ -9566,10 +9566,10 @@ var Parser = /** @class */ (function () {
9566
9566
  * Entities can be emitted on the character, or directly after.
9567
9567
  * We use the section start here to get accurate indices.
9568
9568
  */
9569
- var idx = this.tokenizer.getSectionStart();
9570
- this.endIndex = idx - 1;
9569
+ var index = this.tokenizer.getSectionStart();
9570
+ this.endIndex = index - 1;
9571
9571
  (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, (0, decode_js_1.fromCodePoint)(cp));
9572
- this.startIndex = idx;
9572
+ this.startIndex = index;
9573
9573
  };
9574
9574
  Parser.prototype.isVoidElement = function (name) {
9575
9575
  return !this.options.xmlMode && voidElements.has(name);
@@ -9591,8 +9591,8 @@ var Parser = /** @class */ (function () {
9591
9591
  if (impliesClose) {
9592
9592
  while (this.stack.length > 0 &&
9593
9593
  impliesClose.has(this.stack[this.stack.length - 1])) {
9594
- var el = this.stack.pop();
9595
- (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, el, true);
9594
+ var element = this.stack.pop();
9595
+ (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, element, true);
9596
9596
  }
9597
9597
  }
9598
9598
  if (!this.isVoidElement(name)) {
@@ -9727,8 +9727,8 @@ var Parser = /** @class */ (function () {
9727
9727
  this.attribvalue = "";
9728
9728
  };
9729
9729
  Parser.prototype.getInstructionName = function (value) {
9730
- var idx = value.search(reNameEnd);
9731
- var name = idx < 0 ? value : value.substr(0, idx);
9730
+ var index = value.search(reNameEnd);
9731
+ var name = index < 0 ? value : value.substr(0, index);
9732
9732
  if (this.lowerCaseTagNames) {
9733
9733
  name = name.toLowerCase();
9734
9734
  }
@@ -9788,7 +9788,7 @@ var Parser = /** @class */ (function () {
9788
9788
  if (this.cbs.onclosetag) {
9789
9789
  // Set the end index for all remaining tags
9790
9790
  this.endIndex = this.startIndex;
9791
- for (var i = this.stack.length; i > 0; this.cbs.onclosetag(this.stack[--i], true))
9791
+ for (var index = this.stack.length; index > 0; this.cbs.onclosetag(this.stack[--index], true))
9792
9792
  ;
9793
9793
  }
9794
9794
  (_b = (_a = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a);
@@ -9826,12 +9826,12 @@ var Parser = /** @class */ (function () {
9826
9826
  while (start - this.bufferOffset >= this.buffers[0].length) {
9827
9827
  this.shiftBuffer();
9828
9828
  }
9829
- var str = this.buffers[0].slice(start - this.bufferOffset, end - this.bufferOffset);
9829
+ var slice = this.buffers[0].slice(start - this.bufferOffset, end - this.bufferOffset);
9830
9830
  while (end - this.bufferOffset > this.buffers[0].length) {
9831
9831
  this.shiftBuffer();
9832
- str += this.buffers[0].slice(0, end - this.bufferOffset);
9832
+ slice += this.buffers[0].slice(0, end - this.bufferOffset);
9833
9833
  }
9834
- return str;
9834
+ return slice;
9835
9835
  };
9836
9836
  Parser.prototype.shiftBuffer = function () {
9837
9837
  this.bufferOffset += this.buffers[0].length;
@@ -9863,7 +9863,7 @@ var Parser = /** @class */ (function () {
9863
9863
  Parser.prototype.end = function (chunk) {
9864
9864
  var _a, _b;
9865
9865
  if (this.ended) {
9866
- (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, Error(".end() after done!"));
9866
+ (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(".end() after done!"));
9867
9867
  return;
9868
9868
  }
9869
9869
  if (chunk)
@@ -9930,7 +9930,7 @@ var CharCodes;
9930
9930
  CharCodes[CharCodes["CarriageReturn"] = 13] = "CarriageReturn";
9931
9931
  CharCodes[CharCodes["Space"] = 32] = "Space";
9932
9932
  CharCodes[CharCodes["ExclamationMark"] = 33] = "ExclamationMark";
9933
- CharCodes[CharCodes["Num"] = 35] = "Num";
9933
+ CharCodes[CharCodes["Number"] = 35] = "Number";
9934
9934
  CharCodes[CharCodes["Amp"] = 38] = "Amp";
9935
9935
  CharCodes[CharCodes["SingleQuote"] = 39] = "SingleQuote";
9936
9936
  CharCodes[CharCodes["DoubleQuote"] = 34] = "DoubleQuote";
@@ -10052,6 +10052,7 @@ var Tokenizer = /** @class */ (function () {
10052
10052
  this.running = true;
10053
10053
  /** The offset of the current buffer. */
10054
10054
  this.offset = 0;
10055
+ this.currentSequence = undefined;
10055
10056
  this.sequenceIndex = 0;
10056
10057
  this.trieIndex = 0;
10057
10058
  this.trieCurrent = 0;
@@ -10320,6 +10321,7 @@ var Tokenizer = /** @class */ (function () {
10320
10321
  // Skip everything until ">"
10321
10322
  if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
10322
10323
  this.state = State.Text;
10324
+ this.baseState = State.Text;
10323
10325
  this.sectionStart = this.index + 1;
10324
10326
  }
10325
10327
  };
@@ -10491,7 +10493,7 @@ var Tokenizer = /** @class */ (function () {
10491
10493
  // Start excess with 1 to include the '&'
10492
10494
  this.entityExcess = 1;
10493
10495
  this.entityResult = 0;
10494
- if (c === CharCodes.Num) {
10496
+ if (c === CharCodes.Number) {
10495
10497
  this.state = State.BeforeNumericEntity;
10496
10498
  }
10497
10499
  else if (c === CharCodes.Amp) {
@@ -10547,13 +10549,15 @@ var Tokenizer = /** @class */ (function () {
10547
10549
  var valueLength = (this.entityTrie[this.entityResult] & decode_js_1.BinTrieFlags.VALUE_LENGTH) >>
10548
10550
  14;
10549
10551
  switch (valueLength) {
10550
- case 1:
10552
+ case 1: {
10551
10553
  this.emitCodePoint(this.entityTrie[this.entityResult] &
10552
10554
  ~decode_js_1.BinTrieFlags.VALUE_LENGTH);
10553
10555
  break;
10554
- case 2:
10556
+ }
10557
+ case 2: {
10555
10558
  this.emitCodePoint(this.entityTrie[this.entityResult + 1]);
10556
10559
  break;
10560
+ }
10557
10561
  case 3: {
10558
10562
  this.emitCodePoint(this.entityTrie[this.entityResult + 1]);
10559
10563
  this.emitCodePoint(this.entityTrie[this.entityResult + 2]);
@@ -10659,93 +10663,123 @@ var Tokenizer = /** @class */ (function () {
10659
10663
  Tokenizer.prototype.parse = function () {
10660
10664
  while (this.shouldContinue()) {
10661
10665
  var c = this.buffer.charCodeAt(this.index - this.offset);
10662
- if (this.state === State.Text) {
10663
- this.stateText(c);
10664
- }
10665
- else if (this.state === State.SpecialStartSequence) {
10666
- this.stateSpecialStartSequence(c);
10667
- }
10668
- else if (this.state === State.InSpecialTag) {
10669
- this.stateInSpecialTag(c);
10670
- }
10671
- else if (this.state === State.CDATASequence) {
10672
- this.stateCDATASequence(c);
10673
- }
10674
- else if (this.state === State.InAttributeValueDq) {
10675
- this.stateInAttributeValueDoubleQuotes(c);
10676
- }
10677
- else if (this.state === State.InAttributeName) {
10678
- this.stateInAttributeName(c);
10679
- }
10680
- else if (this.state === State.InCommentLike) {
10681
- this.stateInCommentLike(c);
10682
- }
10683
- else if (this.state === State.InSpecialComment) {
10684
- this.stateInSpecialComment(c);
10685
- }
10686
- else if (this.state === State.BeforeAttributeName) {
10687
- this.stateBeforeAttributeName(c);
10688
- }
10689
- else if (this.state === State.InTagName) {
10690
- this.stateInTagName(c);
10691
- }
10692
- else if (this.state === State.InClosingTagName) {
10693
- this.stateInClosingTagName(c);
10694
- }
10695
- else if (this.state === State.BeforeTagName) {
10696
- this.stateBeforeTagName(c);
10697
- }
10698
- else if (this.state === State.AfterAttributeName) {
10699
- this.stateAfterAttributeName(c);
10700
- }
10701
- else if (this.state === State.InAttributeValueSq) {
10702
- this.stateInAttributeValueSingleQuotes(c);
10703
- }
10704
- else if (this.state === State.BeforeAttributeValue) {
10705
- this.stateBeforeAttributeValue(c);
10706
- }
10707
- else if (this.state === State.BeforeClosingTagName) {
10708
- this.stateBeforeClosingTagName(c);
10709
- }
10710
- else if (this.state === State.AfterClosingTagName) {
10711
- this.stateAfterClosingTagName(c);
10712
- }
10713
- else if (this.state === State.BeforeSpecialS) {
10714
- this.stateBeforeSpecialS(c);
10715
- }
10716
- else if (this.state === State.InAttributeValueNq) {
10717
- this.stateInAttributeValueNoQuotes(c);
10718
- }
10719
- else if (this.state === State.InSelfClosingTag) {
10720
- this.stateInSelfClosingTag(c);
10721
- }
10722
- else if (this.state === State.InDeclaration) {
10723
- this.stateInDeclaration(c);
10724
- }
10725
- else if (this.state === State.BeforeDeclaration) {
10726
- this.stateBeforeDeclaration(c);
10727
- }
10728
- else if (this.state === State.BeforeComment) {
10729
- this.stateBeforeComment(c);
10730
- }
10731
- else if (this.state === State.InProcessingInstruction) {
10732
- this.stateInProcessingInstruction(c);
10733
- }
10734
- else if (this.state === State.InNamedEntity) {
10735
- this.stateInNamedEntity(c);
10736
- }
10737
- else if (this.state === State.BeforeEntity) {
10738
- this.stateBeforeEntity(c);
10739
- }
10740
- else if (this.state === State.InHexEntity) {
10741
- this.stateInHexEntity(c);
10742
- }
10743
- else if (this.state === State.InNumericEntity) {
10744
- this.stateInNumericEntity(c);
10745
- }
10746
- else {
10747
- // `this._state === State.BeforeNumericEntity`
10748
- this.stateBeforeNumericEntity(c);
10666
+ switch (this.state) {
10667
+ case State.Text: {
10668
+ this.stateText(c);
10669
+ break;
10670
+ }
10671
+ case State.SpecialStartSequence: {
10672
+ this.stateSpecialStartSequence(c);
10673
+ break;
10674
+ }
10675
+ case State.InSpecialTag: {
10676
+ this.stateInSpecialTag(c);
10677
+ break;
10678
+ }
10679
+ case State.CDATASequence: {
10680
+ this.stateCDATASequence(c);
10681
+ break;
10682
+ }
10683
+ case State.InAttributeValueDq: {
10684
+ this.stateInAttributeValueDoubleQuotes(c);
10685
+ break;
10686
+ }
10687
+ case State.InAttributeName: {
10688
+ this.stateInAttributeName(c);
10689
+ break;
10690
+ }
10691
+ case State.InCommentLike: {
10692
+ this.stateInCommentLike(c);
10693
+ break;
10694
+ }
10695
+ case State.InSpecialComment: {
10696
+ this.stateInSpecialComment(c);
10697
+ break;
10698
+ }
10699
+ case State.BeforeAttributeName: {
10700
+ this.stateBeforeAttributeName(c);
10701
+ break;
10702
+ }
10703
+ case State.InTagName: {
10704
+ this.stateInTagName(c);
10705
+ break;
10706
+ }
10707
+ case State.InClosingTagName: {
10708
+ this.stateInClosingTagName(c);
10709
+ break;
10710
+ }
10711
+ case State.BeforeTagName: {
10712
+ this.stateBeforeTagName(c);
10713
+ break;
10714
+ }
10715
+ case State.AfterAttributeName: {
10716
+ this.stateAfterAttributeName(c);
10717
+ break;
10718
+ }
10719
+ case State.InAttributeValueSq: {
10720
+ this.stateInAttributeValueSingleQuotes(c);
10721
+ break;
10722
+ }
10723
+ case State.BeforeAttributeValue: {
10724
+ this.stateBeforeAttributeValue(c);
10725
+ break;
10726
+ }
10727
+ case State.BeforeClosingTagName: {
10728
+ this.stateBeforeClosingTagName(c);
10729
+ break;
10730
+ }
10731
+ case State.AfterClosingTagName: {
10732
+ this.stateAfterClosingTagName(c);
10733
+ break;
10734
+ }
10735
+ case State.BeforeSpecialS: {
10736
+ this.stateBeforeSpecialS(c);
10737
+ break;
10738
+ }
10739
+ case State.InAttributeValueNq: {
10740
+ this.stateInAttributeValueNoQuotes(c);
10741
+ break;
10742
+ }
10743
+ case State.InSelfClosingTag: {
10744
+ this.stateInSelfClosingTag(c);
10745
+ break;
10746
+ }
10747
+ case State.InDeclaration: {
10748
+ this.stateInDeclaration(c);
10749
+ break;
10750
+ }
10751
+ case State.BeforeDeclaration: {
10752
+ this.stateBeforeDeclaration(c);
10753
+ break;
10754
+ }
10755
+ case State.BeforeComment: {
10756
+ this.stateBeforeComment(c);
10757
+ break;
10758
+ }
10759
+ case State.InProcessingInstruction: {
10760
+ this.stateInProcessingInstruction(c);
10761
+ break;
10762
+ }
10763
+ case State.InNamedEntity: {
10764
+ this.stateInNamedEntity(c);
10765
+ break;
10766
+ }
10767
+ case State.BeforeEntity: {
10768
+ this.stateBeforeEntity(c);
10769
+ break;
10770
+ }
10771
+ case State.InHexEntity: {
10772
+ this.stateInHexEntity(c);
10773
+ break;
10774
+ }
10775
+ case State.InNumericEntity: {
10776
+ this.stateInNumericEntity(c);
10777
+ break;
10778
+ }
10779
+ default: {
10780
+ // `this._state === State.BeforeNumericEntity`
10781
+ this.stateBeforeNumericEntity(c);
10782
+ }
10749
10783
  }
10750
10784
  this.index++;
10751
10785
  }
@@ -10857,12 +10891,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
10857
10891
  return (mod && mod.__esModule) ? mod : { "default": mod };
10858
10892
  };
10859
10893
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10860
- exports.DefaultHandler = exports.DomUtils = exports.parseFeed = exports.getFeed = exports.ElementType = exports.Tokenizer = exports.createDomStream = exports.parseDOM = exports.parseDocument = exports.DomHandler = exports.Parser = void 0;
10894
+ exports.DomUtils = exports.parseFeed = exports.getFeed = exports.ElementType = exports.Tokenizer = exports.createDomStream = exports.parseDOM = exports.parseDocument = exports.DefaultHandler = exports.DomHandler = exports.Parser = void 0;
10861
10895
  var Parser_js_1 = __webpack_require__(45625);
10862
- Object.defineProperty(exports, "Parser", ({ enumerable: true, get: function () { return Parser_js_1.Parser; } }));
10896
+ var Parser_js_2 = __webpack_require__(45625);
10897
+ Object.defineProperty(exports, "Parser", ({ enumerable: true, get: function () { return Parser_js_2.Parser; } }));
10863
10898
  var domhandler_1 = __webpack_require__(67122);
10864
- Object.defineProperty(exports, "DomHandler", ({ enumerable: true, get: function () { return domhandler_1.DomHandler; } }));
10865
- Object.defineProperty(exports, "DefaultHandler", ({ enumerable: true, get: function () { return domhandler_1.DomHandler; } }));
10899
+ var domhandler_2 = __webpack_require__(67122);
10900
+ Object.defineProperty(exports, "DomHandler", ({ enumerable: true, get: function () { return domhandler_2.DomHandler; } }));
10901
+ // Old name for DomHandler
10902
+ Object.defineProperty(exports, "DefaultHandler", ({ enumerable: true, get: function () { return domhandler_2.DomHandler; } }));
10866
10903
  // Helper methods
10867
10904
  /**
10868
10905
  * Parses the data, returns the resulting document.
@@ -10893,12 +10930,12 @@ exports.parseDOM = parseDOM;
10893
10930
  /**
10894
10931
  * Creates a parser instance, with an attached DOM handler.
10895
10932
  *
10896
- * @param cb A callback that will be called once parsing has been completed.
10933
+ * @param callback A callback that will be called once parsing has been completed.
10897
10934
  * @param options Optional options for the parser and DOM builder.
10898
- * @param elementCb An optional callback that will be called every time a tag has been completed inside of the DOM.
10935
+ * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM.
10899
10936
  */
10900
- function createDomStream(cb, options, elementCb) {
10901
- var handler = new domhandler_1.DomHandler(cb, options, elementCb);
10937
+ function createDomStream(callback, options, elementCallback) {
10938
+ var handler = new domhandler_1.DomHandler(callback, options, elementCallback);
10902
10939
  return new Parser_js_1.Parser(handler, options);
10903
10940
  }
10904
10941
  exports.createDomStream = createDomStream;
@@ -10908,10 +10945,11 @@ Object.defineProperty(exports, "Tokenizer", ({ enumerable: true, get: function (
10908
10945
  * All of the following exports exist for backwards-compatibility.
10909
10946
  * They should probably be removed eventually.
10910
10947
  */
10911
- var ElementType = __importStar(__webpack_require__(18534));
10912
- exports.ElementType = ElementType;
10948
+ exports.ElementType = __importStar(__webpack_require__(18534));
10913
10949
  var domutils_1 = __webpack_require__(10616);
10914
- Object.defineProperty(exports, "getFeed", ({ enumerable: true, get: function () { return domutils_1.getFeed; } }));
10950
+ var domutils_2 = __webpack_require__(10616);
10951
+ Object.defineProperty(exports, "getFeed", ({ enumerable: true, get: function () { return domutils_2.getFeed; } }));
10952
+ var parseFeedDefaultOptions = { xmlMode: true };
10915
10953
  /**
10916
10954
  * Parse a feed.
10917
10955
  *
@@ -10919,7 +10957,7 @@ Object.defineProperty(exports, "getFeed", ({ enumerable: true, get: function ()
10919
10957
  * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`.
10920
10958
  */
10921
10959
  function parseFeed(feed, options) {
10922
- if (options === void 0) { options = { xmlMode: true }; }
10960
+ if (options === void 0) { options = parseFeedDefaultOptions; }
10923
10961
  return (0, domutils_1.getFeed)(parseDOM(feed, options));
10924
10962
  }
10925
10963
  exports.parseFeed = parseFeed;
@@ -231,13 +231,13 @@ const base = {
231
231
  const literaki = {
232
232
  id: base.id,
233
233
  name: base.name,
234
- [types_1.Locale.DE_DE]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesDe }),
235
- [types_1.Locale.EN_GB]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesEn }),
236
- [types_1.Locale.EN_US]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesEn }),
237
- [types_1.Locale.ES_ES]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesEs }),
238
- [types_1.Locale.FA_IR]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesFa }),
239
- [types_1.Locale.FR_FR]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesFr }),
240
- [types_1.Locale.PL_PL]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesPl }),
234
+ [types_1.Locale.DE_DE]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.EN_GB, tiles: tiles_1.tilesDe }),
235
+ [types_1.Locale.EN_GB]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.DE_DE, tiles: tiles_1.tilesEn }),
236
+ [types_1.Locale.EN_US]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.EN_US, tiles: tiles_1.tilesEn }),
237
+ [types_1.Locale.ES_ES]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.ES_ES, tiles: tiles_1.tilesEs }),
238
+ [types_1.Locale.FA_IR]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.FA_IR, tiles: tiles_1.tilesFa }),
239
+ [types_1.Locale.FR_FR]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.FR_FR, tiles: tiles_1.tilesFr }),
240
+ [types_1.Locale.PL_PL]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.PL_PL, tiles: tiles_1.tilesPl }),
241
241
  };
242
242
  exports["default"] = literaki;
243
243
 
@@ -628,13 +628,13 @@ const base = {
628
628
  const scrabble = {
629
629
  id: base.id,
630
630
  name: base.name,
631
- [types_1.Locale.EN_GB]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesEn }),
632
- [types_1.Locale.DE_DE]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesDe }),
633
- [types_1.Locale.EN_US]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesEn }),
634
- [types_1.Locale.ES_ES]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesEs }),
635
- [types_1.Locale.FA_IR]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesFa }),
636
- [types_1.Locale.FR_FR]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesFr }),
637
- [types_1.Locale.PL_PL]: types_1.Config.fromJson({ ...base, tiles: tiles_1.tilesPl }),
631
+ [types_1.Locale.EN_GB]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.EN_GB, tiles: tiles_1.tilesEn }),
632
+ [types_1.Locale.DE_DE]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.DE_DE, tiles: tiles_1.tilesDe }),
633
+ [types_1.Locale.EN_US]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.EN_US, tiles: tiles_1.tilesEn }),
634
+ [types_1.Locale.ES_ES]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.ES_ES, tiles: tiles_1.tilesEs }),
635
+ [types_1.Locale.FA_IR]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.FA_IR, tiles: tiles_1.tilesFa }),
636
+ [types_1.Locale.FR_FR]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.FR_FR, tiles: tiles_1.tilesFr }),
637
+ [types_1.Locale.PL_PL]: types_1.Config.fromJson({ ...base, locale: types_1.Locale.PL_PL, tiles: tiles_1.tilesPl }),
638
638
  };
639
639
  exports["default"] = scrabble;
640
640