@pokepc/dataset 6.7.0 → 6.8.0

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 (205) hide show
  1. package/README.md +15 -3
  2. package/build/{box-preset-sanitizer-DHGv5TJj.mjs → box-preset-sanitizer-CmgPzVjb.mjs} +2 -2
  3. package/build/{box-preset-sanitizer-DHGv5TJj.mjs.map → box-preset-sanitizer-CmgPzVjb.mjs.map} +1 -1
  4. package/build/{build-DvGzwIK8.mjs → build-D2oPkkzJ.mjs} +52 -52
  5. package/build/{build-DvGzwIK8.mjs.map → build-D2oPkkzJ.mjs.map} +1 -1
  6. package/build/{enums-DlMg7WLl.mjs → enums-u8n-nN0B.mjs} +5 -2
  7. package/build/enums-u8n-nN0B.mjs.map +1 -0
  8. package/build/lib/box-preset-sanitizer.mjs +1 -1
  9. package/build/lib/box-preset-transform.mjs +2 -2
  10. package/build/lib/fs.d.mts +6 -6
  11. package/build/lib/fs.d.mts.map +1 -1
  12. package/build/lib/fs.mjs +21 -29
  13. package/build/lib/fs.mjs.map +1 -1
  14. package/build/lib/schemas.d.mts +1 -1
  15. package/build/lib/schemas.mjs +1 -1
  16. package/build/lib/search.d.mts +2 -0
  17. package/build/lib/search.d.mts.map +1 -1
  18. package/build/lib/search.mjs +3 -3
  19. package/build/lib/search.mjs.map +1 -1
  20. package/build/lib/types.d.mts +1 -1
  21. package/build/lib/utils.d.mts +2 -0
  22. package/build/lib/utils.d.mts.map +1 -1
  23. package/build/lib/utils.mjs +3 -2
  24. package/build/lib-next/_build.mjs +1 -1
  25. package/build/lib-next/enums.d.mts.map +1 -1
  26. package/build/lib-next/enums.mjs +1 -1
  27. package/build/lib-next/schemas.d.mts +8 -8
  28. package/build/lib-next/schemas.mjs +1 -1
  29. package/build/{schemas-Bj1AIX0P.mjs → schemas-CWE4YPI2.mjs} +2 -2
  30. package/build/{schemas-Bj1AIX0P.mjs.map → schemas-CWE4YPI2.mjs.map} +1 -1
  31. package/build/{schemas-CcUqoHNr.mjs → schemas-DvWBehAR.mjs} +5 -1
  32. package/build/schemas-DvWBehAR.mjs.map +1 -0
  33. package/build/{schemas-CDSWgtoj.d.mts → schemas-jxei_N2z.d.mts} +54 -48
  34. package/build/schemas-jxei_N2z.d.mts.map +1 -0
  35. package/build/{utils-BwovRocd.mjs → utils-BTjKkD-_.mjs} +2 -2
  36. package/build/utils-BTjKkD-_.mjs.map +1 -0
  37. package/build/utils-internal-C-UStMrZ.d.mts +7 -0
  38. package/build/utils-internal-C-UStMrZ.d.mts.map +1 -0
  39. package/build/{utils-internal-Czgdbnkv.mjs → utils-internal-DPjO9kQX.mjs} +7 -2
  40. package/build/{utils-internal-Czgdbnkv.mjs.map → utils-internal-DPjO9kQX.mjs.map} +1 -1
  41. package/data/games/b2w2-b2.json +4 -0
  42. package/data/games/b2w2-w2.json +4 -0
  43. package/data/games/b2w2.json +4 -0
  44. package/data/games/bdsp-bd.json +4 -0
  45. package/data/games/bdsp-sp.json +4 -0
  46. package/data/games/bdsp.json +4 -0
  47. package/data/games/bw-b.json +4 -0
  48. package/data/games/bw-w.json +4 -0
  49. package/data/games/bw.json +4 -0
  50. package/data/games/bwb2w2.json +4 -0
  51. package/data/games/c.json +4 -0
  52. package/data/games/champions.json +4 -0
  53. package/data/games/col.json +4 -0
  54. package/data/games/dp-d.json +4 -0
  55. package/data/games/dp-p.json +4 -0
  56. package/data/games/dp.json +4 -0
  57. package/data/games/dppt.json +4 -0
  58. package/data/games/e.json +4 -0
  59. package/data/games/frlg-fr.json +4 -0
  60. package/data/games/frlg-lg.json +4 -0
  61. package/data/games/frlg.json +4 -0
  62. package/data/games/go.json +4 -0
  63. package/data/games/gs-g.json +4 -0
  64. package/data/games/gs-s.json +4 -0
  65. package/data/games/gs.json +4 -0
  66. package/data/games/gsc.json +4 -0
  67. package/data/games/hgss-hg.json +4 -0
  68. package/data/games/hgss-ss.json +4 -0
  69. package/data/games/hgss.json +4 -0
  70. package/data/games/home.json +4 -0
  71. package/data/games/la.json +4 -0
  72. package/data/games/lgpe-lge.json +4 -0
  73. package/data/games/lgpe-lgp.json +4 -0
  74. package/data/games/lgpe.json +4 -0
  75. package/data/games/lza-megadimension.json +4 -0
  76. package/data/games/lza.json +4 -0
  77. package/data/games/oras-as.json +4 -0
  78. package/data/games/oras-or.json +4 -0
  79. package/data/games/oras.json +4 -0
  80. package/data/games/pokopia-bubblybasin.json +4 -0
  81. package/data/games/pokopia.json +4 -0
  82. package/data/games/pt.json +4 -0
  83. package/data/games/rb-b.json +4 -0
  84. package/data/games/rb-r.json +4 -0
  85. package/data/games/rb.json +4 -0
  86. package/data/games/rby.json +4 -0
  87. package/data/games/rs-r.json +4 -0
  88. package/data/games/rs-s.json +4 -0
  89. package/data/games/rs.json +4 -0
  90. package/data/games/rse.json +4 -0
  91. package/data/games/sm-m.json +4 -0
  92. package/data/games/sm-s.json +4 -0
  93. package/data/games/sm.json +4 -0
  94. package/data/games/smusum.json +4 -0
  95. package/data/games/sv-indigodisk.json +4 -0
  96. package/data/games/sv-s.json +4 -0
  97. package/data/games/sv-tealmask.json +4 -0
  98. package/data/games/sv-v.json +4 -0
  99. package/data/games/sv.json +4 -0
  100. package/data/games/swsh-crowntundra.json +4 -0
  101. package/data/games/swsh-islearmor.json +4 -0
  102. package/data/games/swsh-sh.json +4 -0
  103. package/data/games/swsh-sw.json +4 -0
  104. package/data/games/swsh.json +4 -0
  105. package/data/games/usum-um.json +4 -0
  106. package/data/games/usum-us.json +4 -0
  107. package/data/games/usum.json +4 -0
  108. package/data/games/wiwa-wa.json +4 -0
  109. package/data/games/wiwa-wi.json +4 -0
  110. package/data/games/wiwa.json +4 -0
  111. package/data/games/xd.json +4 -0
  112. package/data/games/xy-x.json +4 -0
  113. package/data/games/xy-y.json +4 -0
  114. package/data/games/xy.json +4 -0
  115. package/data/games/y.json +4 -0
  116. package/data/pokedexes/hoenn-oras.json +12 -0
  117. package/data/pokedexes/kanto-lgpe.json +11 -0
  118. package/data/pokedexes/national-oras.json +27 -0
  119. package/data/pokemon/abomasnow-mega.json +1 -1
  120. package/data/pokemon/aggron-mega.json +1 -1
  121. package/data/pokemon/ampharos-mega.json +1 -1
  122. package/data/pokemon/blastoise-mega.json +12 -1
  123. package/data/pokemon/blaziken-mega.json +1 -1
  124. package/data/pokemon/charizard-mega-x.json +12 -2
  125. package/data/pokemon/charizard-mega-y.json +12 -2
  126. package/data/pokemon/gengar-mega.json +1 -1
  127. package/data/pokemon/heracross-mega.json +1 -1
  128. package/data/pokemon/houndoom-mega.json +1 -1
  129. package/data/pokemon/kangaskhan-mega.json +1 -1
  130. package/data/pokemon/lucario-mega.json +1 -1
  131. package/data/pokemon/manectric-mega.json +1 -1
  132. package/data/pokemon/mawile-mega.json +2 -1
  133. package/data/pokemon/mewtwo-mega-x.json +10 -1
  134. package/data/pokemon/mewtwo-mega-y.json +10 -1
  135. package/data/pokemon/pinsir-mega.json +1 -1
  136. package/data/pokemon/sableye-mega.json +1 -1
  137. package/data/pokemon/scizor-mega.json +1 -1
  138. package/data/pokemon/tyranitar-mega.json +1 -1
  139. package/data/pokemon/venusaur-mega.json +12 -1
  140. package/data-next/champions/abilities.json +117 -5
  141. package/data-next/champions/battle-states.json +24 -3
  142. package/data-next/champions/i18n/chs/abilities.json +104 -6
  143. package/data-next/champions/i18n/chs/battle-states.json +24 -3
  144. package/data-next/champions/i18n/chs/items.json +144 -0
  145. package/data-next/champions/i18n/chs/moves.json +25 -25
  146. package/data-next/champions/i18n/chs/pokemon.json +195 -0
  147. package/data-next/champions/i18n/cht/abilities.json +105 -7
  148. package/data-next/champions/i18n/cht/battle-states.json +24 -3
  149. package/data-next/champions/i18n/cht/items.json +144 -0
  150. package/data-next/champions/i18n/cht/moves.json +25 -25
  151. package/data-next/champions/i18n/cht/pokemon.json +195 -0
  152. package/data-next/champions/i18n/deu/abilities.json +105 -7
  153. package/data-next/champions/i18n/deu/battle-states.json +24 -3
  154. package/data-next/champions/i18n/deu/items.json +144 -0
  155. package/data-next/champions/i18n/deu/moves.json +28 -28
  156. package/data-next/champions/i18n/deu/pokemon.json +195 -0
  157. package/data-next/champions/i18n/eng/abilities.json +102 -4
  158. package/data-next/champions/i18n/eng/battle-states.json +24 -3
  159. package/data-next/champions/i18n/eng/items.json +144 -0
  160. package/data-next/champions/i18n/eng/moves.json +25 -25
  161. package/data-next/champions/i18n/eng/pokemon.json +195 -0
  162. package/data-next/champions/i18n/es-es/abilities.json +106 -8
  163. package/data-next/champions/i18n/es-es/battle-states.json +24 -3
  164. package/data-next/champions/i18n/es-es/items.json +145 -1
  165. package/data-next/champions/i18n/es-es/moves.json +25 -25
  166. package/data-next/champions/i18n/es-es/pokemon.json +195 -0
  167. package/data-next/champions/i18n/es-la/abilities.json +106 -8
  168. package/data-next/champions/i18n/es-la/battle-states.json +24 -3
  169. package/data-next/champions/i18n/es-la/items.json +145 -1
  170. package/data-next/champions/i18n/es-la/moves.json +26 -26
  171. package/data-next/champions/i18n/es-la/pokemon.json +195 -0
  172. package/data-next/champions/i18n/fra/abilities.json +105 -7
  173. package/data-next/champions/i18n/fra/battle-states.json +24 -3
  174. package/data-next/champions/i18n/fra/items.json +144 -0
  175. package/data-next/champions/i18n/fra/moves.json +25 -25
  176. package/data-next/champions/i18n/fra/pokemon.json +195 -0
  177. package/data-next/champions/i18n/ita/abilities.json +116 -18
  178. package/data-next/champions/i18n/ita/battle-states.json +24 -3
  179. package/data-next/champions/i18n/ita/items.json +145 -1
  180. package/data-next/champions/i18n/ita/moves.json +28 -28
  181. package/data-next/champions/i18n/ita/pokemon.json +195 -0
  182. package/data-next/champions/i18n/jpn/abilities.json +104 -6
  183. package/data-next/champions/i18n/jpn/battle-states.json +24 -3
  184. package/data-next/champions/i18n/jpn/items.json +144 -0
  185. package/data-next/champions/i18n/jpn/moves.json +25 -25
  186. package/data-next/champions/i18n/jpn/pokemon.json +195 -0
  187. package/data-next/champions/i18n/kor/abilities.json +104 -6
  188. package/data-next/champions/i18n/kor/battle-states.json +24 -3
  189. package/data-next/champions/i18n/kor/items.json +144 -0
  190. package/data-next/champions/i18n/kor/moves.json +25 -25
  191. package/data-next/champions/i18n/kor/pokemon.json +195 -0
  192. package/data-next/champions/i18n/pt-br/abilities.json +102 -4
  193. package/data-next/champions/i18n/pt-br/battle-states.json +24 -3
  194. package/data-next/champions/i18n/pt-br/items.json +144 -0
  195. package/data-next/champions/i18n/pt-br/moves.json +25 -25
  196. package/data-next/champions/i18n/pt-br/pokemon.json +195 -0
  197. package/data-next/champions/items.json +180 -0
  198. package/data-next/champions/moves.json +61 -61
  199. package/data-next/champions/pokemon-moves.json +1882 -173
  200. package/data-next/champions/pokemon.json +913 -21
  201. package/package.json +17 -9
  202. package/build/enums-DlMg7WLl.mjs.map +0 -1
  203. package/build/schemas-CDSWgtoj.d.mts.map +0 -1
  204. package/build/schemas-CcUqoHNr.mjs.map +0 -1
  205. package/build/utils-BwovRocd.mjs.map +0 -1
@@ -170,7 +170,10 @@ const battleStates = [
170
170
  "minimized",
171
171
  "atk_def_swapped",
172
172
  "flash_fire",
173
- "micle_berry"
173
+ "micle_berry",
174
+ "octolocked",
175
+ "wide_open",
176
+ "jaw_locked"
174
177
  ];
