@pkhex-everywhere/engine 0.16.0 → 0.18.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.
- package/CHANGELOG.md +16 -0
- package/_framework/{PKHeX.Core.kujhtqrpl7.wasm → PKHeX.Core.1xasc6dsc1.wasm} +0 -0
- package/_framework/{PKHeX.Core.AutoMod.bcm4nagqid.wasm → PKHeX.Core.AutoMod.czi8ongfah.wasm} +0 -0
- package/_framework/{PKHeX.Everywhere.Engine.Host.bed05y4alq.wasm → PKHeX.Everywhere.Engine.Host.a3ej0keoiq.wasm} +0 -0
- package/_framework/{PKHeX.Everywhere.Engine.PlugIns.m1tlz60fri.wasm → PKHeX.Everywhere.Engine.PlugIns.eahx1wxme6.wasm} +0 -0
- package/_framework/PKHeX.Everywhere.Engine.lefi2yju2h.wasm +0 -0
- package/_framework/{PKHeX.Everywhere.PlugIns.9q1s4wx4qj.wasm → PKHeX.Everywhere.PlugIns.c21drnk0yt.wasm} +0 -0
- package/_framework/{PKHeX.Everywhere.RomHacks.5mnpo7n3f0.wasm → PKHeX.Everywhere.RomHacks.2eiw3juwcd.wasm} +0 -0
- package/_framework/PKHeX.Facade.ok6fzoms0k.wasm +0 -0
- package/_framework/{System.Private.CoreLib.xzy0ufsqkn.wasm → System.Private.CoreLib.37lagr3mrw.wasm} +0 -0
- package/_framework/System.Runtime.vnwhlsf4yw.wasm +0 -0
- package/_framework/dotnet.js +26 -26
- package/dist/binary.d.ts +1 -0
- package/dist/generated/client.d.ts +30 -28
- package/dist/generated/errors.d.ts +1 -1
- package/dist/generated/topics.d.ts +1 -1
- package/dist/generated/types.d.ts +125 -66
- package/dist/index.js +3 -3
- package/dist/internal.js +1 -1
- package/dist/{topics-CoiSl0tN.js → topics-Bx58fcG5.js} +41 -22
- package/package.json +1 -1
- package/_framework/PKHeX.Everywhere.Engine.7r5irmt54y.wasm +0 -0
- package/_framework/PKHeX.Facade.6cjzr56v9a.wasm +0 -0
- package/_framework/System.Runtime.7z7c6u2xs5.wasm +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @pkhex-everywhere/engine
|
|
2
2
|
|
|
3
|
+
## 0.18.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- db3c07e: A transfer to an older game keeps a copy of the Pokémon, so a later transfer forward restores what the older game dropped. Each offer has `keepsCopy`, and `transfer.commit` returns a `keptCopy` for each Pokémon that moved to an older game. Pass stored copies in the offer's new `keptCopies`: a copy with the Pokémon's `identityKey` puts back its ball, met data, origin game, ribbons and ability, with the new reason `restored`. `PokemonSummary` and `PokemonPreview` gain `identityKey`, built from the PID, trainer ID and secret ID, and null in Gen 1 and 2.
|
|
8
|
+
|
|
9
|
+
## 0.17.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 1572d36: `pokemon.read` reads Gen 5 Pokémon from Black, White, Black 2 and White 2, in their 220-byte party and 136-byte box layouts.
|
|
14
|
+
- 881c351: The `trade` namespace is now `transfer`. `trade.*` calls become `transfer.*`, `useTrade` becomes `useTransfer`, every `Trade*` type becomes `Transfer*`, `TradedPokemon` becomes `TransferredPokemon`, the `trade` topic becomes `transfer`, and the `trade-refused` and `no-trade` errors become `transfer-refused` and `no-transfer`. The `link` route and the `link` and `tradeEvolution` change reasons keep their names.
|
|
15
|
+
- 2251534: Transfers take the new `unofficial` route between any two saves no game connects, such as Platinum to Ruby. It strips the moves, item, ball and ability the destination doesn't have, with the reason `notInGame`, and reports every other change with the reason `unofficial`. Each offer has a `route`, `TransferField` gains `level`, `nature`, `gender`, `shiny`, `language`, `originalTrainer`, `trainerId`, `originGame` and `metDate`, and a Pokémon PKHeX can't convert is refused with `conversionFailed`. `noRoute` is left for ROM hack formats and Let's Go.
|
|
16
|
+
|
|
17
|
+
`box.previewFile(bytes)` shows how a Pokémon file would arrive, with `unofficial: true` when no game can move it. `box.addFromFile(bytes, { allowUnofficial: true })` adds such a file; without the option it still fails with `conversion-failed`.
|
|
18
|
+
|
|
3
19
|
## 0.16.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
Binary file
|
package/_framework/{PKHeX.Core.AutoMod.bcm4nagqid.wasm → PKHeX.Core.AutoMod.czi8ongfah.wasm}
RENAMED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/_framework/{System.Private.CoreLib.xzy0ufsqkn.wasm → System.Private.CoreLib.37lagr3mrw.wasm}
RENAMED
|
Binary file
|
|
Binary file
|
package/_framework/dotnet.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var e=!1;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),o=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,15,1,13,0,65,1,253,15,65,2,253,15,253,128,2,11])),n=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),r=Symbol.for("wasm promise_control");function i(e,t){let o=null;const n=new Promise((function(n,r){o={isDone:!1,promise:null,resolve:t=>{o.isDone||(o.isDone=!0,n(t),e&&e())},reject:e=>{o.isDone||(o.isDone=!0,r(e),t&&t())}}}));o.promise=n;const i=n;return i[r]=o,{promise:i,promise_control:o}}function s(e){return e[r]}function a(e){e&&function(e){return void 0!==e[r]}(e)||Be(!1,"Promise is not controllable")}const l="__mono_message__",c=["debug","log","trace","warn","info","error"],d="MONO_WASM: ";let u,f,m,g,p,h;function w(e){g=e}function b(e){if(Pe.diagnosticTracing){const t="function"==typeof e?e():e;console.debug(d+t)}}function y(e,...t){console.info(d+e,...t)}function v(e,...t){console.info(e,...t)}function E(e,...t){console.warn(d+e,...t)}function _(e,...t){if(t&&t.length>0&&t[0]&&"object"==typeof t[0]){if(t[0].silent)return;if(t[0].toString)return void console.error(d+e,t[0].toString())}console.error(d+e,...t)}function x(e,t,o){return function(...n){try{let r=n[0];if(void 0===r)r="undefined";else if(null===r)r="null";else if("function"==typeof r)r=r.toString();else if("string"!=typeof r)try{r=JSON.stringify(r)}catch(e){r=r.toString()}t(o?JSON.stringify({method:e,payload:r,arguments:n.slice(1)}):[e+r,...n.slice(1)])}catch(e){m.error(`proxyConsole failed: ${e}`)}}}function j(e,t,o){f=t,g=e,m={...t};const n=`${o}/console`.replace("https://","wss://").replace("http://","ws://");u=new WebSocket(n),u.addEventListener("error",A),u.addEventListener("close",S),function(){for(const e of c)f[e]=x(`console.${e}`,T,!0)}()}function R(e){let t=30;const o=()=>{u?0==u.bufferedAmount||0==t?(e&&v(e),function(){for(const e of c)f[e]=x(`console.${e}`,m.log,!1)}(),u.removeEventListener("error",A),u.removeEventListener("close",S),u.close(1e3,e),u=void 0):(t--,globalThis.setTimeout(o,100)):e&&m&&m.log(e)};o()}function T(e){u&&u.readyState===WebSocket.OPEN?u.send(e):m.log(e)}function A(e){m.error(`[${g}] proxy console websocket error: ${e}`,e)}function S(e){m.debug(`[${g}] proxy console websocket closed: ${e}`,e)}function D(){Pe.preferredIcuAsset=O(Pe.config);let e="invariant"==Pe.config.globalizationMode;if(!e)if(Pe.preferredIcuAsset)Pe.diagnosticTracing&&b("ICU data archive(s) available, disabling invariant mode");else{if("custom"===Pe.config.globalizationMode||"all"===Pe.config.globalizationMode||"sharded"===Pe.config.globalizationMode){const e="invariant globalization mode is inactive and no ICU data archives are available";throw _(`ERROR: ${e}`),new Error(e)}Pe.diagnosticTracing&&b("ICU data archive(s) not available, using invariant globalization mode"),e=!0,Pe.preferredIcuAsset=null}const t="DOTNET_SYSTEM_GLOBALIZATION_INVARIANT",o=Pe.config.environmentVariables;if(void 0===o[t]&&e&&(o[t]="1"),void 0===o.TZ)try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone||null;e&&(o.TZ=e)}catch(e){y("failed to detect timezone, will fallback to UTC")}}function O(e){var t;if((null===(t=e.resources)||void 0===t?void 0:t.icu)&&"invariant"!=e.globalizationMode){const t=e.applicationCulture||(ke?globalThis.navigator&&globalThis.navigator.languages&&globalThis.navigator.languages[0]:Intl.DateTimeFormat().resolvedOptions().locale),o=e.resources.icu;let n=null;if("custom"===e.globalizationMode){if(o.length>=1)return o[0].name}else t&&"all"!==e.globalizationMode?"sharded"===e.globalizationMode&&(n=function(e){const t=e.split("-")[0];return"en"===t||["fr","fr-FR","it","it-IT","de","de-DE","es","es-ES"].includes(e)?"icudt_EFIGS.dat":["zh","ko","ja"].includes(t)?"icudt_CJK.dat":"icudt_no_CJK.dat"}(t)):n="icudt.dat";if(n)for(let e=0;e<o.length;e++){const t=o[e];if(t.virtualPath===n)return t.name}}return e.globalizationMode="invariant",null}(new Date).valueOf();const C=class{constructor(e){this.url=e}toString(){return this.url}};async function k(e,t){try{const o="function"==typeof globalThis.fetch;if(Se){const n=e.startsWith("file://");if(!n&&o)return globalThis.fetch(e,t||{credentials:"same-origin"});p||(h=Ne.require("url"),p=Ne.require("fs")),n&&(e=h.fileURLToPath(e));const r=await p.promises.readFile(e);return{ok:!0,headers:{length:0,get:()=>null},url:e,arrayBuffer:()=>r,json:()=>JSON.parse(r),text:()=>{throw new Error("NotImplementedException")}}}if(o)return globalThis.fetch(e,t||{credentials:"same-origin"});if("function"==typeof read)return{ok:!0,url:e,headers:{length:0,get:()=>null},arrayBuffer:()=>new Uint8Array(read(e,"binary")),json:()=>JSON.parse(read(e,"utf8")),text:()=>read(e,"utf8")}}catch(t){return{ok:!1,url:e,status:500,headers:{length:0,get:()=>null},statusText:"ERR28: "+t,arrayBuffer:()=>{throw t},json:()=>{throw t},text:()=>{throw t}}}throw new Error("No fetch implementation available")}function I(e){return"string"!=typeof e&&Be(!1,"url must be a string"),!M(e)&&0!==e.indexOf("./")&&0!==e.indexOf("../")&&globalThis.URL&&globalThis.document&&globalThis.document.baseURI&&(e=new URL(e,globalThis.document.baseURI).toString()),e}const U=/^[a-zA-Z][a-zA-Z\d+\-.]*?:\/\//,P=/[a-zA-Z]:[\\/]/;function M(e){return Se||Ie?e.startsWith("/")||e.startsWith("\\")||-1!==e.indexOf("///")||P.test(e):U.test(e)}let L,N=0;const $=[],z=[],W=new Map,F={"js-module-threads":!0,"js-module-runtime":!0,"js-module-dotnet":!0,"js-module-native":!0,"js-module-diagnostics":!0},B={...F,"js-module-library-initializer":!0},V={...F,dotnetwasm:!0,heap:!0,manifest:!0},q={...B,manifest:!0},H={...B,dotnetwasm:!0},J={dotnetwasm:!0,symbols:!0},Z={...B,dotnetwasm:!0,symbols:!0},Q={symbols:!0};function G(e){return!("icu"==e.behavior&&e.name!=Pe.preferredIcuAsset)}function K(e,t,o){null!=t||(t=[]),Be(1==t.length,`Expect to have one ${o} asset in resources`);const n=t[0];return n.behavior=o,X(n),e.push(n),n}function X(e){V[e.behavior]&&W.set(e.behavior,e)}function Y(e){Be(V[e],`Unknown single asset behavior ${e}`);const t=W.get(e);if(t&&!t.resolvedUrl)if(t.resolvedUrl=Pe.locateFile(t.name),F[t.behavior]){const e=ge(t);e?("string"!=typeof e&&Be(!1,"loadBootResource response for 'dotnetjs' type should be a URL string"),t.resolvedUrl=e):t.resolvedUrl=ce(t.resolvedUrl,t.behavior)}else if("dotnetwasm"!==t.behavior)throw new Error(`Unknown single asset behavior ${e}`);return t}function ee(e){const t=Y(e);return Be(t,`Single asset for ${e} not found`),t}let te=!1;async function oe(){if(!te){te=!0,Pe.diagnosticTracing&&b("mono_download_assets");try{const e=[],t=[],o=(e,t)=>{!Z[e.behavior]&&G(e)&&Pe.expected_instantiated_assets_count++,!H[e.behavior]&&G(e)&&(Pe.expected_downloaded_assets_count++,t.push(se(e)))};for(const t of $)o(t,e);for(const e of z)o(e,t);Pe.allDownloadsQueued.promise_control.resolve(),Promise.all([...e,...t]).then((()=>{Pe.allDownloadsFinished.promise_control.resolve()})).catch((e=>{throw Pe.err("Error in mono_download_assets: "+e),Xe(1,e),e})),await Pe.runtimeModuleLoaded.promise;const n=async e=>{const t=await e;if(t.buffer){if(!Z[t.behavior]){t.buffer&&"object"==typeof t.buffer||Be(!1,"asset buffer must be array-like or buffer-like or promise of these"),"string"!=typeof t.resolvedUrl&&Be(!1,"resolvedUrl must be string");const e=t.resolvedUrl,o=await t.buffer,n=new Uint8Array(o);pe(t),await Ue.beforeOnRuntimeInitialized.promise,Ue.instantiate_asset(t,e,n)}}else J[t.behavior]?("symbols"===t.behavior&&(await Ue.instantiate_symbols_asset(t),pe(t)),J[t.behavior]&&++Pe.actual_downloaded_assets_count):(t.isOptional||Be(!1,"Expected asset to have the downloaded buffer"),!H[t.behavior]&&G(t)&&Pe.expected_downloaded_assets_count--,!Z[t.behavior]&&G(t)&&Pe.expected_instantiated_assets_count--)},r=[],i=[];for(const t of e)r.push(n(t));for(const e of t)i.push(n(e));Promise.all(r).then((()=>{Ce||Ue.coreAssetsInMemory.promise_control.resolve()})).catch((e=>{throw Pe.err("Error in mono_download_assets: "+e),Xe(1,e),e})),Promise.all(i).then((async()=>{Ce||(await Ue.coreAssetsInMemory.promise,Ue.allAssetsInMemory.promise_control.resolve())})).catch((e=>{throw Pe.err("Error in mono_download_assets: "+e),Xe(1,e),e}))}catch(e){throw Pe.err("Error in mono_download_assets: "+e),e}}}let ne=!1;function re(){if(ne)return;ne=!0;const e=Pe.config,t=[];if(e.assets)for(const t of e.assets)"object"!=typeof t&&Be(!1,`asset must be object, it was ${typeof t} : ${t}`),"string"!=typeof t.behavior&&Be(!1,"asset behavior must be known string"),"string"!=typeof t.name&&Be(!1,"asset name must be string"),t.resolvedUrl&&"string"!=typeof t.resolvedUrl&&Be(!1,"asset resolvedUrl could be string"),t.hash&&"string"!=typeof t.hash&&Be(!1,"asset resolvedUrl could be string"),t.pendingDownload&&"object"!=typeof t.pendingDownload&&Be(!1,"asset pendingDownload could be object"),t.isCore?$.push(t):z.push(t),X(t);else if(e.resources){const o=e.resources;o.wasmNative||Be(!1,"resources.wasmNative must be defined"),o.jsModuleNative||Be(!1,"resources.jsModuleNative must be defined"),o.jsModuleRuntime||Be(!1,"resources.jsModuleRuntime must be defined"),K(z,o.wasmNative,"dotnetwasm"),K(t,o.jsModuleNative,"js-module-native"),K(t,o.jsModuleRuntime,"js-module-runtime"),o.jsModuleDiagnostics&&K(t,o.jsModuleDiagnostics,"js-module-diagnostics");const n=(e,t,o)=>{const n=e;n.behavior=t,o?(n.isCore=!0,$.push(n)):z.push(n)};if(o.coreAssembly)for(let e=0;e<o.coreAssembly.length;e++)n(o.coreAssembly[e],"assembly",!0);if(o.assembly)for(let e=0;e<o.assembly.length;e++)n(o.assembly[e],"assembly",!o.coreAssembly);if(0!=e.debugLevel&&Pe.isDebuggingSupported()){if(o.corePdb)for(let e=0;e<o.corePdb.length;e++)n(o.corePdb[e],"pdb",!0);if(o.pdb)for(let e=0;e<o.pdb.length;e++)n(o.pdb[e],"pdb",!o.corePdb)}if(e.loadAllSatelliteResources&&o.satelliteResources)for(const e in o.satelliteResources)for(let t=0;t<o.satelliteResources[e].length;t++){const r=o.satelliteResources[e][t];r.culture=e,n(r,"resource",!o.coreAssembly)}if(o.coreVfs)for(let e=0;e<o.coreVfs.length;e++)n(o.coreVfs[e],"vfs",!0);if(o.vfs)for(let e=0;e<o.vfs.length;e++)n(o.vfs[e],"vfs",!o.coreVfs);const r=O(e);if(r&&o.icu)for(let e=0;e<o.icu.length;e++){const t=o.icu[e];t.name===r&&n(t,"icu",!1)}if(o.wasmSymbols)for(let e=0;e<o.wasmSymbols.length;e++)n(o.wasmSymbols[e],"symbols",!1)}if(e.appsettings)for(let t=0;t<e.appsettings.length;t++){const o=e.appsettings[t],n=he(o);"appsettings.json"!==n&&n!==`appsettings.${e.applicationEnvironment}.json`||z.push({name:o,behavior:"vfs",cache:"no-cache",useCredentials:!0})}e.assets=[...$,...z,...t]}async function ie(e){const t=await se(e);return await t.pendingDownloadInternal.response,t.buffer}async function se(e){try{return await ae(e)}catch(t){if(!Pe.enableDownloadRetry)throw t;if(Ie||Se)throw t;if(e.pendingDownload&&e.pendingDownloadInternal==e.pendingDownload)throw t;if(e.resolvedUrl&&-1!=e.resolvedUrl.indexOf("file://"))throw t;if(t&&404==t.status)throw t;e.pendingDownloadInternal=void 0,await Pe.allDownloadsQueued.promise;try{return Pe.diagnosticTracing&&b(`Retrying download '${e.name}'`),await ae(e)}catch(t){return e.pendingDownloadInternal=void 0,await new Promise((e=>globalThis.setTimeout(e,100))),Pe.diagnosticTracing&&b(`Retrying download (2) '${e.name}' after delay`),await ae(e)}}}async function ae(e){for(;L;)await L.promise;try{++N,N==Pe.maxParallelDownloads&&(Pe.diagnosticTracing&&b("Throttling further parallel downloads"),L=i());const t=await async function(e){if(e.pendingDownload&&(e.pendingDownloadInternal=e.pendingDownload),e.pendingDownloadInternal&&e.pendingDownloadInternal.response)return e.pendingDownloadInternal.response;if(e.buffer){const t=await e.buffer;return e.resolvedUrl||(e.resolvedUrl="undefined://"+e.name),e.pendingDownloadInternal={url:e.resolvedUrl,name:e.name,response:Promise.resolve({ok:!0,arrayBuffer:()=>t,json:()=>JSON.parse(new TextDecoder("utf-8").decode(t)),text:()=>{throw new Error("NotImplementedException")},headers:{get:()=>{}}})},e.pendingDownloadInternal.response}const t=e.loadRemote&&Pe.config.remoteSources?Pe.config.remoteSources:[""];let o;for(let n of t){n=n.trim(),"./"===n&&(n="");const t=le(e,n);e.name===t?Pe.diagnosticTracing&&b(`Attempting to download '${t}'`):Pe.diagnosticTracing&&b(`Attempting to download '${t}' for ${e.name}`);try{e.resolvedUrl=t;const n=fe(e);if(e.pendingDownloadInternal=n,o=await n.response,!o||!o.ok)continue;return o}catch(e){o||(o={ok:!1,url:t,status:0,statusText:""+e});continue}}const n=e.isOptional||e.name.match(/\.pdb$/)&&Pe.config.ignorePdbLoadErrors;if(o||Be(!1,`Response undefined ${e.name}`),!n){const t=new Error(`download '${o.url}' for ${e.name} failed ${o.status} ${o.statusText}`);throw t.status=o.status,t}y(`optional download '${o.url}' for ${e.name} failed ${o.status} ${o.statusText}`)}(e);return t?(J[e.behavior]||(e.buffer=await t.arrayBuffer(),++Pe.actual_downloaded_assets_count),e):e}finally{if(--N,L&&N==Pe.maxParallelDownloads-1){Pe.diagnosticTracing&&b("Resuming more parallel downloads");const e=L;L=void 0,e.promise_control.resolve()}}}function le(e,t){let o;return null==t&&Be(!1,`sourcePrefix must be provided for ${e.name}`),e.resolvedUrl?o=e.resolvedUrl:(o=""===t?"assembly"===e.behavior||"pdb"===e.behavior?e.name:"resource"===e.behavior&&e.culture&&""!==e.culture?`${e.culture}/${e.name}`:e.name:t+e.name,o=ce(Pe.locateFile(o),e.behavior)),o&&"string"==typeof o||Be(!1,"attemptUrl need to be path or url string"),o}function ce(e,t){return Pe.modulesUniqueQuery&&q[t]&&(e+=Pe.modulesUniqueQuery),e}let de=0;const ue=new Set;function fe(e){try{e.resolvedUrl||Be(!1,"Request's resolvedUrl must be set");const t=function(e){let t=e.resolvedUrl;if(Pe.loadBootResource){const o=ge(e);if(o instanceof Promise)return o;"string"==typeof o&&(t=o)}const o={};return e.cache?o.cache=e.cache:Pe.config.disableNoCacheFetch||(o.cache="no-cache"),e.useCredentials?o.credentials="include":!Pe.config.disableIntegrityCheck&&e.hash&&(o.integrity=e.hash),Pe.fetch_like(t,o)}(e),o={name:e.name,url:e.resolvedUrl,response:t};return ue.add(e.name),o.response.then((()=>{"assembly"==e.behavior&&Pe.loadedAssemblies.push(e.name),de++,Pe.onDownloadResourceProgress&&Pe.onDownloadResourceProgress(de,ue.size)})),o}catch(t){const o={ok:!1,url:e.resolvedUrl,status:500,statusText:"ERR29: "+t,arrayBuffer:()=>{throw t},json:()=>{throw t}};return{name:e.name,url:e.resolvedUrl,response:Promise.resolve(o)}}}const me={resource:"assembly",assembly:"assembly",pdb:"pdb",icu:"globalization",vfs:"configuration",manifest:"manifest",dotnetwasm:"dotnetwasm","js-module-dotnet":"dotnetjs","js-module-native":"dotnetjs","js-module-runtime":"dotnetjs","js-module-threads":"dotnetjs"};function ge(e){var t;if(Pe.loadBootResource){const o=null!==(t=e.hash)&&void 0!==t?t:"",n=e.resolvedUrl,r=me[e.behavior];if(r){const t=Pe.loadBootResource(r,e.name,n,o,e.behavior);return"string"==typeof t?I(t):t}}}function pe(e){e.pendingDownloadInternal=null,e.pendingDownload=null,e.buffer=null,e.moduleExports=null}function he(e){let t=e.lastIndexOf("/");return t>=0&&t++,e.substring(t)}async function we(e){e&&await Promise.all((null!=e?e:[]).map((e=>async function(e){try{const t=e.name;if(!e.moduleExports){const o=ce(Pe.locateFile(t),"js-module-library-initializer");Pe.diagnosticTracing&&b(`Attempting to import '${o}' for ${e}`),e.moduleExports=await import(/*! webpackIgnore: true */o)}Pe.libraryInitializers.push({scriptName:t,exports:e.moduleExports})}catch(t){E(`Failed to import library initializer '${e}': ${t}`)}}(e))))}async function be(e,t){if(!Pe.libraryInitializers)return;const o=[];for(let n=0;n<Pe.libraryInitializers.length;n++){const r=Pe.libraryInitializers[n];r.exports[e]&&o.push(ye(r.scriptName,e,(()=>r.exports[e](...t))))}await Promise.all(o)}async function ye(e,t,o){try{await o()}catch(o){throw E(`Failed to invoke '${t}' on library initializer '${e}': ${o}`),Xe(1,o),o}}function ve(e,t){if(e===t)return e;const o={...t};return void 0!==o.assets&&o.assets!==e.assets&&(o.assets=[...e.assets||[],...o.assets||[]]),void 0!==o.resources&&(o.resources=_e(e.resources||{assembly:[],jsModuleNative:[],jsModuleRuntime:[],wasmNative:[]},o.resources)),void 0!==o.environmentVariables&&(o.environmentVariables={...e.environmentVariables||{},...o.environmentVariables||{}}),void 0!==o.runtimeOptions&&o.runtimeOptions!==e.runtimeOptions&&(o.runtimeOptions=[...e.runtimeOptions||[],...o.runtimeOptions||[]]),Object.assign(e,o)}function Ee(e,t){if(e===t)return e;const o={...t};return o.config&&(e.config||(e.config={}),o.config=ve(e.config,o.config)),Object.assign(e,o)}function _e(e,t){if(e===t)return e;const o={...t};return void 0!==o.coreAssembly&&(o.coreAssembly=[...e.coreAssembly||[],...o.coreAssembly||[]]),void 0!==o.assembly&&(o.assembly=[...e.assembly||[],...o.assembly||[]]),void 0!==o.lazyAssembly&&(o.lazyAssembly=[...e.lazyAssembly||[],...o.lazyAssembly||[]]),void 0!==o.corePdb&&(o.corePdb=[...e.corePdb||[],...o.corePdb||[]]),void 0!==o.pdb&&(o.pdb=[...e.pdb||[],...o.pdb||[]]),void 0!==o.jsModuleWorker&&(o.jsModuleWorker=[...e.jsModuleWorker||[],...o.jsModuleWorker||[]]),void 0!==o.jsModuleNative&&(o.jsModuleNative=[...e.jsModuleNative||[],...o.jsModuleNative||[]]),void 0!==o.jsModuleDiagnostics&&(o.jsModuleDiagnostics=[...e.jsModuleDiagnostics||[],...o.jsModuleDiagnostics||[]]),void 0!==o.jsModuleRuntime&&(o.jsModuleRuntime=[...e.jsModuleRuntime||[],...o.jsModuleRuntime||[]]),void 0!==o.wasmSymbols&&(o.wasmSymbols=[...e.wasmSymbols||[],...o.wasmSymbols||[]]),void 0!==o.wasmNative&&(o.wasmNative=[...e.wasmNative||[],...o.wasmNative||[]]),void 0!==o.icu&&(o.icu=[...e.icu||[],...o.icu||[]]),void 0!==o.satelliteResources&&(o.satelliteResources=function(e,t){if(e===t)return e;for(const o in t)e[o]=[...e[o]||[],...t[o]||[]];return e}(e.satelliteResources||{},o.satelliteResources||{})),void 0!==o.modulesAfterConfigLoaded&&(o.modulesAfterConfigLoaded=[...e.modulesAfterConfigLoaded||[],...o.modulesAfterConfigLoaded||[]]),void 0!==o.modulesAfterRuntimeReady&&(o.modulesAfterRuntimeReady=[...e.modulesAfterRuntimeReady||[],...o.modulesAfterRuntimeReady||[]]),void 0!==o.extensions&&(o.extensions={...e.extensions||{},...o.extensions||{}}),void 0!==o.vfs&&(o.vfs=[...e.vfs||[],...o.vfs||[]]),Object.assign(e,o)}function xe(){const e=Pe.config;if(e.environmentVariables=e.environmentVariables||{},e.runtimeOptions=e.runtimeOptions||[],e.resources=e.resources||{assembly:[],jsModuleNative:[],jsModuleWorker:[],jsModuleRuntime:[],wasmNative:[],vfs:[],satelliteResources:{}},e.assets){Pe.diagnosticTracing&&b("config.assets is deprecated, use config.resources instead");for(const t of e.assets){const o={};switch(t.behavior){case"assembly":o.assembly=[t];break;case"pdb":o.pdb=[t];break;case"resource":o.satelliteResources={},o.satelliteResources[t.culture]=[t];break;case"icu":o.icu=[t];break;case"symbols":o.wasmSymbols=[t];break;case"vfs":o.vfs=[t];break;case"dotnetwasm":o.wasmNative=[t];break;case"js-module-threads":o.jsModuleWorker=[t];break;case"js-module-runtime":o.jsModuleRuntime=[t];break;case"js-module-native":o.jsModuleNative=[t];break;case"js-module-diagnostics":o.jsModuleDiagnostics=[t];break;case"js-module-dotnet":break;default:throw new Error(`Unexpected behavior ${t.behavior} of asset ${t.name}`)}_e(e.resources,o)}}e.debugLevel,e.applicationEnvironment||(e.applicationEnvironment="Production"),e.applicationCulture&&(e.environmentVariables.LANG=`${e.applicationCulture}.UTF-8`),Ue.diagnosticTracing=Pe.diagnosticTracing=!!e.diagnosticTracing,Ue.waitForDebugger=e.waitForDebugger,Pe.maxParallelDownloads=e.maxParallelDownloads||Pe.maxParallelDownloads,Pe.enableDownloadRetry=void 0!==e.enableDownloadRetry?e.enableDownloadRetry:Pe.enableDownloadRetry}let je=!1;async function Re(e){var t;if(je)return void await Pe.afterConfigLoaded.promise;let o;try{if(e.configSrc||Pe.config&&0!==Object.keys(Pe.config).length&&(Pe.config.assets||Pe.config.resources)||(e.configSrc="dotnet.boot.js"),o=e.configSrc,je=!0,o&&(Pe.diagnosticTracing&&b("mono_wasm_load_config"),await async function(e){const t=e.configSrc,o=Pe.locateFile(t);let n=null;void 0!==Pe.loadBootResource&&(n=Pe.loadBootResource("manifest",t,o,"","manifest"));let r,i=null;if(n)if("string"==typeof n)n.includes(".json")?(i=await s(I(n)),r=await Ae(i)):r=(await import(I(n))).config;else{const e=await n;"function"==typeof e.json?(i=e,r=await Ae(i)):r=e.config}else o.includes(".json")?(i=await s(ce(o,"manifest")),r=await Ae(i)):r=(await import(ce(o,"manifest"))).config;function s(e){return Pe.fetch_like(e,{method:"GET",credentials:"include",cache:"no-cache"})}Pe.config.applicationEnvironment&&(r.applicationEnvironment=Pe.config.applicationEnvironment),ve(Pe.config,r)}(e)),xe(),await we(null===(t=Pe.config.resources)||void 0===t?void 0:t.modulesAfterConfigLoaded),await be("onRuntimeConfigLoaded",[Pe.config]),e.onConfigLoaded)try{await e.onConfigLoaded(Pe.config,Le),xe()}catch(e){throw _("onConfigLoaded() failed",e),e}xe(),Pe.afterConfigLoaded.promise_control.resolve(Pe.config)}catch(t){const n=`Failed to load config file ${o} ${t} ${null==t?void 0:t.stack}`;throw Pe.config=e.config=Object.assign(Pe.config,{message:n,error:t,isError:!0}),Xe(1,new Error(n)),t}}function Te(){return!!globalThis.navigator&&(Pe.isChromium||Pe.isFirefox)}async function Ae(e){const t=Pe.config,o=await e.json();t.applicationEnvironment||o.applicationEnvironment||(o.applicationEnvironment=e.headers.get("Blazor-Environment")||e.headers.get("DotNet-Environment")||void 0),o.environmentVariables||(o.environmentVariables={});const n=e.headers.get("DOTNET-MODIFIABLE-ASSEMBLIES");n&&(o.environmentVariables.DOTNET_MODIFIABLE_ASSEMBLIES=n);const r=e.headers.get("ASPNETCORE-BROWSER-TOOLS");return r&&(o.environmentVariables.__ASPNETCORE_BROWSER_TOOLS=r),o}"function"!=typeof importScripts||globalThis.onmessage||(globalThis.dotnetSidecar=!0);const Se="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,De="function"==typeof importScripts,Oe=De&&"undefined"!=typeof dotnetSidecar,Ce=De&&!Oe,ke="object"==typeof window||De&&!Se,Ie=!ke&&!Se;let Ue={},Pe={},Me={},Le={},Ne={},$e=!1;const ze={},We={config:ze},Fe={mono:{},binding:{},internal:Ne,module:We,loaderHelpers:Pe,runtimeHelpers:Ue,diagnosticHelpers:Me,api:Le};function Be(e,t){if(e)return;const o="Assert failed: "+("function"==typeof t?t():t),n=new Error(o);_(o,n),Ue.nativeAbort(n)}function Ve(){return void 0!==Pe.exitCode}function qe(){return Ue.runtimeReady&&!Ve()}function He(){Ve()&&Be(!1,`.NET runtime already exited with ${Pe.exitCode} ${Pe.exitReason}. You can use runtime.runMain() which doesn't exit the runtime.`),Ue.runtimeReady||Be(!1,".NET runtime didn't start yet. Please call dotnet.create() first.")}function Je(){ke&&(globalThis.addEventListener("unhandledrejection",et),globalThis.addEventListener("error",tt))}let Ze,Qe;function Ge(e){Qe&&Qe(e),Xe(e,Pe.exitReason)}function Ke(e){Ze&&Ze(e||Pe.exitReason),Xe(1,e||Pe.exitReason)}function Xe(t,o){var n,r;const i=o&&"object"==typeof o;t=i&&"number"==typeof o.status?o.status:void 0===t?-1:t;const s=i&&"string"==typeof o.message?o.message:""+o;(o=i?o:Ue.ExitStatus?function(e,t){const o=new Ue.ExitStatus(e);return o.message=t,o.toString=()=>t,o}(t,s):new Error("Exit with code "+t+" "+s)).status=t,o.message||(o.message=s);const a=""+(o.stack||(new Error).stack);try{Object.defineProperty(o,"stack",{get:()=>a})}catch(e){}const l=!!o.silent;if(o.silent=!0,Ve())Pe.diagnosticTracing&&b("mono_exit called after exit");else{try{We.onAbort==Ke&&(We.onAbort=Ze),We.onExit==Ge&&(We.onExit=Qe),ke&&(globalThis.removeEventListener("unhandledrejection",et),globalThis.removeEventListener("error",tt)),Ue.runtimeReady?(Ue.jiterpreter_dump_stats&&Ue.jiterpreter_dump_stats(!1),0===t&&(null===(n=Pe.config)||void 0===n?void 0:n.interopCleanupOnExit)&&Ue.forceDisposeProxies(!0,!0),e&&0!==t&&(null===(r=Pe.config)||void 0===r||r.dumpThreadsOnNonZeroExit)):(Pe.diagnosticTracing&&b(`abort_startup, reason: ${o}`),function(e){Pe.allDownloadsQueued.promise_control.reject(e),Pe.allDownloadsFinished.promise_control.reject(e),Pe.afterConfigLoaded.promise_control.reject(e),Pe.wasmCompilePromise.promise_control.reject(e),Pe.runtimeModuleLoaded.promise_control.reject(e),Ue.dotnetReady&&(Ue.dotnetReady.promise_control.reject(e),Ue.afterInstantiateWasm.promise_control.reject(e),Ue.beforePreInit.promise_control.reject(e),Ue.afterPreInit.promise_control.reject(e),Ue.afterPreRun.promise_control.reject(e),Ue.beforeOnRuntimeInitialized.promise_control.reject(e),Ue.afterOnRuntimeInitialized.promise_control.reject(e),Ue.afterPostRun.promise_control.reject(e))}(o))}catch(e){E("mono_exit A failed",e)}try{l||(function(e,t){if(0!==e&&t){const e=Ue.ExitStatus&&t instanceof Ue.ExitStatus?b:_;"string"==typeof t?e(t):(void 0===t.stack&&(t.stack=(new Error).stack+""),t.message?e(Ue.stringify_as_error_with_stack?Ue.stringify_as_error_with_stack(t.message+"\n"+t.stack):t.message+"\n"+t.stack):e(JSON.stringify(t)))}!Ce&&Pe.config&&(Pe.config.logExitCode?Pe.config.forwardConsoleLogsToWS?R("WASM EXIT "+e):v("WASM EXIT "+e):Pe.config.forwardConsoleLogsToWS&&R())}(t,o),function(e){if(ke&&!Ce&&Pe.config&&Pe.config.appendElementOnExit&&document){const t=document.createElement("label");t.id="tests_done",0!==e&&(t.style.background="red"),t.innerHTML=""+e,document.body.appendChild(t)}}(t))}catch(e){E("mono_exit B failed",e)}Pe.exitCode=t,Pe.exitReason||(Pe.exitReason=o),!Ce&&Ue.runtimeReady&&We.runtimeKeepalivePop()}if(Pe.config&&Pe.config.asyncFlushOnExit&&0===t)throw(async()=>{try{await async function(){try{const e=await import(/*! webpackIgnore: true */"process"),t=e=>new Promise(((t,o)=>{e.on("error",o),e.end("","utf8",t)})),o=t(e.stderr),n=t(e.stdout);let r;const i=new Promise((e=>{r=setTimeout((()=>e("timeout")),1e3)}));await Promise.race([Promise.all([n,o]),i]),clearTimeout(r)}catch(e){_(`flushing std* streams failed: ${e}`)}}()}finally{Ye(t,o)}})(),o;Ye(t,o)}function Ye(e,t){if(Ue.runtimeReady&&Ue.nativeExit)try{Ue.nativeExit(e)}catch(e){!Ue.ExitStatus||e instanceof Ue.ExitStatus||E("set_exit_code_and_quit_now failed: "+e.toString())}if(0!==e||!ke)throw Se&&Ne.process?Ne.process.exit(e):Ue.quit&&Ue.quit(e,t),t}function et(e){ot(e,e.reason,"rejection")}function tt(e){ot(e,e.error,"error")}function ot(e,t,o){e.preventDefault();try{t||(t=new Error("Unhandled "+o)),void 0===t.stack&&(t.stack=(new Error).stack),t.stack=t.stack+"",t.silent||(_("Unhandled error:",t),Xe(1,t))}catch(e){}}!function(e){if($e)throw new Error("Loader module already loaded");$e=!0,Ue=e.runtimeHelpers,Pe=e.loaderHelpers,Me=e.diagnosticHelpers,Le=e.api,Ne=e.internal,Object.assign(Le,{INTERNAL:Ne,invokeLibraryInitializers:be}),Object.assign(e.module,{config:ve(ze,{environmentVariables:{}})});const r={mono_wasm_bindings_is_ready:!1,config:e.module.config,diagnosticTracing:!1,nativeAbort:e=>{throw e||new Error("abort")},nativeExit:e=>{throw new Error("exit:"+e)}},l={gitHash:"95017c711e6afc1085133d440e42b4bd78155701",config:e.module.config,diagnosticTracing:!1,maxParallelDownloads:16,enableDownloadRetry:!0,_loaded_files:[],loadedFiles:[],loadedAssemblies:[],libraryInitializers:[],workerNextNumber:1,actual_downloaded_assets_count:0,actual_instantiated_assets_count:0,expected_downloaded_assets_count:0,expected_instantiated_assets_count:0,afterConfigLoaded:i(),allDownloadsQueued:i(),allDownloadsFinished:i(),wasmCompilePromise:i(),runtimeModuleLoaded:i(),loadingWorkers:i(),is_exited:Ve,is_runtime_running:qe,assert_runtime_running:He,mono_exit:Xe,createPromiseController:i,getPromiseController:s,assertIsControllablePromise:a,mono_download_assets:oe,resolve_single_asset_path:ee,setup_proxy_console:j,set_thread_prefix:w,installUnhandledErrorHandler:Je,retrieve_asset_download:ie,invokeLibraryInitializers:be,isDebuggingSupported:Te,exceptions:t,simd:n,relaxedSimd:o};Object.assign(Ue,r),Object.assign(Pe,l)}(Fe);let nt,rt,it,st=!1,at=!1;async function lt(e){if(!at){if(at=!0,ke&&Pe.config.forwardConsoleLogsToWS&&void 0!==globalThis.WebSocket&&j("main",globalThis.console,globalThis.location.origin),We||Be(!1,"Null moduleConfig"),Pe.config||Be(!1,"Null moduleConfig.config"),"function"==typeof e){const t=e(Fe.api);if(t.ready)throw new Error("Module.ready couldn't be redefined.");Object.assign(We,t),Ee(We,t)}else{if("object"!=typeof e)throw new Error("Can't use moduleFactory callback of createDotnetRuntime function.");Ee(We,e)}await async function(e){if(Se){const e=await import(/*! webpackIgnore: true */"process"),t=14;if(e.versions.node.split(".")[0]<t)throw new Error(`NodeJS at '${e.execPath}' has too low version '${e.versions.node}', please use at least ${t}. See also https://aka.ms/dotnet-wasm-features`)}const t=/*! webpackIgnore: true */import.meta.url,o=t.indexOf("?");var n;if(o>0&&(Pe.modulesUniqueQuery=t.substring(o)),Pe.scriptUrl=t.replace(/\\/g,"/").replace(/[?#].*/,""),Pe.scriptDirectory=(n=Pe.scriptUrl).slice(0,n.lastIndexOf("/"))+"/",Pe.locateFile=e=>"URL"in globalThis&&globalThis.URL!==C?new URL(e,Pe.scriptDirectory).toString():M(e)?e:Pe.scriptDirectory+e,Pe.fetch_like=k,Pe.out=console.log,Pe.err=console.error,Pe.onDownloadResourceProgress=e.onDownloadResourceProgress,ke&&globalThis.navigator){const e=globalThis.navigator,t=e.userAgentData&&e.userAgentData.brands;t&&t.length>0?Pe.isChromium=t.some((e=>"Google Chrome"===e.brand||"Microsoft Edge"===e.brand||"Chromium"===e.brand)):e.userAgent&&(Pe.isChromium=e.userAgent.includes("Chrome"),Pe.isFirefox=e.userAgent.includes("Firefox"))}Ne.require=Se?await import(/*! webpackIgnore: true */"module").then((e=>e.createRequire(/*! webpackIgnore: true */import.meta.url))):Promise.resolve((()=>{throw new Error("require not supported")})),void 0===globalThis.URL&&(globalThis.URL=C)}(We)}}async function ct(e){return await lt(e),Ze=We.onAbort,Qe=We.onExit,We.onAbort=Ke,We.onExit=Ge,We.ENVIRONMENT_IS_PTHREAD?async function(){(function(){const e=new MessageChannel,t=e.port1,o=e.port2;t.addEventListener("message",(e=>{var n,r;n=JSON.parse(e.data.config),r=JSON.parse(e.data.monoThreadInfo),st?Pe.diagnosticTracing&&b("mono config already received"):(ve(Pe.config,n),Ue.monoThreadInfo=r,xe(),Pe.diagnosticTracing&&b("mono config received"),st=!0,Pe.afterConfigLoaded.promise_control.resolve(Pe.config),ke&&n.forwardConsoleLogsToWS&&void 0!==globalThis.WebSocket&&Pe.setup_proxy_console("worker-idle",console,globalThis.location.origin)),t.close(),o.close()}),{once:!0}),t.start(),self.postMessage({[l]:{monoCmd:"preload",port:o}},[o])})(),await Pe.afterConfigLoaded.promise,function(){const e=Pe.config;e.assets||Be(!1,"config.assets must be defined");for(const t of e.assets)X(t),Q[t.behavior]&&z.push(t)}(),setTimeout((async()=>{try{await oe()}catch(e){Xe(1,e)}}),0);const e=dt(),t=await Promise.all(e);return await ut(t),We}():async function(){var e;await Re(We),re();const t=dt();(async function(){try{const e=ee("dotnetwasm");await se(e),e&&e.pendingDownloadInternal&&e.pendingDownloadInternal.response||Be(!1,"Can't load dotnet.native.wasm");const t=await e.pendingDownloadInternal.response,o=t.headers&&t.headers.get?t.headers.get("Content-Type"):void 0;let n;if("function"==typeof WebAssembly.compileStreaming&&"application/wasm"===o)n=await WebAssembly.compileStreaming(t);else{ke&&"application/wasm"!==o&&E('WebAssembly resource does not have the expected content type "application/wasm", so falling back to slower ArrayBuffer instantiation.');const e=await t.arrayBuffer();Pe.diagnosticTracing&&b("instantiate_wasm_module buffered"),n=Ie?await Promise.resolve(new WebAssembly.Module(e)):await WebAssembly.compile(e)}e.pendingDownloadInternal=null,e.pendingDownload=null,e.buffer=null,e.moduleExports=null,Pe.wasmCompilePromise.promise_control.resolve(n)}catch(e){Pe.wasmCompilePromise.promise_control.reject(e)}})(),setTimeout((async()=>{try{D(),await oe()}catch(e){Xe(1,e)}}),0);const o=await Promise.all(t);return await ut(o),await Ue.dotnetReady.promise,await we(null===(e=Pe.config.resources)||void 0===e?void 0:e.modulesAfterRuntimeReady),await be("onRuntimeReady",[Fe.api]),Le}()}function dt(){const e=ee("js-module-runtime"),t=ee("js-module-native");if(nt&&rt)return[nt,rt,it];"object"==typeof e.moduleExports?nt=e.moduleExports:(Pe.diagnosticTracing&&b(`Attempting to import '${e.resolvedUrl}' for ${e.name}`),nt=import(/*! webpackIgnore: true */e.resolvedUrl)),"object"==typeof t.moduleExports?rt=t.moduleExports:(Pe.diagnosticTracing&&b(`Attempting to import '${t.resolvedUrl}' for ${t.name}`),rt=import(/*! webpackIgnore: true */t.resolvedUrl));const o=Y("js-module-diagnostics");return o&&("object"==typeof o.moduleExports?it=o.moduleExports:(Pe.diagnosticTracing&&b(`Attempting to import '${o.resolvedUrl}' for ${o.name}`),it=import(/*! webpackIgnore: true */o.resolvedUrl))),[nt,rt,it]}async function ut(e){const{initializeExports:t,initializeReplacements:o,configureRuntimeStartup:n,configureEmscriptenStartup:r,configureWorkerStartup:i,setRuntimeGlobals:s,passEmscriptenInternals:a}=e[0],{default:l}=e[1],c=e[2];s(Fe),t(Fe),c&&c.setRuntimeGlobals(Fe),await n(We),Pe.runtimeModuleLoaded.promise_control.resolve(),l((e=>(Object.assign(We,{ready:e.ready,__dotnet_runtime:{initializeReplacements:o,configureEmscriptenStartup:r,configureWorkerStartup:i,passEmscriptenInternals:a}}),We))).catch((e=>{if(e.message&&e.message.toLowerCase().includes("out of memory"))throw new Error(".NET runtime has failed to start, because too much memory was requested. Please decrease the memory by adjusting EmccMaximumHeapSize. See also https://aka.ms/dotnet-wasm-features");throw e}))}const ft=new class{withModuleConfig(e){try{return Ee(We,e),this}catch(e){throw Xe(1,e),e}}withOnConfigLoaded(e){try{return Ee(We,{onConfigLoaded:e}),this}catch(e){throw Xe(1,e),e}}withConsoleForwarding(){try{return ve(ze,{forwardConsoleLogsToWS:!0}),this}catch(e){throw Xe(1,e),e}}withExitOnUnhandledError(){try{return ve(ze,{exitOnUnhandledError:!0}),Je(),this}catch(e){throw Xe(1,e),e}}withAsyncFlushOnExit(){try{return ve(ze,{asyncFlushOnExit:!0}),this}catch(e){throw Xe(1,e),e}}withExitCodeLogging(){try{return ve(ze,{logExitCode:!0}),this}catch(e){throw Xe(1,e),e}}withElementOnExit(){try{return ve(ze,{appendElementOnExit:!0}),this}catch(e){throw Xe(1,e),e}}withInteropCleanupOnExit(){try{return ve(ze,{interopCleanupOnExit:!0}),this}catch(e){throw Xe(1,e),e}}withDumpThreadsOnNonZeroExit(){try{return ve(ze,{dumpThreadsOnNonZeroExit:!0}),this}catch(e){throw Xe(1,e),e}}withWaitingForDebugger(e){try{return ve(ze,{waitForDebugger:e}),this}catch(e){throw Xe(1,e),e}}withInterpreterPgo(e,t){try{return ve(ze,{interpreterPgo:e,interpreterPgoSaveDelay:t}),ze.runtimeOptions?ze.runtimeOptions.push("--interp-pgo-recording"):ze.runtimeOptions=["--interp-pgo-recording"],this}catch(e){throw Xe(1,e),e}}withConfig(e){try{return ve(ze,e),this}catch(e){throw Xe(1,e),e}}withConfigSrc(e){try{return e&&"string"==typeof e||Be(!1,"must be file path or URL"),Ee(We,{configSrc:e}),this}catch(e){throw Xe(1,e),e}}withVirtualWorkingDirectory(e){try{return e&&"string"==typeof e||Be(!1,"must be directory path"),ve(ze,{virtualWorkingDirectory:e}),this}catch(e){throw Xe(1,e),e}}withEnvironmentVariable(e,t){try{const o={};return o[e]=t,ve(ze,{environmentVariables:o}),this}catch(e){throw Xe(1,e),e}}withEnvironmentVariables(e){try{return e&&"object"==typeof e||Be(!1,"must be dictionary object"),ve(ze,{environmentVariables:e}),this}catch(e){throw Xe(1,e),e}}withDiagnosticTracing(e){try{return"boolean"!=typeof e&&Be(!1,"must be boolean"),ve(ze,{diagnosticTracing:e}),this}catch(e){throw Xe(1,e),e}}withDebugging(e){try{return null!=e&&"number"==typeof e||Be(!1,"must be number"),ve(ze,{debugLevel:e}),this}catch(e){throw Xe(1,e),e}}withApplicationArguments(...e){try{return e&&Array.isArray(e)||Be(!1,"must be array of strings"),ve(ze,{applicationArguments:e}),this}catch(e){throw Xe(1,e),e}}withRuntimeOptions(e){try{return e&&Array.isArray(e)||Be(!1,"must be array of strings"),ze.runtimeOptions?ze.runtimeOptions.push(...e):ze.runtimeOptions=e,this}catch(e){throw Xe(1,e),e}}withMainAssembly(e){try{return ve(ze,{mainAssemblyName:e}),this}catch(e){throw Xe(1,e),e}}withApplicationArgumentsFromQuery(){try{if(!globalThis.window)throw new Error("Missing window to the query parameters from");if(void 0===globalThis.URLSearchParams)throw new Error("URLSearchParams is supported");const e=new URLSearchParams(globalThis.window.location.search).getAll("arg");return this.withApplicationArguments(...e)}catch(e){throw Xe(1,e),e}}withApplicationEnvironment(e){try{return ve(ze,{applicationEnvironment:e}),this}catch(e){throw Xe(1,e),e}}withApplicationCulture(e){try{return ve(ze,{applicationCulture:e}),this}catch(e){throw Xe(1,e),e}}withResourceLoader(e){try{return Pe.loadBootResource=e,this}catch(e){throw Xe(1,e),e}}async download(){try{await async function(){lt(We),await Re(We),re(),D(),oe(),await Pe.allDownloadsFinished.promise}()}catch(e){throw Xe(1,e),e}}async create(){try{return this.instance||(this.instance=await async function(){return await ct(We),Fe.api}()),this.instance}catch(e){throw Xe(1,e),e}}async run(){try{return We.config||Be(!1,"Null moduleConfig.config"),this.instance||await this.create(),this.instance.runMainAndExit()}catch(e){throw Xe(1,e),e}}},mt=Xe,gt=ct;Ie||"function"==typeof globalThis.URL||Be(!1,"This browser/engine doesn't support URL API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features"),"function"!=typeof globalThis.BigInt64Array&&Be(!1,"This browser/engine doesn't support BigInt64Array API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features"),ft.withConfig(/*json-start*/{
|
|
5
5
|
"mainAssemblyName": "PKHeX.Everywhere.Engine.Host",
|
|
6
6
|
"resources": {
|
|
7
|
-
"hash": "sha256-
|
|
7
|
+
"hash": "sha256-cxuQsV8bJZikefEqsR+mU95a7CboO0JmRgEPkj1GCsY=",
|
|
8
8
|
"jsModuleNative": [
|
|
9
9
|
{
|
|
10
10
|
"name": "dotnet.native.b6l13xorvf.js"
|
|
@@ -45,8 +45,8 @@ var e=!1;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
|
|
45
45
|
"coreAssembly": [
|
|
46
46
|
{
|
|
47
47
|
"virtualPath": "System.Private.CoreLib.wasm",
|
|
48
|
-
"name": "System.Private.CoreLib.
|
|
49
|
-
"hash": "sha256-
|
|
48
|
+
"name": "System.Private.CoreLib.37lagr3mrw.wasm",
|
|
49
|
+
"hash": "sha256-z5WSYqmzaE8zsDCoCWA4nTQ2FmjtNQ0rDRf2dnm90gU=",
|
|
50
50
|
"cache": "force-cache"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
@@ -70,51 +70,51 @@ var e=!1;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
|
|
70
70
|
"cache": "force-cache"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
|
-
"virtualPath": "PKHeX.Core.
|
|
74
|
-
"name": "PKHeX.Core.
|
|
75
|
-
"hash": "sha256-
|
|
73
|
+
"virtualPath": "PKHeX.Core.wasm",
|
|
74
|
+
"name": "PKHeX.Core.1xasc6dsc1.wasm",
|
|
75
|
+
"hash": "sha256-u6UVKrOcJRblXkyvwlWtW8aegmCigK5KIA3MmPci1dk=",
|
|
76
76
|
"cache": "force-cache"
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
|
-
"virtualPath": "PKHeX.Core.wasm",
|
|
80
|
-
"name": "PKHeX.Core.
|
|
81
|
-
"hash": "sha256-
|
|
79
|
+
"virtualPath": "PKHeX.Core.AutoMod.wasm",
|
|
80
|
+
"name": "PKHeX.Core.AutoMod.czi8ongfah.wasm",
|
|
81
|
+
"hash": "sha256-GKbGOpREIZ0MseGsn7yaqir2aXh0RMjciZ8O4+JQ3qY=",
|
|
82
82
|
"cache": "force-cache"
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
|
-
"virtualPath": "PKHeX.Everywhere.Engine.
|
|
86
|
-
"name": "PKHeX.Everywhere.Engine.
|
|
87
|
-
"hash": "sha256-
|
|
85
|
+
"virtualPath": "PKHeX.Everywhere.Engine.wasm",
|
|
86
|
+
"name": "PKHeX.Everywhere.Engine.lefi2yju2h.wasm",
|
|
87
|
+
"hash": "sha256-gydG8lV4M4DmU69v4aFB7nFQj8YYyyQ7QchUJdk9ymw=",
|
|
88
88
|
"cache": "force-cache"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
"virtualPath": "PKHeX.Everywhere.Engine.
|
|
92
|
-
"name": "PKHeX.Everywhere.Engine.
|
|
93
|
-
"hash": "sha256-
|
|
91
|
+
"virtualPath": "PKHeX.Everywhere.Engine.Host.wasm",
|
|
92
|
+
"name": "PKHeX.Everywhere.Engine.Host.a3ej0keoiq.wasm",
|
|
93
|
+
"hash": "sha256-Fn51lv0TWcBK1u5AhdBtsQeH2J+1GMpY09n7jonMNFE=",
|
|
94
94
|
"cache": "force-cache"
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
|
-
"virtualPath": "PKHeX.Everywhere.Engine.wasm",
|
|
98
|
-
"name": "PKHeX.Everywhere.Engine.
|
|
99
|
-
"hash": "sha256-
|
|
97
|
+
"virtualPath": "PKHeX.Everywhere.Engine.PlugIns.wasm",
|
|
98
|
+
"name": "PKHeX.Everywhere.Engine.PlugIns.eahx1wxme6.wasm",
|
|
99
|
+
"hash": "sha256-xoa2Kqhz35EQv2ImlOpxmXEWr8g24CkK9gbvEJVVTYY=",
|
|
100
100
|
"cache": "force-cache"
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
"virtualPath": "PKHeX.Everywhere.PlugIns.wasm",
|
|
104
|
-
"name": "PKHeX.Everywhere.PlugIns.
|
|
105
|
-
"hash": "sha256-
|
|
104
|
+
"name": "PKHeX.Everywhere.PlugIns.c21drnk0yt.wasm",
|
|
105
|
+
"hash": "sha256-pD3VxH2Tz0ollYu7ZIVuTk4lPdLCe1t+rOt7DI8r3qo=",
|
|
106
106
|
"cache": "force-cache"
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
"virtualPath": "PKHeX.Everywhere.RomHacks.wasm",
|
|
110
|
-
"name": "PKHeX.Everywhere.RomHacks.
|
|
111
|
-
"hash": "sha256-
|
|
110
|
+
"name": "PKHeX.Everywhere.RomHacks.2eiw3juwcd.wasm",
|
|
111
|
+
"hash": "sha256-5utlmnQL9U/HYZpkiZ2KMpqsfFR3VBrwYg2DXOAUXf8=",
|
|
112
112
|
"cache": "force-cache"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"virtualPath": "PKHeX.Facade.wasm",
|
|
116
|
-
"name": "PKHeX.Facade.
|
|
117
|
-
"hash": "sha256-
|
|
116
|
+
"name": "PKHeX.Facade.ok6fzoms0k.wasm",
|
|
117
|
+
"hash": "sha256-CJI1xI25VeBdPuyy7v6FxnmDcgV+PjA0BXhxc+kYgMo=",
|
|
118
118
|
"cache": "force-cache"
|
|
119
119
|
},
|
|
120
120
|
{
|
|
@@ -257,8 +257,8 @@ var e=!1;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
|
|
257
257
|
},
|
|
258
258
|
{
|
|
259
259
|
"virtualPath": "System.Runtime.wasm",
|
|
260
|
-
"name": "System.Runtime.
|
|
261
|
-
"hash": "sha256-
|
|
260
|
+
"name": "System.Runtime.vnwhlsf4yw.wasm",
|
|
261
|
+
"hash": "sha256-ZSviiOdjwtGcjTDCRR4UqHbTsLxh4OPK7KaApXQbpxs=",
|
|
262
262
|
"cache": "force-cache"
|
|
263
263
|
},
|
|
264
264
|
{
|
package/dist/binary.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ import type { Binary } from './generated/types';
|
|
|
2
2
|
export declare function toBase64(data: Binary): Promise<string>;
|
|
3
3
|
export declare function fileNameOf(data: Binary): string | null;
|
|
4
4
|
export declare function withBytes<T>(value: T, paths: readonly string[]): T;
|
|
5
|
+
export declare function withBase64<T>(value: T, paths: readonly string[]): Promise<T>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ActionPlacement, AddedPokemon, Badge, Binary, BoxEntry, CatalogNames, CatalogNamesRequest, Choice, DeclaredPage, EditablePokemon, EncounterRow, EncounterVersions, ExportedPokemon, ExportedSave, FormatEntry, GameProgress, InstalledPlugIn, ItemHandle, LoadedSave, PlugInAction, PlugInDetails, PlugInFailure, PlugInOutcome, PlugInSetting, PlugInState, PokemonHandle, PokemonId, PokemonOptions, PokemonPatch, PokemonSummary, Pouch, PublishedVersion, SaveEvents, SaveSummary, SaveVersion, SpeciesEntry,
|
|
1
|
+
import type { ActionPlacement, AddFromFileOptions, AddedPokemon, Badge, Binary, BoxEntry, CatalogNames, CatalogNamesRequest, Choice, DeclaredPage, EditablePokemon, EncounterRow, EncounterVersions, ExportedPokemon, ExportedSave, FilePreview, FormatEntry, GameProgress, InstalledPlugIn, ItemHandle, LoadedSave, PlugInAction, PlugInDetails, PlugInFailure, PlugInOutcome, PlugInSetting, PlugInState, PokemonHandle, PokemonId, PokemonOptions, PokemonPatch, PokemonSummary, Pouch, PublishedVersion, SaveEvents, SaveSummary, SaveVersion, SpeciesEntry, TrainerCard, TrainerGender, TransferOffer, TransferPreview, TransferResult, TransferSummary, VersionEntry } from './types';
|
|
2
2
|
export type Invoke = <T>(call: CallName, args: unknown[]) => Promise<T>;
|
|
3
|
-
export declare const queries: readonly ['box.get', 'box.list', 'box.showdown', 'catalog.names', 'encounters.search', 'encounters.versions', 'events.flag', 'events.get', 'game.balls', 'game.blankVersions', 'game.formats', 'game.get', 'game.heldItems', 'game.languages', 'game.moves', 'game.natures', 'game.originGames', 'game.progress', 'game.types', 'game.version', 'inventory.get', 'party.get', 'party.showdown', 'plugins.actions', 'plugins.details', 'plugins.failures', 'plugins.installed', 'plugins.isSupported', 'plugins.pageModule', 'plugins.pages', 'plugins.setting', 'plugins.state', 'pokemon.details', 'pokemon.export', 'pokemon.get', 'pokemon.options', 'pokemon.read', 'pokemon.showdown', 'species.list', '
|
|
4
|
-
export declare const commands: readonly ['box.addEncounter', 'box.addFromFile', 'events.giveTickets', 'events.setFlag', 'events.setWork', 'game.close', 'game.enableFormat', 'game.export', 'game.file', 'game.load', 'game.loadBlank', 'inventory.setItem', 'plugins.dismissFailure', 'plugins.newestCompatible', 'plugins.register', 'plugins.run', 'plugins.setEnabled', 'plugins.setHookEnabled', 'plugins.unregister', 'plugins.updateSetting', 'pokemon.addToBox', 'pokemon.clone', 'pokemon.commit', 'pokemon.edit', 'pokemon.setLevel', 'pokemon.update', '
|
|
3
|
+
export declare const queries: readonly ['box.get', 'box.list', 'box.previewFile', 'box.showdown', 'catalog.names', 'encounters.search', 'encounters.versions', 'events.flag', 'events.get', 'game.balls', 'game.blankVersions', 'game.formats', 'game.get', 'game.heldItems', 'game.languages', 'game.moves', 'game.natures', 'game.originGames', 'game.progress', 'game.types', 'game.version', 'inventory.get', 'party.get', 'party.showdown', 'plugins.actions', 'plugins.details', 'plugins.failures', 'plugins.installed', 'plugins.isSupported', 'plugins.pageModule', 'plugins.pages', 'plugins.setting', 'plugins.state', 'pokemon.details', 'pokemon.export', 'pokemon.get', 'pokemon.options', 'pokemon.read', 'pokemon.showdown', 'species.list', 'trainer.badges', 'trainer.get', 'transfer.get', 'transfer.partnerBoxes', 'transfer.preview'];
|
|
4
|
+
export declare const commands: readonly ['box.addEncounter', 'box.addFromFile', 'events.giveTickets', 'events.setFlag', 'events.setWork', 'game.close', 'game.enableFormat', 'game.export', 'game.file', 'game.load', 'game.loadBlank', 'inventory.setItem', 'plugins.dismissFailure', 'plugins.newestCompatible', 'plugins.register', 'plugins.run', 'plugins.setEnabled', 'plugins.setHookEnabled', 'plugins.unregister', 'plugins.updateSetting', 'pokemon.addToBox', 'pokemon.clone', 'pokemon.commit', 'pokemon.edit', 'pokemon.setLevel', 'pokemon.update', 'trainer.setBadges', 'trainer.setBattlePoints', 'trainer.setGender', 'trainer.setMoney', 'trainer.setName', 'transfer.close', 'transfer.commit', 'transfer.open'];
|
|
5
5
|
export type QueryName = (typeof queries)[number];
|
|
6
6
|
export type CommandName = (typeof commands)[number];
|
|
7
7
|
export type CallName = QueryName | CommandName;
|
|
@@ -9,12 +9,14 @@ export interface EngineClient {
|
|
|
9
9
|
box: {
|
|
10
10
|
/** Requires a loaded save; throws `no-save` otherwise. */
|
|
11
11
|
addEncounter(index: number): Promise<AddedPokemon>;
|
|
12
|
-
/** Requires a loaded save; throws `no-save` otherwise. */
|
|
13
|
-
addFromFile(bytes: Binary): Promise<AddedPokemon>;
|
|
12
|
+
/** Adds a Pokémon file to the first empty box slot, converted to the loaded save's format. Fails with `unparseable`, `not-in-game` and `conversion-failed` as `box.previewFile` does, and with `box-full` when no slot is empty. A file no game can move into the save fails with `conversion-failed` unless `allowUnofficial` is set. Requires a loaded save; throws `no-save` otherwise. */
|
|
13
|
+
addFromFile(bytes: Binary, options?: AddFromFileOptions | null): Promise<AddedPokemon>;
|
|
14
14
|
/** Requires a loaded save; throws `no-save` otherwise. */
|
|
15
15
|
get(): Promise<PokemonSummary[]>;
|
|
16
16
|
/** Lists every box in the save in order, empty ones included, with its name and slot count. Requires a loaded save; throws `no-save` otherwise. */
|
|
17
17
|
list(): Promise<BoxEntry[]>;
|
|
18
|
+
/** Shows how `box.addFromFile` would add a Pokémon file to the loaded save. Nothing is written. Fails with `unparseable` when the bytes aren't a Pokémon, `not-in-game` when the game doesn't have its species, and `conversion-failed` when PKHeX can't convert it at all. Requires a loaded save; throws `no-save` otherwise. */
|
|
19
|
+
previewFile(bytes: Binary): Promise<FilePreview>;
|
|
18
20
|
/** Requires a loaded save; throws `no-save` otherwise. */
|
|
19
21
|
showdown(): Promise<string>;
|
|
20
22
|
};
|
|
@@ -130,10 +132,10 @@ export interface EngineClient {
|
|
|
130
132
|
/** Requires a loaded save; throws `no-save` otherwise. */
|
|
131
133
|
options(at: PokemonHandle): Promise<PokemonOptions>;
|
|
132
134
|
/**
|
|
133
|
-
* Reads one Gen 3 or
|
|
135
|
+
* Reads one Gen 3, 4 or 5 Pokémon from bytes taken from a running game, without a loaded save. Nothing is written, and `legality` is null. Bytes that aren't a Pokémon, such as all zeros, an empty species or a Gen 3 bad egg, fail with `bad-checksum`. From party bytes, `level` is the level the game stores and shows. Box bytes have no level, so theirs comes from the Pokémon's EXP.
|
|
134
136
|
*
|
|
135
|
-
* @param bytes The Pokémon as the game keeps it: encrypted and shuffled, in its party (100-byte PK3, 236-byte PK4) or box (80-byte PK3, 136-byte PK4) layout. Another length fails with `bad-arguments`.
|
|
136
|
-
* @param version The PKHeX game version id the bytes come from. A combined version, such as FireRed/LeafGreen, fails with `bad-arguments`, and a game outside Gen 3
|
|
137
|
+
* @param bytes The Pokémon as the game keeps it: encrypted and shuffled, in its party (100-byte PK3, 236-byte PK4, 220-byte PK5) or box (80-byte PK3, 136-byte PK4 or PK5) layout. Another length fails with `bad-arguments`.
|
|
138
|
+
* @param version The PKHeX game version id the bytes come from. A combined version, such as FireRed/LeafGreen, fails with `bad-arguments`, and a game outside Gen 3 to 5 with `not-supported`.
|
|
137
139
|
* @param formatId The id of a ROM hack's format, from `game.formats()` or `game.version()`, such as `unbound`. The bytes are then read in the hack's party layout, as `pokemon.details` reads the Pokémon in the hack's save. Only party bytes are accepted. `version` must be the format's base game, such as FireRed for Unbound, or the read fails with `bad-arguments`. An unknown or disabled id fails with `not-found`, and `pkhex` with `not-supported`.
|
|
138
140
|
*/
|
|
139
141
|
read(bytes: Binary, version: number, formatId?: string | null): Promise<EditablePokemon>;
|
|
@@ -148,26 +150,6 @@ export interface EngineClient {
|
|
|
148
150
|
/** Requires a loaded save; throws `no-save` otherwise. */
|
|
149
151
|
list(): Promise<SpeciesEntry[]>;
|
|
150
152
|
};
|
|
151
|
-
trade: {
|
|
152
|
-
/** Closes the open trade, dropping the partner save. Closing with no trade open does nothing. */
|
|
153
|
-
close(): Promise<void>;
|
|
154
|
-
/** Moves the offered Pokémon: each leaves its slot and lands in the first empty box slots of the other save. Fails with `trade-refused`, writing nothing, when `trade.preview()` refuses any of them. Requires a loaded save; throws `no-save` otherwise. */
|
|
155
|
-
commit(offer: TradeOffer): Promise<TradeResult>;
|
|
156
|
-
/** Reads the open trade's partner, routes and room, or null when no trade is open or no save is loaded. */
|
|
157
|
-
get(): Promise<TradeSummary | null>;
|
|
158
|
-
/**
|
|
159
|
-
* Opens a partner save next to the loaded one, to move Pokémon between them. It replaces the partner opened before, and stays open until `trade.close()`, even when another save is loaded. Requires a loaded save; throws `no-save` otherwise.
|
|
160
|
-
*
|
|
161
|
-
* @param data The partner save file's bytes.
|
|
162
|
-
* @param fileName The file name to export the partner with. Defaults to the name of a `File`, or `partner.sav`.
|
|
163
|
-
* @param formatId The id of a save format from `game.formats()` to load the partner with, as in `game.load()`.
|
|
164
|
-
*/
|
|
165
|
-
open(data: Binary, fileName?: string | null, formatId?: string | null): Promise<TradeSummary>;
|
|
166
|
-
/** Lists the partner's party, then its boxed Pokémon in box and slot order. Handles point into the partner save. */
|
|
167
|
-
partnerBoxes(): Promise<PokemonSummary[]>;
|
|
168
|
-
/** Shows what moving the offered Pokémon would change, and which ones can't move. Nothing is written. A handle without a Pokémon fails with `not-found`, and the draft with `draft-not-allowed`. Requires a loaded save; throws `no-save` otherwise. */
|
|
169
|
-
preview(offer: TradeOffer): Promise<TradePreview>;
|
|
170
|
-
};
|
|
171
153
|
trainer: {
|
|
172
154
|
/** Lists the gym badges in game order. Gold, Silver and Crystal list the Johto badges, then the Kanto ones. Returns null outside Generations 1 to 3 and for ROM hacks. Requires a loaded save; throws `no-save` otherwise. */
|
|
173
155
|
badges(): Promise<Badge[] | null>;
|
|
@@ -184,5 +166,25 @@ export interface EngineClient {
|
|
|
184
166
|
/** Requires a loaded save; throws `no-save` otherwise. */
|
|
185
167
|
setName(name: string): Promise<void>;
|
|
186
168
|
};
|
|
169
|
+
transfer: {
|
|
170
|
+
/** Closes the open transfer, dropping the partner save. Closing with no transfer open does nothing. */
|
|
171
|
+
close(): Promise<void>;
|
|
172
|
+
/** Moves the offered Pokémon: each leaves its slot and lands in the first empty box slots of the other save. Fails with `transfer-refused`, writing nothing, when `transfer.preview()` refuses any of them. Requires a loaded save; throws `no-save` otherwise. */
|
|
173
|
+
commit(offer: TransferOffer): Promise<TransferResult>;
|
|
174
|
+
/** Reads the open transfer's partner, routes and room, or null when no transfer is open or no save is loaded. */
|
|
175
|
+
get(): Promise<TransferSummary | null>;
|
|
176
|
+
/**
|
|
177
|
+
* Opens a partner save next to the loaded one, to move Pokémon between them. It replaces the partner opened before, and stays open until `transfer.close()`, even when another save is loaded. Requires a loaded save; throws `no-save` otherwise.
|
|
178
|
+
*
|
|
179
|
+
* @param data The partner save file's bytes.
|
|
180
|
+
* @param fileName The file name to export the partner with. Defaults to the name of a `File`, or `partner.sav`.
|
|
181
|
+
* @param formatId The id of a save format from `game.formats()` to load the partner with, as in `game.load()`.
|
|
182
|
+
*/
|
|
183
|
+
open(data: Binary, fileName?: string | null, formatId?: string | null): Promise<TransferSummary>;
|
|
184
|
+
/** Lists the partner's party, then its boxed Pokémon in box and slot order. Handles point into the partner save. */
|
|
185
|
+
partnerBoxes(): Promise<PokemonSummary[]>;
|
|
186
|
+
/** Shows what moving the offered Pokémon would change, and which ones can't move. Nothing is written. A handle without a Pokémon fails with `not-found`, and the draft with `draft-not-allowed`. Requires a loaded save; throws `no-save` otherwise. */
|
|
187
|
+
preview(offer: TransferOffer): Promise<TransferPreview>;
|
|
188
|
+
};
|
|
187
189
|
}
|
|
188
190
|
export declare function createClient(invoke: Invoke): EngineClient;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const errorCodes: readonly ['no-save', 'invalid-save', 'format-choice-required', 'not-found', 'out-of-range', 'pouch-full', 'box-full', 'unparseable', 'conversion-failed', 'not-in-game', 'unknown-species', 'invalid-patch', 'draft-not-allowed', 'no-slot', 'no-draft', 'unknown-call', 'bad-arguments', 'plugin-failed', 'not-supported', 'no-
|
|
1
|
+
export declare const errorCodes: readonly ['no-save', 'invalid-save', 'format-choice-required', 'not-found', 'out-of-range', 'pouch-full', 'box-full', 'unparseable', 'conversion-failed', 'not-in-game', 'unknown-species', 'invalid-patch', 'draft-not-allowed', 'no-slot', 'no-draft', 'unknown-call', 'bad-arguments', 'plugin-failed', 'not-supported', 'no-transfer', 'transfer-refused', 'bad-checksum', 'unexpected'];
|
|
2
2
|
export type ErrorCode = (typeof errorCodes)[number];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { QueryName } from './client';
|
|
2
|
-
export declare const topics: readonly ['*', 'game', 'party', 'box', 'inventory', 'events', 'trainer', 'draft', 'plugins', '
|
|
2
|
+
export declare const topics: readonly ['*', 'game', 'party', 'box', 'inventory', 'events', 'trainer', 'draft', 'plugins', 'transfer'];
|
|
3
3
|
export type Topic = (typeof topics)[number] | `${(typeof topics)[number]}/${string}`;
|
|
4
4
|
export declare const queryTopics: Record<QueryName, readonly Topic[]>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/** Where a plug-in action shows up: `quick` on the home page with no target, `pokemon` in the Pokémon editor, `pokemonStats` on the editor's stats tab. */
|
|
2
2
|
export type ActionPlacement = 'quick' | 'pokemon' | 'pokemonStats';
|
|
3
|
+
/** How `box.addFromFile` adds a Pokémon file. */
|
|
4
|
+
export interface AddFromFileOptions {
|
|
5
|
+
/** Add a Pokémon no game can move into the loaded save, converted as `box.previewFile` shows. Without it, such a file fails with `conversion-failed`. */
|
|
6
|
+
allowUnofficial: boolean;
|
|
7
|
+
}
|
|
3
8
|
/** An item the pouch can hold that the trainer doesn't have yet. */
|
|
4
9
|
export interface AddableItem {
|
|
5
10
|
/** The item's id in the save's own item list. From Generation 4 on, and in ROM hack saves, these are PKHeX.Core item ids; other Generation 1 to 3 saves use their game's own numbering. */
|
|
@@ -234,6 +239,17 @@ export interface ExportedSave {
|
|
|
234
239
|
/** The file name the save was loaded with. */
|
|
235
240
|
fileName: string;
|
|
236
241
|
}
|
|
242
|
+
/** A Pokémon file as `box.addFromFile` would add it to the loaded save, returned by `box.previewFile`. */
|
|
243
|
+
export interface FilePreview {
|
|
244
|
+
/** The Pokémon as it would arrive in the loaded save. */
|
|
245
|
+
pokemon: PokemonPreview;
|
|
246
|
+
/** No game can move this Pokémon into the loaded save. `box.addFromFile` needs `allowUnofficial` to add it. */
|
|
247
|
+
unofficial: boolean;
|
|
248
|
+
/** The fields the conversion changes, in the order of `TransferField`. */
|
|
249
|
+
changes: TransferChange[];
|
|
250
|
+
/** PKHeX's legality check of the Pokémon as it would arrive, judged in the loaded save. Null when the save has no legality check, such as a ROM hack's. */
|
|
251
|
+
legality: Legality | null;
|
|
252
|
+
}
|
|
237
253
|
/** A save format `game.load()` can load a save with, returned by `game.formats()`. */
|
|
238
254
|
export interface FormatEntry {
|
|
239
255
|
/** The format's id, to pass to `game.load()` as `formatId`. */
|
|
@@ -340,6 +356,15 @@ export interface ItemHandle {
|
|
|
340
356
|
/** The item's id in the save's own item list, as `OwnedItem.id` and `AddableItem.id` give it. */
|
|
341
357
|
itemId: number;
|
|
342
358
|
}
|
|
359
|
+
/** A Pokémon as it was before a transfer to an older game, to restore what that game dropped. Store it and pass it in `keptCopies` when the Pokémon moves to a newer game again. */
|
|
360
|
+
export interface KeptCopy {
|
|
361
|
+
/** The Pokémon's `identityKey`. */
|
|
362
|
+
identityKey: string;
|
|
363
|
+
/** The generation of the game it left. */
|
|
364
|
+
generation: number;
|
|
365
|
+
/** The Pokémon as it was in that game, in the bytes `pokemon.export` writes. */
|
|
366
|
+
bytes: Uint8Array<ArrayBuffer>;
|
|
367
|
+
}
|
|
343
368
|
/** The result of PKHeX's legality check on a Pokémon. */
|
|
344
369
|
export interface Legality {
|
|
345
370
|
/** True when PKHeX finds nothing illegal. */
|
|
@@ -368,19 +393,23 @@ export interface MoveSlot {
|
|
|
368
393
|
/** The slot holds a move PKHeX has no id for, such as a ROM hack's own move, named like `Unknown move #90`. Its `id` can only stay in this slot, and the slot can be set to another move or to 0. */
|
|
369
394
|
isUnknown: boolean;
|
|
370
395
|
}
|
|
371
|
-
/** A Pokémon in the offer that can be
|
|
396
|
+
/** A Pokémon in the offer that can be transferred, and what moving it changes. */
|
|
372
397
|
export interface OfferedPokemon {
|
|
373
|
-
direction:
|
|
398
|
+
direction: TransferDirection;
|
|
399
|
+
/** How the Pokémon gets to the other save. */
|
|
400
|
+
route: TransferRoute;
|
|
374
401
|
/** The Pokémon as it is now. Its handle points to the save it leaves. */
|
|
375
402
|
from: PokemonSummary;
|
|
376
403
|
/** The Pokémon as it will be in the other save. Its handle is the box slot it will land in. */
|
|
377
404
|
arrives: PokemonSummary;
|
|
378
|
-
/** The fields the move changes, in the order of `
|
|
379
|
-
changes:
|
|
405
|
+
/** The fields the move changes, in the order of `TransferField`. A move can show up once per move removed. */
|
|
406
|
+
changes: TransferChange[];
|
|
380
407
|
/** What the move changes in either save. */
|
|
381
|
-
saveChanges:
|
|
408
|
+
saveChanges: TransferSaveChange[];
|
|
382
409
|
/** PKHeX's legality check of the Pokémon as it arrives, judged in the destination game. */
|
|
383
410
|
legality: Legality;
|
|
411
|
+
/** `transfer.commit` returns a kept copy of this Pokémon. */
|
|
412
|
+
keepsCopy: boolean;
|
|
384
413
|
}
|
|
385
414
|
/** An item the trainer holds in a pouch. */
|
|
386
415
|
export interface OwnedItem {
|
|
@@ -668,6 +697,30 @@ export interface PokemonPatch {
|
|
|
668
697
|
/** PKHeX move ids for all four slots, 0 for an empty slot. All zeros changes nothing. */
|
|
669
698
|
moves?: number[] | null;
|
|
670
699
|
}
|
|
700
|
+
/** A `PokemonSummary` without `id` and `at`, for a Pokémon that isn't in a slot. */
|
|
701
|
+
export interface PokemonPreview {
|
|
702
|
+
/** PKHeX species id, which is the National Pokédex number. Null when `isUnknown` is true. */
|
|
703
|
+
speciesId: number | null;
|
|
704
|
+
/** The species as the save stores it: the game's internal index in Gen 1 to 3, Gen 9 and ROM hacks, and the National Pokédex number elsewhere. */
|
|
705
|
+
speciesIndex: number;
|
|
706
|
+
/** Species name, or a name like `Unknown (#412)` when `isUnknown` is true. */
|
|
707
|
+
species: string;
|
|
708
|
+
/** Neither PKHeX nor the save knows the species. Show a placeholder instead of a sprite. */
|
|
709
|
+
isUnknown: boolean;
|
|
710
|
+
/** The Pokémon could be opened with `pokemon.edit()` once added. */
|
|
711
|
+
editable: boolean;
|
|
712
|
+
form: PokemonForm;
|
|
713
|
+
/** The species name when the Pokémon has no nickname. */
|
|
714
|
+
nickname: string;
|
|
715
|
+
level: number;
|
|
716
|
+
isShiny: boolean;
|
|
717
|
+
gender: PokemonGender;
|
|
718
|
+
isEgg: boolean;
|
|
719
|
+
/** Type ids, named by `game.types()`. One entry for a single-type Pokémon. */
|
|
720
|
+
types: number[];
|
|
721
|
+
/** The same for this Pokémon in every game it moves to: its PID, trainer ID and secret ID. Null in Gen 1 and 2. */
|
|
722
|
+
identityKey: string | null;
|
|
723
|
+
}
|
|
671
724
|
/** Fires when an edited or cloned Pokémon is written to the save: by `pokemon.commit` back to its slot, or by `pokemon.addToBox` to the first empty box slot. */
|
|
672
725
|
export interface PokemonSaved {
|
|
673
726
|
type: 'pokemonSaved';
|
|
@@ -700,6 +753,8 @@ export interface PokemonSummary {
|
|
|
700
753
|
isEgg: boolean;
|
|
701
754
|
/** Type ids, named by `game.types()`. One entry for a single-type Pokémon. */
|
|
702
755
|
types: number[];
|
|
756
|
+
/** The same for this Pokémon in every game it moves to: its PID, trainer ID and secret ID. Null in Gen 1 and 2. */
|
|
757
|
+
identityKey: string | null;
|
|
703
758
|
}
|
|
704
759
|
/** One bag pouch in the save, returned by `inventory.get`. */
|
|
705
760
|
export interface Pouch {
|
|
@@ -717,12 +772,12 @@ export interface PublishedVersion {
|
|
|
717
772
|
/** The plug-in SDK the version is built against: `1` for the older PKHeX.Web plug-ins, `2` and later for PKHeX.Everywhere plug-ins. The engine runs SDK 3 only. */
|
|
718
773
|
sdk: number;
|
|
719
774
|
}
|
|
720
|
-
/** A Pokémon in the offer that can't be
|
|
775
|
+
/** A Pokémon in the offer that can't be transferred. */
|
|
721
776
|
export interface RefusedPokemon {
|
|
722
|
-
direction:
|
|
777
|
+
direction: TransferDirection;
|
|
723
778
|
/** Where it is, in the save it would leave. */
|
|
724
779
|
at: PokemonHandle;
|
|
725
|
-
reason:
|
|
780
|
+
reason: TransferRefusal;
|
|
726
781
|
}
|
|
727
782
|
/** A feature that relies on PKHeX knowing the save's game: the legality check in `pokemon.details()`, AutoLegality, the `encounters` calls, Showdown export, the `events` calls and plug-ins. Without `plugIns`, hooks don't run, `plugins.actions()` and `plugins.pages()` are empty, and `plugins.run()` and `plugins.pageModule()` fail with `not-supported`. */
|
|
728
783
|
export type SaveCapability = 'legality' | 'autoLegality' | 'encounters' | 'showdown' | 'events' | 'plugIns';
|
|
@@ -821,105 +876,109 @@ export interface TicketsAndIslands {
|
|
|
821
876
|
/** Flags for ferry access and the event islands. Empty outside Emerald. */
|
|
822
877
|
islands: EventFlag[];
|
|
823
878
|
}
|
|
824
|
-
/**
|
|
825
|
-
export interface
|
|
826
|
-
|
|
879
|
+
/** The trainer's identity and currencies, returned by `trainer.get`. */
|
|
880
|
+
export interface TrainerCard {
|
|
881
|
+
/** The trainer ID and secret ID as `TID/SID`, in the format the game displays them. */
|
|
882
|
+
id: string;
|
|
883
|
+
name: string;
|
|
884
|
+
/** The longest name the game allows. `trainer.setName` cuts longer names to this length. */
|
|
885
|
+
maxNameLength: number;
|
|
886
|
+
/** The trainer's gender, or null for games without one: Red, Green, Blue, Yellow, Gold, Silver and Pokémon Stadium. `trainer.setGender` fails with `not-in-game` for those. */
|
|
887
|
+
gender: TrainerGender | null;
|
|
888
|
+
/** The trainer's money, or null when the save has none. `trainer.setMoney` accepts 0 to 999999 and caps it at the game's maximum. */
|
|
889
|
+
money: number | null;
|
|
890
|
+
/** The trainer's Battle Points, or null outside Generation 4 and 6 saves. `trainer.setBattlePoints` accepts 0 to 65535. */
|
|
891
|
+
battlePoints: number | null;
|
|
892
|
+
/** The rival's name, or null when the engine can't read one for this game. */
|
|
893
|
+
rival: string | null;
|
|
894
|
+
}
|
|
895
|
+
/** The trainer's gender, as `trainer.get` returns it and `trainer.setGender` takes it. */
|
|
896
|
+
export type TrainerGender = 'male' | 'female';
|
|
897
|
+
/** A field a transfer changes. */
|
|
898
|
+
export interface TransferChange {
|
|
899
|
+
field: TransferField;
|
|
827
900
|
/** The value as the source game names it. Null when there was none, such as a move the Pokémon learns. */
|
|
828
901
|
before: string | null;
|
|
829
902
|
/** The value as the destination game names it. Null when there is none, such as a removed move or item. */
|
|
830
903
|
after: string | null;
|
|
831
|
-
reason:
|
|
904
|
+
reason: TransferChangeReason;
|
|
832
905
|
}
|
|
833
|
-
/** Why a
|
|
834
|
-
export type
|
|
906
|
+
/** Why a transfer changes a field. */
|
|
907
|
+
export type TransferChangeReason = 'hmRemoved' | 'itemRemapped' | 'itemRemoved' | 'link' | 'timeCapsule' | 'palPark' | 'pokeTransfer' | 'received' | 'tradeEvolution' | 'itemUsed' | 'formReverted' | 'notInGame' | 'unofficial' | 'restored';
|
|
835
908
|
/** Which way a Pokémon moves: `send` from the loaded save to the partner, `receive` from the partner to the loaded save. */
|
|
836
|
-
export type
|
|
837
|
-
/** A field of a Pokémon that a
|
|
838
|
-
export type
|
|
909
|
+
export type TransferDirection = 'send' | 'receive';
|
|
910
|
+
/** A field of a Pokémon that a transfer can change. */
|
|
911
|
+
export type TransferField = 'species' | 'form' | 'heldItem' | 'moves' | 'metLocation' | 'metLevel' | 'ball' | 'friendship' | 'nickname' | 'ability' | 'level' | 'nature' | 'gender' | 'shiny' | 'language' | 'originalTrainer' | 'trainerId' | 'originGame' | 'metDate';
|
|
839
912
|
/** The Pokémon to move. Each handle points to a party or box slot: in the loaded save for `send`, and in the partner for `receive`. */
|
|
840
|
-
export interface
|
|
913
|
+
export interface TransferOffer {
|
|
841
914
|
/** Pokémon to move from the loaded save to the partner. */
|
|
842
915
|
send: PokemonHandle[];
|
|
843
916
|
/** Pokémon to move from the partner to the loaded save. */
|
|
844
917
|
receive: PokemonHandle[];
|
|
918
|
+
/** Copies `transfer.commit` returned from earlier transfers to older games. A copy restores what an older game dropped from the offered Pokémon with its `identityKey`. Copies that apply to none are ignored. */
|
|
919
|
+
keptCopies?: KeptCopy[] | null;
|
|
845
920
|
}
|
|
846
|
-
/** What `
|
|
847
|
-
export interface
|
|
848
|
-
/** The Pokémon that can be
|
|
921
|
+
/** What `transfer.commit` would do with an offer, returned by `transfer.preview`. */
|
|
922
|
+
export interface TransferPreview {
|
|
923
|
+
/** The Pokémon that can be transferred, sent ones first. */
|
|
849
924
|
offers: OfferedPokemon[];
|
|
850
|
-
/** The Pokémon that can't. `
|
|
925
|
+
/** The Pokémon that can't. `transfer.commit` fails while any are left. */
|
|
851
926
|
refused: RefusedPokemon[];
|
|
852
927
|
}
|
|
853
|
-
/** Why a Pokémon can't be
|
|
854
|
-
export type
|
|
855
|
-
/** Both saves after `
|
|
856
|
-
export interface
|
|
928
|
+
/** Why a Pokémon can't be transferred. */
|
|
929
|
+
export type TransferRefusal = 'noRoute' | 'slotLocked' | 'eggAcrossGenerations' | 'languageMismatch' | 'speciesNotInGame' | 'lastPartyMember' | 'noRoom' | 'bagFull' | 'conversionFailed';
|
|
930
|
+
/** Both saves after `transfer.commit`, ready to write back. */
|
|
931
|
+
export interface TransferResult {
|
|
857
932
|
/** The loaded save. */
|
|
858
933
|
save: ExportedSave;
|
|
859
934
|
/** The partner save. */
|
|
860
935
|
partner: ExportedSave;
|
|
861
936
|
/** Where each Pokémon landed, sent ones first. */
|
|
862
|
-
arrived:
|
|
937
|
+
arrived: TransferredPokemon[];
|
|
863
938
|
}
|
|
864
939
|
/** How many empty box slots each save has for Pokémon to arrive in. */
|
|
865
|
-
export interface
|
|
940
|
+
export interface TransferRoom {
|
|
866
941
|
/** Empty box slots in the loaded save. */
|
|
867
942
|
mine: number;
|
|
868
943
|
/** Empty box slots in the partner save. */
|
|
869
944
|
partner: number;
|
|
870
945
|
}
|
|
871
946
|
/** How a Pokémon gets from one save to the other, as the games move it. */
|
|
872
|
-
export type
|
|
873
|
-
/** The routes of an open
|
|
874
|
-
export interface
|
|
947
|
+
export type TransferRoute = 'link' | 'timeCapsule' | 'palPark' | 'pokeTransfer' | 'unofficial';
|
|
948
|
+
/** The routes of an open transfer. A null route means Pokémon can't move that way, and every Pokémon offered that way is refused with `noRoute`. Only saves loaded with a ROM hack format and Let's Go saves have no route. */
|
|
949
|
+
export interface TransferRoutes {
|
|
875
950
|
/** From the loaded save to the partner. */
|
|
876
|
-
send:
|
|
951
|
+
send: TransferRoute | null;
|
|
877
952
|
/** From the partner to the loaded save. */
|
|
878
|
-
receive:
|
|
953
|
+
receive: TransferRoute | null;
|
|
879
954
|
}
|
|
880
|
-
/** A change a
|
|
881
|
-
export interface
|
|
882
|
-
kind:
|
|
955
|
+
/** A change a transfer makes to a save. */
|
|
956
|
+
export interface TransferSaveChange {
|
|
957
|
+
kind: TransferSaveChangeKind;
|
|
883
958
|
/** The save that changes. */
|
|
884
|
-
save:
|
|
959
|
+
save: TransferSide;
|
|
885
960
|
/** What changes, for display: the species caught, the item returned, or the event and its new value. */
|
|
886
961
|
label: string;
|
|
887
962
|
}
|
|
888
|
-
/** What a
|
|
889
|
-
export type
|
|
890
|
-
/** A save in a
|
|
891
|
-
export type
|
|
892
|
-
/** The
|
|
893
|
-
export interface
|
|
963
|
+
/** What a transfer changes in a save besides the Pokémon itself. */
|
|
964
|
+
export type TransferSaveChangeKind = 'pokedexCaught' | 'itemReturned' | 'eventVar';
|
|
965
|
+
/** A save in a transfer: `sender` is the one the Pokémon leaves, `receiver` the one it arrives in. */
|
|
966
|
+
export type TransferSide = 'sender' | 'receiver';
|
|
967
|
+
/** The transfer `transfer.open` opened: the partner save, the routes between the saves and the room in each. */
|
|
968
|
+
export interface TransferSummary {
|
|
894
969
|
partner: SaveSummary;
|
|
895
|
-
routes:
|
|
896
|
-
room:
|
|
970
|
+
routes: TransferRoutes;
|
|
971
|
+
room: TransferRoom;
|
|
897
972
|
}
|
|
898
|
-
/** A Pokémon a
|
|
899
|
-
export interface
|
|
900
|
-
direction:
|
|
973
|
+
/** A Pokémon a transfer moved. */
|
|
974
|
+
export interface TransferredPokemon {
|
|
975
|
+
direction: TransferDirection;
|
|
901
976
|
id: PokemonId;
|
|
902
977
|
/** The box slot it landed in: in the partner for `send`, in the loaded save for `receive`. */
|
|
903
978
|
at: PokemonHandle;
|
|
979
|
+
/** The Pokémon as it was before it moved to an older game. Null when it didn't. Store it to pass in a later transfer's `keptCopies`. */
|
|
980
|
+
keptCopy: KeptCopy | null;
|
|
904
981
|
}
|
|
905
|
-
/** The trainer's identity and currencies, returned by `trainer.get`. */
|
|
906
|
-
export interface TrainerCard {
|
|
907
|
-
/** The trainer ID and secret ID as `TID/SID`, in the format the game displays them. */
|
|
908
|
-
id: string;
|
|
909
|
-
name: string;
|
|
910
|
-
/** The longest name the game allows. `trainer.setName` cuts longer names to this length. */
|
|
911
|
-
maxNameLength: number;
|
|
912
|
-
/** The trainer's gender, or null for games without one: Red, Green, Blue, Yellow, Gold, Silver and Pokémon Stadium. `trainer.setGender` fails with `not-in-game` for those. */
|
|
913
|
-
gender: TrainerGender | null;
|
|
914
|
-
/** The trainer's money, or null when the save has none. `trainer.setMoney` accepts 0 to 999999 and caps it at the game's maximum. */
|
|
915
|
-
money: number | null;
|
|
916
|
-
/** The trainer's Battle Points, or null outside Generation 4 and 6 saves. `trainer.setBattlePoints` accepts 0 to 65535. */
|
|
917
|
-
battlePoints: number | null;
|
|
918
|
-
/** The rival's name, or null when the engine can't read one for this game. */
|
|
919
|
-
rival: string | null;
|
|
920
|
-
}
|
|
921
|
-
/** The trainer's gender, as `trainer.get` returns it and `trainer.setGender` takes it. */
|
|
922
|
-
export type TrainerGender = 'male' | 'female';
|
|
923
982
|
/** A game version with its display name. */
|
|
924
983
|
export interface VersionEntry {
|
|
925
984
|
/** The game's PKHeX `GameVersion` value. */
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createEngine, n as topics, o as wasmHost, r as EngineError } from "./topics-
|
|
1
|
+
import { a as createEngine, n as topics, o as wasmHost, r as EngineError } from "./topics-Bx58fcG5.js";
|
|
2
2
|
//#region src/generated/errors.ts
|
|
3
3
|
var errorCodes = [
|
|
4
4
|
"no-save",
|
|
@@ -20,8 +20,8 @@ var errorCodes = [
|
|
|
20
20
|
"bad-arguments",
|
|
21
21
|
"plugin-failed",
|
|
22
22
|
"not-supported",
|
|
23
|
-
"no-
|
|
24
|
-
"
|
|
23
|
+
"no-transfer",
|
|
24
|
+
"transfer-refused",
|
|
25
25
|
"bad-checksum",
|
|
26
26
|
"unexpected"
|
|
27
27
|
];
|
package/dist/internal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as call, s as affects, t as queryTopics } from "./topics-
|
|
1
|
+
import { i as call, s as affects, t as queryTopics } from "./topics-Bx58fcG5.js";
|
|
2
2
|
export { affects, call, queryTopics };
|
|
@@ -13,6 +13,7 @@ function fileNameOf(data) {
|
|
|
13
13
|
}
|
|
14
14
|
function withBytes(value, paths) {
|
|
15
15
|
if (value == null) return value;
|
|
16
|
+
if (Array.isArray(value)) return value.map((item) => withBytes(item, paths));
|
|
16
17
|
const converted = { ...value };
|
|
17
18
|
for (const path of paths) {
|
|
18
19
|
const [key, ...rest] = path.split(".");
|
|
@@ -22,15 +23,28 @@ function withBytes(value, paths) {
|
|
|
22
23
|
}
|
|
23
24
|
return converted;
|
|
24
25
|
}
|
|
26
|
+
async function withBase64(value, paths) {
|
|
27
|
+
if (value == null) return value;
|
|
28
|
+
if (Array.isArray(value)) return await Promise.all(value.map((item) => withBase64(item, paths)));
|
|
29
|
+
const converted = { ...value };
|
|
30
|
+
for (const path of paths) {
|
|
31
|
+
const [key, ...rest] = path.split(".");
|
|
32
|
+
const decoded = converted[key];
|
|
33
|
+
if (rest.length > 0) converted[key] = await withBase64(decoded, [rest.join(".")]);
|
|
34
|
+
else if (decoded != null && typeof decoded !== "string") converted[key] = await toBase64(decoded);
|
|
35
|
+
}
|
|
36
|
+
return converted;
|
|
37
|
+
}
|
|
25
38
|
//#endregion
|
|
26
39
|
//#region src/generated/client.ts
|
|
27
40
|
function createClient(invoke) {
|
|
28
41
|
return {
|
|
29
42
|
box: {
|
|
30
43
|
addEncounter: (index) => invoke("box.addEncounter", [index]),
|
|
31
|
-
addFromFile: async (bytes) => invoke("box.addFromFile", [await toBase64(bytes)]),
|
|
44
|
+
addFromFile: async (bytes, options) => invoke("box.addFromFile", [await toBase64(bytes), options]),
|
|
32
45
|
get: () => invoke("box.get", []),
|
|
33
46
|
list: () => invoke("box.list", []),
|
|
47
|
+
previewFile: async (bytes) => invoke("box.previewFile", [await toBase64(bytes)]),
|
|
34
48
|
showdown: () => invoke("box.showdown", [])
|
|
35
49
|
},
|
|
36
50
|
catalog: { names: (request) => invoke("catalog.names", [request]) },
|
|
@@ -119,18 +133,6 @@ function createClient(invoke) {
|
|
|
119
133
|
update: (at, patch) => invoke("pokemon.update", [at, patch])
|
|
120
134
|
},
|
|
121
135
|
species: { list: () => invoke("species.list", []) },
|
|
122
|
-
trade: {
|
|
123
|
-
close: () => invoke("trade.close", []),
|
|
124
|
-
commit: async (offer) => withBytes(await invoke("trade.commit", [offer]), ["save.bytes", "partner.bytes"]),
|
|
125
|
-
get: () => invoke("trade.get", []),
|
|
126
|
-
open: async (data, fileName, formatId) => invoke("trade.open", [
|
|
127
|
-
await toBase64(data),
|
|
128
|
-
fileName ?? fileNameOf(data),
|
|
129
|
-
formatId
|
|
130
|
-
]),
|
|
131
|
-
partnerBoxes: () => invoke("trade.partnerBoxes", []),
|
|
132
|
-
preview: (offer) => invoke("trade.preview", [offer])
|
|
133
|
-
},
|
|
134
136
|
trainer: {
|
|
135
137
|
badges: () => invoke("trainer.badges", []),
|
|
136
138
|
get: () => invoke("trainer.get", []),
|
|
@@ -139,6 +141,22 @@ function createClient(invoke) {
|
|
|
139
141
|
setGender: (gender) => invoke("trainer.setGender", [gender]),
|
|
140
142
|
setMoney: (amount) => invoke("trainer.setMoney", [amount]),
|
|
141
143
|
setName: (name) => invoke("trainer.setName", [name])
|
|
144
|
+
},
|
|
145
|
+
transfer: {
|
|
146
|
+
close: () => invoke("transfer.close", []),
|
|
147
|
+
commit: async (offer) => withBytes(await invoke("transfer.commit", [await withBase64(offer, ["keptCopies.bytes"])]), [
|
|
148
|
+
"save.bytes",
|
|
149
|
+
"partner.bytes",
|
|
150
|
+
"arrived.keptCopy.bytes"
|
|
151
|
+
]),
|
|
152
|
+
get: () => invoke("transfer.get", []),
|
|
153
|
+
open: async (data, fileName, formatId) => invoke("transfer.open", [
|
|
154
|
+
await toBase64(data),
|
|
155
|
+
fileName ?? fileNameOf(data),
|
|
156
|
+
formatId
|
|
157
|
+
]),
|
|
158
|
+
partnerBoxes: () => invoke("transfer.partnerBoxes", []),
|
|
159
|
+
preview: async (offer) => invoke("transfer.preview", [await withBase64(offer, ["keptCopies.bytes"])])
|
|
142
160
|
}
|
|
143
161
|
};
|
|
144
162
|
}
|
|
@@ -149,7 +167,7 @@ var overlaps = (a, b) => covers(a, b) || covers(b, a);
|
|
|
149
167
|
var affects = (changed, read) => changed.some((c) => read.some((r) => overlaps(c, r)));
|
|
150
168
|
//#endregion
|
|
151
169
|
//#region package.json
|
|
152
|
-
var version = "0.
|
|
170
|
+
var version = "0.18.0";
|
|
153
171
|
//#endregion
|
|
154
172
|
//#region src/crypto.ts
|
|
155
173
|
var modes = {
|
|
@@ -393,11 +411,12 @@ var topics = [
|
|
|
393
411
|
"trainer",
|
|
394
412
|
"draft",
|
|
395
413
|
"plugins",
|
|
396
|
-
"
|
|
414
|
+
"transfer"
|
|
397
415
|
];
|
|
398
416
|
var queryTopics = {
|
|
399
417
|
"box.get": ["box"],
|
|
400
418
|
"box.list": ["box"],
|
|
419
|
+
"box.previewFile": ["box", "trainer"],
|
|
401
420
|
"box.showdown": ["box"],
|
|
402
421
|
"catalog.names": [],
|
|
403
422
|
"encounters.search": ["game"],
|
|
@@ -460,15 +479,15 @@ var queryTopics = {
|
|
|
460
479
|
"draft"
|
|
461
480
|
],
|
|
462
481
|
"species.list": ["game"],
|
|
463
|
-
"
|
|
464
|
-
"
|
|
465
|
-
"
|
|
466
|
-
|
|
482
|
+
"trainer.badges": ["trainer", "events"],
|
|
483
|
+
"trainer.get": ["trainer"],
|
|
484
|
+
"transfer.get": ["transfer", "box"],
|
|
485
|
+
"transfer.partnerBoxes": ["transfer"],
|
|
486
|
+
"transfer.preview": [
|
|
487
|
+
"transfer",
|
|
467
488
|
"party",
|
|
468
489
|
"box"
|
|
469
|
-
]
|
|
470
|
-
"trainer.badges": ["trainer", "events"],
|
|
471
|
-
"trainer.get": ["trainer"]
|
|
490
|
+
]
|
|
472
491
|
};
|
|
473
492
|
//#endregion
|
|
474
493
|
export { createEngine as a, call as i, topics as n, wasmHost as o, EngineError as r, affects as s, queryTopics as t };
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|