175
178
  const itemCategories = [
176
179
  "power_boost",
@@ -260,4 +263,4 @@ const raidStyles = ["dynamax", "tera"];
260
263
  //#endregion
261
264
  export { raidStyles as _, gameSeries as a, statusConditions as b, itemCategories as c, moveClasses as d, moveTargets as f, pokemonTypesInternalOrder as g, pokemonTypes as h, gamePlatforms as i, ivJudgeValues as l, pokemonSizes as m, battleStates as n, gameTypes as o, pokeballCategories as p, battleStyles as r, genders as s, bagCategories as t, moveCategories as u, ribbonCategories as v, titleTypes as x, statIds as y };
262
265
 
263
- //# sourceMappingURL=enums-DlMg7WLl.mjs.map
266
+ //# sourceMappingURL=enums-u8n-nN0B.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums-u8n-nN0B.mjs","names":[],"sources":["../src/lib-next/enums.ts"],"sourcesContent":["export const gameTypes = ['superset', 'set', 'game', 'dlc'] as const\nexport type GameType = (typeof gameTypes)[number]\n\nexport const gameSeries = ['main', 'spinoff', 'storage', 'legends'] as const\nexport type GameSeries = (typeof gameSeries)[number]\n\nexport const gamePlatforms = [\n 'gb',\n 'gbc',\n 'gba',\n 'nds',\n '3ds',\n 'mobile',\n 'ngc',\n 'wii',\n 'wiiu',\n 'switch',\n 'switch2',\n] as const\nexport type GamePlatform = (typeof gamePlatforms)[number]\n\nexport const pokemonTypes = [\n 'normal',\n 'fire',\n 'water',\n 'electric',\n 'grass',\n 'ice',\n 'fighting',\n 'poison',\n 'ground',\n 'flying',\n 'psychic',\n 'bug',\n 'rock',\n 'ghost',\n 'dragon',\n 'dark',\n 'steel',\n 'fairy',\n] as const\n\nexport const pokemonTypesInternalOrder: PokemonType[] = [\n 'normal',\n 'fighting',\n 'flying',\n 'poison',\n 'ground',\n 'rock',\n 'bug',\n 'ghost',\n 'steel',\n 'fire',\n 'water',\n 'grass',\n 'electric',\n 'psychic',\n 'ice',\n 'dragon',\n 'dark',\n 'fairy',\n]\nexport type PokemonType = (typeof pokemonTypes)[number]\n\nexport const moveCategories = ['physical', 'special', 'status'] as const\nexport type MoveCategory = (typeof moveCategories)[number]\n\nexport const moveClasses = [\n 'punching',\n 'sound_based',\n 'dance',\n 'slicing',\n 'wind',\n 'powder',\n 'ball_bomb',\n 'pulse',\n 'biting',\n 'explosive',\n 'mental',\n 'healing',\n] as const\nexport type MoveClass = (typeof moveClasses)[number]\n\nexport const moveTargets = [\n 'single_target',\n 'self',\n 'single_ally',\n 'all_allies',\n 'random_opponent',\n 'all_opponents',\n 'entire_field',\n 'opponents_side',\n 'users_side',\n 'all_pokemon',\n 'varies',\n] as const\nexport type MoveTarget = (typeof moveTargets)[number]\n\nexport const statusConditions = [\n 'paralyzed',\n 'frozen',\n 'poisoned',\n 'badly_poisoned',\n 'burned',\n 'asleep',\n] as const\nexport type StatusCondition = (typeof statusConditions)[number]\n\nexport const battleStates = [\n 'harsh_sunlight',\n 'rain',\n 'sandstorm',\n 'snow',\n 'electric_terrain',\n 'grassy_terrain',\n 'misty_terrain',\n 'trick_room',\n 'magic_room',\n 'wonder_room',\n 'critical_hit_ratio_boost',\n 'confused',\n 'infatuated',\n 'drowsy',\n 'encore',\n 'no_ability',\n 'unable_to_repeat',\n 'tailwind',\n 'move_disabled',\n 'cant_escape',\n 'locked_on',\n 'electric_boost',\n 'gravity',\n 'safeguard',\n 'stealth_rock',\n 'stockpiling',\n 'taunted',\n 'magnet_rise',\n 'toxic_spikes',\n 'wish',\n 'sticky_web',\n 'ingrained',\n 'cursed',\n 'trick_or_treating',\n 'light_screen',\n 'reflect',\n 'sealing_off',\n 'perishing',\n 'spikes',\n 'destiny_bound',\n 'forest_cursed',\n 'leech_seeded',\n 'bound',\n 'rampaging',\n 'badly_poisoned',\n 'future_attack',\n 'uproar',\n 'aqua_ring',\n 'landed',\n 'fairy_locked',\n 'psychic_terrain',\n 'throat_chopped',\n 'aurora_veil',\n 'salt_cured',\n 'syrupy',\n 'healing_prevented',\n 'recharging',\n 'charging',\n 'sky_high',\n 'submerged',\n 'underground',\n 'concealed',\n 'minimized',\n 'atk_def_swapped',\n 'flash_fire',\n 'micle_berry',\n 'octolocked',\n 'wide_open',\n 'jaw_locked',\n]\nexport type BattleState = (typeof battleStates)[number]\n\nexport const itemCategories = [\n 'power_boost',\n 'recovery',\n 'defense',\n 'stat_boost',\n 'effect_extend',\n 'berry',\n 'other',\n 'mega_stone',\n] as const\nexport type ItemCategory = (typeof itemCategories)[number]\n\nexport const bagCategories = [\n 'ball',\n 'medicine',\n 'battle',\n 'berry',\n 'machine',\n 'mega_stone',\n 'z_crystal',\n 'treasure',\n 'ingredient',\n 'material',\n 'key',\n 'other',\n] as const\nexport type BagCategory = (typeof bagCategories)[number]\n\nexport const pokeballCategories = ['regular', 'special', 'hisuian', 'other'] as const\nexport type PokeballCategory = (typeof pokeballCategories)[number]\n\nexport const ribbonCategories = ['league', 'contest', 'tower', 'memory', 'gift'] as const\nexport type RibbonCategory = (typeof ribbonCategories)[number]\n\nexport const statIds = ['hp', 'atk', 'def', 'spa', 'spd', 'spe', 'acc', 'eva'] as const\nexport type StatId = (typeof statIds)[number]\n\nexport const titleTypes = ['ribbon', 'mark', 'custom'] as const\nexport type TitleType = (typeof titleTypes)[number]\n\nexport const pokemonSizes = ['xs', 's', 'm', 'l', 'xl'] as const\nexport type PokemonSize = (typeof pokemonSizes)[number]\n\nexport const genders = ['m', 'f'] as const // m: male, f: female, null/undefined: genderless\nexport type Gender = (typeof genders)[number]\n\n/**\n * In most core series games:\n * - IV of 0: \"No good\" (or \"Not So Good\" in Let's GO)\n * - IV range of 1-15: \"Decent\" (or \"OK\" in Let's GO)\n * - IV range of 16-25: \"Pretty good\" (or \"Good\" in Let's GO)\n * - IV range 26-29: \"Very good\"\n * - IV of 30: \"Fantastic\"\n * - IV of 31: \"Best\"\n * */\nexport const ivJudgeValues = ['nogood', 'decent', 'good', 'verygood', 'fantastic', 'best'] as const\nexport type IvJudgeValue = (typeof ivJudgeValues)[number]\n\nexport const battleStyles = ['singles', 'doubles', 'triples', 'rotation', 'royale'] as const\nexport type BattleStyle = (typeof battleStyles)[number]\n\nexport const raidStyles = ['dynamax', 'tera'] as const\nexport type RaidStyle = (typeof raidStyles)[number]\n"],"mappings":";AAAA,MAAa,YAAY;CAAC;CAAY;CAAO;CAAQ;AAAK;AAG1D,MAAa,aAAa;CAAC;CAAQ;CAAW;CAAW;AAAS;AAGlE,MAAa,gBAAgB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,4BAA2C;CACtD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,MAAa,iBAAiB;CAAC;CAAY;CAAW;AAAQ;AAG9D,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,MAAa,gBAAgB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,MAAa,qBAAqB;CAAC;CAAW;CAAW;CAAW;AAAO;AAG3E,MAAa,mBAAmB;CAAC;CAAU;CAAW;CAAS;CAAU;AAAM;AAG/E,MAAa,UAAU;CAAC;CAAM;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;AAAK;AAG7E,MAAa,aAAa;CAAC;CAAU;CAAQ;AAAQ;AAGrD,MAAa,eAAe;CAAC;CAAM;CAAK;CAAK;CAAK;AAAI;AAGtD,MAAa,UAAU,CAAC,KAAK,GAAG;;;;;;;;;;AAYhC,MAAa,gBAAgB;CAAC;CAAU;CAAU;CAAQ;CAAY;CAAa;AAAM;AAGzF,MAAa,eAAe;CAAC;CAAW;CAAW;CAAW;CAAY;AAAQ;AAGlF,MAAa,aAAa,CAAC,WAAW,MAAM"}
@@ -1,2 +1,2 @@
1
- import { a as sanitizeModernBoxPresetSlots, i as sanitizeModernBoxPresetSlot, n as incompatibleClassicPokemonIds, r as modernBoxPresetSlotFilters, t as collectModernBoxPresetSanitizerDiagnostics } from "../box-preset-sanitizer-DHGv5TJj.mjs";
1
+ import { a as sanitizeModernBoxPresetSlots, i as sanitizeModernBoxPresetSlot, n as incompatibleClassicPokemonIds, r as modernBoxPresetSlotFilters, t as collectModernBoxPresetSanitizerDiagnostics } from "../box-preset-sanitizer-CmgPzVjb.mjs";
2
2
  export { collectModernBoxPresetSanitizerDiagnostics, incompatibleClassicPokemonIds, modernBoxPresetSlotFilters, sanitizeModernBoxPresetSlot, sanitizeModernBoxPresetSlots };
@@ -1,5 +1,5 @@
1
- import { _ as modernBoxPresetIndexSchema, o as boxPresetSchema, v as modernBoxPresetSchema } from "../schemas-CcUqoHNr.mjs";
2
- import { a as sanitizeModernBoxPresetSlots, t as collectModernBoxPresetSanitizerDiagnostics } from "../box-preset-sanitizer-DHGv5TJj.mjs";
1
+ import { _ as modernBoxPresetIndexSchema, o as boxPresetSchema, v as modernBoxPresetSchema } from "../schemas-DvWBehAR.mjs";
2
+ import { a as sanitizeModernBoxPresetSlots, t as collectModernBoxPresetSanitizerDiagnostics } from "../box-preset-sanitizer-CmgPzVjb.mjs";
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
5
5
  //#region src/lib/box-preset-transform.ts
@@ -9,7 +9,7 @@ export declare const itemsFs: import("yolodb").YoloDbTable<{
9
9
  gen: number;
10
10
  shortDesc: string;
11
11
  desc: string | null;
12
- category: "berry" | "other" | "ball" | "medicine" | "battle" | "machine" | "treasure" | "ingredient" | "material" | "key" | "megastone" | "zcrystal";
12
+ category: "ball" | "medicine" | "battle" | "berry" | "machine" | "megastone" | "zcrystal" | "treasure" | "ingredient" | "material" | "key" | "other";
13
13
  unholdable?: boolean | undefined;
14
14
  }>;
15
15
  export declare const pokeballsFs: import("yolodb").YoloDbTable<{
@@ -18,7 +18,7 @@ export declare const pokeballsFs: import("yolodb").YoloDbTable<{
18
18
  gen: number;
19
19
  shortDesc: string;
20
20
  desc: string | null;
21
- category: "special" | "other" | "regular" | "hisuian";
21
+ category: "other" | "regular" | "special" | "hisuian";
22
22
  unusable?: boolean | undefined;
23
23
  }>;
24
24
  export declare const abilitiesFs: import("yolodb").YoloDbTable<{
@@ -28,7 +28,7 @@ export declare const abilitiesFs: import("yolodb").YoloDbTable<{
28
28
  gen: number;
29
29
  shortDesc: string;
30
30
  desc: string | null;
31
- tags: ("defense" | "other" | "items" | "alert" | "ally-helper" | "stat-boost" | "move-boost" | "bypass" | "handicap" | "heal" | "priority-control" | "damage" | "target-weaken" | "status-trigger" | "status-immunity" | "steal" | "weather" | "terrain" | "trap" | "ability-change" | "type-change" | "species-specific")[];
31
+ tags: ("other" | "alert" | "ally-helper" | "stat-boost" | "move-boost" | "bypass" | "defense" | "handicap" | "heal" | "items" | "priority-control" | "damage" | "target-weaken" | "status-trigger" | "status-immunity" | "steal" | "weather" | "terrain" | "trap" | "ability-change" | "type-change" | "species-specific")[];
32
32
  immunities?: ("normal" | "fire" | "water" | "electric" | "grass" | "ice" | "fighting" | "poison" | "ground" | "flying" | "psychic" | "bug" | "rock" | "ghost" | "dragon" | "dark" | "steel" | "fairy" | "stellar")[] | undefined;
33
33
  weaknesses?: ("normal" | "fire" | "water" | "electric" | "grass" | "ice" | "fighting" | "poison" | "ground" | "flying" | "psychic" | "bug" | "rock" | "ghost" | "dragon" | "dark" | "steel" | "fairy" | "stellar")[] | undefined;
34
34
  }>;
@@ -43,7 +43,7 @@ export declare const movesFs: import("yolodb").YoloDbTable<{
43
43
  power: number;
44
44
  accuracy: number;
45
45
  pp: number;
46
- category: "physical" | "special" | "status";
46
+ category: "special" | "physical" | "status";
47
47
  priority: number;
48
48
  isZ: boolean;
49
49
  isGmax: boolean;
@@ -102,10 +102,10 @@ export declare const colorsFs: import("yolodb").YoloDbTable<{
102
102
  color: string;
103
103
  }>;
104
104
  export declare const languagesFs: import("yolodb").YoloDbTable<{
105
- id: "esla" | "chs" | "cht" | "en" | "es" | "fr" | "de" | "it" | "ja" | "ko" | "pt";
105
+ id: "en" | "es" | "esla" | "fr" | "de" | "it" | "ja" | "ko" | "chs" | "cht" | "pt";
106
106
  name: string;
107
107
  nameEng: string;
108
- alpha3: "eng" | "esp" | "esla" | "fra" | "deu" | "ita" | "jap" | "kor" | "chs" | "cht" | "por";
108
+ alpha3: "esla" | "chs" | "cht" | "eng" | "esp" | "fra" | "deu" | "ita" | "jap" | "kor" | "por";
109
109
  inGameCode: "ENG" | "ES-ES" | "ES-LA" | "FRA" | "DEU" | "ITA" | "JPN" | "KOR" | "CHT" | "CHS" | "PT-BR";
110
110
  locale: string;
111
111
  flag: string;
@@ -1 +1 @@
1
- {"version":3,"file":"fs.d.mts","names":[],"sources":["../../src/lib/fs.ts"],"mappings":";wBA8DgB,eAAe;wBAIf,gBAAgB,GAAG,mBAAmB;wBAMtC,iBAAiB,WAAW,kBAAkB;qBAOjD,0BAAO;;;;;;;;;;qBAIP,8BAAW;;;;;;;;;qBAIX,8BAAW;;;;;;;;;;;qBAIX,0BAAO;;;;;;;;;;;;;;;;qBAIP,+BAAY;;;;qBAIZ,4BAAS;;;;;;;;;qBAIT,0BAAO;;;;;;;;;;;qBAIP,gCAAa;;;;qBAIb,0BAAO;;;;;;qBAIP,4BAAS;;;;;;qBAIT,kCAAe;;;;qBASf,4BAAS;;;;qBAIT,2BAAQ;;;;;qBAIR,8BAAW;;;;;;;;;;qBAIX,gCAAa;;;;;wBAIV,0BAA0B,kBAAkB,KAAK;wBAejD,wBAAwB,kBAAkB,KAAK;wBAe/C,4BAA4B,kBAAkB,KAAK;wBAenD,4BACd,iBACA,iCACC,MAAM,KAAK;wBAgBE,cAAc;wBAQd;wBAOA,kBAAkB,KAAK;wBAOvB,mBAAmB,KAAK;wBAYxB,kBACd,iCACC,MAAM,KAAK;w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zB,gBAAgB,KAAK;wBAIrB,kBAAkB,KAAK;wBAIvB,gBAAgB,KAAK;wBAIrB,sBAAsB,KAAK;wBAI3B,gBAAgB,KAAK;wBAIrB,kBAAkB,KAAK;wBAIvB,wBAAwB,KAAK;wBAI7B,kBAAkB,KAAK;wBAIvB,iBAAiB,KAAK;wBAItB,oBAAoB,KAAK;wBAIzB,sBAAsB,KAAK"}
package/build/lib/fs.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { t as arrayUnique } from "../utils-internal-Czgdbnkv.mjs";
2
- import fs from "node:fs";
3
- import path from "node:path";
1
+ import { t as arrayUnique } from "../utils-internal-DPjO9kQX.mjs";
2
+ import fs, { existsSync, readFileSync } from "node:fs";
3
+ import path, { dirname, join, resolve } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { yolodb } from "yolodb";
6
6
  //#region src/utils/memory-cache.ts
@@ -53,33 +53,25 @@ var MemoryCache = class {
53
53
  }
54
54
  };
55
55
  //#endregion
56
+ //#region src/utils/dataset-directory.ts
57
+ function resolveDatasetDirectory(moduleUrl, configuredDirectory, cwd = process.cwd()) {
58
+ if (configuredDirectory) return validateDirectory(resolve(cwd, configuredDirectory));
59
+ let directory = dirname(fileURLToPath(moduleUrl));
60
+ while (true) {
61
+ const manifest = join(directory, "package.json");
62
+ if (existsSync(manifest) && JSON.parse(readFileSync(manifest, "utf8")).name === "@pokepc/dataset") return validateDirectory(join(directory, "data"));
63
+ const parent = dirname(directory);
64
+ if (parent === directory) throw new Error("Could not locate the @pokepc/dataset package. Set POKEPC_DATASET_DIR.");
65
+ directory = parent;
66
+ }
67
+ }
68
+ function validateDirectory(directory) {
69
+ if (!existsSync(join(directory, "types.json"))) throw new Error(`Dataset directory is missing types.json: ${directory}`);
70
+ return directory;
71
+ }
72
+ //#endregion
56
73
  //#region src/lib/fs.ts
57
- const DATASET_PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
58
- const MONOREPO_ROOT = path.resolve(DATASET_PACKAGE_ROOT, "..", "..");
59
- function uniquePaths(paths) {
60
- return Array.from(new Set(paths));
61
- }
62
- function resolveDatasetDirCandidates(value) {
63
- if (!value) return uniquePaths([
64
- path.join(DATASET_PACKAGE_ROOT, "data"),
65
- path.join(process.cwd(), "data"),
66
- path.join(MONOREPO_ROOT, "packages/dataset/data")
67
- ]);
68
- if (path.isAbsolute(value)) return [value];
69
- return uniquePaths([
70
- path.resolve(process.cwd(), value),
71
- path.resolve(MONOREPO_ROOT, value),
72
- path.resolve(DATASET_PACKAGE_ROOT, value)
73
- ]);
74
- }
75
- const DATASET_DIR_CANDIDATES = [...resolveDatasetDirCandidates(process.env.POKEPC_DATASET_DIR)];
76
- const RESOLVED_DATASET_DIR = DATASET_DIR_CANDIDATES.find((candidate) => fs.existsSync(path.join(candidate, "types.json")));
77
- if (!RESOLVED_DATASET_DIR) {
78
- const errMsg = "Could not find dataset directory. Set POKEPC_DATASET_DIR and try again. Tried: " + DATASET_DIR_CANDIDATES.join(", ");
79
- console.error(errMsg);
80
- throw new Error(errMsg);
81
- }
82
- const DATASET_DIR = RESOLVED_DATASET_DIR;
74
+ const DATASET_DIR = resolveDatasetDirectory(import.meta.url, process.env.POKEPC_DATASET_DIR);
83
75
  console.debug("Resolved POKEPC dataset directory:", DATASET_DIR);
84
76
  const DEFAULT_CACHE_TTL = 1e4;
85
77
  const memoryCache = new MemoryCache(DEFAULT_CACHE_TTL);
@@ -1 +1 @@
1
- {"version":3,"file":"fs.mjs","names":[],"sources":["../../src/utils/memory-cache.ts","../../src/lib/fs.ts"],"sourcesContent":["export class MemoryCache {\n defaultTTL: number = 1000 * 60\n\n constructor(defaultTTL: number = 1000 * 10) {\n this.defaultTTL = defaultTTL\n }\n\n #cache: Map<string, { exptime: number; value: any }> = new Map()\n\n get<T>(key: string): T | undefined {\n const value = this.#cache.get(key)\n if (!value) {\n return undefined\n }\n if (value.exptime > Date.now() || value.exptime === 0) {\n return value.value\n }\n this.#cache.delete(key)\n return undefined\n }\n\n set(key: string, value: any, ttl: number = this.defaultTTL) {\n this.#cache.set(key, { exptime: ttl === 0 ? 0 : Date.now() + ttl, value })\n }\n\n delete(key: string) {\n this.#cache.delete(key)\n }\n\n has(key: string) {\n const value = this.#cache.get(key)\n return Boolean(value && (value.exptime > Date.now() || value.exptime === 0))\n }\n\n clear() {\n this.#cache.clear()\n }\n\n keys() {\n return Array.from(this.#cache.keys())\n }\n\n values() {\n return Array.from(this.#cache.values()).map((value) => value.value)\n }\n\n entries() {\n return Array.from(this.#cache.entries()).map(([key, value]) => [key, value.value])\n }\n\n size() {\n return this.#cache.size\n }\n\n cached<T>(key: string, fn: () => T, ttl: number = this.defaultTTL): T {\n const value = this.get<T>(key)\n if (value) {\n return value\n }\n const result = fn()\n this.set(key, result, ttl)\n return result\n }\n}\n","import { MemoryCache } from '../utils/memory-cache'\nimport { arrayUnique } from '../utils/utils-internal'\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { yolodb } from 'yolodb'\n\nconst DATASET_PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')\nconst MONOREPO_ROOT = path.resolve(DATASET_PACKAGE_ROOT, '..', '..')\n\nfunction uniquePaths(paths: string[]) {\n return Array.from(new Set(paths))\n}\n\nfunction resolveDatasetDirCandidates(value: string | undefined) {\n if (!value) {\n return uniquePaths([\n path.join(DATASET_PACKAGE_ROOT, 'data'),\n path.join(process.cwd(), 'data'),\n path.join(MONOREPO_ROOT, 'packages/dataset/data'),\n ])\n }\n\n if (path.isAbsolute(value)) {\n return [value]\n }\n\n return uniquePaths([\n path.resolve(process.cwd(), value),\n path.resolve(MONOREPO_ROOT, value),\n path.resolve(DATASET_PACKAGE_ROOT, value),\n ])\n}\n\nconst DATASET_DIR_CANDIDATES = [...resolveDatasetDirCandidates(process.env.POKEPC_DATASET_DIR)]\nconst RESOLVED_DATASET_DIR = DATASET_DIR_CANDIDATES.find((candidate) =>\n fs.existsSync(path.join(candidate, 'types.json')),\n)\n\nif (!RESOLVED_DATASET_DIR) {\n const errMsg =\n 'Could not find dataset directory. Set POKEPC_DATASET_DIR and try again. Tried: ' +\n DATASET_DIR_CANDIDATES.join(', ')\n console.error(errMsg)\n throw new Error(errMsg)\n}\n\nconst DATASET_DIR = RESOLVED_DATASET_DIR\n\nconsole.debug('Resolved POKEPC dataset directory:', DATASET_DIR)\n\nconst DEFAULT_CACHE_TTL = 1000 * 10 // 10 seconds\nconst memoryCache = new MemoryCache(DEFAULT_CACHE_TTL)\nconst MEMORY_CACHE_DISABLED = process.env.POKEPC_DISABLE_MEMORY_CACHE === '1'\n\nfunction cached<T>(key: string, fn: () => T, ttl: number = DEFAULT_CACHE_TTL): T {\n if (MEMORY_CACHE_DISABLED) {\n return fn()\n }\n return memoryCache.cached(key, fn, ttl)\n}\n\nexport function absDatasetFile(fileName: string) {\n return path.join(DATASET_DIR, fileName)\n}\n\nexport function readDatasetFile<T>(filePath: string): T {\n const absFilePath = absDatasetFile(filePath)\n const data = fs.readFileSync(absFilePath, 'utf8')\n return JSON.parse(data)\n}\n\nexport function writeDatasetFile(data: any, filePath: string, minified: boolean = false) {\n const absFilePath = absDatasetFile(filePath)\n let jsonData = typeof data === 'string' ? data : JSON.stringify(data, null, minified ? 0 : 2)\n fs.mkdirSync(path.dirname(absFilePath), { recursive: true })\n fs.writeFileSync(absFilePath, jsonData)\n}\n\nexport const itemsFs = yolodb<Pkds.Item>(absDatasetFile('items.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const pokeballsFs = yolodb<Pkds.Pokeball>(absDatasetFile('pokeballs.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const abilitiesFs = yolodb<Pkds.Ability>(absDatasetFile('abilities.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const movesFs = yolodb<Pkds.Move>(absDatasetFile('moves.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const charactersFs = yolodb<Pkds.Character>(absDatasetFile('characters.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const ribbonsFs = yolodb<Pkds.Ribbon>(absDatasetFile('ribbons.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const marksFs = yolodb<Pkds.Mark>(absDatasetFile('marks.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const originMarksFs = yolodb<Pkds.OriginMark>(absDatasetFile('originmarks.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const typesFs = yolodb<Pkds.Type>(absDatasetFile('types.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const naturesFs = yolodb<Pkds.Nature>(absDatasetFile('natures.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const personalitiesFs = yolodb<Pkds.Personality>(\n absDatasetFile('personalities.json'),\n 'id',\n [],\n {\n superjsonEnabled: false,\n },\n)\n\nexport const regionsFs = yolodb<Pkds.Region>(absDatasetFile('regions.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const colorsFs = yolodb<Pkds.Color>(absDatasetFile('colors.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const languagesFs = yolodb<Pkds.Language>(absDatasetFile('languages.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const generationsFs = yolodb<Pkds.Generation>(absDatasetFile('generations.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport function joinPokemonFilesFromIndex(index: string[]): Pkds.Pokemon[] {\n const pokemon: Pkds.Pokemon[] = []\n for (const item of index) {\n const filePath = absDatasetFile(`pokemon/${item}.json`)\n if (!fs.existsSync(filePath)) {\n throw new Error(`Pokemon ${item} not found at ${filePath}`)\n }\n const pkm = JSON.parse(fs.readFileSync(filePath, 'utf8'))\n // const parsed = pokemonSchema.parse(pkm)\n pokemon.push(pkm)\n }\n\n return pokemon\n}\n\nexport function joinGamesFilesFromIndex(index: string[]): Pkds.Game[] {\n const games: Pkds.Game[] = []\n for (const item of index) {\n const filePath = absDatasetFile(`games/${item}.json`)\n if (!fs.existsSync(filePath)) {\n throw new Error(`Game ${item} not found at ${filePath}`)\n }\n const game = JSON.parse(fs.readFileSync(filePath, 'utf8'))\n // const parsed = gameSchema.parse(game)\n games.push(game)\n }\n\n return games\n}\n\nexport function joinPokedexesFilesFromIndex(index: string[]): Pkds.Pokedex[] {\n const pokedexes: Pkds.Pokedex[] = []\n for (const item of index) {\n const filePath = absDatasetFile(`pokedexes/${item}.json`)\n if (!fs.existsSync(filePath)) {\n throw new Error(`Pokedex ${item} not found at ${filePath}`)\n }\n const pokedex = JSON.parse(fs.readFileSync(filePath, 'utf8'))\n // const parsed = pokedexSchema.parse(pokedex)\n pokedexes.push(pokedex)\n }\n\n return pokedexes\n}\n\nexport function joinBoxPresetFilesFromIndex(\n index: string[],\n variant: 'classic' | 'modern' = 'classic',\n): Array<Pkds.LegacyBoxPresetByGameset> {\n const boxPresetGroups: Array<Pkds.LegacyBoxPresetByGameset> = []\n for (const item of index) {\n const filePath = absDatasetFile(`boxpresets/${variant}/${item}.json`)\n if (!fs.existsSync(filePath)) {\n console.error(`Box preset ${item} not found at ${filePath}`)\n continue\n }\n const boxPresets = JSON.parse(fs.readFileSync(filePath, 'utf8'))\n // const parsed = legacyBoxPresetSchema.parse(boxPreset)\n boxPresetGroups.push({ gameset: item, presets: Object.values(boxPresets) })\n }\n\n return boxPresetGroups\n}\n\nexport function readIndexFile(indexName: 'pokemon' | 'games' | 'pokedexes'): string[] {\n const indexFilePath = absDatasetFile(`indices/${indexName}.json`)\n if (!fs.existsSync(indexFilePath)) {\n throw new Error(`Index file ${indexName} not found at ${indexFilePath}`)\n }\n return JSON.parse(fs.readFileSync(indexFilePath, 'utf8'))\n}\n\nexport function regeneratePokemonIndexFile(): string[] {\n const allPokemon = loadAllPokemon()\n const index = allPokemon.flatMap((pkm) => [pkm.id, ...pkm.forms.map((form) => form)])\n writeDatasetFile(arrayUnique(index), 'indices/pokemon.json', false)\n return index\n}\n\nexport function loadAllPokemon(): Pkds.Pokemon[] {\n return cached('allPokemon', () => {\n const index = readIndexFile('pokemon')\n return joinPokemonFilesFromIndex(index)\n })\n}\n\nexport function loadAllGameSets(): Pkds.Game[] {\n return loadAllGames().filter((game) => {\n if (game.type === 'set') {\n return true\n }\n if (game.type === 'game' && !game.gameSet) {\n return true\n }\n return false\n })\n}\n\nexport function loadAllBoxPresets(\n variant: 'classic' | 'modern' = 'classic',\n): Array<Pkds.LegacyBoxPresetByGameset> {\n return cached(`allBoxPresets-${variant}`, () => {\n const filenames = loadAllGameSets().map((game) => game.id)\n return joinBoxPresetFilesFromIndex(filenames, variant)\n })\n}\n\nexport function loadAllGames(): Pkds.Game[] {\n return cached('allGames', () => {\n const index = readIndexFile('games')\n return joinGamesFilesFromIndex(index)\n })\n}\n\nexport function loadAllPokedexes(): Pkds.Pokedex[] {\n return cached('allPokedexes', () => {\n const index = readIndexFile('pokedexes')\n return joinPokedexesFilesFromIndex(index)\n })\n}\n\nexport function loadAllCharacters(): Pkds.Character[] {\n return charactersFs.all()\n}\n\nexport function loadAllItems(): Pkds.Item[] {\n return itemsFs.all()\n}\n\nexport function loadAllPokeballs(): Pkds.Pokeball[] {\n return pokeballsFs.all()\n}\n\nexport function loadAllAbilities(): Pkds.Ability[] {\n return abilitiesFs.all()\n}\n\nexport function loadAllMoves(): Pkds.Move[] {\n return movesFs.all()\n}\n\nexport function loadAllRibbons(): Pkds.Ribbon[] {\n return ribbonsFs.all()\n}\n\nexport function loadAllMarks(): Pkds.Mark[] {\n return marksFs.all()\n}\n\nexport function loadAllOriginMarks(): Pkds.OriginMark[] {\n return originMarksFs.all()\n}\n\nexport function loadAllTypes(): Pkds.Type[] {\n return typesFs.all()\n}\n\nexport function loadAllNatures(): Pkds.Nature[] {\n return naturesFs.all()\n}\n\nexport function loadAllPersonalities(): Pkds.Personality[] {\n return personalitiesFs.all()\n}\n\nexport function loadAllRegions(): Pkds.Region[] {\n return regionsFs.all()\n}\n\nexport function loadAllColors(): Pkds.Color[] {\n return colorsFs.all()\n}\n\nexport function loadAllLanguages(): Pkds.Language[] {\n return languagesFs.all()\n}\n\nexport function loadAllGenerations(): Pkds.Generation[] {\n return generationsFs.all()\n}\n"],"mappings":";;;;;;AAAA,IAAa,cAAb,MAAyB;CACvB,aAAqB;CAErB,YAAY,aAAqB,KAAW;EAC1C,KAAK,aAAa;CACpB;CAEA,yBAAuD,IAAI,IAAI;CAE/D,IAAO,KAA4B;EACjC,MAAM,QAAQ,KAAK,OAAO,IAAI,GAAG;EACjC,IAAI,CAAC,OACH;EAEF,IAAI,MAAM,UAAU,KAAK,IAAI,KAAK,MAAM,YAAY,GAClD,OAAO,MAAM;EAEf,KAAK,OAAO,OAAO,GAAG;CAExB;CAEA,IAAI,KAAa,OAAY,MAAc,KAAK,YAAY;EAC1D,KAAK,OAAO,IAAI,KAAK;GAAE,SAAS,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI;GAAK;EAAM,CAAC;CAC3E;CAEA,OAAO,KAAa;EAClB,KAAK,OAAO,OAAO,GAAG;CACxB;CAEA,IAAI,KAAa;EACf,MAAM,QAAQ,KAAK,OAAO,IAAI,GAAG;EACjC,OAAO,QAAQ,UAAU,MAAM,UAAU,KAAK,IAAI,KAAK,MAAM,YAAY,EAAE;CAC7E;CAEA,QAAQ;EACN,KAAK,OAAO,MAAM;CACpB;CAEA,OAAO;EACL,OAAO,MAAM,KAAK,KAAK,OAAO,KAAK,CAAC;CACtC;CAEA,SAAS;EACP,OAAO,MAAM,KAAK,KAAK,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,UAAU,MAAM,KAAK;CACpE;CAEA,UAAU;EACR,OAAO,MAAM,KAAK,KAAK,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,KAAK,MAAM,KAAK,CAAC;CACnF;CAEA,OAAO;EACL,OAAO,KAAK,OAAO;CACrB;CAEA,OAAU,KAAa,IAAa,MAAc,KAAK,YAAe;EACpE,MAAM,QAAQ,KAAK,IA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BAAgC;CAC9C,OAAO,UAAU,IAAI;AACvB;AAEA,SAAgB,gBAA8B;CAC5C,OAAO,SAAS,IAAI;AACtB;AAEA,SAAgB,mBAAoC;CAClD,OAAO,YAAY,IAAI;AACzB;AAEA,SAAgB,qBAAwC;CACtD,OAAO,cAAc,IAAI;AAC3B"}
1
+ {"version":3,"file":"fs.mjs","names":[],"sources":["../../src/utils/memory-cache.ts","../../src/utils/dataset-directory.ts","../../src/lib/fs.ts"],"sourcesContent":["export class MemoryCache {\n defaultTTL: number = 1000 * 60\n\n constructor(defaultTTL: number = 1000 * 10) {\n this.defaultTTL = defaultTTL\n }\n\n #cache: Map<string, { exptime: number; value: any }> = new Map()\n\n get<T>(key: string): T | undefined {\n const value = this.#cache.get(key)\n if (!value) {\n return undefined\n }\n if (value.exptime > Date.now() || value.exptime === 0) {\n return value.value\n }\n this.#cache.delete(key)\n return undefined\n }\n\n set(key: string, value: any, ttl: number = this.defaultTTL) {\n this.#cache.set(key, { exptime: ttl === 0 ? 0 : Date.now() + ttl, value })\n }\n\n delete(key: string) {\n this.#cache.delete(key)\n }\n\n has(key: string) {\n const value = this.#cache.get(key)\n return Boolean(value && (value.exptime > Date.now() || value.exptime === 0))\n }\n\n clear() {\n this.#cache.clear()\n }\n\n keys() {\n return Array.from(this.#cache.keys())\n }\n\n values() {\n return Array.from(this.#cache.values()).map((value) => value.value)\n }\n\n entries() {\n return Array.from(this.#cache.entries()).map(([key, value]) => [key, value.value])\n }\n\n size() {\n return this.#cache.size\n }\n\n cached<T>(key: string, fn: () => T, ttl: number = this.defaultTTL): T {\n const value = this.get<T>(key)\n if (value) {\n return value\n }\n const result = fn()\n this.set(key, result, ttl)\n return result\n }\n}\n","import { existsSync, readFileSync } from 'node:fs'\nimport { dirname, join, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nexport function resolveDatasetDirectory(\n moduleUrl: string,\n configuredDirectory?: string,\n cwd = process.cwd(),\n): string {\n if (configuredDirectory) {\n return validateDirectory(resolve(cwd, configuredDirectory))\n }\n\n let directory = dirname(fileURLToPath(moduleUrl))\n while (true) {\n const manifest = join(directory, 'package.json')\n if (\n existsSync(manifest) &&\n JSON.parse(readFileSync(manifest, 'utf8')).name === '@pokepc/dataset'\n ) {\n return validateDirectory(join(directory, 'data'))\n }\n const parent = dirname(directory)\n if (parent === directory) {\n throw new Error('Could not locate the @pokepc/dataset package. Set POKEPC_DATASET_DIR.')\n }\n directory = parent\n }\n}\n\nfunction validateDirectory(directory: string): string {\n if (!existsSync(join(directory, 'types.json'))) {\n throw new Error(`Dataset directory is missing types.json: ${directory}`)\n }\n return directory\n}\n","import { MemoryCache } from '../utils/memory-cache'\nimport { resolveDatasetDirectory } from '../utils/dataset-directory'\nimport { arrayUnique } from '../utils/utils-internal'\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport { yolodb } from 'yolodb'\n\nconst DATASET_DIR = resolveDatasetDirectory(import.meta.url, process.env.POKEPC_DATASET_DIR)\n\nconsole.debug('Resolved POKEPC dataset directory:', DATASET_DIR)\n\nconst DEFAULT_CACHE_TTL = 1000 * 10 // 10 seconds\nconst memoryCache = new MemoryCache(DEFAULT_CACHE_TTL)\nconst MEMORY_CACHE_DISABLED = process.env.POKEPC_DISABLE_MEMORY_CACHE === '1'\n\nfunction cached<T>(key: string, fn: () => T, ttl: number = DEFAULT_CACHE_TTL): T {\n if (MEMORY_CACHE_DISABLED) {\n return fn()\n }\n return memoryCache.cached(key, fn, ttl)\n}\n\nexport function absDatasetFile(fileName: string) {\n return path.join(DATASET_DIR, fileName)\n}\n\nexport function readDatasetFile<T>(filePath: string): T {\n const absFilePath = absDatasetFile(filePath)\n const data = fs.readFileSync(absFilePath, 'utf8')\n return JSON.parse(data)\n}\n\nexport function writeDatasetFile(data: any, filePath: string, minified: boolean = false) {\n const absFilePath = absDatasetFile(filePath)\n let jsonData = typeof data === 'string' ? data : JSON.stringify(data, null, minified ? 0 : 2)\n fs.mkdirSync(path.dirname(absFilePath), { recursive: true })\n fs.writeFileSync(absFilePath, jsonData)\n}\n\nexport const itemsFs = yolodb<Pkds.Item>(absDatasetFile('items.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const pokeballsFs = yolodb<Pkds.Pokeball>(absDatasetFile('pokeballs.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const abilitiesFs = yolodb<Pkds.Ability>(absDatasetFile('abilities.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const movesFs = yolodb<Pkds.Move>(absDatasetFile('moves.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const charactersFs = yolodb<Pkds.Character>(absDatasetFile('characters.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const ribbonsFs = yolodb<Pkds.Ribbon>(absDatasetFile('ribbons.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const marksFs = yolodb<Pkds.Mark>(absDatasetFile('marks.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const originMarksFs = yolodb<Pkds.OriginMark>(absDatasetFile('originmarks.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const typesFs = yolodb<Pkds.Type>(absDatasetFile('types.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const naturesFs = yolodb<Pkds.Nature>(absDatasetFile('natures.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const personalitiesFs = yolodb<Pkds.Personality>(\n absDatasetFile('personalities.json'),\n 'id',\n [],\n {\n superjsonEnabled: false,\n },\n)\n\nexport const regionsFs = yolodb<Pkds.Region>(absDatasetFile('regions.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const colorsFs = yolodb<Pkds.Color>(absDatasetFile('colors.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const languagesFs = yolodb<Pkds.Language>(absDatasetFile('languages.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport const generationsFs = yolodb<Pkds.Generation>(absDatasetFile('generations.json'), 'id', [], {\n superjsonEnabled: false,\n})\n\nexport function joinPokemonFilesFromIndex(index: string[]): Pkds.Pokemon[] {\n const pokemon: Pkds.Pokemon[] = []\n for (const item of index) {\n const filePath = absDatasetFile(`pokemon/${item}.json`)\n if (!fs.existsSync(filePath)) {\n throw new Error(`Pokemon ${item} not found at ${filePath}`)\n }\n const pkm = JSON.parse(fs.readFileSync(filePath, 'utf8'))\n // const parsed = pokemonSchema.parse(pkm)\n pokemon.push(pkm)\n }\n\n return pokemon\n}\n\nexport function joinGamesFilesFromIndex(index: string[]): Pkds.Game[] {\n const games: Pkds.Game[] = []\n for (const item of index) {\n const filePath = absDatasetFile(`games/${item}.json`)\n if (!fs.existsSync(filePath)) {\n throw new Error(`Game ${item} not found at ${filePath}`)\n }\n const game = JSON.parse(fs.readFileSync(filePath, 'utf8'))\n // const parsed = gameSchema.parse(game)\n games.push(game)\n }\n\n return games\n}\n\nexport function joinPokedexesFilesFromIndex(index: string[]): Pkds.Pokedex[] {\n const pokedexes: Pkds.Pokedex[] = []\n for (const item of index) {\n const filePath = absDatasetFile(`pokedexes/${item}.json`)\n if (!fs.existsSync(filePath)) {\n throw new Error(`Pokedex ${item} not found at ${filePath}`)\n }\n const pokedex = JSON.parse(fs.readFileSync(filePath, 'utf8'))\n // const parsed = pokedexSchema.parse(pokedex)\n pokedexes.push(pokedex)\n }\n\n return pokedexes\n}\n\nexport function joinBoxPresetFilesFromIndex(\n index: string[],\n variant: 'classic' | 'modern' = 'classic',\n): Array<Pkds.LegacyBoxPresetByGameset> {\n const boxPresetGroups: Array<Pkds.LegacyBoxPresetByGameset> = []\n for (const item of index) {\n const filePath = absDatasetFile(`boxpresets/${variant}/${item}.json`)\n if (!fs.existsSync(filePath)) {\n console.error(`Box preset ${item} not found at ${filePath}`)\n continue\n }\n const boxPresets = JSON.parse(fs.readFileSync(filePath, 'utf8'))\n // const parsed = legacyBoxPresetSchema.parse(boxPreset)\n boxPresetGroups.push({ gameset: item, presets: Object.values(boxPresets) })\n }\n\n return boxPresetGroups\n}\n\nexport function readIndexFile(indexName: 'pokemon' | 'games' | 'pokedexes'): string[] {\n const indexFilePath = absDatasetFile(`indices/${indexName}.json`)\n if (!fs.existsSync(indexFilePath)) {\n throw new Error(`Index file ${indexName} not found at ${indexFilePath}`)\n }\n return JSON.parse(fs.readFileSync(indexFilePath, 'utf8'))\n}\n\nexport function regeneratePokemonIndexFile(): string[] {\n const allPokemon = loadAllPokemon()\n const index = allPokemon.flatMap((pkm) => [pkm.id, ...pkm.forms.map((form) => form)])\n writeDatasetFile(arrayUnique(index), 'indices/pokemon.json', false)\n return index\n}\n\nexport function loadAllPokemon(): Pkds.Pokemon[] {\n return cached('allPokemon', () => {\n const index = readIndexFile('pokemon')\n return joinPokemonFilesFromIndex(index)\n })\n}\n\nexport function loadAllGameSets(): Pkds.Game[] {\n return loadAllGames().filter((game) => {\n if (game.type === 'set') {\n return true\n }\n if (game.type === 'game' && !game.gameSet) {\n return true\n }\n return false\n })\n}\n\nexport function loadAllBoxPresets(\n variant: 'classic' | 'modern' = 'classic',\n): Array<Pkds.LegacyBoxPresetByGameset> {\n return cached(`allBoxPresets-${variant}`, () => {\n const filenames = loadAllGameSets().map((game) => game.id)\n return joinBoxPresetFilesFromIndex(filenames, variant)\n })\n}\n\nexport function loadAllGames(): Pkds.Game[] {\n return cached('allGames', () => {\n const index = readIndexFile('games')\n return joinGamesFilesFromIndex(index)\n })\n}\n\nexport function loadAllPokedexes(): Pkds.Pokedex[] {\n return cached('allPokedexes', () => {\n const index = readIndexFile('pokedexes')\n return joinPokedexesFilesFromIndex(index)\n })\n}\n\nexport function loadAllCharacters(): Pkds.Character[] {\n return charactersFs.all()\n}\n\nexport function loadAllItems(): Pkds.Item[] {\n return itemsFs.all()\n}\n\nexport function loadAllPokeballs(): Pkds.Pokeball[] {\n return pokeballsFs.all()\n}\n\nexport function loadAllAbilities(): Pkds.Ability[] {\n return abilitiesFs.all()\n}\n\nexport function loadAllMoves(): Pkds.Move[] {\n return movesFs.all()\n}\n\nexport function loadAllRibbons(): Pkds.Ribbon[] {\n return ribbonsFs.all()\n}\n\nexport function loadAllMarks(): Pkds.Mark[] {\n return marksFs.all()\n}\n\nexport function loadAllOriginMarks(): Pkds.OriginMark[] {\n return originMarksFs.all()\n}\n\nexport function loadAllTypes(): Pkds.Type[] {\n return typesFs.all()\n}\n\nexport function loadAllNatures(): Pkds.Nature[] {\n return naturesFs.all()\n}\n\nexport function loadAllPersonalities(): Pkds.Personality[] {\n return personalitiesFs.all()\n}\n\nexport function loadAllRegions(): Pkds.Region[] {\n return regionsFs.all()\n}\n\nexport function loadAllColors(): Pkds.Color[] {\n return colorsFs.all()\n}\n\nexport function loadAllLanguages(): Pkds.Language[] {\n return languagesFs.all()\n}\n\nexport function loadAllGenerations(): Pkds.Generation[] {\n return generationsFs.all()\n}\n"],"mappings":";;;;;;AAAA,IAAa,cAAb,MAAyB;CACvB,aAAqB;CAErB,YAAY,aAAqB,KAAW;EAC1C,KAAK,aAAa;CACpB;CAEA,yBAAuD,IAAI,IAAI;CAE/D,IAAO,KAA4B;EACjC,MAAM,QAAQ,KAAK,OAAO,IAAI,GAAG;EACjC,IAAI,CAAC,OACH;EAEF,IAAI,MAAM,UAAU,KAAK,IAAI,KAAK,MAAM,YAAY,GAClD,OAAO,MAAM;EAEf,KAAK,OAAO,OAAO,GAAG;CAExB;CAEA,IAAI,KAAa,OAAY,MAAc,KAAK,YAAY;EAC1D,KAAK,OAAO,IAAI,KAAK;GAAE,SAAS,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI;GAAK;EAAM,CAAC;CAC3E;CAEA,OAAO,KAAa;EAClB,KAAK,OAAO,OAAO,GAAG;CACxB;CAEA,IAAI,KAAa;EACf,MAAM,QAAQ,KAAK,OAAO,IAAI,GAAG;EACjC,OAAO,QAAQ,UAAU,MAAM,UAAU,KAAK,IAAI,KAAK,MAAM,YAAY,EAAE;CAC7E;CAEA,QAAQ;EACN,KAAK,OAAO,MAAM;CACpB;CAEA,OAAO;EACL,OAAO,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SAAgB,iBAAgC;CAC9C,OAAO,UAAU,IAAI;AACvB;AAEA,SAAgB,uBAA2C;CACzD,OAAO,gBAAgB,IAAI;AAC7B;AAEA,SAAgB,iBAAgC;CAC9C,OAAO,UAAU,IAAI;AACvB;AAEA,SAAgB,gBAA8B;CAC5C,OAAO,SAAS,IAAI;AACtB;AAEA,SAAgB,mBAAoC;CAClD,OAAO,YAAY,IAAI;AACzB;AAEA,SAAgB,qBAAwC;CACtD,OAAO,cAAc,IAAI;AAC3B"}
@@ -1,2 +1,2 @@
1
- import { A as pokemonSchema, C as onlineFeaturesSchema, D as pokedexEntrySchema, E as pokeballSchema, M as regionSchema, N as ribbonSchema, O as pokedexSchema, P as typeSchema, S as natureSchema, T as personalitySchema, _ as modernBoxPresetIndexSchema, a as boxPresetMapSchema, b as modernBoxPresetTags, c as colorSchema, d as generationSchema, f as i18nTextSchema, g as modernBoxPresetBoxSchema, h as markSchema, i as boxPresetIndexItemSchema, j as pokemonSearchFilterSchema, k as pokemonRefsSchema, l as gameFeaturesSchema, m as languageSchema, n as boxPresetBoxPokemonSchema, o as boxPresetSchema, p as itemSchema, r as boxPresetBoxSchema, s as characterSchema, t as abilitySchema, u as gameSchema, v as modernBoxPresetSchema, w as originMarkSchema, x as moveSchema, y as modernBoxPresetSlotSchema } from "../schemas-CDSWgtoj.mjs";
1
+ import { A as pokemonSchema, C as onlineFeaturesSchema, D as pokedexEntrySchema, E as pokeballSchema, M as regionSchema, N as ribbonSchema, O as pokedexSchema, P as typeSchema, S as natureSchema, T as personalitySchema, _ as modernBoxPresetIndexSchema, a as boxPresetMapSchema, b as modernBoxPresetTags, c as colorSchema, d as generationSchema, f as i18nTextSchema, g as modernBoxPresetBoxSchema, h as markSchema, i as boxPresetIndexItemSchema, j as pokemonSearchFilterSchema, k as pokemonRefsSchema, l as gameFeaturesSchema, m as languageSchema, n as boxPresetBoxPokemonSchema, o as boxPresetSchema, p as itemSchema, r as boxPresetBoxSchema, s as characterSchema, t as abilitySchema, u as gameSchema, v as modernBoxPresetSchema, w as originMarkSchema, x as moveSchema, y as modernBoxPresetSlotSchema } from "../schemas-jxei_N2z.mjs";
2
2
  export { abilitySchema, boxPresetBoxPokemonSchema, boxPresetBoxSchema, boxPresetIndexItemSchema, boxPresetMapSchema, boxPresetSchema, characterSchema, colorSchema, gameFeaturesSchema, gameSchema, generationSchema, i18nTextSchema, itemSchema, languageSchema, markSchema, modernBoxPresetBoxSchema, modernBoxPresetIndexSchema, modernBoxPresetSchema, modernBoxPresetSlotSchema, modernBoxPresetTags, moveSchema, natureSchema, onlineFeaturesSchema, originMarkSchema, personalitySchema, pokeballSchema, pokedexEntrySchema, pokedexSchema, pokemonRefsSchema, pokemonSchema, pokemonSearchFilterSchema, regionSchema, ribbonSchema, typeSchema };
@@ -1,2 +1,2 @@
1
- import { A as pokemonSchema, C as onlineFeaturesSchema, D as pokedexEntrySchema, E as pokeballSchema, M as regionSchema, N as ribbonSchema, O as pokedexSchema, P as typeSchema, S as natureSchema, T as personalitySchema, _ as modernBoxPresetIndexSchema, a as boxPresetMapSchema, b as modernBoxPresetTags, c as colorSchema, d as generationSchema, f as i18nTextSchema, g as modernBoxPresetBoxSchema, h as markSchema, i as boxPresetIndexItemSchema, j as pokemonSearchFilterSchema, k as pokemonRefsSchema, l as gameFeaturesSchema, m as languageSchema, n as boxPresetBoxPokemonSchema, o as boxPresetSchema, p as itemSchema, r as boxPresetBoxSchema, s as characterSchema, t as abilitySchema, u as gameSchema, v as modernBoxPresetSchema, w as originMarkSchema, x as moveSchema, y as modernBoxPresetSlotSchema } from "../schemas-CcUqoHNr.mjs";
1
+ import { A as pokemonSchema, C as onlineFeaturesSchema, D as pokedexEntrySchema, E as pokeballSchema, M as regionSchema, N as ribbonSchema, O as pokedexSchema, P as typeSchema, S as natureSchema, T as personalitySchema, _ as modernBoxPresetIndexSchema, a as boxPresetMapSchema, b as modernBoxPresetTags, c as colorSchema, d as generationSchema, f as i18nTextSchema, g as modernBoxPresetBoxSchema, h as markSchema, i as boxPresetIndexItemSchema, j as pokemonSearchFilterSchema, k as pokemonRefsSchema, l as gameFeaturesSchema, m as languageSchema, n as boxPresetBoxPokemonSchema, o as boxPresetSchema, p as itemSchema, r as boxPresetBoxSchema, s as characterSchema, t as abilitySchema, u as gameSchema, v as modernBoxPresetSchema, w as originMarkSchema, x as moveSchema, y as modernBoxPresetSlotSchema } from "../schemas-DvWBehAR.mjs";
2
2
  export { abilitySchema, boxPresetBoxPokemonSchema, boxPresetBoxSchema, boxPresetIndexItemSchema, boxPresetMapSchema, boxPresetSchema, characterSchema, colorSchema, gameFeaturesSchema, gameSchema, generationSchema, i18nTextSchema, itemSchema, languageSchema, markSchema, modernBoxPresetBoxSchema, modernBoxPresetIndexSchema, modernBoxPresetSchema, modernBoxPresetSlotSchema, modernBoxPresetTags, moveSchema, natureSchema, onlineFeaturesSchema, originMarkSchema, personalitySchema, pokeballSchema, pokedexEntrySchema, pokedexSchema, pokemonRefsSchema, pokemonSchema, pokemonSearchFilterSchema, regionSchema, ribbonSchema, typeSchema };
@@ -1,5 +1,7 @@
1
+ import { n as sanitizeSearchQuery, t as matchesSearchQuery } from "../utils-internal-C-UStMrZ.mjs";
1
2
  //#region src/lib/search.d.ts
2
3
  export declare function searchPokemon(pokemon: Array<Pkds.TranslatedPokemon>, filters: Partial<Pkds.PokemonSearchFilter>, requiresSearchString?: boolean): Pkds.PokemonSearchResults;
3
4
  export declare function createSearchablePokemonList(pokemon: Array<Pkds.Pokemon>): Array<Pkds.TranslatedPokemon>;
4
5
  //#endregion
6
+ export { matchesSearchQuery, sanitizeSearchQuery };
5
7
  //# sourceMappingURL=search.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.mts","names":[],"sources":["../../src/lib/search.ts"],"mappings":";wBAKgB,cACd,SAAS,MAAM,KAAK,oBACpB,SAAS,QAAQ,KAAK,sBACtB,iCACC,KAAK;wBA8BQ,4BACd,SAAS,MAAM,KAAK,WACnB,MAAM,KAAK"}
1
+ {"version":3,"file":"search.d.mts","names":[],"sources":["../../src/lib/search.ts"],"mappings":";;wBAMgB,cACd,SAAS,MAAM,KAAK,oBACpB,SAAS,QAAQ,KAAK,sBACtB,iCACC,KAAK;wBA8BQ,4BACd,SAAS,MAAM,KAAK,WACnB,MAAM,KAAK"}
@@ -1,5 +1,5 @@
1
- import { i as sanitizeSearchQuery, r as matchesSearchQuery } from "../utils-internal-Czgdbnkv.mjs";
2
- import { o as generatePokemonSearchableText, r as formatDexNum, t as dexNumToGen } from "../utils-BwovRocd.mjs";
1
+ import { i as sanitizeSearchQuery, r as matchesSearchQuery } from "../utils-internal-DPjO9kQX.mjs";
2
+ import { o as generatePokemonSearchableText, r as formatDexNum, t as dexNumToGen } from "../utils-BTjKkD-_.mjs";
3
3
  //#region src/lib/search.ts
4
4
  const MIN_SEARCH_LENGTH = 2;
5
5
  function searchPokemon(pokemon, filters, requiresSearchString = true) {
@@ -40,6 +40,6 @@ function createSearchablePokemonList(pokemon) {
40
40
  }));
41
41
  }
42
42
  //#endregion
43
- export { createSearchablePokemonList, searchPokemon };
43
+ export { createSearchablePokemonList, matchesSearchQuery, sanitizeSearchQuery, searchPokemon };
44
44
 
45
45
  //# sourceMappingURL=search.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.mjs","names":[],"sources":["../../src/lib/search.ts"],"sourcesContent":["import { dexNumToGen, formatDexNum, generatePokemonSearchableText } from './utils'\nimport { matchesSearchQuery, sanitizeSearchQuery } from '../utils/utils-internal'\n\nconst MIN_SEARCH_LENGTH = 2\n\nexport function searchPokemon(\n pokemon: Array<Pkds.TranslatedPokemon>,\n filters: Partial<Pkds.PokemonSearchFilter>,\n requiresSearchString: boolean = true,\n): Pkds.PokemonSearchResults {\n const searchQuery = sanitizeSearchQuery(filters.q ?? '')\n\n if (requiresSearchString && searchQuery.length < MIN_SEARCH_LENGTH) {\n return {\n pokemon: pokemon,\n meta: { total: pokemon.length, skipped: true },\n }\n }\n\n const filteredPokes = pokemon.filter((p) => {\n // const filterGen = filter.q ? 0 : (filter.gen ?? 0)\n const filterGen = filters.gen ?? 0\n\n if (!filters.forms && p.isForm) return false\n if (filters.color && p.color.toLowerCase() !== filters.color.toLowerCase()) return false\n if (filters.type && ![p.type1, p.type2].filter(Boolean).includes(filters.type)) return false\n if (filterGen > 0 && p.speciesGen !== filters.gen) return false\n\n if (filters.q && !matchesSearchQuery(p.searchableText, filters.q)) return false\n\n return true\n })\n\n return {\n pokemon: filteredPokes,\n meta: { total: pokemon.length, skipped: false },\n }\n}\n\nexport function createSearchablePokemonList(\n pokemon: Array<Pkds.Pokemon>,\n): Array<Pkds.TranslatedPokemon> {\n return pokemon.map((pokemon: Pkds.Pokemon): Pkds.TranslatedPokemon => ({\n ...pokemon,\n speciesGen: dexNumToGen(pokemon.dexNum),\n dexNum: formatDexNum(pokemon.dexNum),\n name: pokemon.names['eng'] ?? '',\n speciesName: pokemon.speciesNames?.['eng'],\n formName: pokemon.formNames?.['eng'],\n lang: 'eng',\n searchableText: generatePokemonSearchableText(pokemon),\n }))\n}\n"],"mappings":";;;AAGA,MAAM,oBAAoB;AAE1B,SAAgB,cACd,SACA,SACA,uBAAgC,MACL;CAC3B,MAAM,cAAc,oBAAoB,QAAQ,KAAK,EAAE;CAEvD,IAAI,wBAAwB,YAAY,SAAS,mBAC/C,OAAO;EACI;EACT,MAAM;GAAE,OAAO,QAAQ;GAAQ,SAAS;EAAK;CAC/C;CAiBF,OAAO;EACL,SAfoB,QAAQ,QAAQ,MAAM;GAE1C,MAAM,YAAY,QAAQ,OAAO;GAEjC,IAAI,CAAC,QAAQ,SAAS,EAAE,QAAQ,OAAO;GACvC,IAAI,QAAQ,SAAS,EAAE,MAAM,YAAY,MAAM,QAAQ,MAAM,YAAY,GAAG,OAAO;GACnF,IAAI,QAAQ,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,SAAS,QAAQ,IAAI,GAAG,OAAO;GACvF,IAAI,YAAY,KAAK,EAAE,eAAe,QAAQ,KAAK,OAAO;GAE1D,IAAI,QAAQ,KAAK,CAAC,mBAAmB,EAAE,gBAAgB,QAAQ,CAAC,GAAG,OAAO;GAE1E,OAAO;EACT,CAGuB;EACrB,MAAM;GAAE,OAAO,QAAQ;GAAQ,SAAS;EAAM;CAChD;AACF;AAEA,SAAgB,4BACd,SAC+B;CAC/B,OAAO,QAAQ,KAAK,aAAmD;EACrE,GAAG;EACH,YAAY,YAAY,QAAQ,MAAM;EACtC,QAAQ,aAAa,QAAQ,MAAM;EACnC,MAAM,QAAQ,MAAM,UAAU;EAC9B,aAAa,QAAQ,eAAe;EACpC,UAAU,QAAQ,YAAY;EAC9B,MAAM;EACN,gBAAgB,8BAA8B,OAAO;CACvD,EAAE;AACJ"}
1
+ {"version":3,"file":"search.mjs","names":[],"sources":["../../src/lib/search.ts"],"sourcesContent":["import { dexNumToGen, formatDexNum, generatePokemonSearchableText } from './utils'\nimport { matchesSearchQuery, sanitizeSearchQuery } from '../utils/utils-internal'\nexport { matchesSearchQuery, sanitizeSearchQuery } from '../utils/utils-internal'\n\nconst MIN_SEARCH_LENGTH = 2\n\nexport function searchPokemon(\n pokemon: Array<Pkds.TranslatedPokemon>,\n filters: Partial<Pkds.PokemonSearchFilter>,\n requiresSearchString: boolean = true,\n): Pkds.PokemonSearchResults {\n const searchQuery = sanitizeSearchQuery(filters.q ?? '')\n\n if (requiresSearchString && searchQuery.length < MIN_SEARCH_LENGTH) {\n return {\n pokemon: pokemon,\n meta: { total: pokemon.length, skipped: true },\n }\n }\n\n const filteredPokes = pokemon.filter((p) => {\n // const filterGen = filter.q ? 0 : (filter.gen ?? 0)\n const filterGen = filters.gen ?? 0\n\n if (!filters.forms && p.isForm) return false\n if (filters.color && p.color.toLowerCase() !== filters.color.toLowerCase()) return false\n if (filters.type && ![p.type1, p.type2].filter(Boolean).includes(filters.type)) return false\n if (filterGen > 0 && p.speciesGen !== filters.gen) return false\n\n if (filters.q && !matchesSearchQuery(p.searchableText, filters.q)) return false\n\n return true\n })\n\n return {\n pokemon: filteredPokes,\n meta: { total: pokemon.length, skipped: false },\n }\n}\n\nexport function createSearchablePokemonList(\n pokemon: Array<Pkds.Pokemon>,\n): Array<Pkds.TranslatedPokemon> {\n return pokemon.map((pokemon: Pkds.Pokemon): Pkds.TranslatedPokemon => ({\n ...pokemon,\n speciesGen: dexNumToGen(pokemon.dexNum),\n dexNum: formatDexNum(pokemon.dexNum),\n name: pokemon.names['eng'] ?? '',\n speciesName: pokemon.speciesNames?.['eng'],\n formName: pokemon.formNames?.['eng'],\n lang: 'eng',\n searchableText: generatePokemonSearchableText(pokemon),\n }))\n}\n"],"mappings":";;;AAIA,MAAM,oBAAoB;AAE1B,SAAgB,cACd,SACA,SACA,uBAAgC,MACL;CAC3B,MAAM,cAAc,oBAAoB,QAAQ,KAAK,EAAE;CAEvD,IAAI,wBAAwB,YAAY,SAAS,mBAC/C,OAAO;EACI;EACT,MAAM;GAAE,OAAO,QAAQ;GAAQ,SAAS;EAAK;CAC/C;CAiBF,OAAO;EACL,SAfoB,QAAQ,QAAQ,MAAM;GAE1C,MAAM,YAAY,QAAQ,OAAO;GAEjC,IAAI,CAAC,QAAQ,SAAS,EAAE,QAAQ,OAAO;GACvC,IAAI,QAAQ,SAAS,EAAE,MAAM,YAAY,MAAM,QAAQ,MAAM,YAAY,GAAG,OAAO;GACnF,IAAI,QAAQ,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,SAAS,QAAQ,IAAI,GAAG,OAAO;GACvF,IAAI,YAAY,KAAK,EAAE,eAAe,QAAQ,KAAK,OAAO;GAE1D,IAAI,QAAQ,KAAK,CAAC,mBAAmB,EAAE,gBAAgB,QAAQ,CAAC,GAAG,OAAO;GAE1E,OAAO;EACT,CAGuB;EACrB,MAAM;GAAE,OAAO,QAAQ;GAAQ,SAAS;EAAM;CAChD;AACF;AAEA,SAAgB,4BACd,SAC+B;CAC/B,OAAO,QAAQ,KAAK,aAAmD;EACrE,GAAG;EACH,YAAY,YAAY,QAAQ,MAAM;EACtC,QAAQ,aAAa,QAAQ,MAAM;EACnC,MAAM,QAAQ,MAAM,UAAU;EAC9B,aAAa,QAAQ,eAAe;EACpC,UAAU,QAAQ,YAAY;EAC9B,MAAM;EACN,gBAAgB,8BAA8B,OAAO;CACvD,EAAE;AACJ"}
@@ -1,5 +1,5 @@
1
1
  import { _ as statIds, a as gameType, c as ivJudgeValues, d as languageInGameCodes, f as moveCategory, g as ribbonCategory, h as raidStyles, i as gameSeries, l as languageAlpha3Codes, m as pokemonSizes, n as battleStyles, o as genders, p as pokeballCategory, r as gamePlatforms, s as itemCategory, t as abilityTagIds, u as languageIds, v as titleTypes, y as typeIds } from "../enums-CCbmORM6.mjs";
2
- import { A as pokemonSchema, C as onlineFeaturesSchema, D as pokedexEntrySchema, E as pokeballSchema, M as regionSchema, N as ribbonSchema, O as pokedexSchema, P as typeSchema, S as natureSchema, T as personalitySchema, _ as modernBoxPresetIndexSchema, b as modernBoxPresetTags, c as colorSchema, d as generationSchema, f as i18nTextSchema, g as modernBoxPresetBoxSchema, h as markSchema, j as pokemonSearchFilterSchema, k as pokemonRefsSchema, l as gameFeaturesSchema, m as languageSchema, n as boxPresetBoxPokemonSchema, o as boxPresetSchema, p as itemSchema, r as boxPresetBoxSchema, s as characterSchema, t as abilitySchema, u as gameSchema, v as modernBoxPresetSchema, w as originMarkSchema, x as moveSchema, y as modernBoxPresetSlotSchema } from "../schemas-CDSWgtoj.mjs";
2
+ import { A as pokemonSchema, C as onlineFeaturesSchema, D as pokedexEntrySchema, E as pokeballSchema, M as regionSchema, N as ribbonSchema, O as pokedexSchema, P as typeSchema, S as natureSchema, T as personalitySchema, _ as modernBoxPresetIndexSchema, b as modernBoxPresetTags, c as colorSchema, d as generationSchema, f as i18nTextSchema, g as modernBoxPresetBoxSchema, h as markSchema, j as pokemonSearchFilterSchema, k as pokemonRefsSchema, l as gameFeaturesSchema, m as languageSchema, n as boxPresetBoxPokemonSchema, o as boxPresetSchema, p as itemSchema, r as boxPresetBoxSchema, s as characterSchema, t as abilitySchema, u as gameSchema, v as modernBoxPresetSchema, w as originMarkSchema, x as moveSchema, y as modernBoxPresetSlotSchema } from "../schemas-jxei_N2z.mjs";
3
3
  import z from "zod";
4
4
  //#region src/lib/types.d.ts
5
5
  declare global {
@@ -1,3 +1,4 @@
1
+ import { r as sortStringsInGivenOrder } from "../utils-internal-C-UStMrZ.mjs";
1
2
  //#region src/lib/utils.d.ts
2
3
  export declare function formatDexNum(num: number | string, positions?: number): string;
3
4
  export declare function dexNumToInt(num: number | string): number;
@@ -18,4 +19,5 @@ export declare function getGameCategoryLabel(game: Pkds.Game): string;
18
19
  export declare function generateGameDescription(game: Pkds.Game, gameCatText: string): string;
19
20
  export declare function resolvePokemonName(meta: Pkds.TranslatedPokemon, nickname?: string, lang3Char?: Pkds.LanguageAlpha3): Pkds.PokemonNameInfo;
20
21
  //#endregion
22
+ export { sortStringsInGivenOrder };
21
23
  //# sourceMappingURL=utils.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.mts","names":[],"sources":["../../src/lib/utils.ts"],"mappings":";wBAIgB,aAAa,sBAAsB;wBAInC,YAAY;wBAIZ,YAAY;wBAcZ,kBAAkB,UAAU,KAAK,aAC/C,aAAa,MAAM,IACnB,mBACA,sBACC,MAAM;wBAgBO,0BAA0B,MAAM,KAAK,UAAU,KAAK;wBAmBpD,iBACd,wCACA,MAAM,KAAK,SACX;EAAY;IACX,KAAK;wBA8BQ,qBACd,KAAK,KAAK,SACV,WAAW,KAAK,iBACf,KAAK;wBAeQ,iBACd,SAAS,KAAK,UAAU,KAAK,mBAC7B,MAAM,KAAK,gBACX,2BACC,KAAK;wBAoBQ,qBACd,aAAa,MAAM,KAAK,UAAU,KAAK,oBACvC,MAAM,KAAK,iBACV,MAAM,KAAK;wBAIE,qBACd,aAAa,MAAM,KAAK,UAAU,KAAK,oBACvC,MAAM,KAAK,iBACV,eAAe,KAAK;wBAMP,sBACd,aAAa,MAAM,KAAK,UAAU,KAAK,oBACvC,MAAM,KAAK,iBACV,eAAe,KAAK;wBAMP,2BACd,SAAS,KAAK,mBACd,WAAW,KAAK;wBAmCF,8BAA8B,MAAM,KAAK;wBAsCzC,qBAAqB,MAAM,KAAK;wBAahC,wBAAwB,MAAM,KAAK,MAAM;wBA+BzC,mBACd,MAAM,KAAK,mBACX,mBACA,YAAY,KAAK,iBAChB,KAAK"}
1
+ {"version":3,"file":"utils.d.mts","names":[],"sources":["../../src/lib/utils.ts"],"mappings":";;wBAKgB,aAAa,sBAAsB;wBAInC,YAAY;wBAIZ,YAAY;wBAcZ,kBAAkB,UAAU,KAAK,aAC/C,aAAa,MAAM,IACnB,mBACA,sBACC,MAAM;wBAgBO,0BAA0B,MAAM,KAAK,UAAU,KAAK;wBAmBpD,iBACd,wCACA,MAAM,KAAK,SACX;EAAY;IACX,KAAK;wBA8BQ,qBACd,KAAK,KAAK,SACV,WAAW,KAAK,iBACf,KAAK;wBAeQ,iBACd,SAAS,KAAK,UAAU,KAAK,mBAC7B,MAAM,KAAK,gBACX,2BACC,KAAK;wBAoBQ,qBACd,aAAa,MAAM,KAAK,UAAU,KAAK,oBACvC,MAAM,KAAK,iBACV,MAAM,KAAK;wBAIE,qBACd,aAAa,MAAM,KAAK,UAAU,KAAK,oBACvC,MAAM,KAAK,iBACV,eAAe,KAAK;wBAMP,sBACd,aAAa,MAAM,KAAK,UAAU,KAAK,oBACvC,MAAM,KAAK,iBACV,eAAe,KAAK;wBAMP,2BACd,SAAS,KAAK,mBACd,WAAW,KAAK;wBAmCF,8BAA8B,MAAM,KAAK;wBAsCzC,qBAAqB,MAAM,KAAK;wBAahC,wBAAwB,MAAM,KAAK,MAAM;wBA+BzC,mBACd,MAAM,KAAK,mBACX,mBACA,YAAY,KAAK,iBAChB,KAAK"}
@@ -1,2 +1,3 @@
1
- import { a as generatePokemonDescription, c as getPokemonGender, d as resolvePokemonName, f as translatePokemon, g as translatePokemonText, h as translatePokemonList, i as generateGameDescription, l as getPossiblePokemonGenders, m as translatePokemonByNid, n as dexNumToInt, o as generatePokemonSearchableText, p as translatePokemonById, r as formatDexNum, s as getGameCategoryLabel, t as dexNumToGen, u as randomPokemonList } from "../utils-BwovRocd.mjs";
2
- export { dexNumToGen, dexNumToInt, formatDexNum, generateGameDescription, generatePokemonDescription, generatePokemonSearchableText, getGameCategoryLabel, getPokemonGender, getPossiblePokemonGenders, randomPokemonList, resolvePokemonName, translatePokemon, translatePokemonById, translatePokemonByNid, translatePokemonList, translatePokemonText };
1
+ import { a as sortStringsInGivenOrder } from "../utils-internal-DPjO9kQX.mjs";
2
+ import { a as generatePokemonDescription, c as getPokemonGender, d as resolvePokemonName, f as translatePokemon, g as translatePokemonText, h as translatePokemonList, i as generateGameDescription, l as getPossiblePokemonGenders, m as translatePokemonByNid, n as dexNumToInt, o as generatePokemonSearchableText, p as translatePokemonById, r as formatDexNum, s as getGameCategoryLabel, t as dexNumToGen, u as randomPokemonList } from "../utils-BTjKkD-_.mjs";
3
+ export { dexNumToGen, dexNumToInt, formatDexNum, generateGameDescription, generatePokemonDescription, generatePokemonSearchableText, getGameCategoryLabel, getPokemonGender, getPossiblePokemonGenders, randomPokemonList, resolvePokemonName, sortStringsInGivenOrder, translatePokemon, translatePokemonById, translatePokemonByNid, translatePokemonList, translatePokemonText };
@@ -1,7 +1,7 @@
1
1
  import { n as writeJsonDataFile } from "../fs-B5MIz_Bs.mjs";
2
2
  import { i as appLangs } from "../languages-CY-Q1SED.mjs";
3
3
  //#region src/lib-next/_build.ts
4
- await import("../build-DvGzwIK8.mjs");
4
+ await import("../build-D2oPkkzJ.mjs");
5
5
  await import("../build-bE_0_-0H.mjs");
6
6
  writeJsonDataFile("languages.json", appLangs);
7
7
  console.log(`Exported ${appLangs.length} app languages`);
@@ -1 +1 @@
1
- {"version":3,"file":"enums.d.mts","names":[],"sources":["../../src/lib-next/enums.ts"],"mappings":";qBAAa;YACD,mBAAmB;qBAElB;YACD,qBAAqB;qBAEpB;YAaD,uBAAuB;qBAEtB;qBAqBA,2BAA2B;YAoB5B,sBAAsB;qBAErB;YACD,uBAAuB;qBAEtB;YAcD,oBAAoB;qBAEnB;YAaD,qBAAqB;qBAEpB;YAQD,0BAA0B;qBAEzB;YAoED,sBAAsB;qBAErB;YAUD,uBAAuB;qBAEtB;YAcD,sBAAsB;qBAErB;YACD,2BAA2B;qBAE1B;YACD,yBAAyB;qBAExB;YACD,iBAAiB;qBAEhB;YACD,oBAAoB;qBAEnB;YACD,sBAAsB;qBAErB;YACD,iBAAiB;;;;;;;;;;qBAWhB;YACD,uBAAuB;qBAEtB;YACD,sBAAsB;qBAErB;YACD,oBAAoB"}
1
+ {"version":3,"file":"enums.d.mts","names":[],"sources":["../../src/lib-next/enums.ts"],"mappings":";qBAAa;YACD,mBAAmB;qBAElB;YACD,qBAAqB;qBAEpB;YAaD,uBAAuB;qBAEtB;qBAqBA,2BAA2B;YAoB5B,sBAAsB;qBAErB;YACD,uBAAuB;qBAEtB;YAcD,oBAAoB;qBAEnB;YAaD,qBAAqB;qBAEpB;YAQD,0BAA0B;qBAEzB;YAuED,sBAAsB;qBAErB;YAUD,uBAAuB;qBAEtB;YAcD,sBAAsB;qBAErB;YACD,2BAA2B;qBAE1B;YACD,yBAAyB;qBAExB;YACD,iBAAiB;qBAEhB;YACD,oBAAoB;qBAEnB;YACD,sBAAsB;qBAErB;YACD,iBAAiB;;;;;;;;;;qBAWhB;YACD,uBAAuB;qBAEtB;YACD,sBAAsB;qBAErB;YACD,oBAAoB"}
@@ -1,2 +1,2 @@
1
- import { _ as raidStyles, a as gameSeries, b as statusConditions, c as itemCategories, d as moveClasses, f as moveTargets, g as pokemonTypesInternalOrder, h as pokemonTypes, i as gamePlatforms, l as ivJudgeValues, m as pokemonSizes, n as battleStates, o as gameTypes, p as pokeballCategories, r as battleStyles, s as genders, t as bagCategories, u as moveCategories, v as ribbonCategories, x as titleTypes, y as statIds } from "../enums-DlMg7WLl.mjs";
1
+ import { _ as raidStyles, a as gameSeries, b as statusConditions, c as itemCategories, d as moveClasses, f as moveTargets, g as pokemonTypesInternalOrder, h as pokemonTypes, i as gamePlatforms, l as ivJudgeValues, m as pokemonSizes, n as battleStates, o as gameTypes, p as pokeballCategories, r as battleStyles, s as genders, t as bagCategories, u as moveCategories, v as ribbonCategories, x as titleTypes, y as statIds } from "../enums-u8n-nN0B.mjs";
2
2
  export { bagCategories, battleStates, battleStyles, gamePlatforms, gameSeries, gameTypes, genders, itemCategories, ivJudgeValues, moveCategories, moveClasses, moveTargets, pokeballCategories, pokemonSizes, pokemonTypes, pokemonTypesInternalOrder, raidStyles, ribbonCategories, statIds, statusConditions, titleTypes };
@@ -77,8 +77,8 @@ export declare const moveSchema: z$1.ZodObject<{
77
77
  fairy: "fairy";
78
78
  }>;
79
79
  category: z$1.ZodEnum<{
80
- physical: "physical";
81
80
  special: "special";
81
+ physical: "physical";
82
82
  status: "status";
83
83
  }>;
84
84
  power: z$1.ZodNumber;
@@ -144,8 +144,8 @@ export declare const movesSchema: z$1.ZodArray<z$1.ZodObject<{
144
144
  fairy: "fairy";
145
145
  }>;
146
146
  category: z$1.ZodEnum<{
147
- physical: "physical";
148
147
  special: "special";
148
+ physical: "physical";
149
149
  status: "status";
150
150
  }>;
151
151
  power: z$1.ZodNumber;
@@ -210,13 +210,13 @@ export declare const itemSchema: z$1.ZodObject<{
210
210
  description: z$1.ZodString;
211
211
  pluralName: z$1.ZodString;
212
212
  categories: z$1.ZodArray<z$1.ZodEnum<{
213
+ berry: "berry";
214
+ other: "other";
215
+ defense: "defense";
213
216
  power_boost: "power_boost";
214
217
  recovery: "recovery";
215
- defense: "defense";
216
218
  stat_boost: "stat_boost";
217
219
  effect_extend: "effect_extend";
218
- berry: "berry";
219
- other: "other";
220
220
  mega_stone: "mega_stone";
221
221
  }>>;
222
222
  }, z$1.core.$strip>;
@@ -230,13 +230,13 @@ export declare const itemsSchema: z$1.ZodArray<z$1.ZodObject<{
230
230
  description: z$1.ZodString;
231
231
  pluralName: z$1.ZodString;
232
232
  categories: z$1.ZodArray<z$1.ZodEnum<{
233
+ berry: "berry";
234
+ other: "other";
235
+ defense: "defense";
233
236
  power_boost: "power_boost";
234
237
  recovery: "recovery";
235
- defense: "defense";
236
238
  stat_boost: "stat_boost";
237
239
  effect_extend: "effect_extend";
238
- berry: "berry";
239
- other: "other";
240
240
  mega_stone: "mega_stone";
241
241
  }>>;
242
242
  }, z$1.core.$strip>>;
@@ -1,2 +1,2 @@
1
- import { _ as pokemonListSchema, a as battleStatesSchema, b as pokemonSchema, c as i18nSchema, d as itemSchema, f as itemsSchema, g as pokemonI18nSchema, h as pokemonI18nRecordsSchema, i as battleStateSchema, l as itemI18nRecordsSchema, m as movesSchema, n as abilitySchema, o as championsLinkedBaseSchema, p as moveSchema, r as baseSchema, s as i18nRecordsSchema, t as abilitiesSchema, u as itemI18nSchema, v as pokemonMovesRecordSchema, x as slugSchema, y as pokemonMovesSchema } from "../schemas-Bj1AIX0P.mjs";
1
+ import { _ as pokemonListSchema, a as battleStatesSchema, b as pokemonSchema, c as i18nSchema, d as itemSchema, f as itemsSchema, g as pokemonI18nSchema, h as pokemonI18nRecordsSchema, i as battleStateSchema, l as itemI18nRecordsSchema, m as movesSchema, n as abilitySchema, o as championsLinkedBaseSchema, p as moveSchema, r as baseSchema, s as i18nRecordsSchema, t as abilitiesSchema, u as itemI18nSchema, v as pokemonMovesRecordSchema, x as slugSchema, y as pokemonMovesSchema } from "../schemas-CWE4YPI2.mjs";
2
2
  export { abilitiesSchema, abilitySchema, baseSchema, battleStateSchema, battleStatesSchema, championsLinkedBaseSchema, i18nRecordsSchema, i18nSchema, itemI18nRecordsSchema, itemI18nSchema, itemSchema, itemsSchema, moveSchema, movesSchema, pokemonI18nRecordsSchema, pokemonI18nSchema, pokemonListSchema, pokemonMovesRecordSchema, pokemonMovesSchema, pokemonSchema, slugSchema };
@@ -1,4 +1,4 @@
1
- import { c as itemCategories, d as moveClasses, f as moveTargets, h as pokemonTypes, n as battleStates, u as moveCategories } from "./enums-DlMg7WLl.mjs";
1
+ import { c as itemCategories, d as moveClasses, f as moveTargets, h as pokemonTypes, n as battleStates, u as moveCategories } from "./enums-u8n-nN0B.mjs";
2
2
  import { z as z$1 } from "zod";
3
3
  //#region src/lib-next/schemas.ts
4
4
  const slugSchema = z$1.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
@@ -90,4 +90,4 @@ const pokemonMovesSchema = z$1.array(pokemonMovesRecordSchema);
90
90
  //#endregion
91
91
  export { pokemonListSchema as _, battleStatesSchema as a, pokemonSchema as b, i18nSchema as c, itemSchema as d, itemsSchema as f, pokemonI18nSchema as g, pokemonI18nRecordsSchema as h, battleStateSchema as i, itemI18nRecordsSchema as l, movesSchema as m, abilitySchema as n, championsLinkedBaseSchema as o, moveSchema as p, baseSchema as r, i18nRecordsSchema as s, abilitiesSchema as t, itemI18nSchema as u, pokemonMovesRecordSchema as v, slugSchema as x, pokemonMovesSchema as y };
92
92
 
93
- //# sourceMappingURL=schemas-Bj1AIX0P.mjs.map
93
+ //# sourceMappingURL=schemas-CWE4YPI2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas-Bj1AIX0P.mjs","names":["z"],"sources":["../src/lib-next/schemas.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n battleStates,\n itemCategories,\n moveCategories,\n moveClasses,\n moveTargets,\n pokemonTypes,\n} from './enums'\n\nexport const slugSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)\n\nexport const baseSchema = z.object({\n id: z.string(),\n slug: slugSchema,\n name: z.string(),\n description: z.string(),\n})\n\nexport const championsLinkedBaseSchema = z.object({\n id: slugSchema,\n championsId: z.string(),\n // Null once enriched and PokeAPI has no such resource; absent before the\n // enrichment step has run. Never a guessed id.\n pokeApiId: z.number().int().positive().nullish(),\n slug: slugSchema,\n name: z.string(),\n description: z.string(),\n})\n\nexport const i18nSchema = z.object({\n id: z.string(),\n slug: slugSchema,\n slugLoc: slugSchema,\n name: z.string(),\n description: z.string(), // description template, with placeholders like `{0}`\n})\nexport type I18nRecord = z.infer<typeof i18nSchema>\nexport const i18nRecordsSchema = z.array(i18nSchema)\nexport type I18nRecords = z.infer<typeof i18nRecordsSchema>\n\nexport const itemI18nSchema = i18nSchema.extend({\n pluralName: z.string(),\n})\nexport type ItemI18nRecord = z.infer<typeof itemI18nSchema>\nexport const itemI18nRecordsSchema = z.array(itemI18nSchema)\nexport type ItemI18nRecords = z.infer<typeof itemI18nRecordsSchema>\n\nexport const moveSchema = championsLinkedBaseSchema.extend({\n type: z.enum(pokemonTypes),\n category: z.enum(moveCategories),\n power: z.number().min(0).max(999),\n pp: z.number().min(0).max(99),\n accuracy: z.number().min(0).max(101),\n priority: z.number().min(-10).max(10),\n target: z.enum(moveTargets),\n classification: z.array(z.enum(moveClasses)),\n contact: z.boolean(), // if its a direct contact move or not\n usable: z.boolean(), // if the game allows you to use it or not (e.g. legacy)\n})\nexport type MoveRecord = z.infer<typeof moveSchema>\nexport const movesSchema = z.array(moveSchema)\nexport type MoveRecords = z.infer<typeof movesSchema>\n\nexport const abilitySchema = championsLinkedBaseSchema.extend({})\nexport type AbilityRecord = z.infer<typeof abilitySchema>\nexport const abilitiesSchema = z.array(abilitySchema)\nexport type AbilityRecords = z.infer<typeof abilitiesSchema>\n\nexport const itemSchema = championsLinkedBaseSchema.extend({\n pluralName: z.string(),\n categories: z.array(z.enum(itemCategories)),\n})\nexport type ItemRecord = z.infer<typeof itemSchema>\nexport const itemsSchema = z.array(itemSchema)\nexport type ItemRecords = z.infer<typeof itemsSchema>\n\nexport const battleStateSchema = baseSchema.extend({\n state: z.enum(battleStates),\n})\nexport type BattleStateRecord = z.infer<typeof battleStateSchema>\nexport const battleStatesSchema = z.array(battleStateSchema)\nexport type BattleStateRecords = z.infer<typeof battleStatesSchema>\n\nexport const pokemonSchema = z.object({\n id: slugSchema,\n nid: slugSchema,\n name: z.string(),\n formName: z.string().optional(),\n pokeApiId: z.number().int().positive(),\n pokeApiFormId: z.number().int().positive().optional(),\n showdownId: z.string(),\n baseSpecies: slugSchema.optional(),\n championsId: z.string().regex(/^\\d{7}$/),\n type1: z.enum(pokemonTypes),\n type2: z.enum(pokemonTypes).nullable(),\n abilities: z.array(slugSchema),\n baseHp: z.number().int().min(1),\n baseAtk: z.number().int().min(1),\n baseDef: z.number().int().min(1),\n baseSpAtk: z.number().int().min(1),\n baseSpDef: z.number().int().min(1),\n baseSpeed: z.number().int().min(1),\n height: z.number().int().min(-1),\n weight: z.number().int().min(-1),\n isForm: z.boolean(),\n isBattleOnly: z.boolean(),\n isCosmetic: z.boolean(),\n isFemale: z.boolean(),\n})\nexport type PokemonRecord = z.infer<typeof pokemonSchema>\nexport const pokemonListSchema = z.array(pokemonSchema)\nexport type PokemonRecords = z.infer<typeof pokemonListSchema>\n\nexport const pokemonI18nSchema = z.object({\n id: slugSchema,\n championsId: z.string().regex(/^\\d{7}$/),\n name: z.string(),\n formName: z.string().optional(),\n})\nexport type PokemonI18nRecord = z.infer<typeof pokemonI18nSchema>\nexport const pokemonI18nRecordsSchema = z.array(pokemonI18nSchema)\nexport type PokemonI18nRecords = z.infer<typeof pokemonI18nRecordsSchema>\n\nexport const pokemonMovesRecordSchema = z.object({\n id: slugSchema,\n moves: z.array(slugSchema),\n})\nexport type PokemonMovesRecord = z.infer<typeof pokemonMovesRecordSchema>\n\nexport const pokemonMovesSchema = z.array(pokemonMovesRecordSchema)\nexport type PokemonMovesRecords = z.infer<typeof pokemonMovesSchema>\n"],"mappings":";;;AAUA,MAAa,aAAaA,IAAE,OAAO,CAAC,CAAC,MAAM,4BAA4B;AAEvE,MAAa,aAAaA,IAAE,OAAO;CACjC,IAAIA,IAAE,OAAO;CACb,MAAM;CACN,MAAMA,IAAE,OAAO;CACf,aAAaA,IAAE,OAAO;AACxB,CAAC;AAED,MAAa,4BA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CAC/B,QAAQA,IAAE,QAAQ;CAClB,cAAcA,IAAE,QAAQ;CACxB,YAAYA,IAAE,QAAQ;CACtB,UAAUA,IAAE,QAAQ;AACtB,CAAC;AAED,MAAa,oBAAoBA,IAAE,MAAM,aAAa;AAGtD,MAAa,oBAAoBA,IAAE,OAAO;CACxC,IAAI;CACJ,aAAaA,IAAE,OAAO,CAAC,CAAC,MAAM,SAAS;CACvC,MAAMA,IAAE,OAAO;CACf,UAAUA,IAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC;AAED,MAAa,2BAA2BA,IAAE,MAAM,iBAAiB;AAGjE,MAAa,2BAA2BA,IAAE,OAAO;CAC/C,IAAI;CACJ,OAAOA,IAAE,MAAM,UAAU;AAC3B,CAAC;AAGD,MAAa,qBAAqBA,IAAE,MAAM,wBAAwB"}
1
+ {"version":3,"file":"schemas-CWE4YPI2.mjs","names":["z"],"sources":["../src/lib-next/schemas.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n battleStates,\n itemCategories,\n moveCategories,\n moveClasses,\n moveTargets,\n pokemonTypes,\n} from './enums'\n\nexport const slugSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)\n\nexport const baseSchema = z.object({\n id: z.string(),\n slug: slugSchema,\n name: z.string(),\n description: z.string(),\n})\n\nexport const championsLinkedBaseSchema = z.object({\n id: slugSchema,\n championsId: z.string(),\n // Null once enriched and PokeAPI has no such resource; absent before the\n // enrichment step has run. Never a guessed id.\n pokeApiId: z.number().int().positive().nullish(),\n slug: slugSchema,\n name: z.string(),\n description: z.string(),\n})\n\nexport const i18nSchema = z.object({\n id: z.string(),\n slug: slugSchema,\n slugLoc: slugSchema,\n name: z.string(),\n description: z.string(), // description template, with placeholders like `{0}`\n})\nexport type I18nRecord = z.infer<typeof i18nSchema>\nexport const i18nRecordsSchema = z.array(i18nSchema)\nexport type I18nRecords = z.infer<typeof i18nRecordsSchema>\n\nexport const itemI18nSchema = i18nSchema.extend({\n pluralName: z.string(),\n})\nexport type ItemI18nRecord = z.infer<typeof itemI18nSchema>\nexport const itemI18nRecordsSchema = z.array(itemI18nSchema)\nexport type ItemI18nRecords = z.infer<typeof itemI18nRecordsSchema>\n\nexport const moveSchema = championsLinkedBaseSchema.extend({\n type: z.enum(pokemonTypes),\n category: z.enum(moveCategories),\n power: z.number().min(0).max(999),\n pp: z.number().min(0).max(99),\n accuracy: z.number().min(0).max(101),\n priority: z.number().min(-10).max(10),\n target: z.enum(moveTargets),\n classification: z.array(z.enum(moveClasses)),\n contact: z.boolean(), // if its a direct contact move or not\n usable: z.boolean(), // if the game allows you to use it or not (e.g. legacy)\n})\nexport type MoveRecord = z.infer<typeof moveSchema>\nexport const movesSchema = z.array(moveSchema)\nexport type MoveRecords = z.infer<typeof movesSchema>\n\nexport const abilitySchema = championsLinkedBaseSchema.extend({})\nexport type AbilityRecord = z.infer<typeof abilitySchema>\nexport const abilitiesSchema = z.array(abilitySchema)\nexport type AbilityRecords = z.infer<typeof abilitiesSchema>\n\nexport const itemSchema = championsLinkedBaseSchema.extend({\n pluralName: z.string(),\n categories: z.array(z.enum(itemCategories)),\n})\nexport type ItemRecord = z.infer<typeof itemSchema>\nexport const itemsSchema = z.array(itemSchema)\nexport type ItemRecords = z.infer<typeof itemsSchema>\n\nexport const battleStateSchema = baseSchema.extend({\n state: z.enum(battleStates),\n})\nexport type BattleStateRecord = z.infer<typeof battleStateSchema>\nexport const battleStatesSchema = z.array(battleStateSchema)\nexport type BattleStateRecords = z.infer<typeof battleStatesSchema>\n\nexport const pokemonSchema = z.object({\n id: slugSchema,\n nid: slugSchema,\n name: z.string(),\n formName: z.string().optional(),\n pokeApiId: z.number().int().positive(),\n pokeApiFormId: z.number().int().positive().optional(),\n showdownId: z.string(),\n baseSpecies: slugSchema.optional(),\n championsId: z.string().regex(/^\\d{7}$/),\n type1: z.enum(pokemonTypes),\n type2: z.enum(pokemonTypes).nullable(),\n abilities: z.array(slugSchema),\n baseHp: z.number().int().min(1),\n baseAtk: z.number().int().min(1),\n baseDef: z.number().int().min(1),\n baseSpAtk: z.number().int().min(1),\n baseSpDef: z.number().int().min(1),\n baseSpeed: z.number().int().min(1),\n height: z.number().int().min(-1),\n weight: z.number().int().min(-1),\n isForm: z.boolean(),\n isBattleOnly: z.boolean(),\n isCosmetic: z.boolean(),\n isFemale: z.boolean(),\n})\nexport type PokemonRecord = z.infer<typeof pokemonSchema>\nexport const pokemonListSchema = z.array(pokemonSchema)\nexport type PokemonRecords = z.infer<typeof pokemonListSchema>\n\nexport const pokemonI18nSchema = z.object({\n id: slugSchema,\n championsId: z.string().regex(/^\\d{7}$/),\n name: z.string(),\n formName: z.string().optional(),\n})\nexport type PokemonI18nRecord = z.infer<typeof pokemonI18nSchema>\nexport const pokemonI18nRecordsSchema = z.array(pokemonI18nSchema)\nexport type PokemonI18nRecords = z.infer<typeof pokemonI18nRecordsSchema>\n\nexport const pokemonMovesRecordSchema = z.object({\n id: slugSchema,\n moves: z.array(slugSchema),\n})\nexport type PokemonMovesRecord = z.infer<typeof pokemonMovesRecordSchema>\n\nexport const pokemonMovesSchema = z.array(pokemonMovesRecordSchema)\nexport type PokemonMovesRecords = z.infer<typeof pokemonMovesSchema>\n"],"mappings":";;;AAUA,MAAa,aAAaA,IAAE,OAAO,CAAC,CAAC,MAAM,4BAA4B;AAEvE,MAAa,aAAaA,IAAE,OAAO;CACjC,IAAIA,IAAE,OAAO;CACb,MAAM;CACN,MAAMA,IAAE,OAAO;CACf,aAAaA,IAAE,OAAO;AACxB,CAAC;AAED,MAAa,4BAA4BA,IAAE,OAAO;CAChD,IAAI;CACJ,aAAaA,IAAE,OAAO;CAGtB,WAAWA,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ;CAC/C,MAAM;CACN,MAAMA,IAAE,OAAO;CACf,aAAaA,IAAE,OAAO;AACxB,CAAC;AAED,MAAa,aAAaA,IAAE,OAAO;CACjC,IAAIA,IAAE,OAAO;CACb,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E,OAAO;CACf,UAAUA,IAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC;AAED,MAAa,2BAA2BA,IAAE,MAAM,iBAAiB;AAGjE,MAAa,2BAA2BA,IAAE,OAAO;CAC/C,IAAI;CACJ,OAAOA,IAAE,MAAM,UAAU;AAC3B,CAAC;AAGD,MAAa,qBAAqBA,IAAE,MAAM,wBAAwB"}
@@ -52,6 +52,8 @@ const characterSchema = base.entity.extend({});
52
52
  const colorSchema = base.entity.extend({ color: common.colorHex });
53
53
  const gameFeaturesSchema = z$1.object({
54
54
  storage: z$1.boolean(),
55
+ party: z$1.boolean(),
56
+ battleTeams: z$1.boolean(),
55
57
  pokedex: z$1.boolean(),
56
58
  training: z$1.boolean(),
57
59
  shiny: z$1.boolean(),
@@ -96,6 +98,8 @@ const gameSchema = base.entity.extend({
96
98
  pokedexes: z$1.array(common.slug),
97
99
  maxBoxes: common.int,
98
100
  maxBoxSize: common.int,
101
+ maxPartySize: common.int,
102
+ maxBattleTeams: common.int,
99
103
  platforms: z$1.array(z$1.enum(gamePlatforms)).min(1),
100
104
  isUnreleased: z$1.coerce.boolean().optional(),
101
105
  features: gameFeaturesSchema,
@@ -346,4 +350,4 @@ const pokemonSearchFilterSchema = z$1.object({
346
350
  //#endregion
347
351
  export { pokemonSchema as A, onlineFeaturesSchema as C, pokedexEntrySchema as D, pokeballSchema as E, regionSchema as M, ribbonSchema as N, pokedexSchema as O, typeSchema as P, natureSchema as S, personalitySchema as T, modernBoxPresetIndexSchema as _, boxPresetMapSchema as a, modernBoxPresetTags as b, colorSchema as c, generationSchema as d, i18nTextSchema as f, modernBoxPresetBoxSchema as g, markSchema as h, boxPresetIndexItemSchema as i, pokemonSearchFilterSchema as j, pokemonRefsSchema as k, gameFeaturesSchema as l, languageSchema as m, boxPresetBoxPokemonSchema as n, boxPresetSchema as o, itemSchema as p, boxPresetBoxSchema as r, characterSchema as s, abilitySchema as t, gameSchema as u, modernBoxPresetSchema as v, originMarkSchema as w, moveSchema as x, modernBoxPresetSlotSchema as y };
348
352
 
349
- //# sourceMappingURL=schemas-CcUqoHNr.mjs.map
353
+ //# sourceMappingURL=schemas-DvWBehAR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas-DvWBehAR.mjs","names":["z"],"sources":["../src/lib/schemas.ts"],"sourcesContent":["import { z } from 'zod'\nimport { POKEPC_LATEST_GENERATION } from './constants'\nimport {\n abilityTagIds,\n battleStyles,\n gamePlatforms,\n gameSeries,\n gameType,\n genders,\n itemCategory,\n languageAlpha3Codes,\n languageIds,\n languageInGameCodes,\n moveCategory,\n pokeballCategory,\n raidStyles,\n ribbonCategory,\n statIds,\n typeIds,\n} from './enums'\n\nconst common = {\n name: z.string().max(50),\n gen: z.coerce.number().int().min(0).max(POKEPC_LATEST_GENERATION),\n slug: z\n .string()\n .max(50)\n .regex(/^[a-z0-9-]+$/),\n desc: z.string().max(2000).nullable(),\n shortDesc: z.string().max(200),\n // sortIndex: z.coerce.number().min(0),\n colorHex: z.string().regex(/^#[0-9a-f]{6}$/i),\n dateDay: z.string().regex(/^\\d{4}-\\d{2}-\\d{2}$/),\n statId: z.enum(statIds),\n typeId: z.enum(typeIds),\n int: z.coerce.number().int(),\n dexNum: z.union([z.string().regex(/^\\d{1,5}$/), z.coerce.number().int().min(0).max(99999)]),\n level: z.coerce.number().int().min(1).max(100),\n statValue: z.coerce.number().int().min(-1).max(255),\n}\n\nconst base = {\n entity: z.object({\n id: common.slug,\n name: common.name,\n // sortIndex: defs.sortIndex,\n }),\n entityWithGenAndDescs: z.object({\n id: common.slug,\n name: common.name,\n gen: common.gen,\n shortDesc: common.shortDesc,\n desc: common.desc,\n // sortIndex: defs.sortIndex,\n }),\n entityWithGenAndDescsAndShowdownName: z.object({\n id: common.slug,\n name: common.name,\n psName: common.name,\n gen: common.gen,\n shortDesc: common.shortDesc,\n desc: common.desc,\n // sortIndex: defs.sortIndex,\n }),\n}\n\nexport const i18nTextSchema = z.record(z.enum(languageAlpha3Codes), z.string().optional())\n\nexport const abilitySchema = base.entityWithGenAndDescsAndShowdownName.extend({\n tags: z.array(z.enum(abilityTagIds)).min(1),\n immunities: z.array(common.typeId).optional(),\n weaknesses: z.array(common.typeId).optional(),\n})\nexport const personalitySchema = z.object({\n id: common.slug,\n shortDesc: common.shortDesc,\n // sortIndex: defs.sortIndex,\n})\nexport const characterSchema = base.entity.extend({\n // sprite: z.string(),\n})\nexport const colorSchema = base.entity.extend({\n color: common.colorHex,\n})\nexport const gameFeaturesSchema = z.object({\n storage: z.boolean(), // when true, the game has a storage system (boxes, etc)\n party: z.boolean(), // when true, Pokemon are carried in a party (see maxPartySize)\n battleTeams: z.boolean(), // when true, teams can be registered for battles (see maxBattleTeams)\n pokedex: z.boolean(), // when true, the game has at least one pokedex\n training: z.boolean(), // when true, the Pokemon are trainable with traditional methods (evs, ivs, hyper training, etc)\n shiny: z.boolean(),\n items: z.boolean(),\n gender: z.boolean(),\n pokerus: z.boolean(), // All except Gen 1, GO and from S/V onwards\n nature: z.boolean(),\n ribbons: z.boolean(), // Since gen 3\n marks: z.boolean(), // Since gen 8\n markings: z.boolean(), // Since gen 3 (circle, triangle, square, heart, star, diamond)\n shadow: z.boolean(), // Colosseum, XD and GO\n ball: z.boolean(), // Caught balls, since gen 4\n mega: z.boolean(),\n zmove: z.boolean(),\n gmax: z.boolean(),\n alpha: z.boolean(),\n tera: z.boolean(),\n plusmvs: z.boolean(), // mastered moves, LA and LZA only\n mints: z.boolean(),\n sizes: z.boolean(), // For some games like Let's GO, Legends, etc.\n abilities: z.boolean(), // gen 1-2 and Legends games have no abilities\n})\nexport const onlineFeaturesSchema = z.object({\n battles: z.boolean(),\n battleStyles: z.array(z.enum(battleStyles)),\n trades: z.boolean(),\n raids: z.boolean(),\n raidStyles: z.array(z.enum(raidStyles)),\n coop: z.boolean(),\n})\nexport const gameSchema = base.entity.extend({\n gen: common.gen,\n nameSlug: common.slug,\n codename: common.name.nullable(),\n type: z.enum(gameType),\n series: z.enum(gameSeries),\n gameSet: common.slug.nullable(),\n gameSuperSet: common.slug.nullable(),\n releaseDate: common.dateDay,\n region: common.slug.nullable(),\n originMark: common.slug.nullable(),\n pokedexes: z.array(common.slug),\n maxBoxes: common.int,\n maxBoxSize: common.int,\n maxPartySize: common.int, // Pokemon carried at once, 0 when the game has no party\n maxBattleTeams: common.int, // registrable battle teams, 0 when unsupported (the gen 5-6 Battle Box counts as 1)\n platforms: z.array(z.enum(gamePlatforms)).min(1),\n isUnreleased: z.coerce.boolean().optional(),\n features: gameFeaturesSchema,\n onlineFeatures: onlineFeaturesSchema.optional(),\n // sprite: z.string(),\n // spriteIcon: z.string(),\n})\nexport const generationSchema = z.object({\n id: common.int,\n minDexNum: common.int,\n maxDexNum: common.int,\n})\nexport const itemSchema = base.entityWithGenAndDescsAndShowdownName.extend({\n category: z.enum(itemCategory),\n unholdable: z.coerce.boolean().optional(),\n // sprite: z.string(),\n})\nexport const pokeballSchema = base.entityWithGenAndDescs.extend({\n category: z.enum(pokeballCategory),\n unusable: z.coerce.boolean().optional(),\n})\nexport const languageSchema = base.entity.extend({\n id: z.enum(languageIds),\n name: z.string(),\n nameEng: z.string(),\n alpha3: z.enum(languageAlpha3Codes),\n inGameCode: z.enum(languageInGameCodes),\n locale: z.string(),\n flag: z.string(),\n pkApiId: z.string().nullable(), // PokeAPI ID\n})\nexport const markSchema = base.entityWithGenAndDescs.extend({\n title: common.shortDesc,\n conditions: common.shortDesc,\n chance: z.string(),\n chanceCharm: z.string(),\n // sprite: z.string(),\n})\nexport const ribbonSchema = base.entityWithGenAndDescs.extend({\n title: common.shortDesc,\n category: z.enum(ribbonCategory),\n // sprite: z.string(),\n})\nexport const originMarkSchema = base.entity\nexport const regionSchema = base.entity\nexport const typeSchema = base.entity.extend({\n color: common.colorHex,\n isCanonical: z.boolean(),\n})\nexport const natureSchema = base.entity.extend({\n raises: common.statId.nullable(),\n lowers: common.statId.nullable(),\n})\nexport const moveSchema = base.entityWithGenAndDescsAndShowdownName.extend({\n type: common.typeId,\n power: common.int.min(0).max(999),\n accuracy: common.int.min(0).max(101),\n pp: common.int.min(0).max(100),\n category: z.enum(moveCategory),\n priority: common.int.min(-10).max(10),\n isZ: z.boolean(),\n isGmax: z.boolean(),\n})\n\nexport const pokedexEntrySchema = z.object({\n pid: common.slug,\n dexNum: common.dexNum,\n isForm: z.coerce.boolean(),\n transferOnly: z.coerce.boolean().optional(),\n originDex: common.slug.optional(),\n isNonCanonical: z.coerce.boolean().optional(), // if true, the pokemon is not canonical/main-series species or form. e.g Mosslax.\n // meta: optional data that can be used if the pokemon is not found in the main-series dataset,\n // e.g. this is relevant for spin-off games that contain special forms like in Pokopia.\n // For example, Mosslax has a different dex number than Snorlax in Pokopia, so it needs a special entry.\n meta: z\n .object({\n names: i18nTextSchema,\n speciesNames: i18nTextSchema.optional(),\n formNames: i18nTextSchema.optional(),\n type1: common.slug.optional(),\n type2: common.slug.optional(),\n attributes: z.record(common.slug, z.string()).optional(), // key-value info\n tags: z.array(common.slug).optional(),\n canonicalPid: common.slug.optional(), // e.g. for professor tangrowth, it would be tangrowth\n imgNid: common.slug.optional(), // if using a different nid for the image\n })\n .optional(),\n})\n\nexport const pokedexSchema = base.entity.extend({\n shortDesc: common.shortDesc.optional(),\n desc: common.desc.optional(),\n gen: common.gen,\n region: common.slug.nullable(),\n isNational: z.coerce.boolean(),\n baseDex: common.slug.nullable(),\n pkApiId: z.string().nullable(),\n entries: z.array(pokedexEntrySchema.strict()),\n // transferEntries: z.array(pokedexEntrySchema.strict()).optional(),\n})\n\nexport const pokemonRefsSchema = z.object({\n pkApiId: z.string(),\n pkApiFormId: z.string(),\n pkApiFormSlug: z.string(),\n smogon: z.string(),\n showdown: z.string(),\n showdownName: z.string(),\n serebii: z.string(),\n bulbapedia: z.string(),\n})\n\nexport const pokemonSchema = z.object({\n id: common.slug,\n nid: common.slug,\n imgNid: common.slug.optional(), // if using a different nid for the image\n dexNum: common.dexNum,\n formId: common.slug.optional(),\n // sprite2d: z.string().nullable(), // TODO:! make not nullable\n // sprite3d: z.string().nullable(), // TODO:! make not nullable\n // sprite3dShiny: z.string().nullable(), // TODO:! make not nullable\n region: common.slug,\n gen: common.gen,\n type1: common.slug,\n type2: common.slug.optional(),\n color: common.slug,\n ability1: common.slug,\n ability2: common.slug.optional(),\n abilityHidden: common.slug.optional(),\n abilitySpecial: common.slug.optional(),\n isPrerelease: z.coerce.boolean(),\n isDefault: z.coerce.boolean(),\n isForm: z.coerce.boolean(),\n formItem: common.slug.optional(),\n isLegendary: z.coerce.boolean(),\n isMythical: z.coerce.boolean(),\n isBaby: z.coerce.boolean(),\n isUltraBeast: z.coerce.boolean(),\n isParadox: z.coerce.boolean(),\n paradoxSpecies: z.array(common.slug).optional(),\n isConvergent: z.coerce.boolean(),\n convergentSpecies: z.array(common.slug).optional(),\n isCosmeticForm: z.coerce.boolean(),\n isFemaleForm: z.coerce.boolean(),\n hasGenderDifferences: z.coerce.boolean(),\n isBattleOnlyForm: z.coerce.boolean(),\n isFusion: z.coerce.boolean(),\n isMega: z.coerce.boolean(),\n isPrimal: z.coerce.boolean(),\n isGmax: z.coerce.boolean(),\n isRegional: z.coerce.boolean(),\n canGmax: z.coerce.boolean(),\n canDynamax: z.coerce.boolean(),\n canBeAlpha: z.coerce.boolean(),\n // ---- Obtainability:\n debutIn: common.slug, // the first game it appeared in\n obtainableIn: z.array(common.slug), // if it can be obtained in-game any time, without temporary or online events\n transferOnlyIn: z.array(common.slug), // if it can only be obtained by transferring from another games\n storableIn: z.array(common.slug), // if it's storable in the game's boxes\n eventOnlyIn: z.array(common.slug), // if it's exclusive to an event, and not obtainable in-game\n shinyLockedIn: z.array(common.slug).optional(), // if it's shiny locked in that game.\n shinyReleased: z.coerce.boolean(),\n shinyBase: common.slug.optional(),\n // -------------------\n baseHp: common.statValue,\n baseAtk: common.statValue,\n baseDef: common.statValue,\n baseSpAtk: common.statValue,\n baseSpDef: common.statValue,\n baseSpeed: common.statValue,\n height: common.int.min(-1).max(999999),\n weight: common.int.min(-1).max(999999),\n maleRate: z.coerce.number().min(-1).max(100),\n femaleRate: z.coerce.number().min(-1).max(100),\n baseSpecies: common.slug.optional(),\n baseForms: z.array(common.slug),\n forms: z.array(common.slug),\n formsDesc: z.string().optional(),\n family: common.slug.optional(),\n refs: pokemonRefsSchema,\n // evolution:\n evolvesFrom: common.slug.optional(),\n evoFromLevel: common.level.optional(),\n evoFromItem: common.slug.optional(),\n evoFromMove: common.slug.optional(),\n evoFromAbility: common.slug.optional(), // not provided by showdown (e.g. needed for rockruff (own tempo))\n evoFromGender: z.enum(genders).optional(),\n evoFromTrading: z.coerce.boolean().optional(),\n evoFromFriendship: z.coerce.boolean().optional(),\n evoFromCondition: z.string().optional(),\n // translations:\n names: i18nTextSchema,\n genus: i18nTextSchema,\n speciesNames: i18nTextSchema,\n formNames: i18nTextSchema,\n})\n\n// --- legacy\n\nexport const boxPresetIndexItemSchema = z\n .object({\n id: common.slug,\n gameSet: common.slug,\n legacyId: common.slug.nullable(),\n name: common.name,\n isHidden: z.coerce.boolean().optional(),\n })\n .strict()\n\nexport const boxPresetBoxPokemonSchema = common.slug.nullable().or(\n z.object({\n pid: common.slug,\n gmax: z.coerce.boolean().optional(),\n shinyLocked: z.coerce.boolean().optional(),\n shiny: z.coerce.boolean().optional(),\n }),\n)\n\nexport const boxPresetBoxSchema = z.object({\n title: z.string().max(120).optional(),\n pokemon: z.array(boxPresetBoxPokemonSchema),\n})\n\nexport const boxPresetSchema = z.object({\n id: common.slug,\n legacyId: common.slug.optional(),\n name: z.string().max(120),\n version: z.coerce.number().int().min(0),\n gameSet: common.slug.nullable(),\n description: z.string(),\n boxes: z.array(boxPresetBoxSchema),\n isHidden: z.coerce.boolean().optional(),\n})\n\nexport const boxPresetMapSchema = z.record(z.string(), z.record(z.string(), boxPresetSchema))\n\nexport const modernBoxPresetTags = [\n 'recommended',\n 'national',\n 'grouped',\n 'sorted',\n 'minimal',\n 'shiny',\n 'forms',\n] as const\n\nexport const modernBoxPresetIndexSchema = z.array(common.slug)\n\nexport const modernBoxPresetSlotSchema = common.slug.nullable().or(\n z\n .object({\n pokemon: common.slug,\n shiny: z.coerce.boolean().optional(),\n gmax: z.coerce.boolean().optional(),\n shinyLocked: z.coerce.boolean().optional(),\n })\n .strict(),\n)\n\nexport const modernBoxPresetBoxSchema = z\n .object({\n name: z.string().max(120).optional(),\n slots: z.array(modernBoxPresetSlotSchema),\n })\n .strict()\n\nexport const modernBoxPresetSchema = z\n .object({\n schemaVersion: z.literal(1),\n id: common.slug,\n gameSet: common.slug,\n name: z.string().max(120),\n description: z.string().max(2000).optional(),\n source: z\n .object({\n kind: z.literal('classic'),\n gameSet: common.slug,\n presetId: common.slug,\n version: z.coerce.number().int().min(0).optional(),\n legacyId: common.slug.optional(),\n })\n .strict()\n .optional(),\n tags: z.array(z.enum(modernBoxPresetTags)).optional(),\n boxes: z.array(modernBoxPresetBoxSchema),\n })\n .strict()\n\nexport const pokemonSearchFilterSchema = z.object({\n q: z.string().optional().catch(undefined),\n gen: z.coerce.number().min(1).max(POKEPC_LATEST_GENERATION).optional().catch(undefined),\n lang: z.string().optional().default('en'),\n // pokemon-specific filters:\n color: z.string().optional().catch(undefined),\n type: z.string().optional().catch(undefined),\n forms: z.coerce.boolean().optional().catch(undefined),\n shiny: z.coerce.boolean().optional().catch(undefined),\n})\n"],"mappings":";;;;AAqBA,MAAM,SAAS;CACb,MAAMA,IAAE,OAAO,CAAC,CAAC,IAAI,EAAE;CACvB,KAAKA,IAAE,OAAO,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,EAA4B;CAChE,MAAMA,IACH,OAAO,CAAC,CACR,IAAI,EAAE,CAAC,CACP,MAAM,cAAc;CACvB,MAAMA,IAAE,OAAO,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS;CACpC,WAAWA,IAAE,OAAO,CAAC,CAAC,IAAI,GAAG;CAE7B,UAAUA,IAAE,OAA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