require('./sourcemap-register.js');(()=>{var ke={7351:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(ke,qe,{enumerable:true,get:function(){return Ae[Ce]}})}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};Object.defineProperty(Ae,"__esModule",{value:true});Ae.issue=Ae.issueCommand=void 0;const tt=Ve(Ce(2037));const rt=Ce(5278);function issueCommand(ke,Ae,Ce){const qe=new Command(ke,Ae,Ce);process.stdout.write(qe.toString()+tt.EOL)}Ae.issueCommand=issueCommand;function issue(ke,Ae=""){issueCommand(ke,{},Ae)}Ae.issue=issue;const it="::";class Command{constructor(ke,Ae,Ce){if(!ke){ke="missing.command"}this.command=ke;this.properties=Ae;this.message=Ce}toString(){let ke=it+this.command;if(this.properties&&Object.keys(this.properties).length>0){ke+=" ";let Ae=true;for(const Ce in this.properties){if(this.properties.hasOwnProperty(Ce)){const qe=this.properties[Ce];if(qe){if(Ae){Ae=false}else{ke+=","}ke+=`${Ce}=${escapeProperty(qe)}`}}}}ke+=`${it}${escapeData(this.message)}`;return ke}}function escapeData(ke){return rt.toCommandValue(ke).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(ke){return rt.toCommandValue(ke).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(ke,qe,{enumerable:true,get:function(){return Ae[Ce]}})}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.getIDToken=Ae.getState=Ae.saveState=Ae.group=Ae.endGroup=Ae.startGroup=Ae.info=Ae.notice=Ae.warning=Ae.error=Ae.debug=Ae.isDebug=Ae.setFailed=Ae.setCommandEcho=Ae.setOutput=Ae.getBooleanInput=Ae.getMultilineInput=Ae.getInput=Ae.addPath=Ae.setSecret=Ae.exportVariable=Ae.ExitCode=void 0;const rt=Ce(7351);const it=Ce(717);const nt=Ce(5278);const ot=Ve(Ce(2037));const ct=Ve(Ce(1017));const ht=Ce(8041);var ft;(function(ke){ke[ke["Success"]=0]="Success";ke[ke["Failure"]=1]="Failure"})(ft=Ae.ExitCode||(Ae.ExitCode={}));function exportVariable(ke,Ae){const Ce=nt.toCommandValue(Ae);process.env[ke]=Ce;const qe=process.env["GITHUB_ENV"]||"";if(qe){return it.issueFileCommand("ENV",it.prepareKeyValueMessage(ke,Ae))}rt.issueCommand("set-env",{name:ke},Ce)}Ae.exportVariable=exportVariable;function setSecret(ke){rt.issueCommand("add-mask",{},ke)}Ae.setSecret=setSecret;function addPath(ke){const Ae=process.env["GITHUB_PATH"]||"";if(Ae){it.issueFileCommand("PATH",ke)}else{rt.issueCommand("add-path",{},ke)}process.env["PATH"]=`${ke}${ct.delimiter}${process.env["PATH"]}`}Ae.addPath=addPath;function getInput(ke,Ae){const Ce=process.env[`INPUT_${ke.replace(/ /g,"_").toUpperCase()}`]||"";if(Ae&&Ae.required&&!Ce){throw new Error(`Input required and not supplied: ${ke}`)}if(Ae&&Ae.trimWhitespace===false){return Ce}return Ce.trim()}Ae.getInput=getInput;function getMultilineInput(ke,Ae){const Ce=getInput(ke,Ae).split("\n").filter((ke=>ke!==""));if(Ae&&Ae.trimWhitespace===false){return Ce}return Ce.map((ke=>ke.trim()))}Ae.getMultilineInput=getMultilineInput;function getBooleanInput(ke,Ae){const Ce=["true","True","TRUE"];const qe=["false","False","FALSE"];const ze=getInput(ke,Ae);if(Ce.includes(ze))return true;if(qe.includes(ze))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${ke}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}Ae.getBooleanInput=getBooleanInput;function setOutput(ke,Ae){const Ce=process.env["GITHUB_OUTPUT"]||"";if(Ce){return it.issueFileCommand("OUTPUT",it.prepareKeyValueMessage(ke,Ae))}process.stdout.write(ot.EOL);rt.issueCommand("set-output",{name:ke},nt.toCommandValue(Ae))}Ae.setOutput=setOutput;function setCommandEcho(ke){rt.issue("echo",ke?"on":"off")}Ae.setCommandEcho=setCommandEcho;function setFailed(ke){process.exitCode=ft.Failure;error(ke)}Ae.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}Ae.isDebug=isDebug;function debug(ke){rt.issueCommand("debug",{},ke)}Ae.debug=debug;function error(ke,Ae={}){rt.issueCommand("error",nt.toCommandProperties(Ae),ke instanceof Error?ke.toString():ke)}Ae.error=error;function warning(ke,Ae={}){rt.issueCommand("warning",nt.toCommandProperties(Ae),ke instanceof Error?ke.toString():ke)}Ae.warning=warning;function notice(ke,Ae={}){rt.issueCommand("notice",nt.toCommandProperties(Ae),ke instanceof Error?ke.toString():ke)}Ae.notice=notice;function info(ke){process.stdout.write(ke+ot.EOL)}Ae.info=info;function startGroup(ke){rt.issue("group",ke)}Ae.startGroup=startGroup;function endGroup(){rt.issue("endgroup")}Ae.endGroup=endGroup;function group(ke,Ae){return tt(this,void 0,void 0,(function*(){startGroup(ke);let Ce;try{Ce=yield Ae()}finally{endGroup()}return Ce}))}Ae.group=group;function saveState(ke,Ae){const Ce=process.env["GITHUB_STATE"]||"";if(Ce){return it.issueFileCommand("STATE",it.prepareKeyValueMessage(ke,Ae))}rt.issueCommand("save-state",{name:ke},nt.toCommandValue(Ae))}Ae.saveState=saveState;function getState(ke){return process.env[`STATE_${ke}`]||""}Ae.getState=getState;function getIDToken(ke){return tt(this,void 0,void 0,(function*(){return yield ht.OidcClient.getIDToken(ke)}))}Ae.getIDToken=getIDToken;var yt=Ce(1327);Object.defineProperty(Ae,"summary",{enumerable:true,get:function(){return yt.summary}});var mt=Ce(1327);Object.defineProperty(Ae,"markdownSummary",{enumerable:true,get:function(){return mt.markdownSummary}});var kt=Ce(2981);Object.defineProperty(Ae,"toPosixPath",{enumerable:true,get:function(){return kt.toPosixPath}});Object.defineProperty(Ae,"toWin32Path",{enumerable:true,get:function(){return kt.toWin32Path}});Object.defineProperty(Ae,"toPlatformPath",{enumerable:true,get:function(){return kt.toPlatformPath}})},717:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(ke,qe,{enumerable:true,get:function(){return Ae[Ce]}})}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};Object.defineProperty(Ae,"__esModule",{value:true});Ae.prepareKeyValueMessage=Ae.issueFileCommand=void 0;const tt=Ve(Ce(7147));const rt=Ve(Ce(2037));const it=Ce(5840);const nt=Ce(5278);function issueFileCommand(ke,Ae){const Ce=process.env[`GITHUB_${ke}`];if(!Ce){throw new Error(`Unable to find environment variable for file command ${ke}`)}if(!tt.existsSync(Ce)){throw new Error(`Missing file at path: ${Ce}`)}tt.appendFileSync(Ce,`${nt.toCommandValue(Ae)}${rt.EOL}`,{encoding:"utf8"})}Ae.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(ke,Ae){const Ce=`ghadelimiter_${it.v4()}`;const qe=nt.toCommandValue(Ae);if(ke.includes(Ce)){throw new Error(`Unexpected input: name should not contain the delimiter "${Ce}"`)}if(qe.includes(Ce)){throw new Error(`Unexpected input: value should not contain the delimiter "${Ce}"`)}return`${ke}<<${Ce}${rt.EOL}${qe}${rt.EOL}${Ce}`}Ae.prepareKeyValueMessage=prepareKeyValueMessage},8041:function(ke,Ae,Ce){"use strict";var qe=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.OidcClient=void 0;const ze=Ce(6255);const Ve=Ce(5526);const tt=Ce(2186);class OidcClient{static createHttpClient(ke=true,Ae=10){const Ce={allowRetries:ke,maxRetries:Ae};return new ze.HttpClient("actions/oidc-client",[new Ve.BearerCredentialHandler(OidcClient.getRequestToken())],Ce)}static getRequestToken(){const ke=process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];if(!ke){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable")}return ke}static getIDTokenUrl(){const ke=process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];if(!ke){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable")}return ke}static getCall(ke){var Ae;return qe(this,void 0,void 0,(function*(){const Ce=OidcClient.createHttpClient();const qe=yield Ce.getJson(ke).catch((ke=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${ke.statusCode}\n \n Error Message: ${ke.result.message}`)}));const ze=(Ae=qe.result)===null||Ae===void 0?void 0:Ae.value;if(!ze){throw new Error("Response json body do not have ID Token field")}return ze}))}static getIDToken(ke){return qe(this,void 0,void 0,(function*(){try{let Ae=OidcClient.getIDTokenUrl();if(ke){const Ce=encodeURIComponent(ke);Ae=`${Ae}&audience=${Ce}`}tt.debug(`ID token url is ${Ae}`);const Ce=yield OidcClient.getCall(Ae);tt.setSecret(Ce);return Ce}catch(ke){throw new Error(`Error message: ${ke.message}`)}}))}}Ae.OidcClient=OidcClient},2981:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(ke,qe,{enumerable:true,get:function(){return Ae[Ce]}})}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};Object.defineProperty(Ae,"__esModule",{value:true});Ae.toPlatformPath=Ae.toWin32Path=Ae.toPosixPath=void 0;const tt=Ve(Ce(1017));function toPosixPath(ke){return ke.replace(/[\\]/g,"/")}Ae.toPosixPath=toPosixPath;function toWin32Path(ke){return ke.replace(/[/]/g,"\\")}Ae.toWin32Path=toWin32Path;function toPlatformPath(ke){return ke.replace(/[/\\]/g,tt.sep)}Ae.toPlatformPath=toPlatformPath},1327:function(ke,Ae,Ce){"use strict";var qe=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.summary=Ae.markdownSummary=Ae.SUMMARY_DOCS_URL=Ae.SUMMARY_ENV_VAR=void 0;const ze=Ce(2037);const Ve=Ce(7147);const{access:tt,appendFile:rt,writeFile:it}=Ve.promises;Ae.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";Ae.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return qe(this,void 0,void 0,(function*(){if(this._filePath){return this._filePath}const ke=process.env[Ae.SUMMARY_ENV_VAR];if(!ke){throw new Error(`Unable to find environment variable for $${Ae.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`)}try{yield tt(ke,Ve.constants.R_OK|Ve.constants.W_OK)}catch(Ae){throw new Error(`Unable to access summary file: '${ke}'. Check if the file has correct read/write permissions.`)}this._filePath=ke;return this._filePath}))}wrap(ke,Ae,Ce={}){const qe=Object.entries(Ce).map((([ke,Ae])=>` ${ke}="${Ae}"`)).join("");if(!Ae){return`<${ke}${qe}>`}return`<${ke}${qe}>${Ae}`}write(ke){return qe(this,void 0,void 0,(function*(){const Ae=!!(ke===null||ke===void 0?void 0:ke.overwrite);const Ce=yield this.filePath();const qe=Ae?it:rt;yield qe(Ce,this._buffer,{encoding:"utf8"});return this.emptyBuffer()}))}clear(){return qe(this,void 0,void 0,(function*(){return this.emptyBuffer().write({overwrite:true})}))}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){this._buffer="";return this}addRaw(ke,Ae=false){this._buffer+=ke;return Ae?this.addEOL():this}addEOL(){return this.addRaw(ze.EOL)}addCodeBlock(ke,Ae){const Ce=Object.assign({},Ae&&{lang:Ae});const qe=this.wrap("pre",this.wrap("code",ke),Ce);return this.addRaw(qe).addEOL()}addList(ke,Ae=false){const Ce=Ae?"ol":"ul";const qe=ke.map((ke=>this.wrap("li",ke))).join("");const ze=this.wrap(Ce,qe);return this.addRaw(ze).addEOL()}addTable(ke){const Ae=ke.map((ke=>{const Ae=ke.map((ke=>{if(typeof ke==="string"){return this.wrap("td",ke)}const{header:Ae,data:Ce,colspan:qe,rowspan:ze}=ke;const Ve=Ae?"th":"td";const tt=Object.assign(Object.assign({},qe&&{colspan:qe}),ze&&{rowspan:ze});return this.wrap(Ve,Ce,tt)})).join("");return this.wrap("tr",Ae)})).join("");const Ce=this.wrap("table",Ae);return this.addRaw(Ce).addEOL()}addDetails(ke,Ae){const Ce=this.wrap("details",this.wrap("summary",ke)+Ae);return this.addRaw(Ce).addEOL()}addImage(ke,Ae,Ce){const{width:qe,height:ze}=Ce||{};const Ve=Object.assign(Object.assign({},qe&&{width:qe}),ze&&{height:ze});const tt=this.wrap("img",null,Object.assign({src:ke,alt:Ae},Ve));return this.addRaw(tt).addEOL()}addHeading(ke,Ae){const Ce=`h${Ae}`;const qe=["h1","h2","h3","h4","h5","h6"].includes(Ce)?Ce:"h1";const ze=this.wrap(qe,ke);return this.addRaw(ze).addEOL()}addSeparator(){const ke=this.wrap("hr",null);return this.addRaw(ke).addEOL()}addBreak(){const ke=this.wrap("br",null);return this.addRaw(ke).addEOL()}addQuote(ke,Ae){const Ce=Object.assign({},Ae&&{cite:Ae});const qe=this.wrap("blockquote",ke,Ce);return this.addRaw(qe).addEOL()}addLink(ke,Ae){const Ce=this.wrap("a",ke,{href:Ae});return this.addRaw(Ce).addEOL()}}const nt=new Summary;Ae.markdownSummary=nt;Ae.summary=nt},5278:(ke,Ae)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae.toCommandProperties=Ae.toCommandValue=void 0;function toCommandValue(ke){if(ke===null||ke===undefined){return""}else if(typeof ke==="string"||ke instanceof String){return ke}return JSON.stringify(ke)}Ae.toCommandValue=toCommandValue;function toCommandProperties(ke){if(!Object.keys(ke).length){return{}}return{title:ke.title,file:ke.file,line:ke.startLine,endLine:ke.endLine,col:ke.startColumn,endColumn:ke.endColumn}}Ae.toCommandProperties=toCommandProperties},1514:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(ke,qe,{enumerable:true,get:function(){return Ae[Ce]}})}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.getExecOutput=Ae.exec=void 0;const rt=Ce(1576);const it=Ve(Ce(8159));function exec(ke,Ae,Ce){return tt(this,void 0,void 0,(function*(){const qe=it.argStringToArray(ke);if(qe.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const ze=qe[0];Ae=qe.slice(1).concat(Ae||[]);const Ve=new it.ToolRunner(ze,Ae,Ce);return Ve.exec()}))}Ae.exec=exec;function getExecOutput(ke,Ae,Ce){var qe,ze;return tt(this,void 0,void 0,(function*(){let Ve="";let tt="";const it=new rt.StringDecoder("utf8");const nt=new rt.StringDecoder("utf8");const ot=(qe=Ce===null||Ce===void 0?void 0:Ce.listeners)===null||qe===void 0?void 0:qe.stdout;const ct=(ze=Ce===null||Ce===void 0?void 0:Ce.listeners)===null||ze===void 0?void 0:ze.stderr;const stdErrListener=ke=>{tt+=nt.write(ke);if(ct){ct(ke)}};const stdOutListener=ke=>{Ve+=it.write(ke);if(ot){ot(ke)}};const ht=Object.assign(Object.assign({},Ce===null||Ce===void 0?void 0:Ce.listeners),{stdout:stdOutListener,stderr:stdErrListener});const ft=yield exec(ke,Ae,Object.assign(Object.assign({},Ce),{listeners:ht}));Ve+=it.end();tt+=nt.end();return{exitCode:ft,stdout:Ve,stderr:tt}}))}Ae.getExecOutput=getExecOutput},8159:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(ke,qe,{enumerable:true,get:function(){return Ae[Ce]}})}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.argStringToArray=Ae.ToolRunner=void 0;const rt=Ve(Ce(2037));const it=Ve(Ce(2361));const nt=Ve(Ce(2081));const ot=Ve(Ce(1017));const ct=Ve(Ce(7436));const ht=Ve(Ce(1962));const ft=Ce(9512);const yt=process.platform==="win32";class ToolRunner extends it.EventEmitter{constructor(ke,Ae,Ce){super();if(!ke){throw new Error("Parameter 'toolPath' cannot be null or empty.")}this.toolPath=ke;this.args=Ae||[];this.options=Ce||{}}_debug(ke){if(this.options.listeners&&this.options.listeners.debug){this.options.listeners.debug(ke)}}_getCommandString(ke,Ae){const Ce=this._getSpawnFileName();const qe=this._getSpawnArgs(ke);let ze=Ae?"":"[command]";if(yt){if(this._isCmdFile()){ze+=Ce;for(const ke of qe){ze+=` ${ke}`}}else if(ke.windowsVerbatimArguments){ze+=`"${Ce}"`;for(const ke of qe){ze+=` ${ke}`}}else{ze+=this._windowsQuoteCmdArg(Ce);for(const ke of qe){ze+=` ${this._windowsQuoteCmdArg(ke)}`}}}else{ze+=Ce;for(const ke of qe){ze+=` ${ke}`}}return ze}_processLineBuffer(ke,Ae,Ce){try{let qe=Ae+ke.toString();let ze=qe.indexOf(rt.EOL);while(ze>-1){const ke=qe.substring(0,ze);Ce(ke);qe=qe.substring(ze+rt.EOL.length);ze=qe.indexOf(rt.EOL)}return qe}catch(ke){this._debug(`error processing line. Failed with error ${ke}`);return""}}_getSpawnFileName(){if(yt){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(ke){if(yt){if(this._isCmdFile()){let Ae=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const Ce of this.args){Ae+=" ";Ae+=ke.windowsVerbatimArguments?Ce:this._windowsQuoteCmdArg(Ce)}Ae+='"';return[Ae]}}return this.args}_endsWith(ke,Ae){return ke.endsWith(Ae)}_isCmdFile(){const ke=this.toolPath.toUpperCase();return this._endsWith(ke,".CMD")||this._endsWith(ke,".BAT")}_windowsQuoteCmdArg(ke){if(!this._isCmdFile()){return this._uvQuoteCmdArg(ke)}if(!ke){return'""'}const Ae=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let Ce=false;for(const qe of ke){if(Ae.some((ke=>ke===qe))){Ce=true;break}}if(!Ce){return ke}let qe='"';let ze=true;for(let Ae=ke.length;Ae>0;Ae--){qe+=ke[Ae-1];if(ze&&ke[Ae-1]==="\\"){qe+="\\"}else if(ke[Ae-1]==='"'){ze=true;qe+='"'}else{ze=false}}qe+='"';return qe.split("").reverse().join("")}_uvQuoteCmdArg(ke){if(!ke){return'""'}if(!ke.includes(" ")&&!ke.includes("\t")&&!ke.includes('"')){return ke}if(!ke.includes('"')&&!ke.includes("\\")){return`"${ke}"`}let Ae='"';let Ce=true;for(let qe=ke.length;qe>0;qe--){Ae+=ke[qe-1];if(Ce&&ke[qe-1]==="\\"){Ae+="\\"}else if(ke[qe-1]==='"'){Ce=true;Ae+="\\"}else{Ce=false}}Ae+='"';return Ae.split("").reverse().join("")}_cloneExecOptions(ke){ke=ke||{};const Ae={cwd:ke.cwd||process.cwd(),env:ke.env||process.env,silent:ke.silent||false,windowsVerbatimArguments:ke.windowsVerbatimArguments||false,failOnStdErr:ke.failOnStdErr||false,ignoreReturnCode:ke.ignoreReturnCode||false,delay:ke.delay||1e4};Ae.outStream=ke.outStream||process.stdout;Ae.errStream=ke.errStream||process.stderr;return Ae}_getSpawnOptions(ke,Ae){ke=ke||{};const Ce={};Ce.cwd=ke.cwd;Ce.env=ke.env;Ce["windowsVerbatimArguments"]=ke.windowsVerbatimArguments||this._isCmdFile();if(ke.windowsVerbatimArguments){Ce.argv0=`"${Ae}"`}return Ce}exec(){return tt(this,void 0,void 0,(function*(){if(!ht.isRooted(this.toolPath)&&(this.toolPath.includes("/")||yt&&this.toolPath.includes("\\"))){this.toolPath=ot.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield ct.which(this.toolPath,true);return new Promise(((ke,Ae)=>tt(this,void 0,void 0,(function*(){this._debug(`exec tool: ${this.toolPath}`);this._debug("arguments:");for(const ke of this.args){this._debug(` ${ke}`)}const Ce=this._cloneExecOptions(this.options);if(!Ce.silent&&Ce.outStream){Ce.outStream.write(this._getCommandString(Ce)+rt.EOL)}const qe=new ExecState(Ce,this.toolPath);qe.on("debug",(ke=>{this._debug(ke)}));if(this.options.cwd&&!(yield ht.exists(this.options.cwd))){return Ae(new Error(`The cwd: ${this.options.cwd} does not exist!`))}const ze=this._getSpawnFileName();const Ve=nt.spawn(ze,this._getSpawnArgs(Ce),this._getSpawnOptions(this.options,ze));let tt="";if(Ve.stdout){Ve.stdout.on("data",(ke=>{if(this.options.listeners&&this.options.listeners.stdout){this.options.listeners.stdout(ke)}if(!Ce.silent&&Ce.outStream){Ce.outStream.write(ke)}tt=this._processLineBuffer(ke,tt,(ke=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(ke)}}))}))}let it="";if(Ve.stderr){Ve.stderr.on("data",(ke=>{qe.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(ke)}if(!Ce.silent&&Ce.errStream&&Ce.outStream){const Ae=Ce.failOnStdErr?Ce.errStream:Ce.outStream;Ae.write(ke)}it=this._processLineBuffer(ke,it,(ke=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(ke)}}))}))}Ve.on("error",(ke=>{qe.processError=ke.message;qe.processExited=true;qe.processClosed=true;qe.CheckComplete()}));Ve.on("exit",(ke=>{qe.processExitCode=ke;qe.processExited=true;this._debug(`Exit code ${ke} received from tool '${this.toolPath}'`);qe.CheckComplete()}));Ve.on("close",(ke=>{qe.processExitCode=ke;qe.processExited=true;qe.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);qe.CheckComplete()}));qe.on("done",((Ce,qe)=>{if(tt.length>0){this.emit("stdline",tt)}if(it.length>0){this.emit("errline",it)}Ve.removeAllListeners();if(Ce){Ae(Ce)}else{ke(qe)}}));if(this.options.input){if(!Ve.stdin){throw new Error("child process missing stdin")}Ve.stdin.end(this.options.input)}}))))}))}}Ae.ToolRunner=ToolRunner;function argStringToArray(ke){const Ae=[];let Ce=false;let qe=false;let ze="";function append(ke){if(qe&&ke!=='"'){ze+="\\"}ze+=ke;qe=false}for(let Ve=0;Ve0){Ae.push(ze);ze=""}continue}append(tt)}if(ze.length>0){Ae.push(ze.trim())}return Ae}Ae.argStringToArray=argStringToArray;class ExecState extends it.EventEmitter{constructor(ke,Ae){super();this.processClosed=false;this.processError="";this.processExitCode=0;this.processExited=false;this.processStderr=false;this.delay=1e4;this.done=false;this.timeout=null;if(!Ae){throw new Error("toolPath must not be empty")}this.options=ke;this.toolPath=Ae;if(ke.delay){this.delay=ke.delay}}CheckComplete(){if(this.done){return}if(this.processClosed){this._setResult()}else if(this.processExited){this.timeout=ft.setTimeout(ExecState.HandleTimeout,this.delay,this)}}_debug(ke){this.emit("debug",ke)}_setResult(){let ke;if(this.processExited){if(this.processError){ke=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`)}else if(this.processExitCode!==0&&!this.options.ignoreReturnCode){ke=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)}else if(this.processStderr&&this.options.failOnStdErr){ke=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)}}if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.done=true;this.emit("done",ke,this.processExitCode)}static HandleTimeout(ke){if(ke.done){return}if(!ke.processClosed&&ke.processExited){const Ae=`The STDIO streams did not close within ${ke.delay/1e3} seconds of the exit event from process '${ke.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;ke._debug(Ae)}ke._setResult()}}},5526:function(ke,Ae){"use strict";var Ce=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.PersonalAccessTokenCredentialHandler=Ae.BearerCredentialHandler=Ae.BasicCredentialHandler=void 0;class BasicCredentialHandler{constructor(ke,Ae){this.username=ke;this.password=Ae}prepareRequest(ke){if(!ke.headers){throw Error("The request has no headers")}ke.headers["Authorization"]=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return Ce(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}Ae.BasicCredentialHandler=BasicCredentialHandler;class BearerCredentialHandler{constructor(ke){this.token=ke}prepareRequest(ke){if(!ke.headers){throw Error("The request has no headers")}ke.headers["Authorization"]=`Bearer ${this.token}`}canHandleAuthentication(){return false}handleAuthentication(){return Ce(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}Ae.BearerCredentialHandler=BearerCredentialHandler;class PersonalAccessTokenCredentialHandler{constructor(ke){this.token=ke}prepareRequest(ke){if(!ke.headers){throw Error("The request has no headers")}ke.headers["Authorization"]=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return Ce(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}Ae.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},6255:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;Object.defineProperty(ke,qe,{enumerable:true,get:function(){return Ae[Ce]}})}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.HttpClient=Ae.isHttps=Ae.HttpClientResponse=Ae.HttpClientError=Ae.getProxyUrl=Ae.MediaTypes=Ae.Headers=Ae.HttpCodes=void 0;const rt=Ve(Ce(3685));const it=Ve(Ce(5687));const nt=Ve(Ce(9835));const ot=Ve(Ce(4294));var ct;(function(ke){ke[ke["OK"]=200]="OK";ke[ke["MultipleChoices"]=300]="MultipleChoices";ke[ke["MovedPermanently"]=301]="MovedPermanently";ke[ke["ResourceMoved"]=302]="ResourceMoved";ke[ke["SeeOther"]=303]="SeeOther";ke[ke["NotModified"]=304]="NotModified";ke[ke["UseProxy"]=305]="UseProxy";ke[ke["SwitchProxy"]=306]="SwitchProxy";ke[ke["TemporaryRedirect"]=307]="TemporaryRedirect";ke[ke["PermanentRedirect"]=308]="PermanentRedirect";ke[ke["BadRequest"]=400]="BadRequest";ke[ke["Unauthorized"]=401]="Unauthorized";ke[ke["PaymentRequired"]=402]="PaymentRequired";ke[ke["Forbidden"]=403]="Forbidden";ke[ke["NotFound"]=404]="NotFound";ke[ke["MethodNotAllowed"]=405]="MethodNotAllowed";ke[ke["NotAcceptable"]=406]="NotAcceptable";ke[ke["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";ke[ke["RequestTimeout"]=408]="RequestTimeout";ke[ke["Conflict"]=409]="Conflict";ke[ke["Gone"]=410]="Gone";ke[ke["TooManyRequests"]=429]="TooManyRequests";ke[ke["InternalServerError"]=500]="InternalServerError";ke[ke["NotImplemented"]=501]="NotImplemented";ke[ke["BadGateway"]=502]="BadGateway";ke[ke["ServiceUnavailable"]=503]="ServiceUnavailable";ke[ke["GatewayTimeout"]=504]="GatewayTimeout"})(ct=Ae.HttpCodes||(Ae.HttpCodes={}));var ht;(function(ke){ke["Accept"]="accept";ke["ContentType"]="content-type"})(ht=Ae.Headers||(Ae.Headers={}));var ft;(function(ke){ke["ApplicationJson"]="application/json"})(ft=Ae.MediaTypes||(Ae.MediaTypes={}));function getProxyUrl(ke){const Ae=nt.getProxyUrl(new URL(ke));return Ae?Ae.href:""}Ae.getProxyUrl=getProxyUrl;const yt=[ct.MovedPermanently,ct.ResourceMoved,ct.SeeOther,ct.TemporaryRedirect,ct.PermanentRedirect];const mt=[ct.BadGateway,ct.ServiceUnavailable,ct.GatewayTimeout];const kt=["OPTIONS","GET","DELETE","HEAD"];const St=10;const Et=5;class HttpClientError extends Error{constructor(ke,Ae){super(ke);this.name="HttpClientError";this.statusCode=Ae;Object.setPrototypeOf(this,HttpClientError.prototype)}}Ae.HttpClientError=HttpClientError;class HttpClientResponse{constructor(ke){this.message=ke}readBody(){return tt(this,void 0,void 0,(function*(){return new Promise((ke=>tt(this,void 0,void 0,(function*(){let Ae=Buffer.alloc(0);this.message.on("data",(ke=>{Ae=Buffer.concat([Ae,ke])}));this.message.on("end",(()=>{ke(Ae.toString())}))}))))}))}}Ae.HttpClientResponse=HttpClientResponse;function isHttps(ke){const Ae=new URL(ke);return Ae.protocol==="https:"}Ae.isHttps=isHttps;class HttpClient{constructor(ke,Ae,Ce){this._ignoreSslError=false;this._allowRedirects=true;this._allowRedirectDowngrade=false;this._maxRedirects=50;this._allowRetries=false;this._maxRetries=1;this._keepAlive=false;this._disposed=false;this.userAgent=ke;this.handlers=Ae||[];this.requestOptions=Ce;if(Ce){if(Ce.ignoreSslError!=null){this._ignoreSslError=Ce.ignoreSslError}this._socketTimeout=Ce.socketTimeout;if(Ce.allowRedirects!=null){this._allowRedirects=Ce.allowRedirects}if(Ce.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=Ce.allowRedirectDowngrade}if(Ce.maxRedirects!=null){this._maxRedirects=Math.max(Ce.maxRedirects,0)}if(Ce.keepAlive!=null){this._keepAlive=Ce.keepAlive}if(Ce.allowRetries!=null){this._allowRetries=Ce.allowRetries}if(Ce.maxRetries!=null){this._maxRetries=Ce.maxRetries}}}options(ke,Ae){return tt(this,void 0,void 0,(function*(){return this.request("OPTIONS",ke,null,Ae||{})}))}get(ke,Ae){return tt(this,void 0,void 0,(function*(){return this.request("GET",ke,null,Ae||{})}))}del(ke,Ae){return tt(this,void 0,void 0,(function*(){return this.request("DELETE",ke,null,Ae||{})}))}post(ke,Ae,Ce){return tt(this,void 0,void 0,(function*(){return this.request("POST",ke,Ae,Ce||{})}))}patch(ke,Ae,Ce){return tt(this,void 0,void 0,(function*(){return this.request("PATCH",ke,Ae,Ce||{})}))}put(ke,Ae,Ce){return tt(this,void 0,void 0,(function*(){return this.request("PUT",ke,Ae,Ce||{})}))}head(ke,Ae){return tt(this,void 0,void 0,(function*(){return this.request("HEAD",ke,null,Ae||{})}))}sendStream(ke,Ae,Ce,qe){return tt(this,void 0,void 0,(function*(){return this.request(ke,Ae,Ce,qe)}))}getJson(ke,Ae={}){return tt(this,void 0,void 0,(function*(){Ae[ht.Accept]=this._getExistingOrDefaultHeader(Ae,ht.Accept,ft.ApplicationJson);const Ce=yield this.get(ke,Ae);return this._processResponse(Ce,this.requestOptions)}))}postJson(ke,Ae,Ce={}){return tt(this,void 0,void 0,(function*(){const qe=JSON.stringify(Ae,null,2);Ce[ht.Accept]=this._getExistingOrDefaultHeader(Ce,ht.Accept,ft.ApplicationJson);Ce[ht.ContentType]=this._getExistingOrDefaultHeader(Ce,ht.ContentType,ft.ApplicationJson);const ze=yield this.post(ke,qe,Ce);return this._processResponse(ze,this.requestOptions)}))}putJson(ke,Ae,Ce={}){return tt(this,void 0,void 0,(function*(){const qe=JSON.stringify(Ae,null,2);Ce[ht.Accept]=this._getExistingOrDefaultHeader(Ce,ht.Accept,ft.ApplicationJson);Ce[ht.ContentType]=this._getExistingOrDefaultHeader(Ce,ht.ContentType,ft.ApplicationJson);const ze=yield this.put(ke,qe,Ce);return this._processResponse(ze,this.requestOptions)}))}patchJson(ke,Ae,Ce={}){return tt(this,void 0,void 0,(function*(){const qe=JSON.stringify(Ae,null,2);Ce[ht.Accept]=this._getExistingOrDefaultHeader(Ce,ht.Accept,ft.ApplicationJson);Ce[ht.ContentType]=this._getExistingOrDefaultHeader(Ce,ht.ContentType,ft.ApplicationJson);const ze=yield this.patch(ke,qe,Ce);return this._processResponse(ze,this.requestOptions)}))}request(ke,Ae,Ce,qe){return tt(this,void 0,void 0,(function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const ze=new URL(Ae);let Ve=this._prepareRequest(ke,ze,qe);const tt=this._allowRetries&&kt.includes(ke)?this._maxRetries+1:1;let rt=0;let it;do{it=yield this.requestRaw(Ve,Ce);if(it&&it.message&&it.message.statusCode===ct.Unauthorized){let ke;for(const Ae of this.handlers){if(Ae.canHandleAuthentication(it)){ke=Ae;break}}if(ke){return ke.handleAuthentication(this,Ve,Ce)}else{return it}}let Ae=this._maxRedirects;while(it.message.statusCode&&yt.includes(it.message.statusCode)&&this._allowRedirects&&Ae>0){const tt=it.message.headers["location"];if(!tt){break}const rt=new URL(tt);if(ze.protocol==="https:"&&ze.protocol!==rt.protocol&&!this._allowRedirectDowngrade){throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.")}yield it.readBody();if(rt.hostname!==ze.hostname){for(const ke in qe){if(ke.toLowerCase()==="authorization"){delete qe[ke]}}}Ve=this._prepareRequest(ke,rt,qe);it=yield this.requestRaw(Ve,Ce);Ae--}if(!it.message.statusCode||!mt.includes(it.message.statusCode)){return it}rt+=1;if(rt{function callbackForResult(ke,Ae){if(ke){qe(ke)}else if(!Ae){qe(new Error("Unknown error"))}else{Ce(Ae)}}this.requestRawWithCallback(ke,Ae,callbackForResult)}))}))}requestRawWithCallback(ke,Ae,Ce){if(typeof Ae==="string"){if(!ke.options.headers){ke.options.headers={}}ke.options.headers["Content-Length"]=Buffer.byteLength(Ae,"utf8")}let qe=false;function handleResult(ke,Ae){if(!qe){qe=true;Ce(ke,Ae)}}const ze=ke.httpModule.request(ke.options,(ke=>{const Ae=new HttpClientResponse(ke);handleResult(undefined,Ae)}));let Ve;ze.on("socket",(ke=>{Ve=ke}));ze.setTimeout(this._socketTimeout||3*6e4,(()=>{if(Ve){Ve.end()}handleResult(new Error(`Request timeout: ${ke.options.path}`))}));ze.on("error",(function(ke){handleResult(ke)}));if(Ae&&typeof Ae==="string"){ze.write(Ae,"utf8")}if(Ae&&typeof Ae!=="string"){Ae.on("close",(function(){ze.end()}));Ae.pipe(ze)}else{ze.end()}}getAgent(ke){const Ae=new URL(ke);return this._getAgent(Ae)}_prepareRequest(ke,Ae,Ce){const qe={};qe.parsedUrl=Ae;const ze=qe.parsedUrl.protocol==="https:";qe.httpModule=ze?it:rt;const Ve=ze?443:80;qe.options={};qe.options.host=qe.parsedUrl.hostname;qe.options.port=qe.parsedUrl.port?parseInt(qe.parsedUrl.port):Ve;qe.options.path=(qe.parsedUrl.pathname||"")+(qe.parsedUrl.search||"");qe.options.method=ke;qe.options.headers=this._mergeHeaders(Ce);if(this.userAgent!=null){qe.options.headers["user-agent"]=this.userAgent}qe.options.agent=this._getAgent(qe.parsedUrl);if(this.handlers){for(const ke of this.handlers){ke.prepareRequest(qe.options)}}return qe}_mergeHeaders(ke){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(ke||{}))}return lowercaseKeys(ke||{})}_getExistingOrDefaultHeader(ke,Ae,Ce){let qe;if(this.requestOptions&&this.requestOptions.headers){qe=lowercaseKeys(this.requestOptions.headers)[Ae]}return ke[Ae]||qe||Ce}_getAgent(ke){let Ae;const Ce=nt.getProxyUrl(ke);const qe=Ce&&Ce.hostname;if(this._keepAlive&&qe){Ae=this._proxyAgent}if(this._keepAlive&&!qe){Ae=this._agent}if(Ae){return Ae}const ze=ke.protocol==="https:";let Ve=100;if(this.requestOptions){Ve=this.requestOptions.maxSockets||rt.globalAgent.maxSockets}if(Ce&&Ce.hostname){const ke={maxSockets:Ve,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(Ce.username||Ce.password)&&{proxyAuth:`${Ce.username}:${Ce.password}`}),{host:Ce.hostname,port:Ce.port})};let qe;const tt=Ce.protocol==="https:";if(ze){qe=tt?ot.httpsOverHttps:ot.httpsOverHttp}else{qe=tt?ot.httpOverHttps:ot.httpOverHttp}Ae=qe(ke);this._proxyAgent=Ae}if(this._keepAlive&&!Ae){const ke={keepAlive:this._keepAlive,maxSockets:Ve};Ae=ze?new it.Agent(ke):new rt.Agent(ke);this._agent=Ae}if(!Ae){Ae=ze?it.globalAgent:rt.globalAgent}if(ze&&this._ignoreSslError){Ae.options=Object.assign(Ae.options||{},{rejectUnauthorized:false})}return Ae}_performExponentialBackoff(ke){return tt(this,void 0,void 0,(function*(){ke=Math.min(St,ke);const Ae=Et*Math.pow(2,ke);return new Promise((ke=>setTimeout((()=>ke()),Ae)))}))}_processResponse(ke,Ae){return tt(this,void 0,void 0,(function*(){return new Promise(((Ce,qe)=>tt(this,void 0,void 0,(function*(){const ze=ke.message.statusCode||0;const Ve={statusCode:ze,result:null,headers:{}};if(ze===ct.NotFound){Ce(Ve)}function dateTimeDeserializer(ke,Ae){if(typeof Ae==="string"){const ke=new Date(Ae);if(!isNaN(ke.valueOf())){return ke}}return Ae}let tt;let rt;try{rt=yield ke.readBody();if(rt&&rt.length>0){if(Ae&&Ae.deserializeDates){tt=JSON.parse(rt,dateTimeDeserializer)}else{tt=JSON.parse(rt)}Ve.result=tt}Ve.headers=ke.message.headers}catch(ke){}if(ze>299){let ke;if(tt&&tt.message){ke=tt.message}else if(rt&&rt.length>0){ke=rt}else{ke=`Failed request: (${ze})`}const Ae=new HttpClientError(ke,ze);Ae.result=Ve.result;qe(Ae)}else{Ce(Ve)}}))))}))}}Ae.HttpClient=HttpClient;const lowercaseKeys=ke=>Object.keys(ke).reduce(((Ae,Ce)=>(Ae[Ce.toLowerCase()]=ke[Ce],Ae)),{})},9835:(ke,Ae)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae.checkBypass=Ae.getProxyUrl=void 0;function getProxyUrl(ke){const Ae=ke.protocol==="https:";if(checkBypass(ke)){return undefined}const Ce=(()=>{if(Ae){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(Ce){return new URL(Ce)}else{return undefined}}Ae.getProxyUrl=getProxyUrl;function checkBypass(ke){if(!ke.hostname){return false}const Ae=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!Ae){return false}let Ce;if(ke.port){Ce=Number(ke.port)}else if(ke.protocol==="http:"){Ce=80}else if(ke.protocol==="https:"){Ce=443}const qe=[ke.hostname.toUpperCase()];if(typeof Ce==="number"){qe.push(`${qe[0]}:${Ce}`)}for(const ke of Ae.split(",").map((ke=>ke.trim().toUpperCase())).filter((ke=>ke))){if(qe.some((Ae=>Ae===ke))){return true}}return false}Ae.checkBypass=checkBypass},1962:function(ke,Ae,Ce){"use strict";var qe=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};var ze;Object.defineProperty(Ae,"__esModule",{value:true});const Ve=Ce(9491);const tt=Ce(7147);const rt=Ce(1017);ze=tt.promises,Ae.chmod=ze.chmod,Ae.copyFile=ze.copyFile,Ae.lstat=ze.lstat,Ae.mkdir=ze.mkdir,Ae.readdir=ze.readdir,Ae.readlink=ze.readlink,Ae.rename=ze.rename,Ae.rmdir=ze.rmdir,Ae.stat=ze.stat,Ae.symlink=ze.symlink,Ae.unlink=ze.unlink;Ae.IS_WINDOWS=process.platform==="win32";function exists(ke){return qe(this,void 0,void 0,(function*(){try{yield Ae.stat(ke)}catch(ke){if(ke.code==="ENOENT"){return false}throw ke}return true}))}Ae.exists=exists;function isDirectory(ke,Ce=false){return qe(this,void 0,void 0,(function*(){const qe=Ce?yield Ae.stat(ke):yield Ae.lstat(ke);return qe.isDirectory()}))}Ae.isDirectory=isDirectory;function isRooted(ke){ke=normalizeSeparators(ke);if(!ke){throw new Error('isRooted() parameter "p" cannot be empty')}if(Ae.IS_WINDOWS){return ke.startsWith("\\")||/^[A-Z]:/i.test(ke)}return ke.startsWith("/")}Ae.isRooted=isRooted;function mkdirP(ke,Ce=1e3,ze=1){return qe(this,void 0,void 0,(function*(){Ve.ok(ke,"a path argument must be provided");ke=rt.resolve(ke);if(ze>=Ce)return Ae.mkdir(ke);try{yield Ae.mkdir(ke);return}catch(qe){switch(qe.code){case"ENOENT":{yield mkdirP(rt.dirname(ke),Ce,ze+1);yield Ae.mkdir(ke);return}default:{let Ce;try{Ce=yield Ae.stat(ke)}catch(ke){throw qe}if(!Ce.isDirectory())throw qe}}}}))}Ae.mkdirP=mkdirP;function tryGetExecutablePath(ke,Ce){return qe(this,void 0,void 0,(function*(){let qe=undefined;try{qe=yield Ae.stat(ke)}catch(Ae){if(Ae.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${ke}': ${Ae}`)}}if(qe&&qe.isFile()){if(Ae.IS_WINDOWS){const Ae=rt.extname(ke).toUpperCase();if(Ce.some((ke=>ke.toUpperCase()===Ae))){return ke}}else{if(isUnixExecutable(qe)){return ke}}}const ze=ke;for(const Ve of Ce){ke=ze+Ve;qe=undefined;try{qe=yield Ae.stat(ke)}catch(Ae){if(Ae.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${ke}': ${Ae}`)}}if(qe&&qe.isFile()){if(Ae.IS_WINDOWS){try{const Ce=rt.dirname(ke);const qe=rt.basename(ke).toUpperCase();for(const ze of yield Ae.readdir(Ce)){if(qe===ze.toUpperCase()){ke=rt.join(Ce,ze);break}}}catch(Ae){console.log(`Unexpected error attempting to determine the actual case of the file '${ke}': ${Ae}`)}return ke}else{if(isUnixExecutable(qe)){return ke}}}}return""}))}Ae.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(ke){ke=ke||"";if(Ae.IS_WINDOWS){ke=ke.replace(/\//g,"\\");return ke.replace(/\\\\+/g,"\\")}return ke.replace(/\/\/+/g,"/")}function isUnixExecutable(ke){return(ke.mode&1)>0||(ke.mode&8)>0&&ke.gid===process.getgid()||(ke.mode&64)>0&&ke.uid===process.getuid()}},7436:function(ke,Ae,Ce){"use strict";var qe=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});const ze=Ce(2081);const Ve=Ce(1017);const tt=Ce(3837);const rt=Ce(1962);const it=tt.promisify(ze.exec);function cp(ke,Ae,Ce={}){return qe(this,void 0,void 0,(function*(){const{force:qe,recursive:ze}=readCopyOptions(Ce);const tt=(yield rt.exists(Ae))?yield rt.stat(Ae):null;if(tt&&tt.isFile()&&!qe){return}const it=tt&&tt.isDirectory()?Ve.join(Ae,Ve.basename(ke)):Ae;if(!(yield rt.exists(ke))){throw new Error(`no such file or directory: ${ke}`)}const nt=yield rt.stat(ke);if(nt.isDirectory()){if(!ze){throw new Error(`Failed to copy. ${ke} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(ke,it,0,qe)}}else{if(Ve.relative(ke,it)===""){throw new Error(`'${it}' and '${ke}' are the same file`)}yield copyFile(ke,it,qe)}}))}Ae.cp=cp;function mv(ke,Ae,Ce={}){return qe(this,void 0,void 0,(function*(){if(yield rt.exists(Ae)){let qe=true;if(yield rt.isDirectory(Ae)){Ae=Ve.join(Ae,Ve.basename(ke));qe=yield rt.exists(Ae)}if(qe){if(Ce.force==null||Ce.force){yield rmRF(Ae)}else{throw new Error("Destination already exists")}}}yield mkdirP(Ve.dirname(Ae));yield rt.rename(ke,Ae)}))}Ae.mv=mv;function rmRF(ke){return qe(this,void 0,void 0,(function*(){if(rt.IS_WINDOWS){try{if(yield rt.isDirectory(ke,true)){yield it(`rd /s /q "${ke}"`)}else{yield it(`del /f /a "${ke}"`)}}catch(ke){if(ke.code!=="ENOENT")throw ke}try{yield rt.unlink(ke)}catch(ke){if(ke.code!=="ENOENT")throw ke}}else{let Ae=false;try{Ae=yield rt.isDirectory(ke)}catch(ke){if(ke.code!=="ENOENT")throw ke;return}if(Ae){yield it(`rm -rf "${ke}"`)}else{yield rt.unlink(ke)}}}))}Ae.rmRF=rmRF;function mkdirP(ke){return qe(this,void 0,void 0,(function*(){yield rt.mkdirP(ke)}))}Ae.mkdirP=mkdirP;function which(ke,Ae){return qe(this,void 0,void 0,(function*(){if(!ke){throw new Error("parameter 'tool' is required")}if(Ae){const Ae=yield which(ke,false);if(!Ae){if(rt.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${ke}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${ke}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}}try{const Ae=[];if(rt.IS_WINDOWS&&process.env.PATHEXT){for(const ke of process.env.PATHEXT.split(Ve.delimiter)){if(ke){Ae.push(ke)}}}if(rt.isRooted(ke)){const Ce=yield rt.tryGetExecutablePath(ke,Ae);if(Ce){return Ce}return""}if(ke.includes("/")||rt.IS_WINDOWS&&ke.includes("\\")){return""}const Ce=[];if(process.env.PATH){for(const ke of process.env.PATH.split(Ve.delimiter)){if(ke){Ce.push(ke)}}}for(const qe of Ce){const Ce=yield rt.tryGetExecutablePath(qe+Ve.sep+ke,Ae);if(Ce){return Ce}}return""}catch(ke){throw new Error(`which failed with message ${ke.message}`)}}))}Ae.which=which;function readCopyOptions(ke){const Ae=ke.force==null?true:ke.force;const Ce=Boolean(ke.recursive);return{force:Ae,recursive:Ce}}function cpDirRecursive(ke,Ae,Ce,ze){return qe(this,void 0,void 0,(function*(){if(Ce>=255)return;Ce++;yield mkdirP(Ae);const qe=yield rt.readdir(ke);for(const Ve of qe){const qe=`${ke}/${Ve}`;const tt=`${Ae}/${Ve}`;const it=yield rt.lstat(qe);if(it.isDirectory()){yield cpDirRecursive(qe,tt,Ce,ze)}else{yield copyFile(qe,tt,ze)}}yield rt.chmod(Ae,(yield rt.stat(ke)).mode)}))}function copyFile(ke,Ae,Ce){return qe(this,void 0,void 0,(function*(){if((yield rt.lstat(ke)).isSymbolicLink()){try{yield rt.lstat(Ae);yield rt.unlink(Ae)}catch(ke){if(ke.code==="EPERM"){yield rt.chmod(Ae,"0666");yield rt.unlink(Ae)}}const Ce=yield rt.readlink(ke);yield rt.symlink(Ce,Ae,rt.IS_WINDOWS?"junction":null)}else if(!(yield rt.exists(Ae))||Ce){yield rt.copyFile(ke,Ae)}}))}},2764:ke=>{"use strict";ke.exports=addressparser;function addressparser(ke){var Ae=new Tokenizer(ke);var Ce=Ae.tokenize();var qe=[];var ze=[];var Ve=[];Ce.forEach((function(ke){if(ke.type==="operator"&&(ke.value===","||ke.value===";")){if(ze.length){qe.push(ze)}ze=[]}else{ze.push(ke)}}));if(ze.length){qe.push(ze)}qe.forEach((function(ke){ke=_handleAddress(ke);if(ke.length){Ve=Ve.concat(ke)}}));return Ve}function _handleAddress(ke){var Ae;var Ce=false;var qe="text";var ze;var Ve=[];var tt={address:[],comment:[],group:[],text:[]};var rt;var it;for(rt=0,it=ke.length;rt=0;rt--){if(tt.text[rt].match(/^[^@\s]+@[^@\s]+$/)){tt.address=tt.text.splice(rt,1);break}}var _regexHandler=function(ke){if(!tt.address.length){tt.address=[ke.trim()];return" "}else{return ke}};if(!tt.address.length){for(rt=tt.text.length-1;rt>=0;rt--){tt.text[rt]=tt.text[rt].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,_regexHandler).trim();if(tt.address.length){break}}}}if(!tt.text.length&&tt.comment.length){tt.text=tt.comment;tt.comment=[]}if(tt.address.length>1){tt.text=tt.text.concat(tt.address.splice(1))}tt.text=tt.text.join(" ");tt.address=tt.address.join(" ");if(!tt.address&&Ce){return[]}else{ze={address:tt.address||tt.text||"",name:tt.text||tt.address||""};if(ze.address===ze.name){if((ze.address||"").match(/@/)){ze.name=""}else{ze.address=""}}Ve.push(ze)}}return Ve}function Tokenizer(ke){this.str=(ke||"").toString();this.operatorCurrent="";this.operatorExpecting="";this.node=null;this.escaped=false;this.list=[]}Tokenizer.prototype.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""};Tokenizer.prototype.tokenize=function(){var ke,Ae=[];for(var Ce=0,qe=this.str.length;Ce{"use strict";const qe=Ae;qe.bignum=Ce(6641);qe.define=Ce(5245).define;qe.base=Ce(8096);qe.constants=Ce(3371);qe.decoders=Ce(4952);qe.encoders=Ce(9083)},5245:(ke,Ae,Ce)=>{"use strict";const qe=Ce(9083);const ze=Ce(4952);const Ve=Ce(4124);const tt=Ae;tt.define=function define(ke,Ae){return new Entity(ke,Ae)};function Entity(ke,Ae){this.name=ke;this.body=Ae;this.decoders={};this.encoders={}}Entity.prototype._createNamed=function createNamed(ke){const Ae=this.name;function Generated(ke){this._initNamed(ke,Ae)}Ve(Generated,ke);Generated.prototype._initNamed=function _initNamed(Ae,Ce){ke.call(this,Ae,Ce)};return new Generated(this)};Entity.prototype._getDecoder=function _getDecoder(ke){ke=ke||"der";if(!this.decoders.hasOwnProperty(ke))this.decoders[ke]=this._createNamed(ze[ke]);return this.decoders[ke]};Entity.prototype.decode=function decode(ke,Ae,Ce){return this._getDecoder(Ae).decode(ke,Ce)};Entity.prototype._getEncoder=function _getEncoder(ke){ke=ke||"der";if(!this.encoders.hasOwnProperty(ke))this.encoders[ke]=this._createNamed(qe[ke]);return this.encoders[ke]};Entity.prototype.encode=function encode(ke,Ae,Ce){return this._getEncoder(Ae).encode(ke,Ce)}},5298:(ke,Ae,Ce)=>{"use strict";const qe=Ce(4124);const ze=Ce(3744).b;const Ve=Ce(5118).Buffer;function DecoderBuffer(ke,Ae){ze.call(this,Ae);if(!Ve.isBuffer(ke)){this.error("Input not Buffer");return}this.base=ke;this.offset=0;this.length=ke.length}qe(DecoderBuffer,ze);Ae.C=DecoderBuffer;DecoderBuffer.isDecoderBuffer=function isDecoderBuffer(ke){if(ke instanceof DecoderBuffer){return true}const Ae=typeof ke==="object"&&Ve.isBuffer(ke.base)&&ke.constructor.name==="DecoderBuffer"&&typeof ke.offset==="number"&&typeof ke.length==="number"&&typeof ke.save==="function"&&typeof ke.restore==="function"&&typeof ke.isEmpty==="function"&&typeof ke.readUInt8==="function"&&typeof ke.skip==="function"&&typeof ke.raw==="function";return Ae};DecoderBuffer.prototype.save=function save(){return{offset:this.offset,reporter:ze.prototype.save.call(this)}};DecoderBuffer.prototype.restore=function restore(ke){const Ae=new DecoderBuffer(this.base);Ae.offset=ke.offset;Ae.length=this.offset;this.offset=ke.offset;ze.prototype.restore.call(this,ke.reporter);return Ae};DecoderBuffer.prototype.isEmpty=function isEmpty(){return this.offset===this.length};DecoderBuffer.prototype.readUInt8=function readUInt8(ke){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,true);else return this.error(ke||"DecoderBuffer overrun")};DecoderBuffer.prototype.skip=function skip(ke,Ae){if(!(this.offset+ke<=this.length))return this.error(Ae||"DecoderBuffer overrun");const Ce=new DecoderBuffer(this.base);Ce._reporterState=this._reporterState;Ce.offset=this.offset;Ce.length=this.offset+ke;this.offset+=ke;return Ce};DecoderBuffer.prototype.raw=function raw(ke){return this.base.slice(ke?ke.offset:this.offset,this.length)};function EncoderBuffer(ke,Ae){if(Array.isArray(ke)){this.length=0;this.value=ke.map((function(ke){if(!EncoderBuffer.isEncoderBuffer(ke))ke=new EncoderBuffer(ke,Ae);this.length+=ke.length;return ke}),this)}else if(typeof ke==="number"){if(!(0<=ke&&ke<=255))return Ae.error("non-byte EncoderBuffer value");this.value=ke;this.length=1}else if(typeof ke==="string"){this.value=ke;this.length=Ve.byteLength(ke)}else if(Ve.isBuffer(ke)){this.value=ke;this.length=ke.length}else{return Ae.error("Unsupported type: "+typeof ke)}}Ae.R=EncoderBuffer;EncoderBuffer.isEncoderBuffer=function isEncoderBuffer(ke){if(ke instanceof EncoderBuffer){return true}const Ae=typeof ke==="object"&&ke.constructor.name==="EncoderBuffer"&&typeof ke.length==="number"&&typeof ke.join==="function";return Ae};EncoderBuffer.prototype.join=function join(ke,Ae){if(!ke)ke=Ve.alloc(this.length);if(!Ae)Ae=0;if(this.length===0)return ke;if(Array.isArray(this.value)){this.value.forEach((function(Ce){Ce.join(ke,Ae);Ae+=Ce.length}))}else{if(typeof this.value==="number")ke[Ae]=this.value;else if(typeof this.value==="string")ke.write(this.value,Ae);else if(Ve.isBuffer(this.value))this.value.copy(ke,Ae);Ae+=this.length}return ke}},8096:(ke,Ae,Ce)=>{"use strict";const qe=Ae;qe.Reporter=Ce(3744).b;qe.DecoderBuffer=Ce(5298).C;qe.EncoderBuffer=Ce(5298).R;qe.Node=Ce(842)},842:(ke,Ae,Ce)=>{"use strict";const qe=Ce(3744).b;const ze=Ce(5298).R;const Ve=Ce(5298).C;const tt=Ce(910);const rt=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"];const it=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(rt);const nt=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node(ke,Ae,Ce){const qe={};this._baseState=qe;qe.name=Ce;qe.enc=ke;qe.parent=Ae||null;qe.children=null;qe.tag=null;qe.args=null;qe.reverseArgs=null;qe.choice=null;qe.optional=false;qe.any=false;qe.obj=false;qe.use=null;qe.useDecoder=null;qe.key=null;qe["default"]=null;qe.explicit=null;qe.implicit=null;qe.contains=null;if(!qe.parent){qe.children=[];this._wrap()}}ke.exports=Node;const ot=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function clone(){const ke=this._baseState;const Ae={};ot.forEach((function(Ce){Ae[Ce]=ke[Ce]}));const Ce=new this.constructor(Ae.parent);Ce._baseState=Ae;return Ce};Node.prototype._wrap=function wrap(){const ke=this._baseState;it.forEach((function(Ae){this[Ae]=function _wrappedMethod(){const Ce=new this.constructor(this);ke.children.push(Ce);return Ce[Ae].apply(Ce,arguments)}}),this)};Node.prototype._init=function init(ke){const Ae=this._baseState;tt(Ae.parent===null);ke.call(this);Ae.children=Ae.children.filter((function(ke){return ke._baseState.parent===this}),this);tt.equal(Ae.children.length,1,"Root node can have only one child")};Node.prototype._useArgs=function useArgs(ke){const Ae=this._baseState;const Ce=ke.filter((function(ke){return ke instanceof this.constructor}),this);ke=ke.filter((function(ke){return!(ke instanceof this.constructor)}),this);if(Ce.length!==0){tt(Ae.children===null);Ae.children=Ce;Ce.forEach((function(ke){ke._baseState.parent=this}),this)}if(ke.length!==0){tt(Ae.args===null);Ae.args=ke;Ae.reverseArgs=ke.map((function(ke){if(typeof ke!=="object"||ke.constructor!==Object)return ke;const Ae={};Object.keys(ke).forEach((function(Ce){if(Ce==(Ce|0))Ce|=0;const qe=ke[Ce];Ae[qe]=Ce}));return Ae}))}};nt.forEach((function(ke){Node.prototype[ke]=function _overrided(){const Ae=this._baseState;throw new Error(ke+" not implemented for encoding: "+Ae.enc)}}));rt.forEach((function(ke){Node.prototype[ke]=function _tagMethod(){const Ae=this._baseState;const Ce=Array.prototype.slice.call(arguments);tt(Ae.tag===null);Ae.tag=ke;this._useArgs(Ce);return this}}));Node.prototype.use=function use(ke){tt(ke);const Ae=this._baseState;tt(Ae.use===null);Ae.use=ke;return this};Node.prototype.optional=function optional(){const ke=this._baseState;ke.optional=true;return this};Node.prototype.def=function def(ke){const Ae=this._baseState;tt(Ae["default"]===null);Ae["default"]=ke;Ae.optional=true;return this};Node.prototype.explicit=function explicit(ke){const Ae=this._baseState;tt(Ae.explicit===null&&Ae.implicit===null);Ae.explicit=ke;return this};Node.prototype.implicit=function implicit(ke){const Ae=this._baseState;tt(Ae.explicit===null&&Ae.implicit===null);Ae.implicit=ke;return this};Node.prototype.obj=function obj(){const ke=this._baseState;const Ae=Array.prototype.slice.call(arguments);ke.obj=true;if(Ae.length!==0)this._useArgs(Ae);return this};Node.prototype.key=function key(ke){const Ae=this._baseState;tt(Ae.key===null);Ae.key=ke;return this};Node.prototype.any=function any(){const ke=this._baseState;ke.any=true;return this};Node.prototype.choice=function choice(ke){const Ae=this._baseState;tt(Ae.choice===null);Ae.choice=ke;this._useArgs(Object.keys(ke).map((function(Ae){return ke[Ae]})));return this};Node.prototype.contains=function contains(ke){const Ae=this._baseState;tt(Ae.use===null);Ae.contains=ke;return this};Node.prototype._decode=function decode(ke,Ae){const Ce=this._baseState;if(Ce.parent===null)return ke.wrapResult(Ce.children[0]._decode(ke,Ae));let qe=Ce["default"];let ze=true;let tt=null;if(Ce.key!==null)tt=ke.enterKey(Ce.key);if(Ce.optional){let qe=null;if(Ce.explicit!==null)qe=Ce.explicit;else if(Ce.implicit!==null)qe=Ce.implicit;else if(Ce.tag!==null)qe=Ce.tag;if(qe===null&&!Ce.any){const qe=ke.save();try{if(Ce.choice===null)this._decodeGeneric(Ce.tag,ke,Ae);else this._decodeChoice(ke,Ae);ze=true}catch(ke){ze=false}ke.restore(qe)}else{ze=this._peekTag(ke,qe,Ce.any);if(ke.isError(ze))return ze}}let rt;if(Ce.obj&&ze)rt=ke.enterObject();if(ze){if(Ce.explicit!==null){const Ae=this._decodeTag(ke,Ce.explicit);if(ke.isError(Ae))return Ae;ke=Ae}const ze=ke.offset;if(Ce.use===null&&Ce.choice===null){let Ae;if(Ce.any)Ae=ke.save();const ze=this._decodeTag(ke,Ce.implicit!==null?Ce.implicit:Ce.tag,Ce.any);if(ke.isError(ze))return ze;if(Ce.any)qe=ke.raw(Ae);else ke=ze}if(Ae&&Ae.track&&Ce.tag!==null)Ae.track(ke.path(),ze,ke.length,"tagged");if(Ae&&Ae.track&&Ce.tag!==null)Ae.track(ke.path(),ke.offset,ke.length,"content");if(Ce.any){}else if(Ce.choice===null){qe=this._decodeGeneric(Ce.tag,ke,Ae)}else{qe=this._decodeChoice(ke,Ae)}if(ke.isError(qe))return qe;if(!Ce.any&&Ce.choice===null&&Ce.children!==null){Ce.children.forEach((function decodeChildren(Ce){Ce._decode(ke,Ae)}))}if(Ce.contains&&(Ce.tag==="octstr"||Ce.tag==="bitstr")){const ze=new Ve(qe);qe=this._getUse(Ce.contains,ke._reporterState.obj)._decode(ze,Ae)}}if(Ce.obj&&ze)qe=ke.leaveObject(rt);if(Ce.key!==null&&(qe!==null||ze===true))ke.leaveKey(tt,Ce.key,qe);else if(tt!==null)ke.exitKey(tt);return qe};Node.prototype._decodeGeneric=function decodeGeneric(ke,Ae,Ce){const qe=this._baseState;if(ke==="seq"||ke==="set")return null;if(ke==="seqof"||ke==="setof")return this._decodeList(Ae,ke,qe.args[0],Ce);else if(/str$/.test(ke))return this._decodeStr(Ae,ke,Ce);else if(ke==="objid"&&qe.args)return this._decodeObjid(Ae,qe.args[0],qe.args[1],Ce);else if(ke==="objid")return this._decodeObjid(Ae,null,null,Ce);else if(ke==="gentime"||ke==="utctime")return this._decodeTime(Ae,ke,Ce);else if(ke==="null_")return this._decodeNull(Ae,Ce);else if(ke==="bool")return this._decodeBool(Ae,Ce);else if(ke==="objDesc")return this._decodeStr(Ae,ke,Ce);else if(ke==="int"||ke==="enum")return this._decodeInt(Ae,qe.args&&qe.args[0],Ce);if(qe.use!==null){return this._getUse(qe.use,Ae._reporterState.obj)._decode(Ae,Ce)}else{return Ae.error("unknown tag: "+ke)}};Node.prototype._getUse=function _getUse(ke,Ae){const Ce=this._baseState;Ce.useDecoder=this._use(ke,Ae);tt(Ce.useDecoder._baseState.parent===null);Ce.useDecoder=Ce.useDecoder._baseState.children[0];if(Ce.implicit!==Ce.useDecoder._baseState.implicit){Ce.useDecoder=Ce.useDecoder.clone();Ce.useDecoder._baseState.implicit=Ce.implicit}return Ce.useDecoder};Node.prototype._decodeChoice=function decodeChoice(ke,Ae){const Ce=this._baseState;let qe=null;let ze=false;Object.keys(Ce.choice).some((function(Ve){const tt=ke.save();const rt=Ce.choice[Ve];try{const Ce=rt._decode(ke,Ae);if(ke.isError(Ce))return false;qe={type:Ve,value:Ce};ze=true}catch(Ae){ke.restore(tt);return false}return true}),this);if(!ze)return ke.error("Choice not matched");return qe};Node.prototype._createEncoderBuffer=function createEncoderBuffer(ke){return new ze(ke,this.reporter)};Node.prototype._encode=function encode(ke,Ae,Ce){const qe=this._baseState;if(qe["default"]!==null&&qe["default"]===ke)return;const ze=this._encodeValue(ke,Ae,Ce);if(ze===undefined)return;if(this._skipDefault(ze,Ae,Ce))return;return ze};Node.prototype._encodeValue=function encode(ke,Ae,Ce){const ze=this._baseState;if(ze.parent===null)return ze.children[0]._encode(ke,Ae||new qe);let Ve=null;this.reporter=Ae;if(ze.optional&&ke===undefined){if(ze["default"]!==null)ke=ze["default"];else return}let tt=null;let rt=false;if(ze.any){Ve=this._createEncoderBuffer(ke)}else if(ze.choice){Ve=this._encodeChoice(ke,Ae)}else if(ze.contains){tt=this._getUse(ze.contains,Ce)._encode(ke,Ae);rt=true}else if(ze.children){tt=ze.children.map((function(Ce){if(Ce._baseState.tag==="null_")return Ce._encode(null,Ae,ke);if(Ce._baseState.key===null)return Ae.error("Child should have a key");const qe=Ae.enterKey(Ce._baseState.key);if(typeof ke!=="object")return Ae.error("Child expected, but input is not object");const ze=Ce._encode(ke[Ce._baseState.key],Ae,ke);Ae.leaveKey(qe);return ze}),this).filter((function(ke){return ke}));tt=this._createEncoderBuffer(tt)}else{if(ze.tag==="seqof"||ze.tag==="setof"){if(!(ze.args&&ze.args.length===1))return Ae.error("Too many args for : "+ze.tag);if(!Array.isArray(ke))return Ae.error("seqof/setof, but data is not Array");const Ce=this.clone();Ce._baseState.implicit=null;tt=this._createEncoderBuffer(ke.map((function(Ce){const qe=this._baseState;return this._getUse(qe.args[0],ke)._encode(Ce,Ae)}),Ce))}else if(ze.use!==null){Ve=this._getUse(ze.use,Ce)._encode(ke,Ae)}else{tt=this._encodePrimitive(ze.tag,ke);rt=true}}if(!ze.any&&ze.choice===null){const ke=ze.implicit!==null?ze.implicit:ze.tag;const Ce=ze.implicit===null?"universal":"context";if(ke===null){if(ze.use===null)Ae.error("Tag could be omitted only for .use()")}else{if(ze.use===null)Ve=this._encodeComposite(ke,rt,Ce,tt)}}if(ze.explicit!==null)Ve=this._encodeComposite(ze.explicit,false,"context",Ve);return Ve};Node.prototype._encodeChoice=function encodeChoice(ke,Ae){const Ce=this._baseState;const qe=Ce.choice[ke.type];if(!qe){tt(false,ke.type+" not found in "+JSON.stringify(Object.keys(Ce.choice)))}return qe._encode(ke.value,Ae)};Node.prototype._encodePrimitive=function encodePrimitive(ke,Ae){const Ce=this._baseState;if(/str$/.test(ke))return this._encodeStr(Ae,ke);else if(ke==="objid"&&Ce.args)return this._encodeObjid(Ae,Ce.reverseArgs[0],Ce.args[1]);else if(ke==="objid")return this._encodeObjid(Ae,null,null);else if(ke==="gentime"||ke==="utctime")return this._encodeTime(Ae,ke);else if(ke==="null_")return this._encodeNull();else if(ke==="int"||ke==="enum")return this._encodeInt(Ae,Ce.args&&Ce.reverseArgs[0]);else if(ke==="bool")return this._encodeBool(Ae);else if(ke==="objDesc")return this._encodeStr(Ae,ke);else throw new Error("Unsupported tag: "+ke)};Node.prototype._isNumstr=function isNumstr(ke){return/^[0-9 ]*$/.test(ke)};Node.prototype._isPrintstr=function isPrintstr(ke){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(ke)}},3744:(ke,Ae,Ce)=>{"use strict";const qe=Ce(4124);function Reporter(ke){this._reporterState={obj:null,path:[],options:ke||{},errors:[]}}Ae.b=Reporter;Reporter.prototype.isError=function isError(ke){return ke instanceof ReporterError};Reporter.prototype.save=function save(){const ke=this._reporterState;return{obj:ke.obj,pathLen:ke.path.length}};Reporter.prototype.restore=function restore(ke){const Ae=this._reporterState;Ae.obj=ke.obj;Ae.path=Ae.path.slice(0,ke.pathLen)};Reporter.prototype.enterKey=function enterKey(ke){return this._reporterState.path.push(ke)};Reporter.prototype.exitKey=function exitKey(ke){const Ae=this._reporterState;Ae.path=Ae.path.slice(0,ke-1)};Reporter.prototype.leaveKey=function leaveKey(ke,Ae,Ce){const qe=this._reporterState;this.exitKey(ke);if(qe.obj!==null)qe.obj[Ae]=Ce};Reporter.prototype.path=function path(){return this._reporterState.path.join("/")};Reporter.prototype.enterObject=function enterObject(){const ke=this._reporterState;const Ae=ke.obj;ke.obj={};return Ae};Reporter.prototype.leaveObject=function leaveObject(ke){const Ae=this._reporterState;const Ce=Ae.obj;Ae.obj=ke;return Ce};Reporter.prototype.error=function error(ke){let Ae;const Ce=this._reporterState;const qe=ke instanceof ReporterError;if(qe){Ae=ke}else{Ae=new ReporterError(Ce.path.map((function(ke){return"["+JSON.stringify(ke)+"]"})).join(""),ke.message||ke,ke.stack)}if(!Ce.options.partial)throw Ae;if(!qe)Ce.errors.push(Ae);return Ae};Reporter.prototype.wrapResult=function wrapResult(ke){const Ae=this._reporterState;if(!Ae.options.partial)return ke;return{result:this.isError(ke)?null:ke,errors:Ae.errors}};function ReporterError(ke,Ae){this.path=ke;this.rethrow(Ae)}qe(ReporterError,Error);ReporterError.prototype.rethrow=function rethrow(ke){this.message=ke+" at: "+(this.path||"(shallow)");if(Error.captureStackTrace)Error.captureStackTrace(this,ReporterError);if(!this.stack){try{throw new Error(this.message)}catch(ke){this.stack=ke.stack}}return this}},1188:(ke,Ae)=>{"use strict";function reverse(ke){const Ae={};Object.keys(ke).forEach((function(Ce){if((Ce|0)==Ce)Ce=Ce|0;const qe=ke[Ce];Ae[qe]=Ce}));return Ae}Ae.tagClass={0:"universal",1:"application",2:"context",3:"private"};Ae.tagClassByName=reverse(Ae.tagClass);Ae.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};Ae.tagByName=reverse(Ae.tag)},3371:(ke,Ae,Ce)=>{"use strict";const qe=Ae;qe._reverse=function reverse(ke){const Ae={};Object.keys(ke).forEach((function(Ce){if((Ce|0)==Ce)Ce=Ce|0;const qe=ke[Ce];Ae[qe]=Ce}));return Ae};qe.der=Ce(1188)},3332:(ke,Ae,Ce)=>{"use strict";const qe=Ce(4124);const ze=Ce(6641);const Ve=Ce(5298).C;const tt=Ce(842);const rt=Ce(1188);function DERDecoder(ke){this.enc="der";this.name=ke.name;this.entity=ke;this.tree=new DERNode;this.tree._init(ke.body)}ke.exports=DERDecoder;DERDecoder.prototype.decode=function decode(ke,Ae){if(!Ve.isDecoderBuffer(ke)){ke=new Ve(ke,Ae)}return this.tree._decode(ke,Ae)};function DERNode(ke){tt.call(this,"der",ke)}qe(DERNode,tt);DERNode.prototype._peekTag=function peekTag(ke,Ae,Ce){if(ke.isEmpty())return false;const qe=ke.save();const ze=derDecodeTag(ke,'Failed to peek tag: "'+Ae+'"');if(ke.isError(ze))return ze;ke.restore(qe);return ze.tag===Ae||ze.tagStr===Ae||ze.tagStr+"of"===Ae||Ce};DERNode.prototype._decodeTag=function decodeTag(ke,Ae,Ce){const qe=derDecodeTag(ke,'Failed to decode tag of "'+Ae+'"');if(ke.isError(qe))return qe;let ze=derDecodeLen(ke,qe.primitive,'Failed to get length of "'+Ae+'"');if(ke.isError(ze))return ze;if(!Ce&&qe.tag!==Ae&&qe.tagStr!==Ae&&qe.tagStr+"of"!==Ae){return ke.error('Failed to match tag: "'+Ae+'"')}if(qe.primitive||ze!==null)return ke.skip(ze,'Failed to match body of: "'+Ae+'"');const Ve=ke.save();const tt=this._skipUntilEnd(ke,'Failed to skip indefinite length body: "'+this.tag+'"');if(ke.isError(tt))return tt;ze=ke.offset-Ve.offset;ke.restore(Ve);return ke.skip(ze,'Failed to match body of: "'+Ae+'"')};DERNode.prototype._skipUntilEnd=function skipUntilEnd(ke,Ae){for(;;){const Ce=derDecodeTag(ke,Ae);if(ke.isError(Ce))return Ce;const qe=derDecodeLen(ke,Ce.primitive,Ae);if(ke.isError(qe))return qe;let ze;if(Ce.primitive||qe!==null)ze=ke.skip(qe);else ze=this._skipUntilEnd(ke,Ae);if(ke.isError(ze))return ze;if(Ce.tagStr==="end")break}};DERNode.prototype._decodeList=function decodeList(ke,Ae,Ce,qe){const ze=[];while(!ke.isEmpty()){const Ae=this._peekTag(ke,"end");if(ke.isError(Ae))return Ae;const Ve=Ce.decode(ke,"der",qe);if(ke.isError(Ve)&&Ae)break;ze.push(Ve)}return ze};DERNode.prototype._decodeStr=function decodeStr(ke,Ae){if(Ae==="bitstr"){const Ae=ke.readUInt8();if(ke.isError(Ae))return Ae;return{unused:Ae,data:ke.raw()}}else if(Ae==="bmpstr"){const Ae=ke.raw();if(Ae.length%2===1)return ke.error("Decoding of string type: bmpstr length mismatch");let Ce="";for(let ke=0;ke>6];const ze=(Ce&32)===0;if((Ce&31)===31){let qe=Ce;Ce=0;while((qe&128)===128){qe=ke.readUInt8(Ae);if(ke.isError(qe))return qe;Ce<<=7;Ce|=qe&127}}else{Ce&=31}const Ve=rt.tag[Ce];return{cls:qe,primitive:ze,tag:Ce,tagStr:Ve}}function derDecodeLen(ke,Ae,Ce){let qe=ke.readUInt8(Ce);if(ke.isError(qe))return qe;if(!Ae&&qe===128)return null;if((qe&128)===0){return qe}const ze=qe&127;if(ze>4)return ke.error("length octect is too long");qe=0;for(let Ae=0;Ae{"use strict";const qe=Ae;qe.der=Ce(3332);qe.pem=Ce(8361)},8361:(ke,Ae,Ce)=>{"use strict";const qe=Ce(4124);const ze=Ce(5118).Buffer;const Ve=Ce(3332);function PEMDecoder(ke){Ve.call(this,ke);this.enc="pem"}qe(PEMDecoder,Ve);ke.exports=PEMDecoder;PEMDecoder.prototype.decode=function decode(ke,Ae){const Ce=ke.toString().split(/[\r\n]+/g);const qe=Ae.label.toUpperCase();const tt=/^-----(BEGIN|END) ([^-]+)-----$/;let rt=-1;let it=-1;for(let ke=0;ke{"use strict";const qe=Ce(4124);const ze=Ce(5118).Buffer;const Ve=Ce(842);const tt=Ce(1188);function DEREncoder(ke){this.enc="der";this.name=ke.name;this.entity=ke;this.tree=new DERNode;this.tree._init(ke.body)}ke.exports=DEREncoder;DEREncoder.prototype.encode=function encode(ke,Ae){return this.tree._encode(ke,Ae).join()};function DERNode(ke){Ve.call(this,"der",ke)}qe(DERNode,Ve);DERNode.prototype._encodeComposite=function encodeComposite(ke,Ae,Ce,qe){const Ve=encodeTag(ke,Ae,Ce,this.reporter);if(qe.length<128){const ke=ze.alloc(2);ke[0]=Ve;ke[1]=qe.length;return this._createEncoderBuffer([ke,qe])}let tt=1;for(let ke=qe.length;ke>=256;ke>>=8)tt++;const rt=ze.alloc(1+1+tt);rt[0]=Ve;rt[1]=128|tt;for(let ke=1+tt,Ae=qe.length;Ae>0;ke--,Ae>>=8)rt[ke]=Ae&255;return this._createEncoderBuffer([rt,qe])};DERNode.prototype._encodeStr=function encodeStr(ke,Ae){if(Ae==="bitstr"){return this._createEncoderBuffer([ke.unused|0,ke.data])}else if(Ae==="bmpstr"){const Ae=ze.alloc(ke.length*2);for(let Ce=0;Ce=40)return this.reporter.error("Second objid identifier OOB");ke.splice(0,2,ke[0]*40+ke[1])}let qe=0;for(let Ae=0;Ae=128;Ce>>=7)qe++}const Ve=ze.alloc(qe);let tt=Ve.length-1;for(let Ae=ke.length-1;Ae>=0;Ae--){let Ce=ke[Ae];Ve[tt--]=Ce&127;while((Ce>>=7)>0)Ve[tt--]=128|Ce&127}return this._createEncoderBuffer(Ve)};function two(ke){if(ke<10)return"0"+ke;else return ke}DERNode.prototype._encodeTime=function encodeTime(ke,Ae){let Ce;const qe=new Date(ke);if(Ae==="gentime"){Ce=[two(qe.getUTCFullYear()),two(qe.getUTCMonth()+1),two(qe.getUTCDate()),two(qe.getUTCHours()),two(qe.getUTCMinutes()),two(qe.getUTCSeconds()),"Z"].join("")}else if(Ae==="utctime"){Ce=[two(qe.getUTCFullYear()%100),two(qe.getUTCMonth()+1),two(qe.getUTCDate()),two(qe.getUTCHours()),two(qe.getUTCMinutes()),two(qe.getUTCSeconds()),"Z"].join("")}else{this.reporter.error("Encoding "+Ae+" time is not supported yet")}return this._encodeStr(Ce,"octstr")};DERNode.prototype._encodeNull=function encodeNull(){return this._createEncoderBuffer("")};DERNode.prototype._encodeInt=function encodeInt(ke,Ae){if(typeof ke==="string"){if(!Ae)return this.reporter.error("String int or enum given, but no values map");if(!Ae.hasOwnProperty(ke)){return this.reporter.error("Values map doesn't contain: "+JSON.stringify(ke))}ke=Ae[ke]}if(typeof ke!=="number"&&!ze.isBuffer(ke)){const Ae=ke.toArray();if(!ke.sign&&Ae[0]&128){Ae.unshift(0)}ke=ze.from(Ae)}if(ze.isBuffer(ke)){let Ae=ke.length;if(ke.length===0)Ae++;const Ce=ze.alloc(Ae);ke.copy(Ce);if(ke.length===0)Ce[0]=0;return this._createEncoderBuffer(Ce)}if(ke<128)return this._createEncoderBuffer(ke);if(ke<256)return this._createEncoderBuffer([0,ke]);let Ce=1;for(let Ae=ke;Ae>=256;Ae>>=8)Ce++;const qe=new Array(Ce);for(let Ae=qe.length-1;Ae>=0;Ae--){qe[Ae]=ke&255;ke>>=8}if(qe[0]&128){qe.unshift(0)}return this._createEncoderBuffer(ze.from(qe))};DERNode.prototype._encodeBool=function encodeBool(ke){return this._createEncoderBuffer(ke?255:0)};DERNode.prototype._use=function use(ke,Ae){if(typeof ke==="function")ke=ke(Ae);return ke._getEncoder("der").tree};DERNode.prototype._skipDefault=function skipDefault(ke,Ae,Ce){const qe=this._baseState;let ze;if(qe["default"]===null)return false;const Ve=ke.join();if(qe.defaultBuffer===undefined)qe.defaultBuffer=this._encodeValue(qe["default"],Ae,Ce).join();if(Ve.length!==qe.defaultBuffer.length)return false;for(ze=0;ze=31)return qe.error("Multi-octet tag encoding unsupported");if(!Ae)ze|=32;ze|=tt.tagClassByName[Ce||"universal"]<<6;return ze}},9083:(ke,Ae,Ce)=>{"use strict";const qe=Ae;qe.der=Ce(5769);qe.pem=Ce(279)},279:(ke,Ae,Ce)=>{"use strict";const qe=Ce(4124);const ze=Ce(5769);function PEMEncoder(ke){ze.call(this,ke);this.enc="pem"}qe(PEMEncoder,ze);ke.exports=PEMEncoder;PEMEncoder.prototype.encode=function encode(ke,Ae){const Ce=ze.prototype.encode.call(this,ke);const qe=Ce.toString("base64");const Ve=["-----BEGIN "+Ae.label+"-----"];for(let ke=0;ke0)return ke;return Ae};BN.min=function min(ke,Ae){if(ke.cmp(Ae)<0)return ke;return Ae};BN.prototype._init=function init(ke,Ae,Ce){if(typeof ke==="number"){return this._initNumber(ke,Ae,Ce)}if(typeof ke==="object"){return this._initArray(ke,Ae,Ce)}if(Ae==="hex"){Ae=16}assert(Ae===(Ae|0)&&Ae>=2&&Ae<=36);ke=ke.toString().replace(/\s+/g,"");var qe=0;if(ke[0]==="-"){qe++}if(Ae===16){this._parseHex(ke,qe)}else{this._parseBase(ke,Ae,qe)}if(ke[0]==="-"){this.negative=1}this.strip();if(Ce!=="le")return;this._initArray(this.toArray(),Ae,Ce)};BN.prototype._initNumber=function _initNumber(ke,Ae,Ce){if(ke<0){this.negative=1;ke=-ke}if(ke<67108864){this.words=[ke&67108863];this.length=1}else if(ke<4503599627370496){this.words=[ke&67108863,ke/67108864&67108863];this.length=2}else{assert(ke<9007199254740992);this.words=[ke&67108863,ke/67108864&67108863,1];this.length=3}if(Ce!=="le")return;this._initArray(this.toArray(),Ae,Ce)};BN.prototype._initArray=function _initArray(ke,Ae,Ce){assert(typeof ke.length==="number");if(ke.length<=0){this.words=[0];this.length=1;return this}this.length=Math.ceil(ke.length/3);this.words=new Array(this.length);for(var qe=0;qe=0;qe-=3){Ve=ke[qe]|ke[qe-1]<<8|ke[qe-2]<<16;this.words[ze]|=Ve<>>26-tt&67108863;tt+=24;if(tt>=26){tt-=26;ze++}}}else if(Ce==="le"){for(qe=0,ze=0;qe>>26-tt&67108863;tt+=24;if(tt>=26){tt-=26;ze++}}}return this.strip()};function parseHex(ke,Ae,Ce){var qe=0;var ze=Math.min(ke.length,Ce);for(var Ve=Ae;Ve=49&&tt<=54){qe|=tt-49+10}else if(tt>=17&&tt<=22){qe|=tt-17+10}else{qe|=tt&15}}return qe}BN.prototype._parseHex=function _parseHex(ke,Ae){this.length=Math.ceil((ke.length-Ae)/6);this.words=new Array(this.length);for(var Ce=0;Ce=Ae;Ce-=6){ze=parseHex(ke,Ce,Ce+6);this.words[qe]|=ze<>>26-Ve&4194303;Ve+=24;if(Ve>=26){Ve-=26;qe++}}if(Ce+6!==Ae){ze=parseHex(ke,Ae,Ce+6);this.words[qe]|=ze<>>26-Ve&4194303}this.strip()};function parseBase(ke,Ae,Ce,qe){var ze=0;var Ve=Math.min(ke.length,Ce);for(var tt=Ae;tt=49){ze+=rt-49+10}else if(rt>=17){ze+=rt-17+10}else{ze+=rt}}return ze}BN.prototype._parseBase=function _parseBase(ke,Ae,Ce){this.words=[0];this.length=1;for(var qe=0,ze=1;ze<=67108863;ze*=Ae){qe++}qe--;ze=ze/Ae|0;var Ve=ke.length-Ce;var tt=Ve%qe;var rt=Math.min(Ve,Ve-tt)+Ce;var it=0;for(var nt=Ce;nt1&&this.words[this.length-1]===0){this.length--}return this._normSign()};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0}return this};BN.prototype.inspect=function inspect(){return(this.red?""};var ze=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];var Ve=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];var tt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(ke,Ae){ke=ke||10;Ae=Ae|0||1;var Ce;if(ke===16||ke==="hex"){Ce="";var qe=0;var rt=0;for(var it=0;it>>24-qe&16777215;if(rt!==0||it!==this.length-1){Ce=ze[6-ot.length]+ot+Ce}else{Ce=ot+Ce}qe+=2;if(qe>=26){qe-=26;it--}}if(rt!==0){Ce=rt.toString(16)+Ce}while(Ce.length%Ae!==0){Ce="0"+Ce}if(this.negative!==0){Ce="-"+Ce}return Ce}if(ke===(ke|0)&&ke>=2&&ke<=36){var ct=Ve[ke];var ht=tt[ke];Ce="";var ft=this.clone();ft.negative=0;while(!ft.isZero()){var yt=ft.modn(ht).toString(ke);ft=ft.idivn(ht);if(!ft.isZero()){Ce=ze[ct-yt.length]+yt+Ce}else{Ce=yt+Ce}}if(this.isZero()){Ce="0"+Ce}while(Ce.length%Ae!==0){Ce="0"+Ce}if(this.negative!==0){Ce="-"+Ce}return Ce}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var ke=this.words[0];if(this.length===2){ke+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){ke+=4503599627370496+this.words[1]*67108864}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits")}return this.negative!==0?-ke:ke};BN.prototype.toJSON=function toJSON(){return this.toString(16)};BN.prototype.toBuffer=function toBuffer(ke,Ae){assert(typeof qe!=="undefined");return this.toArrayLike(qe,ke,Ae)};BN.prototype.toArray=function toArray(ke,Ae){return this.toArrayLike(Array,ke,Ae)};BN.prototype.toArrayLike=function toArrayLike(ke,Ae,Ce){var qe=this.byteLength();var ze=Ce||Math.max(1,qe);assert(qe<=ze,"byte array longer than desired length");assert(ze>0,"Requested array length <= 0");this.strip();var Ve=Ae==="le";var tt=new ke(ze);var rt,it;var nt=this.clone();if(!Ve){for(it=0;it=4096){Ce+=13;Ae>>>=13}if(Ae>=64){Ce+=7;Ae>>>=7}if(Ae>=8){Ce+=4;Ae>>>=4}if(Ae>=2){Ce+=2;Ae>>>=2}return Ce+Ae}}BN.prototype._zeroBits=function _zeroBits(ke){if(ke===0)return 26;var Ae=ke;var Ce=0;if((Ae&8191)===0){Ce+=13;Ae>>>=13}if((Ae&127)===0){Ce+=7;Ae>>>=7}if((Ae&15)===0){Ce+=4;Ae>>>=4}if((Ae&3)===0){Ce+=2;Ae>>>=2}if((Ae&1)===0){Ce++}return Ce};BN.prototype.bitLength=function bitLength(){var ke=this.words[this.length-1];var Ae=this._countBits(ke);return(this.length-1)*26+Ae};function toBitArray(ke){var Ae=new Array(ke.bitLength());for(var Ce=0;Ce>>ze}return Ae}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var ke=0;for(var Ae=0;Aeke.length)return this.clone().ior(ke);return ke.clone().ior(this)};BN.prototype.uor=function uor(ke){if(this.length>ke.length)return this.clone().iuor(ke);return ke.clone().iuor(this)};BN.prototype.iuand=function iuand(ke){var Ae;if(this.length>ke.length){Ae=ke}else{Ae=this}for(var Ce=0;Ceke.length)return this.clone().iand(ke);return ke.clone().iand(this)};BN.prototype.uand=function uand(ke){if(this.length>ke.length)return this.clone().iuand(ke);return ke.clone().iuand(this)};BN.prototype.iuxor=function iuxor(ke){var Ae;var Ce;if(this.length>ke.length){Ae=this;Ce=ke}else{Ae=ke;Ce=this}for(var qe=0;qeke.length)return this.clone().ixor(ke);return ke.clone().ixor(this)};BN.prototype.uxor=function uxor(ke){if(this.length>ke.length)return this.clone().iuxor(ke);return ke.clone().iuxor(this)};BN.prototype.inotn=function inotn(ke){assert(typeof ke==="number"&&ke>=0);var Ae=Math.ceil(ke/26)|0;var Ce=ke%26;this._expand(Ae);if(Ce>0){Ae--}for(var qe=0;qe0){this.words[qe]=~this.words[qe]&67108863>>26-Ce}return this.strip()};BN.prototype.notn=function notn(ke){return this.clone().inotn(ke)};BN.prototype.setn=function setn(ke,Ae){assert(typeof ke==="number"&&ke>=0);var Ce=ke/26|0;var qe=ke%26;this._expand(Ce+1);if(Ae){this.words[Ce]=this.words[Ce]|1<ke.length){Ce=this;qe=ke}else{Ce=ke;qe=this}var ze=0;for(var Ve=0;Ve>>26}for(;ze!==0&&Ve>>26}this.length=Ce.length;if(ze!==0){this.words[this.length]=ze;this.length++}else if(Ce!==this){for(;Veke.length)return this.clone().iadd(ke);return ke.clone().iadd(this)};BN.prototype.isub=function isub(ke){if(ke.negative!==0){ke.negative=0;var Ae=this.iadd(ke);ke.negative=1;return Ae._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(ke);this.negative=1;return this._normSign()}var Ce=this.cmp(ke);if(Ce===0){this.negative=0;this.length=1;this.words[0]=0;return this}var qe,ze;if(Ce>0){qe=this;ze=ke}else{qe=ke;ze=this}var Ve=0;for(var tt=0;tt>26;this.words[tt]=Ae&67108863}for(;Ve!==0&&tt>26;this.words[tt]=Ae&67108863}if(Ve===0&&tt>>26;var ct=it&67108863;var ht=Math.min(nt,Ae.length-1);for(var ft=Math.max(0,nt-ke.length+1);ft<=ht;ft++){var yt=nt-ft|0;ze=ke.words[yt]|0;Ve=Ae.words[ft]|0;tt=ze*Ve+ct;ot+=tt/67108864|0;ct=tt&67108863}Ce.words[nt]=ct|0;it=ot|0}if(it!==0){Ce.words[nt]=it|0}else{Ce.length--}return Ce.strip()}var rt=function comb10MulTo(ke,Ae,Ce){var qe=ke.words;var ze=Ae.words;var Ve=Ce.words;var tt=0;var rt;var it;var nt;var ot=qe[0]|0;var ct=ot&8191;var ht=ot>>>13;var ft=qe[1]|0;var yt=ft&8191;var mt=ft>>>13;var kt=qe[2]|0;var St=kt&8191;var Et=kt>>>13;var Pt=qe[3]|0;var Dt=Pt&8191;var Rt=Pt>>>13;var Bt=qe[4]|0;var Tt=Bt&8191;var Ut=Bt>>>13;var Kt=qe[5]|0;var It=Kt&8191;var Ot=Kt>>>13;var Nt=qe[6]|0;var qt=Nt&8191;var zt=Nt>>>13;var Ft=qe[7]|0;var Lt=Ft&8191;var Ht=Ft>>>13;var Gt=qe[8]|0;var $t=Gt&8191;var Vt=Gt>>>13;var Zt=qe[9]|0;var Yt=Zt&8191;var Jt=Zt>>>13;var Xt=ze[0]|0;var Qt=Xt&8191;var er=Xt>>>13;var tr=ze[1]|0;var rr=tr&8191;var ir=tr>>>13;var nr=ze[2]|0;var sr=nr&8191;var vr=nr>>>13;var _r=ze[3]|0;var kr=_r&8191;var Ar=_r>>>13;var Sr=ze[4]|0;var Er=Sr&8191;var xr=Sr>>>13;var Dr=ze[5]|0;var Rr=Dr&8191;var Br=Dr>>>13;var Ur=ze[6]|0;var Ir=Ur&8191;var Lr=Ur>>>13;var Gr=ze[7]|0;var $r=Gr&8191;var Vr=Gr>>>13;var Jr=ze[8]|0;var Qr=Jr&8191;var ti=Jr>>>13;var ri=ze[9]|0;var si=ri&8191;var ai=ri>>>13;Ce.negative=ke.negative^Ae.negative;Ce.length=19;rt=Math.imul(ct,Qt);it=Math.imul(ct,er);it=it+Math.imul(ht,Qt)|0;nt=Math.imul(ht,er);var ui=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(ui>>>26)|0;ui&=67108863;rt=Math.imul(yt,Qt);it=Math.imul(yt,er);it=it+Math.imul(mt,Qt)|0;nt=Math.imul(mt,er);rt=rt+Math.imul(ct,rr)|0;it=it+Math.imul(ct,ir)|0;it=it+Math.imul(ht,rr)|0;nt=nt+Math.imul(ht,ir)|0;var hi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(hi>>>26)|0;hi&=67108863;rt=Math.imul(St,Qt);it=Math.imul(St,er);it=it+Math.imul(Et,Qt)|0;nt=Math.imul(Et,er);rt=rt+Math.imul(yt,rr)|0;it=it+Math.imul(yt,ir)|0;it=it+Math.imul(mt,rr)|0;nt=nt+Math.imul(mt,ir)|0;rt=rt+Math.imul(ct,sr)|0;it=it+Math.imul(ct,vr)|0;it=it+Math.imul(ht,sr)|0;nt=nt+Math.imul(ht,vr)|0;var pi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(pi>>>26)|0;pi&=67108863;rt=Math.imul(Dt,Qt);it=Math.imul(Dt,er);it=it+Math.imul(Rt,Qt)|0;nt=Math.imul(Rt,er);rt=rt+Math.imul(St,rr)|0;it=it+Math.imul(St,ir)|0;it=it+Math.imul(Et,rr)|0;nt=nt+Math.imul(Et,ir)|0;rt=rt+Math.imul(yt,sr)|0;it=it+Math.imul(yt,vr)|0;it=it+Math.imul(mt,sr)|0;nt=nt+Math.imul(mt,vr)|0;rt=rt+Math.imul(ct,kr)|0;it=it+Math.imul(ct,Ar)|0;it=it+Math.imul(ht,kr)|0;nt=nt+Math.imul(ht,Ar)|0;var yi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(yi>>>26)|0;yi&=67108863;rt=Math.imul(Tt,Qt);it=Math.imul(Tt,er);it=it+Math.imul(Ut,Qt)|0;nt=Math.imul(Ut,er);rt=rt+Math.imul(Dt,rr)|0;it=it+Math.imul(Dt,ir)|0;it=it+Math.imul(Rt,rr)|0;nt=nt+Math.imul(Rt,ir)|0;rt=rt+Math.imul(St,sr)|0;it=it+Math.imul(St,vr)|0;it=it+Math.imul(Et,sr)|0;nt=nt+Math.imul(Et,vr)|0;rt=rt+Math.imul(yt,kr)|0;it=it+Math.imul(yt,Ar)|0;it=it+Math.imul(mt,kr)|0;nt=nt+Math.imul(mt,Ar)|0;rt=rt+Math.imul(ct,Er)|0;it=it+Math.imul(ct,xr)|0;it=it+Math.imul(ht,Er)|0;nt=nt+Math.imul(ht,xr)|0;var mi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(mi>>>26)|0;mi&=67108863;rt=Math.imul(It,Qt);it=Math.imul(It,er);it=it+Math.imul(Ot,Qt)|0;nt=Math.imul(Ot,er);rt=rt+Math.imul(Tt,rr)|0;it=it+Math.imul(Tt,ir)|0;it=it+Math.imul(Ut,rr)|0;nt=nt+Math.imul(Ut,ir)|0;rt=rt+Math.imul(Dt,sr)|0;it=it+Math.imul(Dt,vr)|0;it=it+Math.imul(Rt,sr)|0;nt=nt+Math.imul(Rt,vr)|0;rt=rt+Math.imul(St,kr)|0;it=it+Math.imul(St,Ar)|0;it=it+Math.imul(Et,kr)|0;nt=nt+Math.imul(Et,Ar)|0;rt=rt+Math.imul(yt,Er)|0;it=it+Math.imul(yt,xr)|0;it=it+Math.imul(mt,Er)|0;nt=nt+Math.imul(mt,xr)|0;rt=rt+Math.imul(ct,Rr)|0;it=it+Math.imul(ct,Br)|0;it=it+Math.imul(ht,Rr)|0;nt=nt+Math.imul(ht,Br)|0;var gi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(gi>>>26)|0;gi&=67108863;rt=Math.imul(qt,Qt);it=Math.imul(qt,er);it=it+Math.imul(zt,Qt)|0;nt=Math.imul(zt,er);rt=rt+Math.imul(It,rr)|0;it=it+Math.imul(It,ir)|0;it=it+Math.imul(Ot,rr)|0;nt=nt+Math.imul(Ot,ir)|0;rt=rt+Math.imul(Tt,sr)|0;it=it+Math.imul(Tt,vr)|0;it=it+Math.imul(Ut,sr)|0;nt=nt+Math.imul(Ut,vr)|0;rt=rt+Math.imul(Dt,kr)|0;it=it+Math.imul(Dt,Ar)|0;it=it+Math.imul(Rt,kr)|0;nt=nt+Math.imul(Rt,Ar)|0;rt=rt+Math.imul(St,Er)|0;it=it+Math.imul(St,xr)|0;it=it+Math.imul(Et,Er)|0;nt=nt+Math.imul(Et,xr)|0;rt=rt+Math.imul(yt,Rr)|0;it=it+Math.imul(yt,Br)|0;it=it+Math.imul(mt,Rr)|0;nt=nt+Math.imul(mt,Br)|0;rt=rt+Math.imul(ct,Ir)|0;it=it+Math.imul(ct,Lr)|0;it=it+Math.imul(ht,Ir)|0;nt=nt+Math.imul(ht,Lr)|0;var bi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(bi>>>26)|0;bi&=67108863;rt=Math.imul(Lt,Qt);it=Math.imul(Lt,er);it=it+Math.imul(Ht,Qt)|0;nt=Math.imul(Ht,er);rt=rt+Math.imul(qt,rr)|0;it=it+Math.imul(qt,ir)|0;it=it+Math.imul(zt,rr)|0;nt=nt+Math.imul(zt,ir)|0;rt=rt+Math.imul(It,sr)|0;it=it+Math.imul(It,vr)|0;it=it+Math.imul(Ot,sr)|0;nt=nt+Math.imul(Ot,vr)|0;rt=rt+Math.imul(Tt,kr)|0;it=it+Math.imul(Tt,Ar)|0;it=it+Math.imul(Ut,kr)|0;nt=nt+Math.imul(Ut,Ar)|0;rt=rt+Math.imul(Dt,Er)|0;it=it+Math.imul(Dt,xr)|0;it=it+Math.imul(Rt,Er)|0;nt=nt+Math.imul(Rt,xr)|0;rt=rt+Math.imul(St,Rr)|0;it=it+Math.imul(St,Br)|0;it=it+Math.imul(Et,Rr)|0;nt=nt+Math.imul(Et,Br)|0;rt=rt+Math.imul(yt,Ir)|0;it=it+Math.imul(yt,Lr)|0;it=it+Math.imul(mt,Ir)|0;nt=nt+Math.imul(mt,Lr)|0;rt=rt+Math.imul(ct,$r)|0;it=it+Math.imul(ct,Vr)|0;it=it+Math.imul(ht,$r)|0;nt=nt+Math.imul(ht,Vr)|0;var vi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(vi>>>26)|0;vi&=67108863;rt=Math.imul($t,Qt);it=Math.imul($t,er);it=it+Math.imul(Vt,Qt)|0;nt=Math.imul(Vt,er);rt=rt+Math.imul(Lt,rr)|0;it=it+Math.imul(Lt,ir)|0;it=it+Math.imul(Ht,rr)|0;nt=nt+Math.imul(Ht,ir)|0;rt=rt+Math.imul(qt,sr)|0;it=it+Math.imul(qt,vr)|0;it=it+Math.imul(zt,sr)|0;nt=nt+Math.imul(zt,vr)|0;rt=rt+Math.imul(It,kr)|0;it=it+Math.imul(It,Ar)|0;it=it+Math.imul(Ot,kr)|0;nt=nt+Math.imul(Ot,Ar)|0;rt=rt+Math.imul(Tt,Er)|0;it=it+Math.imul(Tt,xr)|0;it=it+Math.imul(Ut,Er)|0;nt=nt+Math.imul(Ut,xr)|0;rt=rt+Math.imul(Dt,Rr)|0;it=it+Math.imul(Dt,Br)|0;it=it+Math.imul(Rt,Rr)|0;nt=nt+Math.imul(Rt,Br)|0;rt=rt+Math.imul(St,Ir)|0;it=it+Math.imul(St,Lr)|0;it=it+Math.imul(Et,Ir)|0;nt=nt+Math.imul(Et,Lr)|0;rt=rt+Math.imul(yt,$r)|0;it=it+Math.imul(yt,Vr)|0;it=it+Math.imul(mt,$r)|0;nt=nt+Math.imul(mt,Vr)|0;rt=rt+Math.imul(ct,Qr)|0;it=it+Math.imul(ct,ti)|0;it=it+Math.imul(ht,Qr)|0;nt=nt+Math.imul(ht,ti)|0;var wi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(wi>>>26)|0;wi&=67108863;rt=Math.imul(Yt,Qt);it=Math.imul(Yt,er);it=it+Math.imul(Jt,Qt)|0;nt=Math.imul(Jt,er);rt=rt+Math.imul($t,rr)|0;it=it+Math.imul($t,ir)|0;it=it+Math.imul(Vt,rr)|0;nt=nt+Math.imul(Vt,ir)|0;rt=rt+Math.imul(Lt,sr)|0;it=it+Math.imul(Lt,vr)|0;it=it+Math.imul(Ht,sr)|0;nt=nt+Math.imul(Ht,vr)|0;rt=rt+Math.imul(qt,kr)|0;it=it+Math.imul(qt,Ar)|0;it=it+Math.imul(zt,kr)|0;nt=nt+Math.imul(zt,Ar)|0;rt=rt+Math.imul(It,Er)|0;it=it+Math.imul(It,xr)|0;it=it+Math.imul(Ot,Er)|0;nt=nt+Math.imul(Ot,xr)|0;rt=rt+Math.imul(Tt,Rr)|0;it=it+Math.imul(Tt,Br)|0;it=it+Math.imul(Ut,Rr)|0;nt=nt+Math.imul(Ut,Br)|0;rt=rt+Math.imul(Dt,Ir)|0;it=it+Math.imul(Dt,Lr)|0;it=it+Math.imul(Rt,Ir)|0;nt=nt+Math.imul(Rt,Lr)|0;rt=rt+Math.imul(St,$r)|0;it=it+Math.imul(St,Vr)|0;it=it+Math.imul(Et,$r)|0;nt=nt+Math.imul(Et,Vr)|0;rt=rt+Math.imul(yt,Qr)|0;it=it+Math.imul(yt,ti)|0;it=it+Math.imul(mt,Qr)|0;nt=nt+Math.imul(mt,ti)|0;rt=rt+Math.imul(ct,si)|0;it=it+Math.imul(ct,ai)|0;it=it+Math.imul(ht,si)|0;nt=nt+Math.imul(ht,ai)|0;var _i=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(_i>>>26)|0;_i&=67108863;rt=Math.imul(Yt,rr);it=Math.imul(Yt,ir);it=it+Math.imul(Jt,rr)|0;nt=Math.imul(Jt,ir);rt=rt+Math.imul($t,sr)|0;it=it+Math.imul($t,vr)|0;it=it+Math.imul(Vt,sr)|0;nt=nt+Math.imul(Vt,vr)|0;rt=rt+Math.imul(Lt,kr)|0;it=it+Math.imul(Lt,Ar)|0;it=it+Math.imul(Ht,kr)|0;nt=nt+Math.imul(Ht,Ar)|0;rt=rt+Math.imul(qt,Er)|0;it=it+Math.imul(qt,xr)|0;it=it+Math.imul(zt,Er)|0;nt=nt+Math.imul(zt,xr)|0;rt=rt+Math.imul(It,Rr)|0;it=it+Math.imul(It,Br)|0;it=it+Math.imul(Ot,Rr)|0;nt=nt+Math.imul(Ot,Br)|0;rt=rt+Math.imul(Tt,Ir)|0;it=it+Math.imul(Tt,Lr)|0;it=it+Math.imul(Ut,Ir)|0;nt=nt+Math.imul(Ut,Lr)|0;rt=rt+Math.imul(Dt,$r)|0;it=it+Math.imul(Dt,Vr)|0;it=it+Math.imul(Rt,$r)|0;nt=nt+Math.imul(Rt,Vr)|0;rt=rt+Math.imul(St,Qr)|0;it=it+Math.imul(St,ti)|0;it=it+Math.imul(Et,Qr)|0;nt=nt+Math.imul(Et,ti)|0;rt=rt+Math.imul(yt,si)|0;it=it+Math.imul(yt,ai)|0;it=it+Math.imul(mt,si)|0;nt=nt+Math.imul(mt,ai)|0;var Bi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Bi>>>26)|0;Bi&=67108863;rt=Math.imul(Yt,sr);it=Math.imul(Yt,vr);it=it+Math.imul(Jt,sr)|0;nt=Math.imul(Jt,vr);rt=rt+Math.imul($t,kr)|0;it=it+Math.imul($t,Ar)|0;it=it+Math.imul(Vt,kr)|0;nt=nt+Math.imul(Vt,Ar)|0;rt=rt+Math.imul(Lt,Er)|0;it=it+Math.imul(Lt,xr)|0;it=it+Math.imul(Ht,Er)|0;nt=nt+Math.imul(Ht,xr)|0;rt=rt+Math.imul(qt,Rr)|0;it=it+Math.imul(qt,Br)|0;it=it+Math.imul(zt,Rr)|0;nt=nt+Math.imul(zt,Br)|0;rt=rt+Math.imul(It,Ir)|0;it=it+Math.imul(It,Lr)|0;it=it+Math.imul(Ot,Ir)|0;nt=nt+Math.imul(Ot,Lr)|0;rt=rt+Math.imul(Tt,$r)|0;it=it+Math.imul(Tt,Vr)|0;it=it+Math.imul(Ut,$r)|0;nt=nt+Math.imul(Ut,Vr)|0;rt=rt+Math.imul(Dt,Qr)|0;it=it+Math.imul(Dt,ti)|0;it=it+Math.imul(Rt,Qr)|0;nt=nt+Math.imul(Rt,ti)|0;rt=rt+Math.imul(St,si)|0;it=it+Math.imul(St,ai)|0;it=it+Math.imul(Et,si)|0;nt=nt+Math.imul(Et,ai)|0;var Ti=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Ti>>>26)|0;Ti&=67108863;rt=Math.imul(Yt,kr);it=Math.imul(Yt,Ar);it=it+Math.imul(Jt,kr)|0;nt=Math.imul(Jt,Ar);rt=rt+Math.imul($t,Er)|0;it=it+Math.imul($t,xr)|0;it=it+Math.imul(Vt,Er)|0;nt=nt+Math.imul(Vt,xr)|0;rt=rt+Math.imul(Lt,Rr)|0;it=it+Math.imul(Lt,Br)|0;it=it+Math.imul(Ht,Rr)|0;nt=nt+Math.imul(Ht,Br)|0;rt=rt+Math.imul(qt,Ir)|0;it=it+Math.imul(qt,Lr)|0;it=it+Math.imul(zt,Ir)|0;nt=nt+Math.imul(zt,Lr)|0;rt=rt+Math.imul(It,$r)|0;it=it+Math.imul(It,Vr)|0;it=it+Math.imul(Ot,$r)|0;nt=nt+Math.imul(Ot,Vr)|0;rt=rt+Math.imul(Tt,Qr)|0;it=it+Math.imul(Tt,ti)|0;it=it+Math.imul(Ut,Qr)|0;nt=nt+Math.imul(Ut,ti)|0;rt=rt+Math.imul(Dt,si)|0;it=it+Math.imul(Dt,ai)|0;it=it+Math.imul(Rt,si)|0;nt=nt+Math.imul(Rt,ai)|0;var Oi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Oi>>>26)|0;Oi&=67108863;rt=Math.imul(Yt,Er);it=Math.imul(Yt,xr);it=it+Math.imul(Jt,Er)|0;nt=Math.imul(Jt,xr);rt=rt+Math.imul($t,Rr)|0;it=it+Math.imul($t,Br)|0;it=it+Math.imul(Vt,Rr)|0;nt=nt+Math.imul(Vt,Br)|0;rt=rt+Math.imul(Lt,Ir)|0;it=it+Math.imul(Lt,Lr)|0;it=it+Math.imul(Ht,Ir)|0;nt=nt+Math.imul(Ht,Lr)|0;rt=rt+Math.imul(qt,$r)|0;it=it+Math.imul(qt,Vr)|0;it=it+Math.imul(zt,$r)|0;nt=nt+Math.imul(zt,Vr)|0;rt=rt+Math.imul(It,Qr)|0;it=it+Math.imul(It,ti)|0;it=it+Math.imul(Ot,Qr)|0;nt=nt+Math.imul(Ot,ti)|0;rt=rt+Math.imul(Tt,si)|0;it=it+Math.imul(Tt,ai)|0;it=it+Math.imul(Ut,si)|0;nt=nt+Math.imul(Ut,ai)|0;var qi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(qi>>>26)|0;qi&=67108863;rt=Math.imul(Yt,Rr);it=Math.imul(Yt,Br);it=it+Math.imul(Jt,Rr)|0;nt=Math.imul(Jt,Br);rt=rt+Math.imul($t,Ir)|0;it=it+Math.imul($t,Lr)|0;it=it+Math.imul(Vt,Ir)|0;nt=nt+Math.imul(Vt,Lr)|0;rt=rt+Math.imul(Lt,$r)|0;it=it+Math.imul(Lt,Vr)|0;it=it+Math.imul(Ht,$r)|0;nt=nt+Math.imul(Ht,Vr)|0;rt=rt+Math.imul(qt,Qr)|0;it=it+Math.imul(qt,ti)|0;it=it+Math.imul(zt,Qr)|0;nt=nt+Math.imul(zt,ti)|0;rt=rt+Math.imul(It,si)|0;it=it+Math.imul(It,ai)|0;it=it+Math.imul(Ot,si)|0;nt=nt+Math.imul(Ot,ai)|0;var zi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(zi>>>26)|0;zi&=67108863;rt=Math.imul(Yt,Ir);it=Math.imul(Yt,Lr);it=it+Math.imul(Jt,Ir)|0;nt=Math.imul(Jt,Lr);rt=rt+Math.imul($t,$r)|0;it=it+Math.imul($t,Vr)|0;it=it+Math.imul(Vt,$r)|0;nt=nt+Math.imul(Vt,Vr)|0;rt=rt+Math.imul(Lt,Qr)|0;it=it+Math.imul(Lt,ti)|0;it=it+Math.imul(Ht,Qr)|0;nt=nt+Math.imul(Ht,ti)|0;rt=rt+Math.imul(qt,si)|0;it=it+Math.imul(qt,ai)|0;it=it+Math.imul(zt,si)|0;nt=nt+Math.imul(zt,ai)|0;var Fi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Fi>>>26)|0;Fi&=67108863;rt=Math.imul(Yt,$r);it=Math.imul(Yt,Vr);it=it+Math.imul(Jt,$r)|0;nt=Math.imul(Jt,Vr);rt=rt+Math.imul($t,Qr)|0;it=it+Math.imul($t,ti)|0;it=it+Math.imul(Vt,Qr)|0;nt=nt+Math.imul(Vt,ti)|0;rt=rt+Math.imul(Lt,si)|0;it=it+Math.imul(Lt,ai)|0;it=it+Math.imul(Ht,si)|0;nt=nt+Math.imul(Ht,ai)|0;var Gi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Gi>>>26)|0;Gi&=67108863;rt=Math.imul(Yt,Qr);it=Math.imul(Yt,ti);it=it+Math.imul(Jt,Qr)|0;nt=Math.imul(Jt,ti);rt=rt+Math.imul($t,si)|0;it=it+Math.imul($t,ai)|0;it=it+Math.imul(Vt,si)|0;nt=nt+Math.imul(Vt,ai)|0;var Vi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Vi>>>26)|0;Vi&=67108863;rt=Math.imul(Yt,si);it=Math.imul(Yt,ai);it=it+Math.imul(Jt,si)|0;nt=Math.imul(Jt,ai);var Yi=(tt+rt|0)+((it&8191)<<13)|0;tt=(nt+(it>>>13)|0)+(Yi>>>26)|0;Yi&=67108863;Ve[0]=ui;Ve[1]=hi;Ve[2]=pi;Ve[3]=yi;Ve[4]=mi;Ve[5]=gi;Ve[6]=bi;Ve[7]=vi;Ve[8]=wi;Ve[9]=_i;Ve[10]=Bi;Ve[11]=Ti;Ve[12]=Oi;Ve[13]=qi;Ve[14]=zi;Ve[15]=Fi;Ve[16]=Gi;Ve[17]=Vi;Ve[18]=Yi;if(tt!==0){Ve[19]=tt;Ce.length++}return Ce};if(!Math.imul){rt=smallMulTo}function bigMulTo(ke,Ae,Ce){Ce.negative=Ae.negative^ke.negative;Ce.length=ke.length+Ae.length;var qe=0;var ze=0;for(var Ve=0;Ve>>26)|0;ze+=tt>>>26;tt&=67108863}Ce.words[Ve]=rt;qe=tt;tt=ze}if(qe!==0){Ce.words[Ve]=qe}else{Ce.length--}return Ce.strip()}function jumboMulTo(ke,Ae,Ce){var qe=new FFTM;return qe.mulp(ke,Ae,Ce)}BN.prototype.mulTo=function mulTo(ke,Ae){var Ce;var qe=this.length+ke.length;if(this.length===10&&ke.length===10){Ce=rt(this,ke,Ae)}else if(qe<63){Ce=smallMulTo(this,ke,Ae)}else if(qe<1024){Ce=bigMulTo(this,ke,Ae)}else{Ce=jumboMulTo(this,ke,Ae)}return Ce};function FFTM(ke,Ae){this.x=ke;this.y=Ae}FFTM.prototype.makeRBT=function makeRBT(ke){var Ae=new Array(ke);var Ce=BN.prototype._countBits(ke)-1;for(var qe=0;qe>=1}return qe};FFTM.prototype.permute=function permute(ke,Ae,Ce,qe,ze,Ve){for(var tt=0;tt>>1){ze++}return 1<>>13;Ce[2*Ve+1]=ze&8191;ze=ze>>>13}for(Ve=2*Ae;Ve>=26;Ae+=qe/67108864|0;Ae+=ze>>>26;this.words[Ce]=ze&67108863}if(Ae!==0){this.words[Ce]=Ae;this.length++}return this};BN.prototype.muln=function muln(ke){return this.clone().imuln(ke)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(ke){var Ae=toBitArray(ke);if(Ae.length===0)return new BN(1);var Ce=this;for(var qe=0;qe=0);var Ae=ke%26;var Ce=(ke-Ae)/26;var qe=67108863>>>26-Ae<<26-Ae;var ze;if(Ae!==0){var Ve=0;for(ze=0;ze>>26-Ae}if(Ve){this.words[ze]=Ve;this.length++}}if(Ce!==0){for(ze=this.length-1;ze>=0;ze--){this.words[ze+Ce]=this.words[ze]}for(ze=0;ze=0);var qe;if(Ae){qe=(Ae-Ae%26)/26}else{qe=0}var ze=ke%26;var Ve=Math.min((ke-ze)/26,this.length);var tt=67108863^67108863>>>ze<Ve){this.length-=Ve;for(it=0;it=0&&(nt!==0||it>=qe);it--){var ot=this.words[it]|0;this.words[it]=nt<<26-ze|ot>>>ze;nt=ot&tt}if(rt&&nt!==0){rt.words[rt.length++]=nt}if(this.length===0){this.words[0]=0;this.length=1}return this.strip()};BN.prototype.ishrn=function ishrn(ke,Ae,Ce){assert(this.negative===0);return this.iushrn(ke,Ae,Ce)};BN.prototype.shln=function shln(ke){return this.clone().ishln(ke)};BN.prototype.ushln=function ushln(ke){return this.clone().iushln(ke)};BN.prototype.shrn=function shrn(ke){return this.clone().ishrn(ke)};BN.prototype.ushrn=function ushrn(ke){return this.clone().iushrn(ke)};BN.prototype.testn=function testn(ke){assert(typeof ke==="number"&&ke>=0);var Ae=ke%26;var Ce=(ke-Ae)/26;var qe=1<=0);var Ae=ke%26;var Ce=(ke-Ae)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=Ce){return this}if(Ae!==0){Ce++}this.length=Math.min(Ce,this.length);if(Ae!==0){var qe=67108863^67108863>>>Ae<=67108864;Ae++){this.words[Ae]-=67108864;if(Ae===this.length-1){this.words[Ae+1]=1}else{this.words[Ae+1]++}}this.length=Math.max(this.length,Ae+1);return this};BN.prototype.isubn=function isubn(ke){assert(typeof ke==="number");assert(ke<67108864);if(ke<0)return this.iaddn(-ke);if(this.negative!==0){this.negative=0;this.iaddn(ke);this.negative=1;return this}this.words[0]-=ke;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var Ae=0;Ae>26)-(rt/67108864|0);this.words[ze+Ce]=Ve&67108863}for(;ze>26;this.words[ze+Ce]=Ve&67108863}if(tt===0)return this.strip();assert(tt===-1);tt=0;for(ze=0;ze>26;this.words[ze]=Ve&67108863}this.negative=1;return this.strip()};BN.prototype._wordDiv=function _wordDiv(ke,Ae){var Ce=this.length-ke.length;var qe=this.clone();var ze=ke;var Ve=ze.words[ze.length-1]|0;var tt=this._countBits(Ve);Ce=26-tt;if(Ce!==0){ze=ze.ushln(Ce);qe.iushln(Ce);Ve=ze.words[ze.length-1]|0}var rt=qe.length-ze.length;var it;if(Ae!=="mod"){it=new BN(null);it.length=rt+1;it.words=new Array(it.length);for(var nt=0;nt=0;ct--){var ht=(qe.words[ze.length+ct]|0)*67108864+(qe.words[ze.length+ct-1]|0);ht=Math.min(ht/Ve|0,67108863);qe._ishlnsubmul(ze,ht,ct);while(qe.negative!==0){ht--;qe.negative=0;qe._ishlnsubmul(ze,1,ct);if(!qe.isZero()){qe.negative^=1}}if(it){it.words[ct]=ht}}if(it){it.strip()}qe.strip();if(Ae!=="div"&&Ce!==0){qe.iushrn(Ce)}return{div:it||null,mod:qe}};BN.prototype.divmod=function divmod(ke,Ae,Ce){assert(!ke.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var qe,ze,Ve;if(this.negative!==0&&ke.negative===0){Ve=this.neg().divmod(ke,Ae);if(Ae!=="mod"){qe=Ve.div.neg()}if(Ae!=="div"){ze=Ve.mod.neg();if(Ce&&ze.negative!==0){ze.iadd(ke)}}return{div:qe,mod:ze}}if(this.negative===0&&ke.negative!==0){Ve=this.divmod(ke.neg(),Ae);if(Ae!=="mod"){qe=Ve.div.neg()}return{div:qe,mod:Ve.mod}}if((this.negative&ke.negative)!==0){Ve=this.neg().divmod(ke.neg(),Ae);if(Ae!=="div"){ze=Ve.mod.neg();if(Ce&&ze.negative!==0){ze.isub(ke)}}return{div:Ve.div,mod:ze}}if(ke.length>this.length||this.cmp(ke)<0){return{div:new BN(0),mod:this}}if(ke.length===1){if(Ae==="div"){return{div:this.divn(ke.words[0]),mod:null}}if(Ae==="mod"){return{div:null,mod:new BN(this.modn(ke.words[0]))}}return{div:this.divn(ke.words[0]),mod:new BN(this.modn(ke.words[0]))}}return this._wordDiv(ke,Ae)};BN.prototype.div=function div(ke){return this.divmod(ke,"div",false).div};BN.prototype.mod=function mod(ke){return this.divmod(ke,"mod",false).mod};BN.prototype.umod=function umod(ke){return this.divmod(ke,"mod",true).mod};BN.prototype.divRound=function divRound(ke){var Ae=this.divmod(ke);if(Ae.mod.isZero())return Ae.div;var Ce=Ae.div.negative!==0?Ae.mod.isub(ke):Ae.mod;var qe=ke.ushrn(1);var ze=ke.andln(1);var Ve=Ce.cmp(qe);if(Ve<0||ze===1&&Ve===0)return Ae.div;return Ae.div.negative!==0?Ae.div.isubn(1):Ae.div.iaddn(1)};BN.prototype.modn=function modn(ke){assert(ke<=67108863);var Ae=(1<<26)%ke;var Ce=0;for(var qe=this.length-1;qe>=0;qe--){Ce=(Ae*Ce+(this.words[qe]|0))%ke}return Ce};BN.prototype.idivn=function idivn(ke){assert(ke<=67108863);var Ae=0;for(var Ce=this.length-1;Ce>=0;Ce--){var qe=(this.words[Ce]|0)+Ae*67108864;this.words[Ce]=qe/ke|0;Ae=qe%ke}return this.strip()};BN.prototype.divn=function divn(ke){return this.clone().idivn(ke)};BN.prototype.egcd=function egcd(ke){assert(ke.negative===0);assert(!ke.isZero());var Ae=this;var Ce=ke.clone();if(Ae.negative!==0){Ae=Ae.umod(ke)}else{Ae=Ae.clone()}var qe=new BN(1);var ze=new BN(0);var Ve=new BN(0);var tt=new BN(1);var rt=0;while(Ae.isEven()&&Ce.isEven()){Ae.iushrn(1);Ce.iushrn(1);++rt}var it=Ce.clone();var nt=Ae.clone();while(!Ae.isZero()){for(var ot=0,ct=1;(Ae.words[0]&ct)===0&&ot<26;++ot,ct<<=1);if(ot>0){Ae.iushrn(ot);while(ot-- >0){if(qe.isOdd()||ze.isOdd()){qe.iadd(it);ze.isub(nt)}qe.iushrn(1);ze.iushrn(1)}}for(var ht=0,ft=1;(Ce.words[0]&ft)===0&&ht<26;++ht,ft<<=1);if(ht>0){Ce.iushrn(ht);while(ht-- >0){if(Ve.isOdd()||tt.isOdd()){Ve.iadd(it);tt.isub(nt)}Ve.iushrn(1);tt.iushrn(1)}}if(Ae.cmp(Ce)>=0){Ae.isub(Ce);qe.isub(Ve);ze.isub(tt)}else{Ce.isub(Ae);Ve.isub(qe);tt.isub(ze)}}return{a:Ve,b:tt,gcd:Ce.iushln(rt)}};BN.prototype._invmp=function _invmp(ke){assert(ke.negative===0);assert(!ke.isZero());var Ae=this;var Ce=ke.clone();if(Ae.negative!==0){Ae=Ae.umod(ke)}else{Ae=Ae.clone()}var qe=new BN(1);var ze=new BN(0);var Ve=Ce.clone();while(Ae.cmpn(1)>0&&Ce.cmpn(1)>0){for(var tt=0,rt=1;(Ae.words[0]&rt)===0&&tt<26;++tt,rt<<=1);if(tt>0){Ae.iushrn(tt);while(tt-- >0){if(qe.isOdd()){qe.iadd(Ve)}qe.iushrn(1)}}for(var it=0,nt=1;(Ce.words[0]&nt)===0&&it<26;++it,nt<<=1);if(it>0){Ce.iushrn(it);while(it-- >0){if(ze.isOdd()){ze.iadd(Ve)}ze.iushrn(1)}}if(Ae.cmp(Ce)>=0){Ae.isub(Ce);qe.isub(ze)}else{Ce.isub(Ae);ze.isub(qe)}}var ot;if(Ae.cmpn(1)===0){ot=qe}else{ot=ze}if(ot.cmpn(0)<0){ot.iadd(ke)}return ot};BN.prototype.gcd=function gcd(ke){if(this.isZero())return ke.abs();if(ke.isZero())return this.abs();var Ae=this.clone();var Ce=ke.clone();Ae.negative=0;Ce.negative=0;for(var qe=0;Ae.isEven()&&Ce.isEven();qe++){Ae.iushrn(1);Ce.iushrn(1)}do{while(Ae.isEven()){Ae.iushrn(1)}while(Ce.isEven()){Ce.iushrn(1)}var ze=Ae.cmp(Ce);if(ze<0){var Ve=Ae;Ae=Ce;Ce=Ve}else if(ze===0||Ce.cmpn(1)===0){break}Ae.isub(Ce)}while(true);return Ce.iushln(qe)};BN.prototype.invm=function invm(ke){return this.egcd(ke).a.umod(ke)};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1};BN.prototype.andln=function andln(ke){return this.words[0]&ke};BN.prototype.bincn=function bincn(ke){assert(typeof ke==="number");var Ae=ke%26;var Ce=(ke-Ae)/26;var qe=1<>>26;tt&=67108863;this.words[Ve]=tt}if(ze!==0){this.words[Ve]=ze;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(ke){var Ae=ke<0;if(this.negative!==0&&!Ae)return-1;if(this.negative===0&&Ae)return 1;this.strip();var Ce;if(this.length>1){Ce=1}else{if(Ae){ke=-ke}assert(ke<=67108863,"Number is too big");var qe=this.words[0]|0;Ce=qe===ke?0:qeke.length)return 1;if(this.length=0;Ce--){var qe=this.words[Ce]|0;var ze=ke.words[Ce]|0;if(qe===ze)continue;if(qeze){Ae=1}break}return Ae};BN.prototype.gtn=function gtn(ke){return this.cmpn(ke)===1};BN.prototype.gt=function gt(ke){return this.cmp(ke)===1};BN.prototype.gten=function gten(ke){return this.cmpn(ke)>=0};BN.prototype.gte=function gte(ke){return this.cmp(ke)>=0};BN.prototype.ltn=function ltn(ke){return this.cmpn(ke)===-1};BN.prototype.lt=function lt(ke){return this.cmp(ke)===-1};BN.prototype.lten=function lten(ke){return this.cmpn(ke)<=0};BN.prototype.lte=function lte(ke){return this.cmp(ke)<=0};BN.prototype.eqn=function eqn(ke){return this.cmpn(ke)===0};BN.prototype.eq=function eq(ke){return this.cmp(ke)===0};BN.red=function red(ke){return new Red(ke)};BN.prototype.toRed=function toRed(ke){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return ke.convertTo(this)._forceRed(ke)};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};BN.prototype._forceRed=function _forceRed(ke){this.red=ke;return this};BN.prototype.forceRed=function forceRed(ke){assert(!this.red,"Already a number in reduction context");return this._forceRed(ke)};BN.prototype.redAdd=function redAdd(ke){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,ke)};BN.prototype.redIAdd=function redIAdd(ke){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,ke)};BN.prototype.redSub=function redSub(ke){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,ke)};BN.prototype.redISub=function redISub(ke){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,ke)};BN.prototype.redShl=function redShl(ke){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,ke)};BN.prototype.redMul=function redMul(ke){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,ke);return this.red.mul(this,ke)};BN.prototype.redIMul=function redIMul(ke){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,ke);return this.red.imul(this,ke)};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};BN.prototype.redPow=function redPow(ke){assert(this.red&&!ke.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,ke)};var it={k256:null,p224:null,p192:null,p25519:null};function MPrime(ke,Ae){this.name=ke;this.p=new BN(Ae,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var ke=new BN(null);ke.words=new Array(Math.ceil(this.n/13));return ke};MPrime.prototype.ireduce=function ireduce(ke){var Ae=ke;var Ce;do{this.split(Ae,this.tmp);Ae=this.imulK(Ae);Ae=Ae.iadd(this.tmp);Ce=Ae.bitLength()}while(Ce>this.n);var qe=Ce0){Ae.isub(this.p)}else{if(Ae.strip!==undefined){Ae.strip()}else{Ae._strip()}}return Ae};MPrime.prototype.split=function split(ke,Ae){ke.iushrn(this.n,0,Ae)};MPrime.prototype.imulK=function imulK(ke){return ke.imul(this.k)};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=function split(ke,Ae){var Ce=4194303;var qe=Math.min(ke.length,9);for(var ze=0;ze>>22;Ve=tt}Ve>>>=22;ke.words[ze-10]=Ve;if(Ve===0&&ke.length>10){ke.length-=10}else{ke.length-=9}};K256.prototype.imulK=function imulK(ke){ke.words[ke.length]=0;ke.words[ke.length+1]=0;ke.length+=2;var Ae=0;for(var Ce=0;Ce>>=26;ke.words[Ce]=ze;Ae=qe}if(Ae!==0){ke.words[ke.length++]=Ae}return ke};BN._prime=function prime(ke){if(it[ke])return it[ke];var prime;if(ke==="k256"){prime=new K256}else if(ke==="p224"){prime=new P224}else if(ke==="p192"){prime=new P192}else if(ke==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+ke)}it[ke]=prime;return prime};function Red(ke){if(typeof ke==="string"){var Ae=BN._prime(ke);this.m=Ae.p;this.prime=Ae}else{assert(ke.gtn(1),"modulus must be greater than 1");this.m=ke;this.prime=null}}Red.prototype._verify1=function _verify1(ke){assert(ke.negative===0,"red works only with positives");assert(ke.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(ke,Ae){assert((ke.negative|Ae.negative)===0,"red works only with positives");assert(ke.red&&ke.red===Ae.red,"red works only with red numbers")};Red.prototype.imod=function imod(ke){if(this.prime)return this.prime.ireduce(ke)._forceRed(this);return ke.umod(this.m)._forceRed(this)};Red.prototype.neg=function neg(ke){if(ke.isZero()){return ke.clone()}return this.m.sub(ke)._forceRed(this)};Red.prototype.add=function add(ke,Ae){this._verify2(ke,Ae);var Ce=ke.add(Ae);if(Ce.cmp(this.m)>=0){Ce.isub(this.m)}return Ce._forceRed(this)};Red.prototype.iadd=function iadd(ke,Ae){this._verify2(ke,Ae);var Ce=ke.iadd(Ae);if(Ce.cmp(this.m)>=0){Ce.isub(this.m)}return Ce};Red.prototype.sub=function sub(ke,Ae){this._verify2(ke,Ae);var Ce=ke.sub(Ae);if(Ce.cmpn(0)<0){Ce.iadd(this.m)}return Ce._forceRed(this)};Red.prototype.isub=function isub(ke,Ae){this._verify2(ke,Ae);var Ce=ke.isub(Ae);if(Ce.cmpn(0)<0){Ce.iadd(this.m)}return Ce};Red.prototype.shl=function shl(ke,Ae){this._verify1(ke);return this.imod(ke.ushln(Ae))};Red.prototype.imul=function imul(ke,Ae){this._verify2(ke,Ae);return this.imod(ke.imul(Ae))};Red.prototype.mul=function mul(ke,Ae){this._verify2(ke,Ae);return this.imod(ke.mul(Ae))};Red.prototype.isqr=function isqr(ke){return this.imul(ke,ke.clone())};Red.prototype.sqr=function sqr(ke){return this.mul(ke,ke)};Red.prototype.sqrt=function sqrt(ke){if(ke.isZero())return ke.clone();var Ae=this.m.andln(3);assert(Ae%2===1);if(Ae===3){var Ce=this.m.add(new BN(1)).iushrn(2);return this.pow(ke,Ce)}var qe=this.m.subn(1);var ze=0;while(!qe.isZero()&&qe.andln(1)===0){ze++;qe.iushrn(1)}assert(!qe.isZero());var Ve=new BN(1).toRed(this);var tt=Ve.redNeg();var rt=this.m.subn(1).iushrn(1);var it=this.m.bitLength();it=new BN(2*it*it).toRed(this);while(this.pow(it,rt).cmp(tt)!==0){it.redIAdd(tt)}var nt=this.pow(it,qe);var ot=this.pow(ke,qe.addn(1).iushrn(1));var ct=this.pow(ke,qe);var ht=ze;while(ct.cmp(Ve)!==0){var ft=ct;for(var yt=0;ft.cmp(Ve)!==0;yt++){ft=ft.redSqr()}assert(yt=0;ze--){var nt=Ae.words[ze];for(var ot=it-1;ot>=0;ot--){var ct=nt>>ot&1;if(Ve!==qe[0]){Ve=this.sqr(Ve)}if(ct===0&&tt===0){rt=0;continue}tt<<=1;tt|=ct;rt++;if(rt!==Ce&&(ze!==0||ot!==0))continue;Ve=this.mul(Ve,qe[tt]);rt=0;tt=0}it=26}return Ve};Red.prototype.convertTo=function convertTo(ke){var Ae=ke.umod(this.m);return Ae===ke?Ae.clone():Ae};Red.prototype.convertFrom=function convertFrom(ke){var Ae=ke.clone();Ae.red=null;return Ae};BN.mont=function mont(ke){return new Mont(ke)};function Mont(ke){Red.call(this,ke);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26}this.r=new BN(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(ke){return this.imod(ke.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(ke){var Ae=this.imod(ke.mul(this.rinv));Ae.red=null;return Ae};Mont.prototype.imul=function imul(ke,Ae){if(ke.isZero()||Ae.isZero()){ke.words[0]=0;ke.length=1;return ke}var Ce=ke.imul(Ae);var qe=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var ze=Ce.isub(qe).iushrn(this.shift);var Ve=ze;if(ze.cmp(this.m)>=0){Ve=ze.isub(this.m)}else if(ze.cmpn(0)<0){Ve=ze.iadd(this.m)}return Ve._forceRed(this)};Mont.prototype.mul=function mul(ke,Ae){if(ke.isZero()||Ae.isZero())return new BN(0)._forceRed(this);var Ce=ke.mul(Ae);var qe=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var ze=Ce.isub(qe).iushrn(this.shift);var Ve=ze;if(ze.cmp(this.m)>=0){Ve=ze.isub(this.m)}else if(ze.cmpn(0)<0){Ve=ze.iadd(this.m)}return Ve._forceRed(this)};Mont.prototype.invm=function invm(ke){var Ae=this.imod(ke._invmp(this.m).mul(this.r2));return Ae._forceRed(this)}})(false||ke,this)},4124:(ke,Ae,Ce)=>{try{var qe=Ce(3837);if(typeof qe.inherits!=="function")throw"";ke.exports=qe.inherits}catch(Ae){ke.exports=Ce(8544)}},8544:ke=>{if(typeof Object.create==="function"){ke.exports=function inherits(ke,Ae){if(Ae){ke.super_=Ae;ke.prototype=Object.create(Ae.prototype,{constructor:{value:ke,enumerable:false,writable:true,configurable:true}})}}}else{ke.exports=function inherits(ke,Ae){if(Ae){ke.super_=Ae;var TempCtor=function(){};TempCtor.prototype=Ae.prototype;ke.prototype=new TempCtor;ke.prototype.constructor=ke}}}},910:ke=>{ke.exports=assert;function assert(ke,Ae){if(!ke)throw new Error(Ae||"Assertion failed")}assert.equal=function assertEqual(ke,Ae,Ce){if(ke!=Ae)throw new Error(Ce||"Assertion failed: "+ke+" != "+Ae)}},7946:(ke,Ae,Ce)=>{"use strict"; /*! OpenPGP.js v5.5.0 - 2022-08-31 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */const qe="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};Object.defineProperty(Ae,"__esModule",{value:!0});var ze=Ce(4300),Ve=Ce(2781),tt=Ce(6113),rt=Ce(9796),it=Ce(2037),nt=Ce(3837),ot=Ce(4293);function c(ke){return ke&&"object"==typeof ke&&"default"in ke?ke:{default:ke}}var ct=c(ze),ht=c(Ve),ft=c(tt),yt=c(rt),mt=c(it),kt=c(nt),St=c(ot);const Et=Symbol("doneWritingPromise"),Pt=Symbol("doneWritingResolve"),Dt=Symbol("doneWritingReject"),Rt=Symbol("readingIndex");class v extends Array{constructor(){super(),this[Et]=new Promise(((ke,Ae)=>{this[Pt]=ke,this[Dt]=Ae})),this[Et].catch((()=>{}))}}function _(ke){return ke&&ke.getReader&&Array.isArray(ke)}function k(ke){if(!_(ke)){const Ae=ke.getWriter(),Ce=Ae.releaseLock;return Ae.releaseLock=()=>{Ae.closed.catch((function(){})),Ce.call(Ae)},Ae}this.stream=ke}v.prototype.getReader=function(){return void 0===this[Rt]&&(this[Rt]=0),{read:async()=>(await this[Et],this[Rt]===this.length?{value:void 0,done:!0}:{value:this[this[Rt]++],done:!1})}},v.prototype.readToEnd=async function(ke){await this[Et];const Ae=ke(this.slice(this[Rt]));return this.length=0,Ae},v.prototype.clone=function(){const ke=new v;return ke[Et]=this[Et].then((()=>{ke.push(...this)})),ke},k.prototype.write=async function(ke){this.stream.push(ke)},k.prototype.close=async function(){this.stream[Pt]()},k.prototype.abort=async function(ke){return this.stream[Dt](ke),ke},k.prototype.releaseLock=function(){};const Bt="object"==typeof qe.process&&"object"==typeof qe.process.versions,Tt=Bt&&ht.default.Readable;function E(ke){return _(ke)?"array":qe.ReadableStream&&qe.ReadableStream.prototype.isPrototypeOf(ke)?"web":Lt&&Lt.prototype.isPrototypeOf(ke)?"ponyfill":Tt&&Tt.prototype.isPrototypeOf(ke)?"node":!(!ke||!ke.getReader)&&"web-like"}function P(ke){return Uint8Array.prototype.isPrototypeOf(ke)}function x(ke){if(1===ke.length)return ke[0];let Ae=0;for(let Ce=0;Ce{Ae||(Ut.isBuffer(qe)&&(qe=new Uint8Array(qe.buffer,qe.byteOffset,qe.byteLength)),Ce.enqueue(qe),ke.pause())})),ke.on("end",(()=>{Ae||Ce.close()})),ke.on("error",(ke=>Ce.error(ke)))},pull(){ke.resume()},cancel(Ce){Ae=!0,ke.destroy(Ce)}})};class e extends Kt{constructor(ke,Ae){super(Ae),this._reader=H(ke)}async _read(ke){try{for(;;){const{done:ke,value:Ae}=await this._reader.read();if(ke){this.push(null);break}if(!this.push(Ae)||this._cancelling){this._reading=!1;break}}}catch(ke){this.emit("error",ke)}}_destroy(ke){this._reader.cancel(ke)}}Ot=function(ke,Ae){return new e(ke,Ae)}}const Nt=new WeakSet,qt=Symbol("externalBuffer");function I(ke){if(this.stream=ke,ke[qt]&&(this[qt]=ke[qt].slice()),_(ke)){const Ae=ke.getReader();return this._read=Ae.read.bind(Ae),this._releaseLock=()=>{},void(this._cancel=()=>{})}let Ae=E(ke);if("node"===Ae&&(ke=It(ke)),Ae){const Ae=ke.getReader();return this._read=Ae.read.bind(Ae),this._releaseLock=()=>{Ae.closed.catch((function(){})),Ae.releaseLock()},void(this._cancel=Ae.cancel.bind(Ae))}let Ce=!1;this._read=async()=>Ce||Nt.has(ke)?{value:void 0,done:!0}:(Ce=!0,{value:ke,done:!1}),this._releaseLock=()=>{if(Ce)try{Nt.add(ke)}catch(ke){}}}I.prototype.read=async function(){if(this[qt]&&this[qt].length){return{done:!1,value:this[qt].shift()}}return this._read()},I.prototype.releaseLock=function(){this[qt]&&(this.stream[qt]=this[qt]),this._releaseLock()},I.prototype.cancel=function(ke){return this._cancel(ke)},I.prototype.readLine=async function(){let ke,Ae=[];for(;!ke;){let{done:Ce,value:qe}=await this.read();if(qe+="",Ce)return Ae.length?W(Ae):void 0;const ze=qe.indexOf("\n")+1;ze&&(ke=W(Ae.concat(qe.substr(0,ze))),Ae=[]),ze!==qe.length&&Ae.push(qe.substr(ze))}return this.unshift(...Ae),ke},I.prototype.readByte=async function(){const{done:ke,value:Ae}=await this.read();if(ke)return;const Ce=Ae[0];return this.unshift(re(Ae,1)),Ce},I.prototype.readBytes=async function(ke){const Ae=[];let Ce=0;for(;;){const{done:qe,value:ze}=await this.read();if(qe)return Ae.length?W(Ae):void 0;if(Ae.push(ze),Ce+=ze.length,Ce>=ke){const Ce=W(Ae);return this.unshift(re(Ce,ke)),re(Ce,0,ke)}}},I.prototype.peekBytes=async function(ke){const Ae=await this.readBytes(ke);return this.unshift(Ae),Ae},I.prototype.unshift=function(...ke){this[qt]||(this[qt]=[]),1===ke.length&&P(ke[0])&&this[qt].length&&ke[0].length&&this[qt][0].byteOffset>=ke[0].length?this[qt][0]=new Uint8Array(this[qt][0].buffer,this[qt][0].byteOffset-ke[0].length,this[qt][0].byteLength+ke[0].length):this[qt].unshift(...ke.filter((ke=>ke&&ke.length)))},I.prototype.readToEnd=async function(ke=W){const Ae=[];for(;;){const{done:ke,value:Ce}=await this.read();if(ke)break;Ae.push(Ce)}return ke(Ae)};let zt,Ft,{ReadableStream:Lt,WritableStream:Ht,TransformStream:Gt}=qe;async function F(){if(Gt)return;const[ke,Ae]=await Promise.all([Promise.resolve().then((function(){return Ud})),Promise.resolve().then((function(){return Ld}))]);({ReadableStream:Lt,WritableStream:Ht,TransformStream:Gt}=ke);const{createReadableStreamWrapper:Ce}=Ae;qe.ReadableStream&&Lt!==qe.ReadableStream&&(zt=Ce(Lt),Ft=Ce(qe.ReadableStream))}const $t=Bt&&ct.default.Buffer;function j(ke){let Ae=E(ke);return"node"===Ae?It(ke):"web"===Ae&&zt?zt(ke):Ae?ke:new Lt({start(Ae){Ae.enqueue(ke),Ae.close()}})}function L(ke){if(E(ke))return ke;const Ae=new v;return(async()=>{const Ce=G(Ae);await Ce.write(ke),await Ce.close()})(),Ae}function W(ke){return ke.some((ke=>E(ke)&&!_(ke)))?function(ke){ke=ke.map(j);const Ae=Z((async function(ke){await Promise.all(qe.map((Ae=>ne(Ae,ke))))}));let Ce=Promise.resolve();const qe=ke.map(((qe,ze)=>X(qe,((qe,Ve)=>(Ce=Ce.then((()=>V(qe,Ae.writable,{preventClose:ze!==ke.length-1}))),Ce)))));return Ae.readable}(ke):ke.some((ke=>_(ke)))?function(ke){const Ae=new v;let Ce=Promise.resolve();return ke.forEach(((qe,ze)=>(Ce=Ce.then((()=>V(qe,Ae,{preventClose:ze!==ke.length-1}))),Ce))),Ae}(ke):"string"==typeof ke[0]?ke.join(""):$t&&$t.isBuffer(ke[0])?$t.concat(ke):x(ke)}function H(ke){return new I(ke)}function G(ke){return new k(ke)}async function V(ke,Ae,{preventClose:Ce=!1,preventAbort:qe=!1,preventCancel:ze=!1}={}){if(E(ke)&&!_(ke)){ke=j(ke);try{if(ke[qt]){const Ce=G(Ae);for(let Ae=0;Ae{Ae=ke})),Ae=null)},close:Ce.close.bind(Ce),abort:Ce.error.bind(Ce)})}}function Y(ke,Ae=(()=>{}),Ce=(()=>{})){if(_(ke)){const qe=new v;return(async()=>{const ze=G(qe);try{const qe=await ie(ke),Ve=Ae(qe),tt=Ce();let rt;rt=void 0!==Ve&&void 0!==tt?W([Ve,tt]):void 0!==Ve?Ve:tt,await ze.write(rt),await ze.close()}catch(ke){await ze.abort(ke)}})(),qe}if(E(ke))return $(ke,{async transform(ke,Ce){try{const qe=await Ae(ke);void 0!==qe&&Ce.enqueue(qe)}catch(ke){Ce.error(ke)}},async flush(ke){try{const Ae=await Ce();void 0!==Ae&&ke.enqueue(Ae)}catch(Ae){ke.error(Ae)}}});const qe=Ae(ke),ze=Ce();return void 0!==qe&&void 0!==ze?W([qe,ze]):void 0!==qe?qe:ze}function X(ke,Ae){if(E(ke)&&!_(ke)){let Ce;const qe=new Gt({start(ke){Ce=ke}}),ze=V(ke,qe.writable),Ve=Z((async function(ke){Ce.error(ke),await ze,await new Promise(setTimeout)}));return Ae(qe.readable,Ve.writable),Ve.readable}ke=L(ke);const Ce=new v;return Ae(ke,Ce),Ce}function Q(ke,Ae){let Ce;const qe=X(ke,((ke,ze)=>{const Ve=H(ke);Ve.remainder=()=>(Ve.releaseLock(),V(ke,ze),qe),Ce=Ae(Ve)}));return Ce}function J(ke){if(_(ke))return ke.clone();if(E(ke)){const Ae=function(ke){if(_(ke))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(E(ke)){const Ae=j(ke).tee();return Ae[0][qt]=Ae[1][qt]=ke[qt],Ae}return[re(ke),re(ke)]}(ke);return te(ke,Ae[0]),Ae[1]}return re(ke)}function ee(ke){return _(ke)?J(ke):E(ke)?new Lt({start(Ae){const Ce=X(ke,(async(ke,Ce)=>{const qe=H(ke),ze=G(Ce);try{for(;;){await ze.ready;const{done:Ce,value:Ve}=await qe.read();if(Ce){try{Ae.close()}catch(ke){}return void await ze.close()}try{Ae.enqueue(Ve)}catch(ke){}await ze.write(Ve)}}catch(ke){Ae.error(ke),await ze.abort(ke)}}));te(ke,Ce)}}):re(ke)}function te(ke,Ae){Object.entries(Object.getOwnPropertyDescriptors(ke.constructor.prototype)).forEach((([Ce,qe])=>{"constructor"!==Ce&&(qe.value?qe.value=qe.value.bind(Ae):qe.get=qe.get.bind(Ae),Object.defineProperty(ke,Ce,qe))}))}function re(ke,Ae=0,Ce=1/0){if(_(ke))throw Error("Not implemented");if(E(ke)){if(Ae>=0&&Ce>=0){let qe=0;return $(ke,{transform(ke,ze){qe=Ae&&ze.enqueue(re(ke,Math.max(Ae-qe,0),Ce-qe)),qe+=ke.length):ze.terminate()}})}if(Ae<0&&(Ce<0||Ce===1/0)){let qe=[];return Y(ke,(ke=>{ke.length>=-Ae?qe=[ke]:qe.push(ke)}),(()=>re(W(qe),Ae,Ce)))}if(0===Ae&&Ce<0){let qe;return Y(ke,(ke=>{const ze=qe?W([qe,ke]):ke;if(ze.length>=-Ce)return qe=re(ze,Ce),re(ze,Ae,Ce);qe=ze}))}return console.warn(`stream.slice(input, ${Ae}, ${Ce}) not implemented efficiently.`),ae((async()=>re(await ie(ke),Ae,Ce)))}return ke[qt]&&(ke=W(ke[qt].concat([ke]))),!P(ke)||$t&&$t.isBuffer(ke)?ke.slice(Ae,Ce):(Ce===1/0&&(Ce=ke.length),ke.subarray(Ae,Ce))}async function ie(ke,Ae=W){return _(ke)?ke.readToEnd(Ae):E(ke)?H(ke).readToEnd(Ae):ke}async function ne(ke,Ae){if(E(ke)){if(ke.cancel)return ke.cancel(Ae);if(ke.destroy)return ke.destroy(Ae),await new Promise(setTimeout),Ae}}function ae(ke){const Ae=new v;return(async()=>{const Ce=G(Ae);try{await Ce.write(await ke()),await Ce.close()}catch(ke){await Ce.abort(ke)}})(),Ae}class se{constructor(ke){if(void 0===ke)throw Error("Invalid BigInteger input");if(ke instanceof Uint8Array){const Ae=ke,Ce=Array(Ae.length);for(let ke=0;keBigInt(0);){const ke=Ce&BigInt(1);Ce>>=BigInt(1);const Ve=ze*qe%Ae.value;ze=ke?Ve:ze,qe=qe*qe%Ae.value}return new se(ze)}modInv(ke){const{gcd:Ae,x:Ce}=this._egcd(ke);if(!Ae.isOne())throw Error("Inverse does not exist");return Ce.add(ke).mod(ke)}_egcd(ke){let Ae=BigInt(0),Ce=BigInt(1),qe=BigInt(1),ze=BigInt(0),Ve=this.value;for(ke=ke.value;ke!==BigInt(0);){const tt=Ve/ke;let rt=Ae;Ae=qe-tt*Ae,qe=rt,rt=Ce,Ce=ze-tt*Ce,ze=rt,rt=ke,ke=Ve%ke,Ve=rt}return{x:new se(qe),y:new se(ze),gcd:new se(Ve)}}gcd(ke){let Ae=this.value;for(ke=ke.value;ke!==BigInt(0);){const Ce=ke;ke=Ae%ke,Ae=Ce}return new se(Ae)}ileftShift(ke){return this.value<<=ke.value,this}leftShift(ke){return this.clone().ileftShift(ke)}irightShift(ke){return this.value>>=ke.value,this}rightShift(ke){return this.clone().irightShift(ke)}equal(ke){return this.value===ke.value}lt(ke){return this.valueke.value}gte(ke){return this.value>=ke.value}isZero(){return this.value===BigInt(0)}isOne(){return this.value===BigInt(1)}isNegative(){return this.valueNumber.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return ke}getBit(ke){return(this.value>>BigInt(ke)&BigInt(1))===BigInt(0)?0:1}bitLength(){const ke=new se(0),Ae=new se(1),Ce=new se(-1),qe=this.isNegative()?Ce:ke;let ze=1;const Ve=this.clone();for(;!Ve.irightShift(Ae).equal(qe);)ze++;return ze}byteLength(){const ke=new se(0),Ae=new se(-1),Ce=this.isNegative()?Ae:ke,qe=new se(8);let ze=1;const Ve=this.clone();for(;!Ve.irightShift(qe).equal(Ce);)ze++;return ze}toUint8Array(ke="be",Ae){let Ce=this.value.toString(16);Ce.length%2==1&&(Ce="0"+Ce);const qe=Ce.length/2,ze=new Uint8Array(Ae||qe),Ve=Ae?Ae-qe:0;let tt=0;for(;tt{try{return"development"===process.env.NODE_ENV}catch(ke){}return!1})(),Zt={isString:function(ke){return"string"==typeof ke||String.prototype.isPrototypeOf(ke)},isArray:function(ke){return Array.prototype.isPrototypeOf(ke)},isUint8Array:P,isStream:E,readNumber:function(ke){let Ae=0;for(let Ce=0;Ce>8*(Ae-qe-1)&255;return Ce},readDate:function(ke){const Ae=Zt.readNumber(ke);return new Date(1e3*Ae)},writeDate:function(ke){const Ae=Math.floor(ke.getTime()/1e3);return Zt.writeNumber(Ae,4)},normalizeDate:function(ke=Date.now()){return null===ke||ke===1/0?ke:new Date(1e3*Math.floor(+ke/1e3))},readMPI:function(ke){const Ae=(ke[0]<<8|ke[1])+7>>>3;return ke.subarray(2,2+Ae)},leftPad(ke,Ae){const Ce=new Uint8Array(Ae),qe=Ae-ke.length;return Ce.set(ke,qe),Ce},uint8ArrayToMPI:function(ke){const Ae=Zt.uint8ArrayBitLength(ke);if(0===Ae)throw Error("Zero MPI");const Ce=ke.subarray(ke.length-Math.ceil(Ae/8)),qe=new Uint8Array([(65280&Ae)>>8,255&Ae]);return Zt.concatUint8Array([qe,Ce])},uint8ArrayBitLength:function(ke){let Ae;for(Ae=0;Ae>1);for(let Ce=0;Ce>1;Ce++)Ae[Ce]=parseInt(ke.substr(Ce<<1,2),16);return Ae},uint8ArrayToHex:function(ke){const Ae=[],Ce=ke.length;let qe,ze=0;for(;ze{if(!Zt.isString(ke))throw Error("stringToUint8Array: Data must be in the form of a string");const Ae=new Uint8Array(ke.length);for(let Ce=0;Cer("",!0)))},decodeUTF8:function(ke){const Ae=new TextDecoder("utf-8");function r(ke,Ce=!1){return Ae.decode(ke,{stream:!Ce})}return Y(ke,r,(()=>r(new Uint8Array,!0)))},concat:W,concatUint8Array:x,equalsUint8Array:function(ke,Ae){if(!Zt.isUint8Array(ke)||!Zt.isUint8Array(Ae))throw Error("Data must be in the form of a Uint8Array");if(ke.length!==Ae.length)return!1;for(let Ce=0;Ce>>16;return 0!==Ce&&(ke=Ce,Ae+=16),Ce=ke>>8,0!==Ce&&(ke=Ce,Ae+=8),Ce=ke>>4,0!==Ce&&(ke=Ce,Ae+=4),Ce=ke>>2,0!==Ce&&(ke=Ce,Ae+=2),Ce=ke>>1,0!==Ce&&(ke=Ce,Ae+=1),Ae},double:function(ke){const Ae=new Uint8Array(ke.length),Ce=ke.length-1;for(let qe=0;qe>7;return Ae[Ce]=ke[Ce]<<1^135*(ke[0]>>7),Ae},shiftRight:function(ke,Ae){if(Ae)for(let Ce=ke.length-1;Ce>=0;Ce--)ke[Ce]>>=Ae,Ce>0&&(ke[Ce]|=ke[Ce-1]<<8-Ae);return ke},getWebCrypto:function(){return void 0!==qe&&qe.crypto&&qe.crypto.subtle},detectBigInt:()=>"undefined"!=typeof BigInt,getBigInteger:async function(){if(Zt.detectBigInt())return se;{const{default:ke}=await Promise.resolve().then((function(){return Zd}));return ke}},getNodeCrypto:function(){return ft.default},getNodeZlib:function(){return yt.default},getNodeBuffer:function(){return(ct.default||{}).Buffer},getHardwareConcurrency:function(){if("undefined"!=typeof navigator)return navigator.hardwareConcurrency||1;return mt.default.cpus().length},isEmailAddress:function(ke){if(!Zt.isString(ke))return!1;return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+([a-zA-Z]{2,}|xn--[a-zA-Z\-0-9]+)))$/.test(ke)},canonicalizeEOL:function(ke){let Ae=!1;return Y(ke,(ke=>{let Ce;Ae&&(ke=Zt.concatUint8Array([new Uint8Array([13]),ke])),13===ke[ke.length-1]?(Ae=!0,ke=ke.subarray(0,-1)):Ae=!1;const qe=[];for(let Ae=0;Ce=ke.indexOf(10,Ae)+1,Ce;Ae=Ce)13!==ke[Ce-2]&&qe.push(Ce);if(!qe.length)return ke;const ze=new Uint8Array(ke.length+qe.length);let Ve=0;for(let Ae=0;AeAe?new Uint8Array([13]):void 0))},nativeEOL:function(ke){let Ae=!1;return Y(ke,(ke=>{let Ce;13===(ke=Ae&&10!==ke[0]?Zt.concatUint8Array([new Uint8Array([13]),ke]):new Uint8Array(ke))[ke.length-1]?(Ae=!0,ke=ke.subarray(0,-1)):Ae=!1;let qe=0;for(let Ae=0;Ae!==ke.length;Ae=Ce){Ce=ke.indexOf(13,Ae)+1,Ce||(Ce=ke.length);const ze=Ce-(10===ke[Ce]?1:0);Ae&&ke.copyWithin(qe,Ae,ze),qe+=ze-Ae}return ke.subarray(0,qe)}),(()=>Ae?new Uint8Array([13]):void 0))},removeTrailingSpaces:function(ke){return ke.split("\n").map((ke=>{let Ae=ke.length-1;for(;Ae>=0&&(" "===ke[Ae]||"\t"===ke[Ae]||"\r"===ke[Ae]);Ae--);return ke.substr(0,Ae+1)})).join("\n")},wrapError:function(ke,Ae){if(!Ae)return Error(ke);try{Ae.message=ke+": "+Ae.message}catch(ke){}return Ae},constructAllowedPackets:function(ke){const Ae={};return ke.forEach((ke=>{if(!ke.tag)throw Error("Invalid input: expected a packet class");Ae[ke.tag]=ke})),Ae},anyPromise:function(ke){return new Promise((async(Ae,Ce)=>{let qe;await Promise.all(ke.map((async ke=>{try{Ae(await ke)}catch(ke){qe=ke}}))),Ce(qe)}))},selectUint8Array:function(ke,Ae,Ce){const qe=Math.max(Ae.length,Ce.length),ze=new Uint8Array(qe);let Ve=0;for(let qe=0;qe{Ae=Zt.concatUint8Array([Ae,ke]);const Ce=[],qe=Math.floor(Ae.length/45),ze=45*qe,Ve=Jt(Ae.subarray(0,ze));for(let ke=0;keAe.length?Jt(Ae)+"\n":""))}function le(ke){let Ae="";return Y(ke,(ke=>{Ae+=ke;let Ce=0;const qe=[" ","\t","\r","\n"];for(let ke=0;ke0&&(ze-Ce)%4!=0;ze--)qe.includes(Ae[ze])&&Ce--;const Ve=Xt(Ae.substr(0,ze));return Ae=Ae.substr(ze),Ve}),(()=>Xt(Ae)))}function pe(ke){return le(ke.replace(/-/g,"+").replace(/_/g,"/"))}function ye(ke,Ae){let Ce=de(ke).replace(/[\r\n]/g,"");return Ae&&(Ce=Ce.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")),Ce}Yt?(Jt=ke=>Yt.from(ke).toString("base64"),Xt=ke=>{const Ae=Yt.from(ke,"base64");return new Uint8Array(Ae.buffer,Ae.byteOffset,Ae.byteLength)}):(Jt=ke=>btoa(Zt.uint8ArrayToString(ke)),Xt=ke=>Zt.stringToUint8Array(atob(ke)));const Qt=Symbol("byValue");var er={curve:{p256:"p256","P-256":"p256",secp256r1:"p256",prime256v1:"p256","1.2.840.10045.3.1.7":"p256","2a8648ce3d030107":"p256","2A8648CE3D030107":"p256",p384:"p384","P-384":"p384",secp384r1:"p384","1.3.132.0.34":"p384","2b81040022":"p384","2B81040022":"p384",p521:"p521","P-521":"p521",secp521r1:"p521","1.3.132.0.35":"p521","2b81040023":"p521","2B81040023":"p521",secp256k1:"secp256k1","1.3.132.0.10":"secp256k1","2b8104000a":"secp256k1","2B8104000A":"secp256k1",ED25519:"ed25519",ed25519:"ed25519",Ed25519:"ed25519","1.3.6.1.4.1.11591.15.1":"ed25519","2b06010401da470f01":"ed25519","2B06010401DA470F01":"ed25519",X25519:"curve25519",cv25519:"curve25519",curve25519:"curve25519",Curve25519:"curve25519","1.3.6.1.4.1.3029.1.5.1":"curve25519","2b060104019755010501":"curve25519","2B060104019755010501":"curve25519",brainpoolP256r1:"brainpoolP256r1","1.3.36.3.3.2.8.1.1.7":"brainpoolP256r1","2b2403030208010107":"brainpoolP256r1","2B2403030208010107":"brainpoolP256r1",brainpoolP384r1:"brainpoolP384r1","1.3.36.3.3.2.8.1.1.11":"brainpoolP384r1","2b240303020801010b":"brainpoolP384r1","2B240303020801010B":"brainpoolP384r1",brainpoolP512r1:"brainpoolP512r1","1.3.36.3.3.2.8.1.1.13":"brainpoolP512r1","2b240303020801010d":"brainpoolP512r1","2B240303020801010D":"brainpoolP512r1"},s2k:{simple:0,salted:1,iterated:3,gnu:101},publicKey:{rsaEncryptSign:1,rsaEncrypt:2,rsaSign:3,elgamal:16,dsa:17,ecdh:18,ecdsa:19,eddsa:22,aedh:23,aedsa:24},symmetric:{plaintext:0,idea:1,tripledes:2,cast5:3,blowfish:4,aes128:7,aes192:8,aes256:9,twofish:10},compression:{uncompressed:0,zip:1,zlib:2,bzip2:3},hash:{md5:1,sha1:2,ripemd:3,sha256:8,sha384:9,sha512:10,sha224:11},webHash:{"SHA-1":2,"SHA-256":8,"SHA-384":9,"SHA-512":10},aead:{eax:1,ocb:2,experimentalGCM:100},packet:{publicKeyEncryptedSessionKey:1,signature:2,symEncryptedSessionKey:3,onePassSignature:4,secretKey:5,publicKey:6,secretSubkey:7,compressedData:8,symmetricallyEncryptedData:9,marker:10,literalData:11,trust:12,userID:13,publicSubkey:14,userAttribute:17,symEncryptedIntegrityProtectedData:18,modificationDetectionCode:19,aeadEncryptedData:20},literal:{binary:98,text:116,utf8:117,mime:109},signature:{binary:0,text:1,standalone:2,certGeneric:16,certPersona:17,certCasual:18,certPositive:19,certRevocation:48,subkeyBinding:24,keyBinding:25,key:31,keyRevocation:32,subkeyRevocation:40,timestamp:64,thirdParty:80},signatureSubpacket:{signatureCreationTime:2,signatureExpirationTime:3,exportableCertification:4,trustSignature:5,regularExpression:6,revocable:7,keyExpirationTime:9,placeholderBackwardsCompatibility:10,preferredSymmetricAlgorithms:11,revocationKey:12,issuer:16,notationData:20,preferredHashAlgorithms:21,preferredCompressionAlgorithms:22,keyServerPreferences:23,preferredKeyServer:24,primaryUserID:25,policyURI:26,keyFlags:27,signersUserID:28,reasonForRevocation:29,features:30,signatureTarget:31,embeddedSignature:32,issuerFingerprint:33,preferredAEADAlgorithms:34},keyFlags:{certifyKeys:1,signData:2,encryptCommunication:4,encryptStorage:8,splitPrivateKey:16,authentication:32,sharedPrivateKey:128},armor:{multipartSection:0,multipartLast:1,signed:2,message:3,publicKey:4,privateKey:5,signature:6},reasonForRevocation:{noReason:0,keySuperseded:1,keyCompromised:2,keyRetired:3,userIDInvalid:32},features:{modificationDetection:1,aead:2,v5Keys:4},write:function(ke,Ae){if("number"==typeof Ae&&(Ae=this.read(ke,Ae)),void 0!==ke[Ae])return ke[Ae];throw Error("Invalid enum value.")},read:function(ke,Ae){if(ke[Qt]||(ke[Qt]=[],Object.entries(ke).forEach((([Ae,Ce])=>{ke[Qt][Ce]=Ae}))),void 0!==ke[Qt][Ae])return ke[Qt][Ae];throw Error("Invalid enum value.")}},tr={preferredHashAlgorithm:er.hash.sha256,preferredSymmetricAlgorithm:er.symmetric.aes256,preferredCompressionAlgorithm:er.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:er.aead.eax,aeadChunkSizeByte:12,v5Keys:!1,s2kIterationCountByte:224,allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,checksumRequired:!1,minRSABits:2047,passwordCollisionCheck:!1,revocationsExpire:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([er.symmetric.aes128,er.symmetric.aes192,er.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.5.0",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:["preferred-email-encoding@pgp.com","pka-address@gnupg.org"],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([er.hash.md5,er.hash.ripemd]),rejectMessageHashAlgorithms:new Set([er.hash.md5,er.hash.ripemd,er.hash.sha1]),rejectPublicKeyAlgorithms:new Set([er.publicKey.elgamal,er.publicKey.dsa]),rejectCurves:new Set([er.curve.brainpoolP256r1,er.curve.brainpoolP384r1,er.curve.brainpoolP512r1,er.curve.secp256k1])};function we(ke){const Ae=ke.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!Ae)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(Ae[1])?er.armor.multipartSection:/MESSAGE, PART \d+/.test(Ae[1])?er.armor.multipartLast:/SIGNED MESSAGE/.test(Ae[1])?er.armor.signed:/MESSAGE/.test(Ae[1])?er.armor.message:/PUBLIC KEY BLOCK/.test(Ae[1])?er.armor.publicKey:/PRIVATE KEY BLOCK/.test(Ae[1])?er.armor.privateKey:/SIGNATURE/.test(Ae[1])?er.armor.signature:void 0}function ve(ke,Ae){let Ce="";return Ae.showVersion&&(Ce+="Version: "+Ae.versionString+"\n"),Ae.showComment&&(Ce+="Comment: "+Ae.commentString+"\n"),ke&&(Ce+="Comment: "+ke+"\n"),Ce+="\n",Ce}function _e(ke){return de(function(ke){let Ae=13501623;return Y(ke,(ke=>{const Ce=ir?Math.floor(ke.length/4):0,qe=new Uint32Array(ke.buffer,ke.byteOffset,Ce);for(let ke=0;ke>24&255]^rr[1][Ae>>16&255]^rr[2][Ae>>8&255]^rr[3][Ae>>0&255];for(let qe=4*Ce;qe>8^rr[0][255&Ae^ke[qe]]}),(()=>new Uint8Array([Ae,Ae>>8,Ae>>16])))}(ke))}const rr=[Array(255),Array(255),Array(255),Array(255)];for(let ke=0;ke<=255;ke++){let Ae=ke<<16;for(let ke=0;ke<8;ke++)Ae=Ae<<1^(0!=(8388608&Ae)?8801531:0);rr[0][ke]=(16711680&Ae)>>16|65280&Ae|(255&Ae)<<16}for(let ke=0;ke<=255;ke++)rr[1][ke]=rr[0][ke]>>8^rr[0][255&rr[0][ke]];for(let ke=0;ke<=255;ke++)rr[2][ke]=rr[1][ke]>>8^rr[0][255&rr[1][ke]];for(let ke=0;ke<=255;ke++)rr[3][ke]=rr[2][ke]>>8^rr[0][255&rr[2][ke]];const ir=function(){const ke=new ArrayBuffer(2);return new DataView(ke).setInt16(0,255,!0),255===new Int16Array(ke)[0]}();function Se(ke){for(let Ae=0;Ae=0&&qe!==ke.length-1&&(Ae=ke.slice(0,qe),Ce=ke.slice(qe+1).substr(0,4)),{body:Ae,checksum:Ce}}function Pe(ke,Ae=tr){return new Promise((async(Ce,qe)=>{try{const ze=/^-----[^-]+-----$/m,Ve=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let tt;const rt=[];let it,nt,ot,ct=rt,ht=[],ft=le(X(ke,(async(ke,Ae)=>{const yt=H(ke);try{for(;;){let ke=await yt.readLine();if(void 0===ke)throw Error("Misformed armored text");if(ke=Zt.removeTrailingSpaces(ke.replace(/[\r\n]/g,"")),tt)if(it)nt||2!==tt||(ze.test(ke)?(ht=ht.join("\r\n"),nt=!0,Se(ct),ct=[],it=!1):ht.push(ke.replace(/^- /,"")));else if(ze.test(ke)&&qe(Error("Mandatory blank line missing between armor headers and armor data")),Ve.test(ke)){if(Se(ct),it=!0,nt||2!==tt){Ce({text:ht,data:ft,headers:rt,type:tt});break}}else ct.push(ke);else ze.test(ke)&&(tt=we(ke))}}catch(ke){return void qe(ke)}const mt=G(Ae);try{for(;;){await mt.ready;const{done:ke,value:Ae}=await yt.read();if(ke)throw Error("Misformed armored text");const Ce=Ae+"";if(-1!==Ce.indexOf("=")||-1!==Ce.indexOf("-")){let ke=await yt.readToEnd();ke.length||(ke=""),ke=Ce+ke,ke=Zt.removeTrailingSpaces(ke.replace(/\r/g,""));const Ae=ke.split(ze);if(1===Ae.length)throw Error("Misformed armored text");const qe=Ee(Ae[0].slice(0,-1));ot=qe.checksum,await mt.write(qe.body);break}await mt.write(Ce)}await mt.ready,await mt.close()}catch(ke){await mt.abort(ke)}})));ft=X(ft,(async(ke,Ce)=>{const qe=ie(_e(ee(ke)));qe.catch((()=>{})),await V(ke,Ce,{preventClose:!0});const ze=G(Ce);try{const ke=(await qe).replace("\n","");if(ot!==ke&&(ot||Ae.checksumRequired))throw Error("Ascii armor integrity check failed");await ze.ready,await ze.close()}catch(ke){await ze.abort(ke)}}))}catch(ke){qe(ke)}})).then((async ke=>(_(ke.data)&&(ke.data=await ie(ke.data)),ke)))}function xe(ke,Ae,Ce,qe,ze,Ve=tr){let tt,rt;ke===er.armor.signed&&(tt=Ae.text,rt=Ae.hash,Ae=Ae.data);const it=ee(Ae),nt=[];switch(ke){case er.armor.multipartSection:nt.push("-----BEGIN PGP MESSAGE, PART "+Ce+"/"+qe+"-----\n"),nt.push(ve(ze,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP MESSAGE, PART "+Ce+"/"+qe+"-----\n");break;case er.armor.multipartLast:nt.push("-----BEGIN PGP MESSAGE, PART "+Ce+"-----\n"),nt.push(ve(ze,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP MESSAGE, PART "+Ce+"-----\n");break;case er.armor.signed:nt.push("-----BEGIN PGP SIGNED MESSAGE-----\n"),nt.push("Hash: "+rt+"\n\n"),nt.push(tt.replace(/^-/gm,"- -")),nt.push("\n-----BEGIN PGP SIGNATURE-----\n"),nt.push(ve(ze,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP SIGNATURE-----\n");break;case er.armor.message:nt.push("-----BEGIN PGP MESSAGE-----\n"),nt.push(ve(ze,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP MESSAGE-----\n");break;case er.armor.publicKey:nt.push("-----BEGIN PGP PUBLIC KEY BLOCK-----\n"),nt.push(ve(ze,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP PUBLIC KEY BLOCK-----\n");break;case er.armor.privateKey:nt.push("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"),nt.push(ve(ze,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP PRIVATE KEY BLOCK-----\n");break;case er.armor.signature:nt.push("-----BEGIN PGP SIGNATURE-----\n"),nt.push(ve(ze,Ve)),nt.push(de(Ae)),nt.push("=",_e(it)),nt.push("-----END PGP SIGNATURE-----\n")}return Zt.concat(nt)}class Me{constructor(){this.bytes=""}read(ke){this.bytes=Zt.uint8ArrayToString(ke.subarray(0,8))}write(){return Zt.stringToUint8Array(this.bytes)}toHex(){return Zt.uint8ArrayToHex(Zt.stringToUint8Array(this.bytes))}equals(ke,Ae=!1){return Ae&&(ke.isWildcard()||this.isWildcard())||this.bytes===ke.bytes}isNull(){return""===this.bytes}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(ke){return ke.toHex()}static fromID(ke){const Ae=new Me;return Ae.read(Zt.hexToUint8Array(ke)),Ae}static wildcard(){const ke=new Me;return ke.read(new Uint8Array(8)),ke}}var nr=function(){var ke,Ae,Ce=!1;function i(Ce,qe){var ze=ke[(Ae[Ce]+Ae[qe])%255];return 0!==Ce&&0!==qe||(ze=0),ze}var qe,ze,Ve,tt,rt=!1;function u(){function u(Ce){var qe,ze,Ve;for(ze=Ve=function(Ce){var qe=ke[255-Ae[Ce]];return 0===Ce&&(qe=0),qe}(Ce),qe=0;qe<4;qe++)Ve^=ze=255&(ze<<1|ze>>>7);return Ve^=99}Ce||function(){ke=[],Ae=[];var qe,ze,Ve=1;for(qe=0;qe<255;qe++)ke[qe]=Ve,ze=128&Ve,Ve<<=1,Ve&=255,128===ze&&(Ve^=27),Ve^=ke[qe],Ae[ke[qe]]=qe;ke[255]=ke[0],Ae[0]=0,Ce=!0}(),qe=[],ze=[],Ve=[[],[],[],[]],tt=[[],[],[],[]];for(var it=0;it<256;it++){var nt=u(it);qe[it]=nt,ze[nt]=it,Ve[0][it]=i(2,nt)<<24|nt<<16|nt<<8|i(3,nt),tt[0][nt]=i(14,it)<<24|i(9,it)<<16|i(13,it)<<8|i(11,it);for(var ot=1;ot<4;ot++)Ve[ot][it]=Ve[ot-1][it]>>>8|Ve[ot-1][it]<<24,tt[ot][nt]=tt[ot-1][nt]>>>8|tt[ot-1][nt]<<24}rt=!0}var h=function(ke,Ae){rt||u();var Ce=new Uint32Array(Ae);Ce.set(qe,512),Ce.set(ze,768);for(var it=0;it<4;it++)Ce.set(Ve[it],4096+1024*it>>2),Ce.set(tt[it],8192+1024*it>>2);var nt=function(ke,Ae,Ce){"use asm";var qe=0,ze=0,Ve=0,tt=0,rt=0,it=0,nt=0,ot=0,ct=0,ht=0,ft=0,yt=0,mt=0,kt=0,St=0,Et=0,Pt=0,Dt=0,Rt=0,Bt=0,Tt=0;var Ut=new ke.Uint32Array(Ce),Kt=new ke.Uint8Array(Ce);function P(ke,Ae,Ce,rt,it,nt,ot,ct){ke=ke|0;Ae=Ae|0;Ce=Ce|0;rt=rt|0;it=it|0;nt=nt|0;ot=ot|0;ct=ct|0;var ht=0,ft=0,yt=0,mt=0,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]=qe>>>24,Kt[Ae|1]=qe>>>16&255,Kt[Ae|2]=qe>>>8&255,Kt[Ae|3]=qe&255,Kt[Ae|4]=ze>>>24,Kt[Ae|5]=ze>>>16&255,Kt[Ae|6]=ze>>>8&255,Kt[Ae|7]=ze&255,Kt[Ae|8]=Ve>>>24,Kt[Ae|9]=Ve>>>16&255,Kt[Ae|10]=Ve>>>8&255,Kt[Ae|11]=Ve&255,Kt[Ae|12]=tt>>>24,Kt[Ae|13]=tt>>>16&255,Kt[Ae|14]=tt>>>8&255,Kt[Ae|15]=tt&255;rt=rt+16|0,Ae=Ae+16|0,Ce=Ce-16|0}return rt|0}function G(ke,Ae,Ce){ke=ke|0;Ae=Ae|0;Ce=Ce|0;var qe=0;if(Ae&15)return-1;while((Ce|0)>=16){Ot[ke&1](Kt[Ae|0]<<24|Kt[Ae|1]<<16|Kt[Ae|2]<<8|Kt[Ae|3],Kt[Ae|4]<<24|Kt[Ae|5]<<16|Kt[Ae|6]<<8|Kt[Ae|7],Kt[Ae|8]<<24|Kt[Ae|9]<<16|Kt[Ae|10]<<8|Kt[Ae|11],Kt[Ae|12]<<24|Kt[Ae|13]<<16|Kt[Ae|14]<<8|Kt[Ae|15]);qe=qe+16|0,Ae=Ae+16|0,Ce=Ce-16|0}return qe|0}var It=[x,M,C,K,D,R,U,I];var Ot=[C,B];return{set_rounds:T,set_state:z,set_iv:q,set_nonce:O,set_mask:F,set_counter:N,get_state:j,get_iv:L,gcm_init:W,cipher:H,mac:G}}({Uint8Array:Uint8Array,Uint32Array:Uint32Array},ke,Ae);return nt.set_key=function(ke,Ae,ze,Ve,rt,it,ot,ct,ht){var ft=Ce.subarray(0,60),yt=Ce.subarray(256,316);ft.set([Ae,ze,Ve,rt,it,ot,ct,ht]);for(var mt=ke,kt=1;mt<4*ke+28;mt++){var St=ft[mt-1];(mt%ke==0||8===ke&&mt%ke==4)&&(St=qe[St>>>24]<<24^qe[St>>>16&255]<<16^qe[St>>>8&255]<<8^qe[255&St]),mt%ke==0&&(St=St<<8^St>>>24^kt<<24,kt=kt<<1^(128&kt?27:0)),ft[mt]=ft[mt-ke]^St}for(var Et=0;Et=mt-4?St:tt[0][qe[St>>>24]]^tt[1][qe[St>>>16&255]]^tt[2][qe[St>>>8&255]]^tt[3][qe[255&St]]}nt.set_rounds(ke+5)},nt};return h.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},h.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},h.MAC={CBC:0,GCM:1},h.HEAP_DATA=16384,h}();function Ke(ke){return ke instanceof Uint8Array}function De(ke,Ae){const Ce=ke?ke.byteLength:Ae||65536;if(4095&Ce||Ce<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return ke=ke||new Uint8Array(new ArrayBuffer(Ce))}function Re(ke,Ae,Ce,qe,ze){const Ve=ke.length-Ae,tt=Veke+Ae.length),0),Ce=new Uint8Array(Ae);let qe=0;for(let Ae=0;Ae>2,ze.getUint32(0),ze.getUint32(4),ze.getUint32(8),ze.getUint32(12),qe>16?ze.getUint32(16):0,qe>16?ze.getUint32(20):0,qe>24?ze.getUint32(24):0,qe>24?ze.getUint32(28):0),void 0!==Ae){if(16!==Ae.length)throw new Be("illegal iv size");let ke=new DataView(Ae.buffer,Ae.byteOffset,Ae.byteLength);Ce.set_iv(ke.getUint32(0),ke.getUint32(4),ke.getUint32(8),ke.getUint32(12))}else Ce.set_iv(0,0,0,0)}AES_Encrypt_process(ke){if(!Ke(ke))throw new TypeError("data isn't of expected type");let{heap:Ae,asm:Ce}=this.acquire_asm(),qe=nr.ENC[this.mode],ze=nr.HEAP_DATA,Ve=this.pos,tt=this.len,rt=0,it=ke.length||0,nt=0,ot=0,ct=new Uint8Array(tt+it&-16);for(;it>0;)ot=Re(Ae,Ve+tt,ke,rt,it),tt+=ot,rt+=ot,it-=ot,ot=Ce.cipher(qe,ze+Ve,tt),ot&&ct.set(Ae.subarray(Ve,Ve+ot),nt),nt+=ot,ot0;)ht=Re(Ae,Ve+tt,ke,rt,it),tt+=ht,rt+=ht,it-=ht,ht=Ce.cipher(qe,ze+Ve,tt-(it?0:ct)),ht&&ft.set(Ae.subarray(Ve,Ve+ht),nt),nt+=ht,ht0){if(Ve%16){if(this.hasOwnProperty("padding"))throw new Be("data length must be a multiple of the block size");Ve+=16-Ve%16}if(Ae.cipher(Ce,qe+ze,Ve),this.hasOwnProperty("padding")&&this.padding){let Ae=ke[ze+tt-1];if(Ae<1||Ae>16||Ae>tt)throw new Te("bad padding");let Ce=0;for(let qe=Ae;qe>1;qe--)Ce|=Ae^ke[ze+tt-qe];if(Ce)throw new Te("bad padding");tt-=Ae}}const rt=new Uint8Array(tt);return tt>0&&rt.set(ke.subarray(ze,ze+tt)),this.pos=0,this.len=0,this.release_asm(),rt}}class Fe{static encrypt(ke,Ae,Ce=!1){return new Fe(Ae,Ce).encrypt(ke)}static decrypt(ke,Ae,Ce=!1){return new Fe(Ae,Ce).decrypt(ke)}constructor(ke,Ae=!1,Ce){this.aes=Ce||new Oe(ke,void 0,Ae,"ECB")}encrypt(ke){return Ue(this.aes.AES_Encrypt_process(ke),this.aes.AES_Encrypt_finish())}decrypt(ke){return Ue(this.aes.AES_Decrypt_process(ke),this.aes.AES_Decrypt_finish())}}function Ne(ke){const t=function(ke){const Ae=new Fe(ke);this.encrypt=function(ke){return Ae.encrypt(ke)},this.decrypt=function(ke){return Ae.decrypt(ke)}};return t.blockSize=t.prototype.blockSize=16,t.keySize=t.prototype.keySize=ke/8,t}function je(ke,Ae,Ce,qe,ze,Ve){const tt=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],rt=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],it=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],nt=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],ot=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],ct=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],ht=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],ft=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];let yt,mt,kt,St,Et,Pt,Dt,Rt,Bt,Tt,Ut,Kt,It,Ot,Nt=0,qt=Ae.length;const zt=32===ke.length?3:9;Rt=3===zt?Ce?[0,32,2]:[30,-2,-2]:Ce?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],Ce&&(qt=(Ae=function(ke,Ae){const Ce=8-ke.length%8;let qe;if(2===Ae&&Ce<8)qe=32;else if(1===Ae)qe=Ce;else{if(Ae||!(Ce<8)){if(8===Ce)return ke;throw Error("des: invalid padding")}qe=0}const ze=new Uint8Array(ke.length+Ce);for(let Ae=0;Ae>>4^Dt),Dt^=kt,Pt^=kt<<4,kt=65535&(Pt>>>16^Dt),Dt^=kt,Pt^=kt<<16,kt=858993459&(Dt>>>2^Pt),Pt^=kt,Dt^=kt<<2,kt=16711935&(Dt>>>8^Pt),Pt^=kt,Dt^=kt<<8,kt=1431655765&(Pt>>>1^Dt),Dt^=kt,Pt^=kt<<1,Pt=Pt<<1|Pt>>>31,Dt=Dt<<1|Dt>>>31,mt=0;mt>>4|Dt<<28)^ke[yt+1],kt=Pt,Pt=Dt,Dt=kt^(rt[St>>>24&63]|nt[St>>>16&63]|ct[St>>>8&63]|ft[63&St]|tt[Et>>>24&63]|it[Et>>>16&63]|ot[Et>>>8&63]|ht[63&Et]);kt=Pt,Pt=Dt,Dt=kt}Pt=Pt>>>1|Pt<<31,Dt=Dt>>>1|Dt<<31,kt=1431655765&(Pt>>>1^Dt),Dt^=kt,Pt^=kt<<1,kt=16711935&(Dt>>>8^Pt),Pt^=kt,Dt^=kt<<8,kt=858993459&(Dt>>>2^Pt),Pt^=kt,Dt^=kt<<2,kt=65535&(Pt>>>16^Dt),Dt^=kt,Pt^=kt<<16,kt=252645135&(Pt>>>4^Dt),Dt^=kt,Pt^=kt<<4,1===qe&&(Ce?(Bt=Pt,Ut=Dt):(Pt^=Tt,Dt^=Kt)),Ft[Lt++]=Pt>>>24,Ft[Lt++]=Pt>>>16&255,Ft[Lt++]=Pt>>>8&255,Ft[Lt++]=255&Pt,Ft[Lt++]=Dt>>>24,Ft[Lt++]=Dt>>>16&255,Ft[Lt++]=Dt>>>8&255,Ft[Lt++]=255&Dt}return Ce||(Ft=function(ke,Ae){let Ce,qe=null;if(2===Ae)Ce=32;else if(1===Ae)qe=ke[ke.length-1];else{if(Ae)throw Error("des: invalid padding");Ce=0}if(!qe){for(qe=1;ke[ke.length-qe]===Ce;)qe++;qe--}return ke.subarray(0,ke.length-qe)}(Ft,Ve)),Ft}function Le(ke){const Ae=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],Ce=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],qe=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],ze=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],Ve=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],tt=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],rt=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],it=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],nt=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],ot=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],ct=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],ht=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],ft=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],yt=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],mt=ke.length>8?3:1,kt=Array(32*mt),St=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let Et,Pt,Dt,Rt=0,Bt=0;for(let Tt=0;Tt>>4^Tt),Tt^=Dt,mt^=Dt<<4,Dt=65535&(Tt>>>-16^mt),mt^=Dt,Tt^=Dt<<-16,Dt=858993459&(mt>>>2^Tt),Tt^=Dt,mt^=Dt<<2,Dt=65535&(Tt>>>-16^mt),mt^=Dt,Tt^=Dt<<-16,Dt=1431655765&(mt>>>1^Tt),Tt^=Dt,mt^=Dt<<1,Dt=16711935&(Tt>>>8^mt),mt^=Dt,Tt^=Dt<<8,Dt=1431655765&(mt>>>1^Tt),Tt^=Dt,mt^=Dt<<1,Dt=mt<<8|Tt>>>20&240,mt=Tt<<24|Tt<<8&16711680|Tt>>>8&65280|Tt>>>24&240,Tt=Dt;for(let ke=0;ke<16;ke++)St[ke]?(mt=mt<<2|mt>>>26,Tt=Tt<<2|Tt>>>26):(mt=mt<<1|mt>>>27,Tt=Tt<<1|Tt>>>27),mt&=-15,Tt&=-15,Et=Ae[mt>>>28]|Ce[mt>>>24&15]|qe[mt>>>20&15]|ze[mt>>>16&15]|Ve[mt>>>12&15]|tt[mt>>>8&15]|rt[mt>>>4&15],Pt=it[Tt>>>28]|nt[Tt>>>24&15]|ot[Tt>>>20&15]|ct[Tt>>>16&15]|ht[Tt>>>12&15]|ft[Tt>>>8&15]|yt[Tt>>>4&15],Dt=65535&(Pt>>>16^Et),kt[Bt++]=Et^Dt,kt[Bt++]=Pt^Dt<<16}return kt}function We(ke){this.key=[];for(let Ae=0;Ae<3;Ae++)this.key.push(new Uint8Array(ke.subarray(8*Ae,8*Ae+8)));this.encrypt=function(ke){return je(Le(this.key[2]),je(Le(this.key[1]),je(Le(this.key[0]),ke,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function He(){this.BlockSize=8,this.KeySize=16,this.setKey=function(ke){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),ke.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(ke),!0},this.reset=function(){for(let ke=0;ke<16;ke++)this.masking[ke]=0,this.rotate[ke]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(ke){const Ae=Array(ke.length);for(let Ce=0;Ce>>24&255,Ae[Ce+1]=Ve>>>16&255,Ae[Ce+2]=Ve>>>8&255,Ae[Ce+3]=255&Ve,Ae[Ce+4]=ze>>>24&255,Ae[Ce+5]=ze>>>16&255,Ae[Ce+6]=ze>>>8&255,Ae[Ce+7]=255&ze}return Ae},this.decrypt=function(ke){const Ae=Array(ke.length);for(let Ce=0;Ce>>24&255,Ae[Ce+1]=Ve>>>16&255,Ae[Ce+2]=Ve>>>8&255,Ae[Ce+3]=255&Ve,Ae[Ce+4]=ze>>>24&255,Ae[Ce+5]=ze>>16&255,Ae[Ce+6]=ze>>8&255,Ae[Ce+7]=255&ze}return Ae};const ke=[,,,,];ke[0]=[,,,,],ke[0][0]=[4,0,13,15,12,14,8],ke[0][1]=[5,2,16,18,17,19,10],ke[0][2]=[6,3,23,22,21,20,9],ke[0][3]=[7,1,26,25,27,24,11],ke[1]=[,,,,],ke[1][0]=[0,6,21,23,20,22,16],ke[1][1]=[1,4,0,2,1,3,18],ke[1][2]=[2,5,7,6,5,4,17],ke[1][3]=[3,7,10,9,11,8,19],ke[2]=[,,,,],ke[2][0]=[4,0,13,15,12,14,8],ke[2][1]=[5,2,16,18,17,19,10],ke[2][2]=[6,3,23,22,21,20,9],ke[2][3]=[7,1,26,25,27,24,11],ke[3]=[,,,,],ke[3][0]=[0,6,21,23,20,22,16],ke[3][1]=[1,4,0,2,1,3,18],ke[3][2]=[2,5,7,6,5,4,17],ke[3][3]=[3,7,10,9,11,8,19];const Ae=[,,,,];function r(ke,Ae,qe){const ze=Ae+ke,Ve=ze<>>32-qe;return(Ce[0][Ve>>>24]^Ce[1][Ve>>>16&255])-Ce[2][Ve>>>8&255]+Ce[3][255&Ve]}function i(ke,Ae,qe){const ze=Ae^ke,Ve=ze<>>32-qe;return Ce[0][Ve>>>24]-Ce[1][Ve>>>16&255]+Ce[2][Ve>>>8&255]^Ce[3][255&Ve]}function n(ke,Ae,qe){const ze=Ae-ke,Ve=ze<>>32-qe;return(Ce[0][Ve>>>24]+Ce[1][Ve>>>16&255]^Ce[2][Ve>>>8&255])-Ce[3][255&Ve]}Ae[0]=[,,,,],Ae[0][0]=[24,25,23,22,18],Ae[0][1]=[26,27,21,20,22],Ae[0][2]=[28,29,19,18,25],Ae[0][3]=[30,31,17,16,28],Ae[1]=[,,,,],Ae[1][0]=[3,2,12,13,8],Ae[1][1]=[1,0,14,15,13],Ae[1][2]=[7,6,8,9,3],Ae[1][3]=[5,4,10,11,7],Ae[2]=[,,,,],Ae[2][0]=[19,18,28,29,25],Ae[2][1]=[17,16,30,31,28],Ae[2][2]=[23,22,24,25,18],Ae[2][3]=[21,20,26,27,22],Ae[3]=[,,,,],Ae[3][0]=[8,9,7,6,3],Ae[3][1]=[10,11,5,4,7],Ae[3][2]=[12,13,3,2,8],Ae[3][3]=[14,15,1,0,13],this.keySchedule=function(qe){const ze=[,,,,,,,,],Ve=Array(32);let tt;for(let ke=0;ke<4;ke++)tt=4*ke,ze[ke]=qe[tt]<<24|qe[tt+1]<<16|qe[tt+2]<<8|qe[tt+3];const rt=[6,7,4,5];let it,nt=0;for(let qe=0;qe<2;qe++)for(let qe=0;qe<4;qe++){for(tt=0;tt<4;tt++){const Ae=ke[qe][tt];it=ze[Ae[1]],it^=Ce[4][ze[Ae[2]>>>2]>>>24-8*(3&Ae[2])&255],it^=Ce[5][ze[Ae[3]>>>2]>>>24-8*(3&Ae[3])&255],it^=Ce[6][ze[Ae[4]>>>2]>>>24-8*(3&Ae[4])&255],it^=Ce[7][ze[Ae[5]>>>2]>>>24-8*(3&Ae[5])&255],it^=Ce[rt[tt]][ze[Ae[6]>>>2]>>>24-8*(3&Ae[6])&255],ze[Ae[0]]=it}for(tt=0;tt<4;tt++){const ke=Ae[qe][tt];it=Ce[4][ze[ke[0]>>>2]>>>24-8*(3&ke[0])&255],it^=Ce[5][ze[ke[1]>>>2]>>>24-8*(3&ke[1])&255],it^=Ce[6][ze[ke[2]>>>2]>>>24-8*(3&ke[2])&255],it^=Ce[7][ze[ke[3]>>>2]>>>24-8*(3&ke[3])&255],it^=Ce[4+tt][ze[ke[4]>>>2]>>>24-8*(3&ke[4])&255],Ve[nt]=it,nt++}}for(let ke=0;ke<16;ke++)this.masking[ke]=Ve[ke],this.rotate[ke]=31&Ve[16+ke]};const Ce=[,,,,,,,,];Ce[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],Ce[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],Ce[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],Ce[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],Ce[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],Ce[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],Ce[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],Ce[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function Ge(ke){this.cast5=new He,this.cast5.setKey(ke),this.encrypt=function(ke){return this.cast5.encrypt(ke)}}We.keySize=We.prototype.keySize=24,We.blockSize=We.prototype.blockSize=8,Ge.blockSize=Ge.prototype.blockSize=8,Ge.keySize=Ge.prototype.keySize=16;const _r=4294967295;function $e(ke,Ae){return(ke<>>32-Ae)&_r}function Ze(ke,Ae){return ke[Ae]|ke[Ae+1]<<8|ke[Ae+2]<<16|ke[Ae+3]<<24}function Ye(ke,Ae,Ce){ke.splice(Ae,4,255&Ce,Ce>>>8&255,Ce>>>16&255,Ce>>>24&255)}function Xe(ke,Ae){return ke>>>8*Ae&255}function Qe(ke){this.tf=function(){let ke=null,Ae=null,Ce=-1,qe=[],ze=[[],[],[],[]];function a(ke){return ze[0][Xe(ke,0)]^ze[1][Xe(ke,1)]^ze[2][Xe(ke,2)]^ze[3][Xe(ke,3)]}function s(ke){return ze[0][Xe(ke,3)]^ze[1][Xe(ke,0)]^ze[2][Xe(ke,1)]^ze[3][Xe(ke,2)]}function o(ke,Ae){let Ce=a(Ae[0]),ze=s(Ae[1]);Ae[2]=$e(Ae[2]^Ce+ze+qe[4*ke+8]&_r,31),Ae[3]=$e(Ae[3],1)^Ce+2*ze+qe[4*ke+9]&_r,Ce=a(Ae[2]),ze=s(Ae[3]),Ae[0]=$e(Ae[0]^Ce+ze+qe[4*ke+10]&_r,31),Ae[1]=$e(Ae[1],1)^Ce+2*ze+qe[4*ke+11]&_r}function c(ke,Ae){let Ce=a(Ae[0]),ze=s(Ae[1]);Ae[2]=$e(Ae[2],1)^Ce+ze+qe[4*ke+10]&_r,Ae[3]=$e(Ae[3]^Ce+2*ze+qe[4*ke+11]&_r,31),Ce=a(Ae[2]),ze=s(Ae[3]),Ae[0]=$e(Ae[0],1)^Ce+ze+qe[4*ke+8]&_r,Ae[1]=$e(Ae[1]^Ce+2*ze+qe[4*ke+9]&_r,31)}return{name:"twofish",blocksize:16,open:function(Ae){let Ce,Ve,tt,rt,it;ke=Ae;const nt=[],ot=[],ct=[];let ht;const ft=[];let yt,mt,kt;const St=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],Et=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],Pt=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],Dt=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],Rt=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],Bt=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],Tt=[[],[]],Ut=[[],[],[],[]];function E(ke){return ke^ke>>2^[0,90,180,238][3&ke]}function P(ke){return ke^ke>>1^ke>>2^[0,238,180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16)+(kt<<24),Ut[2][Ce]=mt+(kt<<8)+(yt<<16)+(kt<<24),yt=Tt[0][Ce],mt=E(yt),kt=P(yt),Ut[1][Ce]=kt+(kt<<8)+(mt<<16)+(yt<<24),Ut[3][Ce]=mt+(yt<<8)+(kt<<16)+(mt<<24);for(ht=ct.length/2,Ce=0;Ce=0;ke--)c(ke,Ve);Ye(Ae,Ce,Ve[2]^qe[0]),Ye(Ae,Ce+4,Ve[3]^qe[1]),Ye(Ae,Ce+8,Ve[0]^qe[2]),Ye(Ae,Ce+12,Ve[1]^qe[3]),Ce+=16},finalize:function(){return Ae}}}(),this.tf.open(Array.from(ke),0),this.encrypt=function(ke){return this.tf.encrypt(Array.from(ke),0)}}function Je(){}function et(ke){this.bf=new Je,this.bf.init(ke),this.encrypt=function(ke){return this.bf.encryptBlock(ke)}}Qe.keySize=Qe.prototype.keySize=32,Qe.blockSize=Qe.prototype.blockSize=16,Je.prototype.BLOCKSIZE=8,Je.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],Je.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],Je.prototype.NN=16,Je.prototype._clean=function(ke){if(ke<0){ke=(2147483647&ke)+2147483648}return ke},Je.prototype._F=function(ke){let Ae;const Ce=255&ke,qe=255&(ke>>>=8),ze=255&(ke>>>=8),Ve=255&(ke>>>=8);return Ae=this.sboxes[0][Ve]+this.sboxes[1][ze],Ae^=this.sboxes[2][qe],Ae+=this.sboxes[3][Ce],Ae},Je.prototype._encryptBlock=function(ke){let Ae,Ce=ke[0],qe=ke[1];for(Ae=0;Ae>>24-8*Ae&255,ze[Ae+qe]=Ce[1]>>>24-8*Ae&255;return ze},Je.prototype._decryptBlock=function(ke){let Ae,Ce=ke[0],qe=ke[1];for(Ae=this.NN+1;Ae>1;--Ae){Ce^=this.parray[Ae],qe=this._F(Ce)^qe;const ke=Ce;Ce=qe,qe=ke}Ce^=this.parray[1],qe^=this.parray[0],ke[0]=this._clean(qe),ke[1]=this._clean(Ce)},Je.prototype.init=function(ke){let Ae,Ce=0;for(this.parray=[],Ae=0;Ae=ke.length&&(Ce=0);this.parray[Ae]=this.PARRAY[Ae]^qe}for(this.sboxes=[],Ae=0;Ae<4;++Ae)for(this.sboxes[Ae]=[],Ce=0;Ce<256;++Ce)this.sboxes[Ae][Ce]=this.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|51],Dt[ke|52]<<24|Dt[ke|53]<<16|Dt[ke|54]<<8|Dt[ke|55],Dt[ke|56]<<24|Dt[ke|57]<<16|Dt[ke|58]<<8|Dt[ke|59],Dt[ke|60]<<24|Dt[ke|61]<<16|Dt[ke|62]<<8|Dt[ke|63])}function A(ke){ke=ke|0;Dt[ke|0]=qe>>>24;Dt[ke|1]=qe>>>16&255;Dt[ke|2]=qe>>>8&255;Dt[ke|3]=qe&255;Dt[ke|4]=ze>>>24;Dt[ke|5]=ze>>>16&255;Dt[ke|6]=ze>>>8&255;Dt[ke|7]=ze&255;Dt[ke|8]=Ve>>>24;Dt[ke|9]=Ve>>>16&255;Dt[ke|10]=Ve>>>8&255;Dt[ke|11]=Ve&255;Dt[ke|12]=tt>>>24;Dt[ke|13]=tt>>>16&255;Dt[ke|14]=tt>>>8&255;Dt[ke|15]=tt&255;Dt[ke|16]=rt>>>24;Dt[ke|17]=rt>>>16&255;Dt[ke|18]=rt>>>8&255;Dt[ke|19]=rt&255}function S(){qe=0x67452301;ze=0xefcdab89;Ve=0x98badcfe;tt=0x10325476;rt=0xc3d2e1f0;it=nt=0}function E(ke,Ae,Ce,ot,ct,ht,ft){ke=ke|0;Ae=Ae|0;Ce=Ce|0;ot=ot|0;ct=ct|0;ht=ht|0;ft=ft|0;qe=ke;ze=Ae;Ve=Ce;tt=ot;rt=ct;it=ht;nt=ft}function P(ke,Ae){ke=ke|0;Ae=Ae|0;var Ce=0;if(ke&63)return-1;while((Ae|0)>=64){k(ke);ke=ke+64|0;Ae=Ae-64|0;Ce=Ce+64|0}it=it+Ce|0;if(it>>>0>>0)nt=nt+1|0;return Ce|0}function x(ke,Ae,Ce){ke=ke|0;Ae=Ae|0;Ce=Ce|0;var qe=0,ze=0;if(ke&63)return-1;if(~Ce)if(Ce&31)return-1;if((Ae|0)>=64){qe=P(ke,Ae)|0;if((qe|0)==-1)return-1;ke=ke+qe|0;Ae=Ae-qe|0}qe=qe+Ae|0;it=it+Ae|0;if(it>>>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,qt^0x36363636,zt^0x36363636,Ft^0x36363636,Lt^0x36363636);ot=qe;ct=ze;ht=Ve;ft=tt;yt=rt;it=64;nt=0}function D(ke,Ae,Ce){ke=ke|0;Ae=Ae|0;Ce=Ce|0;var it=0,nt=0,ot=0,ct=0,ht=0,ft=0;if(ke&63)return-1;if(~Ce)if(Ce&31)return-1;ft=x(ke,Ae,-1)|0;it=qe,nt=ze,ot=Ve,ct=tt,ht=rt;C();_(it,nt,ot,ct,ht,0x80000000,0,0,0,0,0,0,0,0,0,672);if(~Ce)A(Ce);return ft|0}function R(ke,Ae,Ce,it,nt){ke=ke|0;Ae=Ae|0;Ce=Ce|0;it=it|0;nt=nt|0;var ot=0,ct=0,ht=0,ft=0,yt=0,mt=0,kt=0,St=0,Et=0,Pt=0;if(ke&63)return-1;if(~nt)if(nt&31)return-1;Dt[ke+Ae|0]=Ce>>>24;Dt[ke+Ae+1|0]=Ce>>>16&255;Dt[ke+Ae+2|0]=Ce>>>8&255;Dt[ke+Ae+3|0]=Ce&255;D(ke,Ae+4|0,-1)|0;ot=mt=qe,ct=kt=ze,ht=St=Ve,ft=Et=tt,yt=Pt=rt;it=it-1|0;while((it|0)>0){M();_(mt,kt,St,Et,Pt,0x80000000,0,0,0,0,0,0,0,0,0,672);mt=qe,kt=ze,St=Ve,Et=tt,Pt=rt;C();_(mt,kt,St,Et,Pt,0x80000000,0,0,0,0,0,0,0,0,0,672);mt=qe,kt=ze,St=Ve,Et=tt,Pt=rt;ot=ot^qe;ct=ct^ze;ht=ht^Ve;ft=ft^tt;yt=yt^rt;it=it-1|0}qe=ot;ze=ct;Ve=ht;tt=ft;rt=yt;if(~nt)A(nt);return 0}return{reset:S,init:E,process:P,finish:x,hmac_reset:M,hmac_init:K,hmac_finish:D,pbkdf2_generate_block:R}};class st{constructor(){this.pos=0,this.len=0}reset(){const{asm:ke}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,ke.reset(),this}process(ke){if(null!==this.result)throw new Ie("state must be reset before processing new data");const{asm:Ae,heap:Ce}=this.acquire_asm();let qe=this.pos,ze=this.len,Ve=0,tt=ke.length,rt=0;for(;tt>0;)rt=Re(Ce,qe+ze,ke,Ve,tt),ze+=rt,Ve+=rt,tt-=rt,rt=Ae.process(qe,ze),qe+=rt,ze-=rt,ze||(qe=0);return this.pos=qe,this.len=ze,this}finish(){if(null!==this.result)throw new Ie("state must be reset before processing new data");const{asm:ke,heap:Ae}=this.acquire_asm();return ke.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(Ae.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const xr=[],Dr=[];class ut extends st{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=xr.pop()||De(),this.asm=Dr.pop()||at({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(xr.push(this.heap),Dr.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(ke){return(new ut).process(ke).finish().result}}ut.NAME="sha1",ut.heap_pool=[],ut.asm_pool=[],ut.asm_function=at;const Rr=[],Br=[];class dt extends st{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return void 0!==this.heap&&void 0!==this.asm||(this.heap=Rr.pop()||De(),this.asm=Br.pop()||function(ke,Ae,Ce){"use asm";var qe=0,ze=0,Ve=0,tt=0,rt=0,it=0,nt=0,ot=0,ct=0,ht=0,ft=0,yt=0,mt=0,kt=0,St=0,Et=0,Pt=0,Dt=0,Rt=0,Bt=0,Tt=0,Ut=0,Kt=0,It=0,Ot=0,Nt=0,qt=new ke.Uint8Array(Ce);function K(ke,Ae,Ce,ct,ht,ft,yt,mt,kt,St,Et,Pt,Dt,Rt,Bt,Tt){ke=ke|0;Ae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<8|qt[ke|15],qt[ke|16]<<24|qt[ke|17]<<16|qt[ke|18]<<8|qt[ke|19],qt[ke|20]<<24|qt[ke|21]<<16|qt[ke|22]<<8|qt[ke|23],qt[ke|24]<<24|qt[ke|25]<<16|qt[ke|26]<<8|qt[ke|27],qt[ke|28]<<24|qt[ke|29]<<16|qt[ke|30]<<8|qt[ke|31],qt[ke|32]<<24|qt[ke|33]<<16|qt[ke|34]<<8|qt[ke|35],qt[ke|36]<<24|qt[ke|37]<<16|qt[ke|38]<<8|qt[ke|39],qt[ke|40]<<24|qt[ke|41]<<16|qt[ke|42]<<8|qt[ke|43],qt[ke|44]<<24|qt[ke|45]<<16|qt[ke|46]<<8|qt[ke|47],qt[ke|48]<<24|qt[ke|49]<<16|qt[ke|50]<<8|qt[ke|51],qt[ke|52]<<24|qt[ke|53]<<16|qt[ke|54]<<8|qt[ke|55],qt[ke|56]<<24|qt[ke|57]<<16|qt[ke|58]<<8|qt[ke|59],qt[ke|60]<<24|qt[ke|61]<<16|qt[ke|62]<<8|qt[ke|63])}function R(ke){ke=ke|0;qt[ke|0]=qe>>>24;qt[ke|1]=qe>>>16&255;qt[ke|2]=qe>>>8&255;qt[ke|3]=qe&255;qt[ke|4]=ze>>>24;qt[ke|5]=ze>>>16&255;qt[ke|6]=ze>>>8&255;qt[ke|7]=ze&255;qt[ke|8]=Ve>>>24;qt[ke|9]=Ve>>>16&255;qt[ke|10]=Ve>>>8&255;qt[ke|11]=Ve&255;qt[ke|12]=tt>>>24;qt[ke|13]=tt>>>16&255;qt[ke|14]=tt>>>8&255;qt[ke|15]=tt&255;qt[ke|16]=rt>>>24;qt[ke|17]=rt>>>16&255;qt[ke|18]=rt>>>8&255;qt[ke|19]=rt&255;qt[ke|20]=it>>>24;qt[ke|21]=it>>>16&255;qt[ke|22]=it>>>8&255;qt[ke|23]=it&255;qt[ke|24]=nt>>>24;qt[ke|25]=nt>>>16&255;qt[ke|26]=nt>>>8&255;qt[ke|27]=nt&255;qt[ke|28]=ot>>>24;qt[ke|29]=ot>>>16&255;qt[ke|30]=ot>>>8&255;qt[ke|31]=ot&255}function U(){qe=0x6a09e667;ze=0xbb67ae85;Ve=0x3c6ef372;tt=0xa54ff53a;rt=0x510e527f;it=0x9b05688c;nt=0x1f83d9ab;ot=0x5be0cd19;ct=ht=0}function I(ke,Ae,Ce,ft,yt,mt,kt,St,Et,Pt){ke=ke|0;Ae=Ae|0;Ce=Ce|0;ft=ft|0;yt=yt|0;mt=mt|0;kt=kt|0;St=St|0;Et=Et|0;Pt=Pt|0;qe=ke;ze=Ae;Ve=Ce;tt=ft;rt=yt;it=mt;nt=kt;ot=St;ct=Et;ht=Pt}function B(ke,Ae){ke=ke|0;Ae=Ae|0;var Ce=0;if(ke&63)return-1;while((Ae|0)>=64){D(ke);ke=ke+64|0;Ae=Ae-64|0;Ce=Ce+64|0}ct=ct+Ce|0;if(ct>>>0>>0)ht=ht+1|0;return Ce|0}function T(ke,Ae,Ce){ke=ke|0;Ae=Ae|0;Ce=Ce|0;var qe=0,ze=0;if(ke&63)return-1;if(~Ce)if(Ce&31)return-1;if((Ae|0)>=64){qe=B(ke,Ae)|0;if((qe|0)==-1)return-1;ke=ke+qe|0;Ae=Ae-qe|0}qe=qe+Ae|0;ct=ct+Ae|0;if(ct>>>0>>0)ht=ht+1|0;qt[ke|Ae]=0x80;if((Ae|0)>=56){for(ze=Ae+1|0;(ze|0)<64;ze=ze+1|0)qt[ke|ze]=0x00;D(ke);Ae=0;qt[ke|0]=0}for(ze=Ae+1|0;(ze|0)<59;ze=ze+1|0)qt[ke|ze]=0;qt[ke|56]=ht>>>21&255;qt[ke|57]=ht>>>13&255;qt[ke|58]=ht>>>5&255;qt[ke|59]=ht<<3&255|ct>>>29;qt[ke|60]=ct>>>21&255;qt[ke|61]=ct>>>13&255;qt[ke|62]=ct>>>5&255;qt[ke|63]=ct<<3&255;D(ke);if(~Ce)R(Ce);return qe|0}function z(){qe=ft;ze=yt;Ve=mt;tt=kt;rt=St;it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mt,kt,St,Et,0x80000000,0,0,0,0,0,0,768);if(~Ce)R(Ce);return Pt|0}function N(ke,Ae,Ce,ct,ht){ke=ke|0;Ae=Ae|0;Ce=Ce|0;ct=ct|0;ht=ht|0;var ft=0,yt=0,mt=0,kt=0,St=0,Et=0,Pt=0,Dt=0,Rt=0,Bt=0,Tt=0,Ut=0,Kt=0,It=0,Ot=0,Nt=0;if(ke&63)return-1;if(~ht)if(ht&31)return-1;qt[ke+Ae|0]=Ce>>>24;qt[ke+Ae+1|0]=Ce>>>16&255;qt[ke+Ae+2|0]=Ce>>>8&255;qt[ke+Ae+3|0]=Ce&255;F(ke,Ae+4|0,-1)|0;ft=Rt=qe,yt=Bt=ze,mt=Tt=Ve,kt=Ut=tt,St=Kt=rt,Et=It=it,Pt=Ot=nt,Dt=Nt=ot;ct=ct-1|0;while((ct|0)>0){z();K(Rt,Bt,Tt,Ut,Kt,It,Ot,Nt,0x80000000,0,0,0,0,0,0,768);Rt=qe,Bt=ze,Tt=Ve,Ut=tt,Kt=rt,It=it,Ot=nt,Nt=ot;q();K(Rt,Bt,Tt,Ut,Kt,It,Ot,Nt,0x80000000,0,0,0,0,0,0,768);Rt=qe,Bt=ze,Tt=Ve,Ut=tt,Kt=rt,It=it,Ot=nt,Nt=ot;ft=ft^qe;yt=yt^ze;mt=mt^Ve;kt=kt^tt;St=St^rt;Et=Et^it;Pt=Pt^nt;Dt=Dt^ot;ct=ct-1|0}qe=ft;ze=yt;Ve=mt;tt=kt;rt=St;it=Et;nt=Pt;ot=Dt;if(~ht)R(ht);return 0}return{reset:U,init:I,process:B,finish:T,hmac_reset:z,hmac_init:O,hmac_finish:F,pbkdf2_generate_block:N}}({Uint8Array:Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){void 0!==this.heap&&void 0!==this.asm&&(Rr.push(this.heap),Br.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(ke){return(new dt).process(ke).finish().result}}dt.NAME="sha256";var Ur=pt;function pt(ke,Ae){if(!ke)throw Error(Ae||"Assertion failed")}pt.equal=function(ke,Ae,Ce){if(ke!=Ae)throw Error(Ce||"Assertion failed: "+ke+" != "+Ae)};var Ir=void 0!==qe?qe:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function bt(ke,Ae){return ke(Ae={exports:{}},Ae.exports),Ae.exports}var Lr=bt((function(ke){ke.exports="function"==typeof Object.create?function(ke,Ae){ke.super_=Ae,ke.prototype=Object.create(Ae.prototype,{constructor:{value:ke,enumerable:!1,writable:!0,configurable:!0}})}:function(ke,Ae){ke.super_=Ae;var r=function(){};r.prototype=Ae.prototype,ke.prototype=new r,ke.prototype.constructor=ke}})),Gr=bt((function(ke){try{var Ae=kt.default;if("function"!=typeof Ae.inherits)throw"";ke.exports=Ae.inherits}catch(Ae){ke.exports=Lr}}));function wt(ke){return(ke>>>24|ke>>>8&65280|ke<<8&16711680|(255&ke)<<24)>>>0}function vt(ke){return 1===ke.length?"0"+ke:ke}function _t(ke){return 7===ke.length?"0"+ke:6===ke.length?"00"+ke:5===ke.length?"000"+ke:4===ke.length?"0000"+ke:3===ke.length?"00000"+ke:2===ke.length?"000000"+ke:1===ke.length?"0000000"+ke:ke}var $r={inherits:Gr,toArray:function(ke,Ae){if(Array.isArray(ke))return ke.slice();if(!ke)return[];var Ce=[];if("string"==typeof ke)if(Ae){if("hex"===Ae)for((ke=ke.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(ke="0"+ke),qe=0;qe>8,tt=255&ze;Ve?Ce.push(Ve,tt):Ce.push(tt)}else for(qe=0;qe>>0}return Ve},split32:function(ke,Ae){for(var Ce=Array(4*ke.length),qe=0,ze=0;qe>>24,Ce[ze+1]=Ve>>>16&255,Ce[ze+2]=Ve>>>8&255,Ce[ze+3]=255&Ve):(Ce[ze+3]=Ve>>>24,Ce[ze+2]=Ve>>>16&255,Ce[ze+1]=Ve>>>8&255,Ce[ze]=255&Ve)}return Ce},rotr32:function(ke,Ae){return ke>>>Ae|ke<<32-Ae},rotl32:function(ke,Ae){return ke<>>32-Ae},sum32:function(ke,Ae){return ke+Ae>>>0},sum32_3:function(ke,Ae,Ce){return ke+Ae+Ce>>>0},sum32_4:function(ke,Ae,Ce,qe){return ke+Ae+Ce+qe>>>0},sum32_5:function(ke,Ae,Ce,qe,ze){return ke+Ae+Ce+qe+ze>>>0},sum64:function(ke,Ae,Ce,qe){var ze=ke[Ae],Ve=qe+ke[Ae+1]>>>0,tt=(Ve>>0,ke[Ae+1]=Ve},sum64_hi:function(ke,Ae,Ce,qe){return(Ae+qe>>>0>>0},sum64_lo:function(ke,Ae,Ce,qe){return Ae+qe>>>0},sum64_4_hi:function(ke,Ae,Ce,qe,ze,Ve,tt,rt){var it=0,nt=Ae;return it+=(nt=nt+qe>>>0)>>0)>>0)>>0},sum64_4_lo:function(ke,Ae,Ce,qe,ze,Ve,tt,rt){return Ae+qe+Ve+rt>>>0},sum64_5_hi:function(ke,Ae,Ce,qe,ze,Ve,tt,rt,it,nt){var ot=0,ct=Ae;return ot+=(ct=ct+qe>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(ke,Ae,Ce,qe,ze,Ve,tt,rt,it,nt){return Ae+qe+Ve+rt+nt>>>0},rotr64_hi:function(ke,Ae,Ce){return(Ae<<32-Ce|ke>>>Ce)>>>0},rotr64_lo:function(ke,Ae,Ce){return(ke<<32-Ce|Ae>>>Ce)>>>0},shr64_hi:function(ke,Ae,Ce){return ke>>>Ce},shr64_lo:function(ke,Ae,Ce){return(ke<<32-Ce|Ae>>>Ce)>>>0}};function At(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var Vr=At;At.prototype.update=function(ke,Ae){if(ke=$r.toArray(ke,Ae),this.pending?this.pending=this.pending.concat(ke):this.pending=ke,this.pendingTotal+=ke.length,this.pending.length>=this._delta8){var Ce=(ke=this.pending).length%this._delta8;this.pending=ke.slice(ke.length-Ce,ke.length),0===this.pending.length&&(this.pending=null),ke=$r.join32(ke,0,ke.length-Ce,this.endian);for(var qe=0;qe>>24&255,qe[ze++]=ke>>>16&255,qe[ze++]=ke>>>8&255,qe[ze++]=255&ke}else for(qe[ze++]=255&ke,qe[ze++]=ke>>>8&255,qe[ze++]=ke>>>16&255,qe[ze++]=ke>>>24&255,qe[ze++]=0,qe[ze++]=0,qe[ze++]=0,qe[ze++]=0,Ve=8;Ve>>3},g1_256:function(ke){return Qr(ke,17)^Qr(ke,19)^ke>>>10}},ri=$r.sum32,si=$r.sum32_4,ai=$r.sum32_5,ui=ti.ch32,hi=ti.maj32,pi=ti.s0_256,yi=ti.s1_256,mi=ti.g0_256,gi=ti.g1_256,bi=Jr.BlockHash,vi=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function jt(){if(!(this instanceof jt))return new jt;bi.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=vi,this.W=Array(64)}$r.inherits(jt,bi);var wi=jt;function Wt(){if(!(this instanceof Wt))return new Wt;wi.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}jt.blockSize=512,jt.outSize=256,jt.hmacStrength=192,jt.padLength=64,jt.prototype._update=function(ke,Ae){for(var Ce=this.W,qe=0;qe<16;qe++)Ce[qe]=ke[Ae+qe];for(;qe>>32-ze,Ce)}function qr(ke,Ae,Ce,qe,ze,Ve,tt){return zr(Ae&Ce|~Ae&qe,ke,Ae,ze,Ve,tt)}function Or(ke,Ae,Ce,qe,ze,Ve,tt){return zr(Ae&qe|Ce&~qe,ke,Ae,ze,Ve,tt)}function Fr(ke,Ae,Ce,qe,ze,Ve,tt){return zr(Ae^Ce^qe,ke,Ae,ze,Ve,tt)}function Nr(ke,Ae,Ce,qe,ze,Ve,tt){return zr(Ce^(Ae|~qe),ke,Ae,ze,Ve,tt)}function jr(ke){const Ae=[];let Ce;for(Ce=0;Ce<64;Ce+=4)Ae[Ce>>2]=ke.charCodeAt(Ce)+(ke.charCodeAt(Ce+1)<<8)+(ke.charCodeAt(Ce+2)<<16)+(ke.charCodeAt(Ce+3)<<24);return Ae}const Cn="0123456789abcdef".split("");function Wr(ke){let Ae="",Ce=0;for(;Ce<4;Ce++)Ae+=Cn[ke>>8*Ce+4&15]+Cn[ke>>8*Ce&15];return Ae}function Hr(ke,Ae){return ke+Ae&4294967295}const Rn=Zt.getWebCrypto(),Bn=Zt.getNodeCrypto(),Un=Bn&&Bn.getHashes();function Zr(ke){if(Bn&&Un.includes(ke))return async function(Ae){const Ce=Bn.createHash(ke);return Y(Ae,(ke=>{Ce.update(ke)}),(()=>new Uint8Array(Ce.digest())))}}function Yr(ke,Ae){return async function(Ce,qe=tr){if(_(Ce)&&(Ce=await ie(Ce)),!Zt.isStream(Ce)&&Rn&&Ae&&Ce.length>=qe.minBytesForWebCrypto)return new Uint8Array(await Rn.digest(Ae,Ce));const ze=ke();return Y(Ce,(ke=>{ze.update(ke)}),(()=>new Uint8Array(ze.digest())))}}function Xr(ke,Ae){return async function(Ce,qe=tr){if(_(Ce)&&(Ce=await ie(Ce)),Zt.isStream(Ce)){const Ae=new ke;return Y(Ce,(ke=>{Ae.process(ke)}),(()=>Ae.finish().result))}return Rn&&Ae&&Ce.length>=qe.minBytesForWebCrypto?new Uint8Array(await Rn.digest(Ae,Ce)):ke.bytes(Ce)}}const On={md5:Zr("md5")||async function(ke){const Ae=function(ke){const Ae=ke.length,Ce=[1732584193,-271733879,-1732584194,271733878];let qe;for(qe=64;qe<=ke.length;qe+=64)Tr(Ce,jr(ke.substring(qe-64,qe)));ke=ke.substring(qe-64);const ze=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(qe=0;qe>2]|=ke.charCodeAt(qe)<<(qe%4<<3);if(ze[qe>>2]|=128<<(qe%4<<3),qe>55)for(Tr(Ce,ze),qe=0;qe<16;qe++)ze[qe]=0;return ze[14]=8*Ae,Tr(Ce,ze),Ce}(Zt.uint8ArrayToString(ke));return Zt.hexToUint8Array(function(ke){for(let Ae=0;Ae>>8)-1}(ke,Ae,Ce,qe,32)}function p(ke,Ae){var Ce;for(Ce=0;Ce<16;Ce++)ke[Ce]=0|Ae[Ce]}function y(ke){var Ae,Ce,qe=1;for(Ae=0;Ae<16;Ae++)Ce=ke[Ae]+qe+65535,qe=Math.floor(Ce/65536),ke[Ae]=Ce-65536*qe;ke[0]+=qe-1+37*(qe-1)}function b(ke,Ae,Ce){for(var qe,ze=~(Ce-1),Ve=0;Ve<16;Ve++)qe=ze&(ke[Ve]^Ae[Ve]),ke[Ve]^=qe,Ae[Ve]^=qe}function m(ke,Ae){var Ce,qe,ze,Ve=t(),tt=t();for(Ce=0;Ce<16;Ce++)tt[Ce]=Ae[Ce];for(y(tt),y(tt),y(tt),qe=0;qe<2;qe++){for(Ve[0]=tt[0]-65517,Ce=1;Ce<15;Ce++)Ve[Ce]=tt[Ce]-65535-(Ve[Ce-1]>>16&1),Ve[Ce-1]&=65535;Ve[15]=tt[15]-32767-(Ve[14]>>16&1),ze=Ve[15]>>16&1,Ve[14]&=65535,b(tt,Ve,1-ze)}for(Ce=0;Ce<16;Ce++)ke[2*Ce]=255&tt[Ce],ke[2*Ce+1]=tt[Ce]>>8}function g(ke,Ae){var Ce=new Uint8Array(32),qe=new Uint8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zt+=qe*vr,Ft+=qe*_r,Lt+=qe*kr,Ht+=qe*Ar,Pt+=(qe=Ae[14])*Vt,Dt+=qe*Zt,Rt+=qe*Yt,Bt+=qe*Jt,Tt+=qe*Xt,Ut+=qe*Qt,Kt+=qe*er,It+=qe*tr,Ot+=qe*rr,Nt+=qe*ir,qt+=qe*nr,zt+=qe*sr,Ft+=qe*vr,Lt+=qe*_r,Ht+=qe*kr,Gt+=qe*Ar,Dt+=(qe=Ae[15])*Vt,tt+=38*(Bt+=qe*Yt),rt+=38*(Tt+=qe*Jt),it+=38*(Ut+=qe*Xt),nt+=38*(Kt+=qe*Qt),ot+=38*(It+=qe*er),ct+=38*(Ot+=qe*tr),ht+=38*(Nt+=qe*rr),ft+=38*(qt+=qe*ir),yt+=38*(zt+=qe*nr),mt+=38*(Ft+=qe*sr),kt+=38*(Lt+=qe*vr),St+=38*(Ht+=qe*_r),Et+=38*(Gt+=qe*kr),Pt+=38*($t+=qe*Ar),Ve=(qe=(Ve+=38*(Rt+=qe*Zt))+(ze=1)+65535)-65536*(ze=Math.floor(qe/65536)),tt=(qe=tt+ze+65535)-65536*(ze=Math.floor(qe/65536)),rt=(qe=rt+ze+65535)-65536*(ze=Math.floor(qe/65536)),it=(qe=it+ze+65535)-65536*(ze=Math.floor(qe/65536)),nt=(qe=nt+ze+65535)-65536*(ze=Math.floor(qe/65536)),ot=(qe=ot+ze+65535)-65536*(ze=Math.floor(qe/65536)),ct=(qe=ct+ze+65535)-65536*(ze=Math.floor(qe/65536)),ht=(qe=ht+ze+65535)-65536*(ze=Math.floor(qe/65536)),ft=(qe=ft+ze+65535)-65536*(ze=Math.floor(qe/65536)),yt=(qe=yt+ze+65535)-65536*(ze=Math.floor(qe/65536)),mt=(qe=mt+ze+65535)-65536*(ze=Math.floor(qe/65536)),kt=(qe=kt+ze+65535)-65536*(ze=Math.floor(qe/65536)),St=(qe=St+ze+65535)-65536*(ze=Math.floor(qe/65536)),Et=(qe=Et+ze+65535)-65536*(ze=Math.floor(qe/65536)),Pt=(qe=Pt+ze+65535)-65536*(ze=Math.floor(qe/65536)),Dt=(qe=Dt+ze+65535)-65536*(ze=Math.floor(qe/65536)),Ve=(qe=(Ve+=ze-1+37*(ze-1))+(ze=1)+65535)-65536*(ze=Math.floor(qe/65536)),tt=(qe=tt+ze+65535)-65536*(ze=Math.floor(qe/65536)),rt=(qe=rt+ze+65535)-65536*(ze=Math.floor(qe/65536)),it=(qe=it+ze+65535)-65536*(ze=Math.floor(qe/65536)),nt=(qe=nt+ze+65535)-65536*(ze=Math.floor(qe/65536)),ot=(qe=ot+ze+65535)-65536*(ze=Math.floor(qe/65536)),ct=(qe=ct+ze+65535)-65536*(ze=Math.floor(qe/65536)),ht=(qe=ht+ze+65535)-65536*(ze=Math.floor(qe/65536)),ft=(qe=ft+ze+65535)-65536*(ze=Math.floor(qe/65536)),yt=(qe=yt+ze+65535)-65536*(ze=Math.floor(qe/65536)),mt=(qe=mt+ze+65535)-65536*(ze=Math.floor(qe/65536)),kt=(qe=kt+ze+65535)-65536*(ze=Math.floor(qe/65536)),St=(qe=St+ze+65535)-65536*(ze=Math.floor(qe/65536)),Et=(qe=Et+ze+65535)-65536*(ze=Math.floor(qe/65536)),Pt=(qe=Pt+ze+65535)-65536*(ze=Math.floor(qe/65536)),Dt=(qe=Dt+ze+65535)-65536*(ze=Math.floor(qe/65536)),Ve+=ze-1+37*(ze-1),ke[0]=Ve,ke[1]=tt,ke[2]=rt,ke[3]=it,ke[4]=nt,ke[5]=ot,ke[6]=ct,ke[7]=ht,ke[8]=ft,ke[9]=yt,ke[10]=mt,ke[11]=kt,ke[12]=St,ke[13]=Et,ke[14]=Pt,ke[15]=Dt}function S(ke,Ae){A(ke,Ae,Ae)}function E(ke,Ae){var Ce,qe=t();for(Ce=0;Ce<16;Ce++)qe[Ce]=Ae[Ce];for(Ce=253;Ce>=0;Ce--)S(qe,qe),2!==Ce&&4!==Ce&&A(qe,qe,Ae);for(Ce=0;Ce<16;Ce++)ke[Ce]=qe[Ce]}function P(ke,Ae,Ce){var qe,Ve,tt=new Uint8Array(32),rt=new Float64Array(80),it=t(),nt=t(),ot=t(),ct=t(),ht=t(),ft=t();for(Ve=0;Ve<31;Ve++)tt[Ve]=Ae[Ve];for(tt[31]=127&Ae[31]|64,tt[0]&=248,v(rt,Ce),Ve=0;Ve<16;Ve++)nt[Ve]=rt[Ve],ct[Ve]=it[Ve]=ot[Ve]=0;for(it[0]=ct[0]=1,Ve=254;Ve>=0;--Ve)b(it,nt,qe=tt[Ve>>>3]>>>(7&Ve)&1),b(ot,ct,qe),_(ht,it,ot),k(it,it,ot),_(ot,nt,ct),k(nt,nt,ct),S(ct,ht),S(ft,it),A(it,ot,it),A(ot,nt,ht),_(ht,it,ot),k(it,it,ot),S(nt,it),k(ot,ct,ft),A(it,ot,ze),_(it,it,ct),A(ot,ot,it),A(it,ct,ft),A(ct,nt,rt),S(nt,ht),b(it,nt,qe),b(ot,ct,qe);for(Ve=0;Ve<16;Ve++)rt[Ve+16]=it[Ve],rt[Ve+32]=ot[Ve],rt[Ve+48]=nt[Ve],rt[Ve+64]=ct[Ve];var yt=rt.subarray(32),mt=rt.subarray(16);return E(yt,yt),A(mt,mt,yt),m(ke,mt),0}function x(ke,Ce){return P(ke,Ce,Ae)}function M(ke,Ae){var Ce=t(),qe=t(),ze=t(),Ve=t(),rt=t(),it=t(),nt=t(),ot=t(),ct=t();k(Ce,ke[1],ke[0]),k(ct,Ae[1],Ae[0]),A(Ce,Ce,ct),_(qe,ke[0],ke[1]),_(ct,Ae[0],Ae[1]),A(qe,qe,ct),A(ze,ke[3],Ae[3]),A(ze,ze,tt),A(Ve,ke[2],Ae[2]),_(Ve,Ve,Ve),k(rt,qe,Ce),k(it,Ve,ze),_(nt,Ve,ze),_(ot,qe,Ce),A(ke[0],rt,it),A(ke[1],ot,nt),A(ke[2],nt,it),A(ke[3],rt,ot)}function C(ke,Ae,Ce){var qe;for(qe=0;qe<4;qe++)b(ke[qe],Ae[qe],Ce)}function K(ke,Ae){var Ce=t(),qe=t(),ze=t();E(ze,Ae[2]),A(Ce,Ae[0],ze),A(qe,Ae[1],ze),m(ke,qe),ke[31]^=w(Ce)<<7}function D(ke,Ae,ze){var Ve,tt;for(p(ke[0],Ce),p(ke[1],qe),p(ke[2],qe),p(ke[3],Ce),tt=255;tt>=0;--tt)C(ke,Ae,Ve=ze[tt/8|0]>>(7&tt)&1),M(Ae,ke),M(ke,ke),C(ke,Ae,Ve)}function R(ke,Ae){var Ce=[t(),t(),t(),t()];p(Ce[0],rt),p(Ce[1],it),p(Ce[2],qe),A(Ce[3],rt,it),D(ke,Ce,Ae)}function U(Ae,Ce,qe){var ze,Ve,tt=[t(),t(),t(),t()];for(qe||r(Ce,32),(ze=ke.hash(Ce.subarray(0,32)))[0]&=248,ze[31]&=127,ze[31]|=64,R(tt,ze),K(Ae,tt),Ve=0;Ve<32;Ve++)Ce[Ve+32]=Ae[Ve];return 0}var ot=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function B(ke,Ae){var Ce,qe,ze,Ve;for(qe=63;qe>=32;--qe){for(Ce=0,ze=qe-32,Ve=qe-12;ze>4)*ot[ze],Ce=Ae[ze]>>8,Ae[ze]&=255;for(ze=0;ze<32;ze++)Ae[ze]-=Ce*ot[ze];for(qe=0;qe<32;qe++)Ae[qe+1]+=Ae[qe]>>8,ke[qe]=255&Ae[qe]}function T(ke){var Ae,Ce=new Float64Array(64);for(Ae=0;Ae<64;Ae++)Ce[Ae]=ke[Ae];for(Ae=0;Ae<64;Ae++)ke[Ae]=0;B(ke,Ce)}function z(ke,Ae){var ze=t(),tt=t(),rt=t(),it=t(),ot=t(),ct=t(),ht=t();return p(ke[2],qe),v(ke[1],Ae),S(rt,ke[1]),A(it,rt,Ve),k(rt,rt,ke[2]),_(it,ke[2],it),S(ot,it),S(ct,ot),A(ht,ct,ot),A(ze,ht,rt),A(ze,ze,it),function(ke,Ae){var Ce,qe=t();for(Ce=0;Ce<16;Ce++)qe[Ce]=Ae[Ce];for(Ce=250;Ce>=0;Ce--)S(qe,qe),1!==Ce&&A(qe,qe,Ae);for(Ce=0;Ce<16;Ce++)ke[Ce]=qe[Ce]}(ze,ze),A(ze,ze,rt),A(ze,ze,it),A(ze,ze,it),A(ke[0],ze,it),S(tt,ke[0]),A(tt,tt,it),g(tt,rt)&&A(ke[0],ke[0],nt),S(tt,ke[0]),A(tt,tt,it),g(tt,rt)?-1:(w(ke[0])===Ae[31]>>7&&k(ke[0],Ce,ke[0]),A(ke[3],ke[0],ke[1]),0)}var ct=64;function O(){for(var ke=0;ke=0},ke.sign.keyPair=function(){var ke=new Uint8Array(32),Ae=new Uint8Array(64);return U(ke,Ae),{publicKey:ke,secretKey:Ae}},ke.sign.keyPair.fromSecretKey=function(ke){if(O(ke),64!==ke.length)throw Error("bad secret key size");for(var Ae=new Uint8Array(32),Ce=0;CeAe&&(ke=ke.subarray(0,Ae)),this.buffer.set(ke,this.size),this.size+=ke.length}async get(ke){if(!this.buffer)throw Error("RandomBuffer is not initialized");if(!(ke instanceof Uint8Array))throw Error("Invalid type: buf not an Uint8Array");if(this.sizeke&&(it.imod(Ve.leftShift(ze)).iadd(Ve),nt=it.mod(tt).toNumber())}while(!await ci(it,Ae,Ce));return it}async function ci(ke,Ae,Ce){return!(Ae&&!ke.dec().gcd(Ae).isOne())&&(!!await async function(ke){const Ae=await Zt.getBigInteger();return Zn.every((Ce=>0!==ke.mod(new Ae(Ce))))}(ke)&&(!!await async function(ke,Ae){const Ce=await Zt.getBigInteger();return(Ae=Ae||new Ce(2)).modExp(ke.dec(),ke).isOne()}(ke)&&!!await async function(ke,Ae,Ce){const qe=await Zt.getBigInteger(),ze=ke.bitLength();Ae||(Ae=Math.max(1,ze/48|0));const Ve=ke.dec();let tt=0;for(;!Ve.getBit(tt);)tt++;const rt=ke.rightShift(new qe(tt));for(;Ae>0;Ae--){let Ae,ze=(Ce?Ce():await ni(new qe(2),Ve)).modExp(rt,ke);if(!ze.isOne()&&!ze.equal(Ve)){for(Ae=1;AeAe-11)throw Error("Message too long");const qe=await async function(ke){const Ae=new Uint8Array(ke);let Ce=0;for(;Ce=8&!qe;if(Ae)return Zt.selectUint8Array(tt,Ve,Ae);if(tt)return Ve;throw Error("Decryption error")}async function li(ke,Ae,Ce){let qe;if(Ae.length!==Nn.getHashByteLength(ke))throw Error("Invalid hash length");const ze=new Uint8Array(Yn[ke].length);for(qe=0;qeps.generateKeyPair("rsa",Ce,((Ce,qe,ze)=>{Ce?Ae(Ce):ke(As.decode(ze,"der"))}))));return{n:qe.modulus.toArrayLike(Uint8Array),e:qe.publicExponent.toArrayLike(Uint8Array),d:qe.privateExponent.toArrayLike(Uint8Array),p:qe.prime2.toArrayLike(Uint8Array),q:qe.prime1.toArrayLike(Uint8Array),u:qe.coefficient.toArrayLike(Uint8Array)}}let Ce,qe,ze;do{qe=await oi(ke-(ke>>1),Ae,40),Ce=await oi(ke>>1,Ae,40),ze=Ce.mul(qe)}while(ze.bitLength()!==ke);const Ve=Ce.dec().imul(qe.dec());return qe.lt(Ce)&&([Ce,qe]=[qe,Ce]),{n:ze.toUint8Array(),e:Ae.toUint8Array(),d:Ae.modInv(Ve).toUint8Array(),p:Ce.toUint8Array(),q:qe.toUint8Array(),u:Ce.modInv(qe).toUint8Array()}},validateParams:async function(ke,Ae,Ce,qe,ze,Ve){const tt=await Zt.getBigInteger();if(ke=new tt(ke),qe=new tt(qe),ze=new tt(ze),!qe.mul(ze).equal(ke))return!1;const rt=new tt(2);if(Ve=new tt(Ve),!qe.mul(Ve).mod(ze).isOne())return!1;Ae=new tt(Ae),Ce=new tt(Ce);const it=new tt(Math.floor(ke.bitLength()/3)),nt=await ni(rt,rt.leftShift(it)),ot=nt.mul(Ce).mul(Ae);return!(!ot.mod(qe.dec()).equal(nt)||!ot.mod(ze.dec()).equal(nt))}});var Ps=Object.freeze({__proto__:null,encrypt:async function(ke,Ae,Ce,qe){const ze=await Zt.getBigInteger();Ae=new ze(Ae),Ce=new ze(Ce),qe=new ze(qe);const Ve=new ze(await fi(ke,Ae.byteLength())),tt=await ni(new ze(1),Ae.dec());return{c1:Ce.modExp(tt,Ae).toUint8Array(),c2:qe.modExp(tt,Ae).imul(Ve).imod(Ae).toUint8Array()}},decrypt:async function(ke,Ae,Ce,qe,ze){const Ve=await Zt.getBigInteger();return ke=new Ve(ke),Ae=new Ve(Ae),Ce=new Ve(Ce),qe=new Ve(qe),di(ke.modExp(qe,Ce).modInv(Ce).imul(Ae).imod(Ce).toUint8Array("be",Ce.byteLength()),ze)},validateParams:async function(ke,Ae,Ce,qe){const ze=await Zt.getBigInteger();ke=new ze(ke),Ae=new ze(Ae),Ce=new ze(Ce);const Ve=new ze(1);if(Ae.lte(Ve)||Ae.gte(ke))return!1;const tt=new ze(ke.bitLength()),rt=new ze(1023);if(tt.lt(rt))return!1;if(!Ae.modExp(ke.dec(),ke).isOne())return!1;let it=Ae;const nt=new ze(1),ot=new ze(2).leftShift(new ze(17));for(;nt.lt(ot);){if(it=it.mul(Ae).imod(ke),it.isOne())return!1;nt.iinc()}qe=new ze(qe);const ct=new ze(2),ht=await ni(ct.leftShift(tt.dec()),ct.leftShift(tt)),ft=ke.dec().imul(ht).iadd(qe);return!!Ce.equal(Ae.modExp(ft,ke))}});class ki{constructor(ke){if(ke instanceof ki)this.oid=ke.oid;else if(Zt.isArray(ke)||Zt.isUint8Array(ke)){if(6===(ke=new Uint8Array(ke))[0]){if(ke[1]!==ke.length-2)throw Error("Length mismatch in DER encoded oid");ke=ke.subarray(2)}this.oid=ke}else this.oid=""}read(ke){if(ke.length>=1){const Ae=ke[0];if(ke.length>=1+Ae)return this.oid=ke.subarray(1,1+Ae),1+this.oid.length}throw Error("Invalid oid")}write(){return Zt.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return Zt.uint8ArrayToHex(this.oid)}getName(){const ke=this.toHex();if(er.curve[ke])return er.write(er.curve,ke);throw Error("Unknown curve object identifier.")}}function Ai(ke,Ae){return ke.keyPair({priv:Ae})}function Si(ke,Ae){const Ce=ke.keyPair({pub:Ae});if(!0!==Ce.validate().result)throw Error("Invalid elliptic public key");return Ce}async function Ei(ke){if(!tr.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:Ae}=await Promise.resolve().then((function(){return Wp}));return new Ae.ec(ke)}function Pi(ke){let Ae,Ce=0;const qe=ke[0];return qe<192?([Ce]=ke,Ae=1):qe<255?(Ce=(ke[0]-192<<8)+ke[1]+192,Ae=2):255===qe&&(Ce=Zt.readNumber(ke.subarray(1,5)),Ae=5),{len:Ce,offset:Ae}}function xi(ke){return ke<192?new Uint8Array([ke]):ke>191&&ke<8384?new Uint8Array([192+(ke-192>>8),ke-192&255]):Zt.concatUint8Array([new Uint8Array([255]),Zt.writeNumber(ke,4)])}function Mi(ke){if(ke<0||ke>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+ke])}function Ci(ke){return new Uint8Array([192|ke])}function Ki(ke,Ae){return Zt.concatUint8Array([Ci(ke),xi(Ae)])}function Di(ke){return[er.packet.literalData,er.packet.compressedData,er.packet.symmetricallyEncryptedData,er.packet.symEncryptedIntegrityProtectedData,er.packet.aeadEncryptedData].includes(ke)}async function Ri(ke,Ae){const Ce=H(ke);let qe,ze;try{const Ve=await Ce.peekBytes(2);if(!Ve||Ve.length<2||0==(128&Ve[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const tt=await Ce.readByte();let rt,it,nt=-1,ot=-1;ot=0,0!=(64&tt)&&(ot=1),ot?nt=63&tt:(nt=(63&tt)>>2,it=3&tt);const ct=Di(nt);let ht,ft=null;if(ct){if("array"===Zt.isStream(ke)){const ke=new v;qe=G(ke),ft=ke}else{const ke=new Gt;qe=G(ke.writable),ft=ke.readable}ze=Ae({tag:nt,packet:ft})}else ft=[];do{if(ot){const ke=await Ce.readByte();if(ht=!1,ke<192)rt=ke;else if(ke>=192&&ke<224)rt=(ke-192<<8)+await Ce.readByte()+192;else if(ke>223&&ke<255){if(rt=1<<(31&ke),ht=!0,!ct)throw new TypeError("This packet type does not support partial lengths.")}else rt=await Ce.readByte()<<24|await Ce.readByte()<<16|await Ce.readByte()<<8|await Ce.readByte()}else switch(it){case 0:rt=await Ce.readByte();break;case 1:rt=await Ce.readByte()<<8|await Ce.readByte();break;case 2:rt=await Ce.readByte()<<24|await Ce.readByte()<<16|await Ce.readByte()<<8|await Ce.readByte();break;default:rt=1/0}if(rt>0){let ke=0;for(;;){qe&&await qe.ready;const{done:Ae,value:ze}=await Ce.read();if(Ae){if(rt===1/0)break;throw Error("Unexpected end of packet")}const Ve=rt===1/0?ze:ze.subarray(0,rt-ke);if(qe?await qe.write(Ve):ft.push(Ve),ke+=ze.length,ke>=rt){Ce.unshift(ze.subarray(rt-ke+ze.length));break}}}}while(ht);const yt=await Ce.peekBytes(ct?1/0:2);return qe?(await qe.ready,await qe.close()):(ft=Zt.concatUint8Array(ft),await Ae({tag:nt,packet:ft})),!yt||!yt.length}catch(ke){if(qe)return await qe.abort(ke),!0;throw ke}finally{qe&&await ze,Ce.releaseLock()}}class Ui extends Error{constructor(...ke){super(...ke),Error.captureStackTrace&&Error.captureStackTrace(this,Ui),this.name="UnsupportedError"}}class Ii{constructor(ke,Ae){this.tag=ke,this.rawContent=Ae}write(){return this.rawContent}}const Rs=Zt.getWebCrypto(),Us=Zt.getNodeCrypto(),Is={p256:"P-256",p384:"P-384",p521:"P-521"},Ns=Us?Us.getCurves():[],Ls=Us?{secp256k1:Ns.includes("secp256k1")?"secp256k1":void 0,p256:Ns.includes("prime256v1")?"prime256v1":void 0,p384:Ns.includes("secp384r1")?"secp384r1":void 0,p521:Ns.includes("secp521r1")?"secp521r1":void 0,ed25519:Ns.includes("ED25519")?"ED25519":void 0,curve25519:Ns.includes("X25519")?"X25519":void 0,brainpoolP256r1:Ns.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:Ns.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:Ns.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},Hs={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:er.publicKey.ecdsa,hash:er.hash.sha256,cipher:er.symmetric.aes128,node:Ls.p256,web:Is.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:er.publicKey.ecdsa,hash:er.hash.sha384,cipher:er.symmetric.aes192,node:Ls.p384,web:Is.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:er.publicKey.ecdsa,hash:er.hash.sha512,cipher:er.symmetric.aes256,node:Ls.p521,web:Is.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:er.publicKey.ecdsa,hash:er.hash.sha256,cipher:er.symmetric.aes128,node:Ls.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:er.publicKey.eddsa,hash:er.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:er.publicKey.ecdh,hash:er.hash.sha256,cipher:er.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:er.publicKey.ecdsa,hash:er.hash.sha256,cipher:er.symmetric.aes128,node:Ls.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:er.publicKey.ecdsa,hash:er.hash.sha384,cipher:er.symmetric.aes192,node:Ls.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:er.publicKey.ecdsa,hash:er.hash.sha512,cipher:er.symmetric.aes256,node:Ls.brainpoolP512r1,payloadSize:64}};class Ni{constructor(ke,Ae){try{(Zt.isArray(ke)||Zt.isUint8Array(ke))&&(ke=new ki(ke)),ke instanceof ki&&(ke=ke.getName()),this.name=er.write(er.curve,ke)}catch(ke){throw new Ui("Unknown curve")}Ae=Ae||Hs[this.name],this.keyType=Ae.keyType,this.oid=Ae.oid,this.hash=Ae.hash,this.cipher=Ae.cipher,this.node=Ae.node&&Hs[this.name],this.web=Ae.web&&Hs[this.name],this.payloadSize=Ae.payloadSize,this.web&&Zt.getWebCrypto()?this.type="web":this.node&&Zt.getNodeCrypto()?this.type="node":"curve25519"===this.name?this.type="curve25519":"ed25519"===this.name&&(this.type="ed25519")}async genKeyPair(){let ke;switch(this.type){case"web":try{return await async function(ke){const Ae=await Rs.generateKey({name:"ECDSA",namedCurve:Is[ke]},!0,["sign","verify"]),Ce=await Rs.exportKey("jwk",Ae.privateKey);return{publicKey:Li(await Rs.exportKey("jwk",Ae.publicKey)),privateKey:pe(Ce.d)}}(this.name)}catch(ke){Zt.printDebugError("Browser did not support generating ec key "+ke.message);break}case"node":return async function(ke){const Ae=Us.createECDH(Ls[ke]);return await Ae.generateKeys(),{publicKey:new Uint8Array(Ae.getPublicKey()),privateKey:new Uint8Array(Ae.getPrivateKey())}}(this.name);case"curve25519":{const Ae=await ii(32);Ae[0]=127&Ae[0]|64,Ae[31]&=248;const Ce=Ae.slice().reverse();ke=qn.box.keyPair.fromSecretKey(Ce);return{publicKey:Zt.concatUint8Array([new Uint8Array([64]),ke.publicKey]),privateKey:Ae}}case"ed25519":{const ke=await ii(32),Ae=qn.sign.keyPair.fromSeed(ke);return{publicKey:Zt.concatUint8Array([new Uint8Array([64]),Ae.publicKey]),privateKey:ke}}}const Ae=await Ei(this.name);return ke=await Ae.genKeyPair({entropy:Zt.uint8ArrayToString(await ii(32))}),{publicKey:new Uint8Array(ke.getPublic("array",!1)),privateKey:ke.getPrivate().toArrayLike(Uint8Array)}}}async function ji(ke,Ae,Ce,qe){const ze={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:ke===er.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},Ve=Ae.getName();if(!ze[Ve])return!1;if("curve25519"===Ve){qe=qe.slice().reverse();const{publicKey:ke}=qn.box.keyPair.fromSecretKey(qe);Ce=new Uint8Array(Ce);const Ae=new Uint8Array([64,...ke]);return!!Zt.equalsUint8Array(Ae,Ce)}const tt=await Ei(Ve);try{Ce=Si(tt,Ce).getPublic()}catch(ke){return!1}return!!Ai(tt,qe).getPublic().eq(Ce)}function Li(ke){const Ae=pe(ke.x),Ce=pe(ke.y),qe=new Uint8Array(Ae.length+Ce.length+1);return qe[0]=4,qe.set(Ae,1),qe.set(Ce,Ae.length+1),qe}function Wi(ke,Ae,Ce){const qe=ke,ze=Ce.slice(1,qe+1),Ve=Ce.slice(qe+1,2*qe+1);return{kty:"EC",crv:Ae,x:ye(ze,!0),y:ye(Ve,!0),ext:!0}}function Hi(ke,Ae,Ce,qe){const ze=Wi(ke,Ae,Ce);return ze.d=ye(qe,!0),ze}const Gs=Zt.getWebCrypto(),Vs=Zt.getNodeCrypto();async function $i(ke,Ae,Ce,qe,ze,Ve){const tt=new Ni(ke);if(Ce&&!Zt.isStream(Ce)){const Ve={publicKey:qe,privateKey:ze};switch(tt.type){case"web":try{return await async function(ke,Ae,Ce,qe){const ze=ke.payloadSize,Ve=Hi(ke.payloadSize,Is[ke.name],qe.publicKey,qe.privateKey),tt=await Gs.importKey("jwk",Ve,{name:"ECDSA",namedCurve:Is[ke.name],hash:{name:er.read(er.webHash,ke.hash)}},!1,["sign"]),rt=new Uint8Array(await Gs.sign({name:"ECDSA",namedCurve:Is[ke.name],hash:{name:er.read(er.webHash,Ae)}},tt,Ce));return{r:rt.slice(0,ze),s:rt.slice(ze,ze<<1)}}(tt,Ae,Ce,Ve)}catch(ke){if("p521"!==tt.name&&("DataError"===ke.name||"OperationError"===ke.name))throw ke;Zt.printDebugError("Browser did not support signing: "+ke.message)}break;case"node":{const ke=await async function(ke,Ae,Ce,qe){const ze=Vs.createSign(er.read(er.hash,Ae));ze.write(Ce),ze.end();const Ve=ea.encode({version:1,parameters:ke.oid,privateKey:Array.from(qe.privateKey),publicKey:{unused:0,data:Array.from(qe.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return Ys.decode(ze.sign(Ve),"der")}(tt,Ae,Ce,Ve);return{r:ke.r.toArrayLike(Uint8Array),s:ke.s.toArrayLike(Uint8Array)}}}}return async function(ke,Ae,Ce){const qe=await Ei(ke.name),ze=Ai(qe,Ce).sign(Ae);return{r:ze.r.toArrayLike(Uint8Array),s:ze.s.toArrayLike(Uint8Array)}}(tt,Ve,ze)}async function Zi(ke,Ae,Ce,qe,ze,Ve){const tt=new Ni(ke);if(qe&&!Zt.isStream(qe))switch(tt.type){case"web":try{return await async function(ke,Ae,{r:Ce,s:qe},ze,Ve){const tt=Wi(ke.payloadSize,Is[ke.name],Ve),rt=await Gs.importKey("jwk",tt,{name:"ECDSA",namedCurve:Is[ke.name],hash:{name:er.read(er.webHash,ke.hash)}},!1,["verify"]),it=Zt.concatUint8Array([Ce,qe]).buffer;return Gs.verify({name:"ECDSA",namedCurve:Is[ke.name],hash:{name:er.read(er.webHash,Ae)}},rt,it,ze)}(tt,Ae,Ce,qe,ze)}catch(ke){if("p521"!==tt.name&&("DataError"===ke.name||"OperationError"===ke.name))throw ke;Zt.printDebugError("Browser did not support verifying: "+ke.message)}break;case"node":return async function(ke,Ae,{r:Ce,s:qe},ze,Ve){const{default:tt}=await Promise.resolve().then((function(){return Wd})),rt=Vs.createVerify(er.read(er.hash,Ae));rt.write(ze),rt.end();const it=ia.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:ke.oid},subjectPublicKey:{unused:0,data:Array.from(Ve)}},"pem",{label:"PUBLIC KEY"}),nt=Ys.encode({r:new tt(Ce),s:new tt(qe)},"der");try{return rt.verify(it,nt)}catch(ke){return!1}}(tt,Ae,Ce,qe,ze)}return async function(ke,Ae,Ce,qe){const ze=await Ei(ke.name);return Si(ze,qe).verify(Ce,Ae)}(tt,Ce,void 0===Ae?qe:Ve,ze)}const Zs=Vs?St.default:void 0,Ys=Vs?Zs.define("ECDSASignature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())})):void 0,ea=Vs?Zs.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())})):void 0,ta=Vs?Zs.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())})):void 0,ia=Vs?Zs.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(ta),this.key("subjectPublicKey").bitstr())})):void 0;var na=Object.freeze({__proto__:null,sign:$i,verify:Zi,validateParams:async function(ke,Ae,Ce){const qe=new Ni(ke);if(qe.keyType!==er.publicKey.ecdsa)return!1;switch(qe.type){case"web":case"node":{const qe=await ii(8),ze=er.hash.sha256,Ve=await Nn.digest(ze,qe);try{const tt=await $i(ke,ze,qe,Ae,Ce,Ve);return await Zi(ke,ze,tt,qe,Ae,Ve)}catch(ke){return!1}}default:return ji(er.publicKey.ecdsa,ke,Ae,Ce)}}});qn.hash=ke=>new Uint8Array(tn().update(ke).digest());var sa=Object.freeze({__proto__:null,sign:async function(ke,Ae,Ce,qe,ze,Ve){if(Nn.getHashByteLength(Ae)=0;--ke)for(let Ae=rt-1;Ae>=0;--Ae)it[1]=rt*ke+(Ae+1),nt[0]=Ve[0]^it[0],nt[1]=Ve[1]^it[1],nt[2]=tt[2*Ae],nt[3]=tt[2*Ae+1],nt=sn(Ce.decrypt(on(nt))),Ve=nt.subarray(0,2),tt[2*Ae]=nt[2],tt[2*Ae+1]=nt[3];if(Ve[0]===qe[0]&&Ve[1]===qe[1])return on(tt);throw Error("Key Data Integrity failed")}function sn(ke){const{length:Ae}=ke,Ce=function(ke){if(Zt.isString(ke)){const{length:Ae}=ke,Ce=new ArrayBuffer(Ae),qe=new Uint8Array(Ce);for(let Ce=0;Ce0){const Ce=ke[Ae-1];if(Ce>=1){const qe=ke.subarray(Ae-Ce),ze=new Uint8Array(Ce).fill(Ce);if(Zt.equalsUint8Array(qe,ze))return ke.subarray(0,Ae-Ce)}}throw Error("Invalid padding")}var ca=Object.freeze({__proto__:null,encode:un,decode:hn});const ua=Zt.getWebCrypto(),ha=Zt.getNodeCrypto();function pn(ke,Ae,Ce,qe){return Zt.concatUint8Array([Ae.write(),new Uint8Array([ke]),Ce.write(),Zt.stringToUint8Array("Anonymous Sender "),qe.subarray(0,20)])}async function yn(ke,Ae,Ce,qe,ze=!1,Ve=!1){let tt;if(ze){for(tt=0;tt=0&&0===Ae[tt];tt--);Ae=Ae.subarray(0,tt+1)}return(await Nn.digest(ke,Zt.concatUint8Array([new Uint8Array([0,0,0,1]),Ae,qe]))).subarray(0,Ce)}async function bn(ke,Ae){switch(ke.type){case"curve25519":{const Ce=await ii(32),{secretKey:qe,sharedKey:ze}=await mn(ke,Ae,null,Ce);let{publicKey:Ve}=qn.box.keyPair.fromSecretKey(qe);return Ve=Zt.concatUint8Array([new Uint8Array([64]),Ve]),{publicKey:Ve,sharedKey:ze}}case"web":if(ke.web&&Zt.getWebCrypto())try{return await async function(ke,Ae){const Ce=Wi(ke.payloadSize,ke.web.web,Ae);let qe=ua.generateKey({name:"ECDH",namedCurve:ke.web.web},!0,["deriveKey","deriveBits"]),ze=ua.importKey("jwk",Ce,{name:"ECDH",namedCurve:ke.web.web},!1,[]);[qe,ze]=await Promise.all([qe,ze]);let Ve=ua.deriveBits({name:"ECDH",namedCurve:ke.web.web,public:ze},qe.privateKey,ke.web.sharedSize),tt=ua.exportKey("jwk",qe.publicKey);[Ve,tt]=await Promise.all([Ve,tt]);const rt=new Uint8Array(Ve);return{publicKey:new Uint8Array(Li(tt)),sharedKey:rt}}(ke,Ae)}catch(ke){Zt.printDebugError(ke)}break;case"node":return async function(ke,Ae){const Ce=ha.createECDH(ke.node.node);Ce.generateKeys();const qe=new Uint8Array(Ce.computeSecret(Ae));return{publicKey:new Uint8Array(Ce.getPublicKey()),sharedKey:qe}}(ke,Ae)}return async function(ke,Ae){const Ce=await Ei(ke.name),qe=await ke.genKeyPair();Ae=Si(Ce,Ae);const ze=Ai(Ce,qe.privateKey),Ve=qe.publicKey,tt=ze.derive(Ae.getPublic()),rt=Ce.curve.p.byteLength(),it=tt.toArrayLike(Uint8Array,"be",rt);return{publicKey:Ve,sharedKey:it}}(ke,Ae)}async function mn(ke,Ae,Ce,qe){if(qe.length!==ke.payloadSize){const Ae=new Uint8Array(ke.payloadSize);Ae.set(qe,ke.payloadSize-qe.length),qe=Ae}switch(ke.type){case"curve25519":{const ke=qe.slice().reverse();return{secretKey:ke,sharedKey:qn.scalarMult(ke,Ae.subarray(1))}}case"web":if(ke.web&&Zt.getWebCrypto())try{return await async function(ke,Ae,Ce,qe){const ze=Hi(ke.payloadSize,ke.web.web,Ce,qe);let Ve=ua.importKey("jwk",ze,{name:"ECDH",namedCurve:ke.web.web},!0,["deriveKey","deriveBits"]);const tt=Wi(ke.payloadSize,ke.web.web,Ae);let rt=ua.importKey("jwk",tt,{name:"ECDH",namedCurve:ke.web.web},!0,[]);[Ve,rt]=await Promise.all([Ve,rt]);let it=ua.deriveBits({name:"ECDH",namedCurve:ke.web.web,public:rt},Ve,ke.web.sharedSize),nt=ua.exportKey("jwk",Ve);[it,nt]=await Promise.all([it,nt]);const ot=new Uint8Array(it);return{secretKey:pe(nt.d),sharedKey:ot}}(ke,Ae,Ce,qe)}catch(ke){Zt.printDebugError(ke)}break;case"node":return async function(ke,Ae,Ce){const qe=ha.createECDH(ke.node.node);qe.setPrivateKey(Ce);const ze=new Uint8Array(qe.computeSecret(Ae));return{secretKey:new Uint8Array(qe.getPrivateKey()),sharedKey:ze}}(ke,Ae,qe)}return async function(ke,Ae,Ce){const qe=await Ei(ke.name);Ae=Si(qe,Ae),Ce=Ai(qe,Ce);const ze=new Uint8Array(Ce.getPrivate()),Ve=Ce.derive(Ae.getPublic()),tt=qe.curve.p.byteLength(),rt=Ve.toArrayLike(Uint8Array,"be",tt);return{secretKey:ze,sharedKey:rt}}(ke,Ae,qe)}var fa=Object.freeze({__proto__:null,validateParams:async function(ke,Ae,Ce){return ji(er.publicKey.ecdh,ke,Ae,Ce)},encrypt:async function(ke,Ae,Ce,qe,ze){const Ve=un(Ce),tt=new Ni(ke),{publicKey:rt,sharedKey:it}=await bn(tt,qe),nt=pn(er.publicKey.ecdh,ke,Ae,ze),{keySize:ot}=kn(Ae.cipher);return{publicKey:rt,wrappedKey:nn(await yn(Ae.hash,it,ot,nt),Ve)}},decrypt:async function(ke,Ae,Ce,qe,ze,Ve,tt){const rt=new Ni(ke),{sharedKey:it}=await mn(rt,Ce,ze,Ve),nt=pn(er.publicKey.ecdh,ke,Ae,tt),{keySize:ot}=kn(Ae.cipher);let ct;for(let Ce=0;Ce<3;Ce++)try{return hn(an(await yn(Ae.hash,it,ot,nt,1===Ce,2===Ce),qe))}catch(ke){ct=ke}throw ct}});var la={rsa:Es,elgamal:Ps,elliptic:Object.freeze({__proto__:null,Curve:Ni,ecdh:fa,ecdsa:na,eddsa:sa,generate:async function(ke){const Ae=await Zt.getBigInteger();ke=new Ni(ke);const Ce=await ke.genKeyPair(),qe=new Ae(Ce.publicKey).toUint8Array(),ze=new Ae(Ce.privateKey).toUint8Array("be",ke.payloadSize);return{oid:ke.oid,Q:qe,secret:ze,hash:ke.hash,cipher:ke.cipher}},getPreferredHashAlgo:function(ke){return Hs[er.write(er.curve,ke.toHex())].hash}}),dsa:Object.freeze({__proto__:null,sign:async function(ke,Ae,Ce,qe,ze,Ve){const tt=await Zt.getBigInteger(),rt=new tt(1);let it,nt,ot,ct;qe=new tt(qe),ze=new tt(ze),Ce=new tt(Ce),Ve=new tt(Ve),Ce=Ce.mod(qe),Ve=Ve.mod(ze);const ht=new tt(Ae.subarray(0,ze.byteLength())).mod(ze);for(;;){if(it=await ni(rt,ze),nt=Ce.modExp(it,qe).imod(ze),nt.isZero())continue;const ke=Ve.mul(nt).imod(ze);if(ct=ht.add(ke).imod(ze),ot=it.modInv(ze).imul(ct).imod(ze),!ot.isZero())break}return{r:nt.toUint8Array("be",ze.byteLength()),s:ot.toUint8Array("be",ze.byteLength())}},verify:async function(ke,Ae,Ce,qe,ze,Ve,tt,rt){const it=await Zt.getBigInteger(),nt=new it(0);if(Ae=new it(Ae),Ce=new it(Ce),Ve=new it(Ve),tt=new it(tt),ze=new it(ze),rt=new it(rt),Ae.lte(nt)||Ae.gte(tt)||Ce.lte(nt)||Ce.gte(tt))return Zt.printDebug("invalid DSA Signature"),!1;const ot=new it(qe.subarray(0,tt.byteLength())).imod(tt),ct=Ce.modInv(tt);if(ct.isZero())return Zt.printDebug("invalid DSA Signature"),!1;ze=ze.mod(Ve),rt=rt.mod(Ve);const ht=ot.mul(ct).imod(tt),ft=Ae.mul(ct).imod(tt),yt=ze.modExp(ht,Ve),mt=rt.modExp(ft,Ve);return yt.mul(mt).imod(Ve).imod(tt).equal(Ae)},validateParams:async function(ke,Ae,Ce,qe,ze){const Ve=await Zt.getBigInteger();ke=new Ve(ke),Ae=new Ve(Ae),Ce=new Ve(Ce),qe=new Ve(qe);const tt=new Ve(1);if(Ce.lte(tt)||Ce.gte(ke))return!1;if(!ke.dec().mod(Ae).isZero())return!1;if(!Ce.modExp(Ae,ke).isOne())return!1;const rt=new Ve(Ae.bitLength()),it=new Ve(150);if(rt.lt(it)||!await ci(Ae,null,32))return!1;ze=new Ve(ze);const nt=new Ve(2),ot=await ni(nt.leftShift(rt.dec()),nt.leftShift(rt)),ct=Ae.mul(ot).add(ze);return!!qe.equal(Ce.modExp(ct,ke))}}),nacl:qn};class vn{constructor(ke){ke=void 0===ke?new Uint8Array([]):Zt.isString(ke)?Zt.stringToUint8Array(ke):new Uint8Array(ke),this.data=ke}read(ke){if(ke.length>=1){const Ae=ke[0];if(ke.length>=1+Ae)return this.data=ke.subarray(1,1+Ae),1+this.data.length}throw Error("Invalid symmetric key")}write(){return Zt.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class _n{constructor(ke){if(ke){const{hash:Ae,cipher:Ce}=ke;this.hash=Ae,this.cipher=Ce}else this.hash=null,this.cipher=null}read(ke){if(ke.length<4||3!==ke[0]||1!==ke[1])throw Error("Cannot read KDFParams");return this.hash=ke[2],this.cipher=ke[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}}function kn(ke){const Ae=er.read(er.symmetric,ke);return Er[Ae]}function An(ke){try{ke.getName()}catch(ke){throw new Ui("Unknown curve OID")}}var da=Object.freeze({__proto__:null,publicKeyEncrypt:async function(ke,Ae,Ce,qe){switch(ke){case er.publicKey.rsaEncrypt:case er.publicKey.rsaEncryptSign:{const{n:ke,e:qe}=Ae;return{c:await la.rsa.encrypt(Ce,ke,qe)}}case er.publicKey.elgamal:{const{p:ke,g:qe,y:ze}=Ae;return la.elgamal.encrypt(Ce,ke,qe,ze)}case er.publicKey.ecdh:{const{oid:ke,Q:ze,kdfParams:Ve}=Ae,{publicKey:tt,wrappedKey:rt}=await la.elliptic.ecdh.encrypt(ke,Ve,Ce,ze,qe);return{V:tt,C:new vn(rt)}}default:return[]}},publicKeyDecrypt:async function(ke,Ae,Ce,qe,ze,Ve){switch(ke){case er.publicKey.rsaEncryptSign:case er.publicKey.rsaEncrypt:{const{c:ke}=qe,{n:ze,e:tt}=Ae,{d:rt,p:it,q:nt,u:ot}=Ce;return la.rsa.decrypt(ke,ze,tt,rt,it,nt,ot,Ve)}case er.publicKey.elgamal:{const{c1:ke,c2:ze}=qe,tt=Ae.p,rt=Ce.x;return la.elgamal.decrypt(ke,ze,tt,rt,Ve)}case er.publicKey.ecdh:{const{oid:ke,Q:Ve,kdfParams:tt}=Ae,{d:rt}=Ce,{V:it,C:nt}=qe;return la.elliptic.ecdh.decrypt(ke,tt,it,nt.data,Ve,rt,ze)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(ke,Ae){let Ce=0;switch(ke){case er.publicKey.rsaEncrypt:case er.publicKey.rsaEncryptSign:case er.publicKey.rsaSign:{const ke=Zt.readMPI(Ae.subarray(Ce));Ce+=ke.length+2;const qe=Zt.readMPI(Ae.subarray(Ce));return Ce+=qe.length+2,{read:Ce,publicParams:{n:ke,e:qe}}}case er.publicKey.dsa:{const ke=Zt.readMPI(Ae.subarray(Ce));Ce+=ke.length+2;const qe=Zt.readMPI(Ae.subarray(Ce));Ce+=qe.length+2;const ze=Zt.readMPI(Ae.subarray(Ce));Ce+=ze.length+2;const Ve=Zt.readMPI(Ae.subarray(Ce));return Ce+=Ve.length+2,{read:Ce,publicParams:{p:ke,q:qe,g:ze,y:Ve}}}case er.publicKey.elgamal:{const ke=Zt.readMPI(Ae.subarray(Ce));Ce+=ke.length+2;const qe=Zt.readMPI(Ae.subarray(Ce));Ce+=qe.length+2;const ze=Zt.readMPI(Ae.subarray(Ce));return Ce+=ze.length+2,{read:Ce,publicParams:{p:ke,g:qe,y:ze}}}case er.publicKey.ecdsa:{const ke=new ki;Ce+=ke.read(Ae),An(ke);const qe=Zt.readMPI(Ae.subarray(Ce));return Ce+=qe.length+2,{read:Ce,publicParams:{oid:ke,Q:qe}}}case er.publicKey.eddsa:{const ke=new ki;Ce+=ke.read(Ae),An(ke);let qe=Zt.readMPI(Ae.subarray(Ce));return Ce+=qe.length+2,qe=Zt.leftPad(qe,33),{read:Ce,publicParams:{oid:ke,Q:qe}}}case er.publicKey.ecdh:{const ke=new ki;Ce+=ke.read(Ae),An(ke);const qe=Zt.readMPI(Ae.subarray(Ce));Ce+=qe.length+2;const ze=new _n;return Ce+=ze.read(Ae.subarray(Ce)),{read:Ce,publicParams:{oid:ke,Q:qe,kdfParams:ze}}}default:throw new Ui("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(ke,Ae,Ce){let qe=0;switch(ke){case er.publicKey.rsaEncrypt:case er.publicKey.rsaEncryptSign:case er.publicKey.rsaSign:{const ke=Zt.readMPI(Ae.subarray(qe));qe+=ke.length+2;const Ce=Zt.readMPI(Ae.subarray(qe));qe+=Ce.length+2;const ze=Zt.readMPI(Ae.subarray(qe));qe+=ze.length+2;const Ve=Zt.readMPI(Ae.subarray(qe));return qe+=Ve.length+2,{read:qe,privateParams:{d:ke,p:Ce,q:ze,u:Ve}}}case er.publicKey.dsa:case er.publicKey.elgamal:{const ke=Zt.readMPI(Ae.subarray(qe));return qe+=ke.length+2,{read:qe,privateParams:{x:ke}}}case er.publicKey.ecdsa:case er.publicKey.ecdh:{const ke=new Ni(Ce.oid);let ze=Zt.readMPI(Ae.subarray(qe));return qe+=ze.length+2,ze=Zt.leftPad(ze,ke.payloadSize),{read:qe,privateParams:{d:ze}}}case er.publicKey.eddsa:{const ke=new Ni(Ce.oid);let ze=Zt.readMPI(Ae.subarray(qe));return qe+=ze.length+2,ze=Zt.leftPad(ze,ke.payloadSize),{read:qe,privateParams:{seed:ze}}}default:throw new Ui("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(ke,Ae){let Ce=0;switch(ke){case er.publicKey.rsaEncrypt:case er.publicKey.rsaEncryptSign:return{c:Zt.readMPI(Ae.subarray(Ce))};case er.publicKey.elgamal:{const ke=Zt.readMPI(Ae.subarray(Ce));Ce+=ke.length+2;return{c1:ke,c2:Zt.readMPI(Ae.subarray(Ce))}}case er.publicKey.ecdh:{const ke=Zt.readMPI(Ae.subarray(Ce));Ce+=ke.length+2;const qe=new vn;return qe.read(Ae.subarray(Ce)),{V:ke,C:qe}}default:throw new Ui("Unknown public key encryption algorithm.")}},serializeParams:function(ke,Ae){const Ce=Object.keys(Ae).map((ke=>{const Ce=Ae[ke];return Zt.isUint8Array(Ce)?Zt.uint8ArrayToMPI(Ce):Ce.write()}));return Zt.concatUint8Array(Ce)},generateParams:function(ke,Ae,Ce){switch(ke){case er.publicKey.rsaEncrypt:case er.publicKey.rsaEncryptSign:case er.publicKey.rsaSign:return la.rsa.generate(Ae,65537).then((({n:ke,e:Ae,d:Ce,p:qe,q:ze,u:Ve})=>({privateParams:{d:Ce,p:qe,q:ze,u:Ve},publicParams:{n:ke,e:Ae}})));case er.publicKey.ecdsa:return la.elliptic.generate(Ce).then((({oid:ke,Q:Ae,secret:Ce})=>({privateParams:{d:Ce},publicParams:{oid:new ki(ke),Q:Ae}})));case er.publicKey.eddsa:return la.elliptic.generate(Ce).then((({oid:ke,Q:Ae,secret:Ce})=>({privateParams:{seed:Ce},publicParams:{oid:new ki(ke),Q:Ae}})));case er.publicKey.ecdh:return la.elliptic.generate(Ce).then((({oid:ke,Q:Ae,secret:Ce,hash:qe,cipher:ze})=>({privateParams:{d:Ce},publicParams:{oid:new ki(ke),Q:Ae,kdfParams:new _n({hash:qe,cipher:ze})}})));case er.publicKey.dsa:case er.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(ke,Ae,Ce){if(!Ae||!Ce)throw Error("Missing key parameters");switch(ke){case er.publicKey.rsaEncrypt:case er.publicKey.rsaEncryptSign:case er.publicKey.rsaSign:{const{n:ke,e:qe}=Ae,{d:ze,p:Ve,q:tt,u:rt}=Ce;return la.rsa.validateParams(ke,qe,ze,Ve,tt,rt)}case er.publicKey.dsa:{const{p:ke,q:qe,g:ze,y:Ve}=Ae,{x:tt}=Ce;return la.dsa.validateParams(ke,qe,ze,Ve,tt)}case er.publicKey.elgamal:{const{p:ke,g:qe,y:ze}=Ae,{x:Ve}=Ce;return la.elgamal.validateParams(ke,qe,ze,Ve)}case er.publicKey.ecdsa:case er.publicKey.ecdh:{const qe=la.elliptic[er.read(er.publicKey,ke)],{oid:ze,Q:Ve}=Ae,{d:tt}=Ce;return qe.validateParams(ze,Ve,tt)}case er.publicKey.eddsa:{const{oid:ke,Q:qe}=Ae,{seed:ze}=Ce;return la.elliptic.eddsa.validateParams(ke,qe,ze)}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(ke){const{blockSize:Ae}=kn(ke),Ce=await ii(Ae),qe=new Uint8Array([Ce[Ce.length-2],Ce[Ce.length-1]]);return Zt.concat([Ce,qe])},generateSessionKey:function(ke){const{keySize:Ae}=kn(ke);return ii(Ae)},getAEADMode:function(ke){const Ae=er.read(er.aead,ke);return lo[Ae]},getCipher:kn});const pa=Zt.getWebCrypto(),ma=Zt.getNodeCrypto(),ga=ma?ma.getCiphers():[],ba={idea:ga.includes("idea-cfb")?"idea-cfb":void 0,tripledes:ga.includes("des-ede3-cfb")?"des-ede3-cfb":void 0,cast5:ga.includes("cast5-cfb")?"cast5-cfb":void 0,blowfish:ga.includes("bf-cfb")?"bf-cfb":void 0,aes128:ga.includes("aes-128-cfb")?"aes-128-cfb":void 0,aes192:ga.includes("aes-192-cfb")?"aes-192-cfb":void 0,aes256:ga.includes("aes-256-cfb")?"aes-256-cfb":void 0};var va=Object.freeze({__proto__:null,encrypt:async function(ke,Ae,Ce,qe,ze){const Ve=er.read(er.symmetric,ke);if(Zt.getNodeCrypto()&&ba[Ve])return function(ke,Ae,Ce,qe){const ze=er.read(er.symmetric,ke),Ve=new ma.createCipheriv(ba[ze],Ae,qe);return Y(Ce,(ke=>new Uint8Array(Ve.update(ke))))}(ke,Ae,Ce,qe);if("aes"===Ve.substr(0,3))return function(ke,Ae,Ce,qe,ze){if(Zt.getWebCrypto()&&24!==Ae.length&&!Zt.isStream(Ce)&&Ce.length>=3e3*ze.minBytesForWebCrypto)return async function(ke,Ae,Ce,qe){const ze="AES-CBC",Ve=await pa.importKey("raw",Ae,{name:ze},!1,["encrypt"]),{blockSize:tt}=kn(ke),rt=Zt.concatUint8Array([new Uint8Array(tt),Ce]),it=new Uint8Array(await pa.encrypt({name:ze,iv:qe},Ve,rt)).subarray(0,Ce.length);return function(ke,Ae){for(let Ce=0;CeVe.aes.AES_Encrypt_process(ke)),(()=>Ve.aes.AES_Encrypt_finish()))}(ke,Ae,Ce,qe,ze);const tt=new Er[Ve](Ae),rt=tt.blockSize,it=qe.slice();let nt=new Uint8Array;const h=ke=>{ke&&(nt=Zt.concatUint8Array([nt,ke]));const Ae=new Uint8Array(nt.length);let Ce,qe=0;for(;ke?nt.length>=rt:nt.length;){const ke=tt.encrypt(it);for(Ce=0;Cenew Uint8Array(Ve.update(ke))))}(ke,Ae,Ce,qe);if("aes"===ze.substr(0,3))return function(ke,Ae,Ce,qe){if(Zt.isStream(Ce)){const ke=new ei(Ae,qe);return Y(Ce,(Ae=>ke.aes.AES_Decrypt_process(Ae)),(()=>ke.aes.AES_Decrypt_finish()))}return ei.decrypt(Ce,Ae,qe)}(0,Ae,Ce,qe);const Ve=new Er[ze](Ae),tt=Ve.blockSize;let rt=qe,it=new Uint8Array;const u=ke=>{ke&&(it=Zt.concatUint8Array([it,ke]));const Ae=new Uint8Array(it.length);let Ce,qe=0;for(;ke?it.length>=tt:it.length;){const ke=Ve.encrypt(rt);for(rt=it,Ce=0;Ce48)throw new Be("illegal counter size");let ke=Math.pow(2,Ce)-1;qe.set_mask(0,0,ke/4294967296|0,0|ke)}else Ce=48,qe.set_mask(0,0,65535,4294967295);if(void 0===ke)throw Error("nonce is required");{let Ae=ke.length;if(!Ae||Ae>16)throw new Be("illegal nonce size");let Ce=new DataView(new ArrayBuffer(16));new Uint8Array(Ce.buffer).set(ke),qe.set_nonce(Ce.getUint32(0),Ce.getUint32(4),Ce.getUint32(8),Ce.getUint32(12))}if(void 0!==Ae){if(Ae<0||Ae>=Math.pow(2,Ce))throw new Be("illegal counter value");qe.set_counter(0,0,Ae/4294967296|0,0|Ae)}}}class Dn{static encrypt(ke,Ae,Ce=!0,qe){return new Dn(Ae,qe,Ce).encrypt(ke)}static decrypt(ke,Ae,Ce=!0,qe){return new Dn(Ae,qe,Ce).decrypt(ke)}constructor(ke,Ae,Ce=!0,qe){this.aes=qe||new Oe(ke,Ae,Ce,"CBC")}encrypt(ke){return Ue(this.aes.AES_Encrypt_process(ke),this.aes.AES_Encrypt_finish())}decrypt(ke){return Ue(this.aes.AES_Decrypt_process(ke),this.aes.AES_Decrypt_finish())}}const wa=Zt.getWebCrypto(),_a=Zt.getNodeCrypto();function In(ke,Ae){const Ce=ke.length-16;for(let qe=0;qe<16;qe++)ke[qe+Ce]^=Ae[qe];return ke}const ka=new Uint8Array(16);async function Tn(ke){const Ae=await async function(ke){if(Zt.getWebCrypto()&&24!==ke.length)return ke=await wa.importKey("raw",ke,{name:"AES-CBC",length:8*ke.length},!1,["encrypt"]),async function(Ae){const Ce=await wa.encrypt({name:"AES-CBC",iv:ka,length:128},ke,Ae);return new Uint8Array(Ce).subarray(0,Ce.byteLength-16)};if(Zt.getNodeCrypto())return async function(Ae){const Ce=new _a.createCipheriv("aes-"+8*ke.length+"-cbc",ke,ka).update(Ae);return new Uint8Array(Ce)};return async function(Ae){return Dn.encrypt(Ae,ke,!1,ka)}}(ke),Ce=Zt.double(await Ae(ka)),qe=Zt.double(Ce);return async function(ke){return(await Ae(function(ke,Ae,Ce){if(ke.length&&ke.length%16==0)return In(ke,Ae);const qe=new Uint8Array(ke.length+(16-ke.length%16));return qe.set(ke),qe[ke.length]=128,In(qe,Ce)}(ke,Ce,qe))).subarray(-16)}}const Aa=Zt.getWebCrypto(),Sa=Zt.getNodeCrypto(),Ea=Zt.getNodeBuffer(),Ma=new Uint8Array(16),xa=new Uint8Array(16);xa[15]=1;const Ca=new Uint8Array(16);async function Ln(ke){const Ae=await Tn(ke);return function(ke,Ce){return Ae(Zt.concatUint8Array([ke,Ce]))}}async function Wn(ke){return Zt.getWebCrypto()&&24!==ke.length?(ke=await Aa.importKey("raw",ke,{name:"AES-CTR",length:8*ke.length},!1,["encrypt"]),async function(Ae,Ce){const qe=await Aa.encrypt({name:"AES-CTR",counter:Ce,length:128},ke,Ae);return new Uint8Array(qe)}):Zt.getNodeCrypto()?async function(Ae,Ce){const qe=new Sa.createCipheriv("aes-"+8*ke.length+"-ctr",ke,Ce),ze=Ea.concat([qe.update(Ae),qe.final()]);return new Uint8Array(ze)}:async function(Ae,Ce){return Kn.encrypt(Ae,ke,Ce)}}async function Hn(ke,Ae){if(ke!==er.symmetric.aes128&&ke!==er.symmetric.aes192&&ke!==er.symmetric.aes256)throw Error("EAX mode supports only AES cipher");const[Ce,qe]=await Promise.all([Ln(Ae),Wn(Ae)]);return{encrypt:async function(ke,Ae,ze){const[Ve,tt]=await Promise.all([Ce(Ma,Ae),Ce(xa,ze)]),rt=await qe(ke,Ve),it=await Ce(Ca,rt);for(let ke=0;ke<16;ke++)it[ke]^=tt[ke]^Ve[ke];return Zt.concatUint8Array([rt,it])},decrypt:async function(ke,Ae,ze){if(ke.length<16)throw Error("Invalid EAX ciphertext");const Ve=ke.subarray(0,-16),tt=ke.subarray(-16),[rt,it,nt]=await Promise.all([Ce(Ma,Ae),Ce(xa,ze),Ce(Ca,Ve)]),ot=nt;for(let ke=0;ke<16;ke++)ot[ke]^=it[ke]^rt[ke];if(!Zt.equalsUint8Array(tt,ot))throw Error("Authentication tag mismatch");return await qe(Ve,rt)}}}Ca[15]=2,Hn.getNonce=function(ke,Ae){const Ce=ke.slice();for(let ke=0;ke>3),17+(nt>>3)),8-(7&nt)).subarray(1),ft=new Uint8Array(16),yt=new Uint8Array(Ae.length+16);let mt,kt=0;for(mt=0;mt16)throw new Be("illegal tagSize value");const rt=Ae.length||0,it=new Uint8Array(16);12!==rt?(this._gcm_mac_process(Ae),tt[0]=0,tt[1]=0,tt[2]=0,tt[3]=0,tt[4]=0,tt[5]=0,tt[6]=0,tt[7]=0,tt[8]=0,tt[9]=0,tt[10]=0,tt[11]=rt>>>29,tt[12]=rt>>>21&255,tt[13]=rt>>>13&255,tt[14]=rt>>>5&255,tt[15]=rt<<3&255,Ve.mac(nr.MAC.GCM,nr.HEAP_DATA,16),Ve.get_iv(nr.HEAP_DATA),Ve.set_iv(0,0,0,0),it.set(tt.subarray(0,16))):(it.set(Ae),it[15]=1);const nt=new DataView(it.buffer);if(this.gamma0=nt.getUint32(12),Ve.set_nonce(nt.getUint32(0),nt.getUint32(4),nt.getUint32(8),0),Ve.set_mask(0,0,0,4294967295),void 0!==Ce){if(Ce.length>68719476704)throw new Be("illegal adata length");Ce.length?(this.adata=Ce,this._gcm_mac_process(Ce)):this.adata=void 0}else this.adata=void 0;if(this.counter<1||this.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");Ve.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(ke,Ae,Ce,qe,ze){return new Qn(Ae,Ce,qe,ze).encrypt(ke)}static decrypt(ke,Ae,Ce,qe,ze){return new Qn(Ae,Ce,qe,ze).decrypt(ke)}encrypt(ke){return this.AES_GCM_encrypt(ke)}decrypt(ke){return this.AES_GCM_decrypt(ke)}AES_GCM_Encrypt_process(ke){let Ae=0,Ce=ke.length||0,{asm:qe,heap:ze}=this.aes.acquire_asm(),Ve=this.counter,tt=this.aes.pos,rt=this.aes.len,it=0,nt=rt+Ce&-16,ot=0;if((Ve-1<<4)+rt+Ce>68719476704)throw new RangeError("counter overflow");const ct=new Uint8Array(nt);for(;Ce>0;)ot=Re(ze,tt+rt,ke,Ae,Ce),rt+=ot,Ae+=ot,Ce-=ot,ot=qe.cipher(nr.ENC.CTR,nr.HEAP_DATA+tt,rt),ot=qe.mac(nr.MAC.GCM,nr.HEAP_DATA+tt,ot),ot&&ct.set(ze.subarray(tt,tt+ot),it),Ve+=ot>>>4,it+=ot,ot>>29,Ae[4]=nt>>>21,Ae[5]=nt>>>13&255,Ae[6]=nt>>>5&255,Ae[7]=nt<<3&255,Ae[8]=Ae[9]=Ae[10]=0,Ae[11]=ot>>>29,Ae[12]=ot>>>21&255,Ae[13]=ot>>>13&255,Ae[14]=ot>>>5&255,Ae[15]=ot<<3&255,ke.mac(nr.MAC.GCM,nr.HEAP_DATA,16),ke.get_iv(nr.HEAP_DATA),ke.set_counter(0,0,0,this.gamma0),ke.cipher(nr.ENC.CTR,nr.HEAP_DATA,16),rt.set(Ae.subarray(0,qe),tt),this.counter=1,this.aes.pos=0,this.aes.len=0,rt}AES_GCM_Decrypt_process(ke){let Ae=0,Ce=ke.length||0,{asm:qe,heap:ze}=this.aes.acquire_asm(),Ve=this.counter,tt=this.tagSize,rt=this.aes.pos,it=this.aes.len,nt=0,ot=it+Ce>tt?it+Ce-tt&-16:0,ct=it+Ce-ot,ht=0;if((Ve-1<<4)+it+Ce>68719476704)throw new RangeError("counter overflow");const ft=new Uint8Array(ot);for(;Ce>ct;)ht=Re(ze,rt+it,ke,Ae,Ce-ct),it+=ht,Ae+=ht,Ce-=ht,ht=qe.mac(nr.MAC.GCM,nr.HEAP_DATA+rt,ht),ht=qe.cipher(nr.DEC.CTR,nr.HEAP_DATA+rt,ht),ht&&ft.set(ze.subarray(rt,rt+ht),nt),Ve+=ht>>>4,nt+=ht,rt=0,it=0;return Ce>0&&(it+=Re(ze,0,ke,Ae,Ce)),this.counter=Ve,this.aes.pos=rt,this.aes.len=it,ft}AES_GCM_Decrypt_finish(){let{asm:ke,heap:Ae}=this.aes.acquire_asm(),Ce=this.tagSize,qe=this.adata,ze=this.counter,Ve=this.aes.pos,tt=this.aes.len,rt=tt-Ce;if(tt>>29,Ae[4]=ct>>>21,Ae[5]=ct>>>13&255,Ae[6]=ct>>>5&255,Ae[7]=ct<<3&255,Ae[8]=Ae[9]=Ae[10]=0,Ae[11]=ht>>>29,Ae[12]=ht>>>21&255,Ae[13]=ht>>>13&255,Ae[14]=ht>>>5&255,Ae[15]=ht<<3&255,ke.mac(nr.MAC.GCM,nr.HEAP_DATA,16),ke.get_iv(nr.HEAP_DATA),ke.set_counter(0,0,0,this.gamma0),ke.cipher(nr.ENC.CTR,nr.HEAP_DATA,16);let ft=0;for(let ke=0;ke0;){for(Ve=Re(Ce,0,ke,qe,ze),qe+=Ve,ze-=Ve;15&Ve;)Ce[Ve++]=0;Ae.mac(nr.MAC.GCM,nr.HEAP_DATA,Ve)}}}const io=Zt.getWebCrypto(),no=Zt.getNodeCrypto(),ho=Zt.getNodeBuffer();async function ra(ke,Ae){if(ke!==er.symmetric.aes128&&ke!==er.symmetric.aes192&&ke!==er.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(Zt.getWebCrypto()&&24!==Ae.length){const ke=await io.importKey("raw",Ae,{name:"AES-GCM"},!1,["encrypt","decrypt"]);return{encrypt:async function(Ce,qe,ze=new Uint8Array){if(!Ce.length)return Qn.encrypt(Ce,Ae,qe,ze);const Ve=await io.encrypt({name:"AES-GCM",iv:qe,additionalData:ze,tagLength:128},ke,Ce);return new Uint8Array(Ve)},decrypt:async function(Ce,qe,ze=new Uint8Array){if(16===Ce.length)return Qn.decrypt(Ce,Ae,qe,ze);const Ve=await io.decrypt({name:"AES-GCM",iv:qe,additionalData:ze,tagLength:128},ke,Ce);return new Uint8Array(Ve)}}}return Zt.getNodeCrypto()?{encrypt:async function(ke,Ce,qe=new Uint8Array){const ze=new no.createCipheriv("aes-"+8*Ae.length+"-gcm",Ae,Ce);ze.setAAD(qe);const Ve=ho.concat([ze.update(ke),ze.final(),ze.getAuthTag()]);return new Uint8Array(Ve)},decrypt:async function(ke,Ce,qe=new Uint8Array){const ze=new no.createDecipheriv("aes-"+8*Ae.length+"-gcm",Ae,Ce);ze.setAAD(qe),ze.setAuthTag(ke.slice(ke.length-16,ke.length));const Ve=ho.concat([ze.update(ke.slice(0,ke.length-16)),ze.final()]);return new Uint8Array(Ve)}}:{encrypt:async function(ke,Ce,qe){return Qn.encrypt(ke,Ae,Ce,qe)},decrypt:async function(ke,Ce,qe){return Qn.decrypt(ke,Ae,Ce,qe)}}}ra.getNonce=function(ke,Ae){const Ce=ke.slice();for(let ke=0;ke=0;)ke[Ae]=0}const hc=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],lc=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],dc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],pc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],gc=Array(576);ya(gc);const Ac=Array(60);ya(Ac);const Cc=Array(512);ya(Cc);const Dc=Array(256);ya(Dc);const Bc=Array(29);ya(Bc);const Tc=Array(30);function Pa(ke,Ae,Ce,qe,ze){this.static_tree=ke,this.extra_bits=Ae,this.extra_base=Ce,this.elems=qe,this.max_length=ze,this.has_stree=ke&&ke.length}let Uc,Ic,zc;function Ka(ke,Ae){this.dyn_tree=ke,this.max_code=0,this.stat_desc=Ae}function Da(ke){return ke<256?Cc[ke]:Cc[256+(ke>>>7)]}function Ra(ke,Ae){ke.pending_buf[ke.pending++]=255&Ae,ke.pending_buf[ke.pending++]=Ae>>>8&255}function Ua(ke,Ae,Ce){ke.bi_valid>16-Ce?(ke.bi_buf|=Ae<>16-ke.bi_valid,ke.bi_valid+=Ce-16):(ke.bi_buf|=Ae<>>=1,Ce<<=1}while(--Ae>0);return Ce>>>1}function Ta(ke,Ae,Ce){const qe=Array(16);let ze,Ve,tt=0;for(ze=1;ze<=15;ze++)qe[ze]=tt=tt+Ce[ze-1]<<1;for(Ve=0;Ve<=Ae;Ve++){const Ae=ke[2*Ve+1];0!==Ae&&(ke[2*Ve]=Ba(qe[Ae]++,Ae))}}function za(ke){let Ae;for(Ae=0;Ae<286;Ae++)ke.dyn_ltree[2*Ae]=0;for(Ae=0;Ae<30;Ae++)ke.dyn_dtree[2*Ae]=0;for(Ae=0;Ae<19;Ae++)ke.bl_tree[2*Ae]=0;ke.dyn_ltree[512]=1,ke.opt_len=ke.static_len=0,ke.last_lit=ke.matches=0}function qa(ke){ke.bi_valid>8?Ra(ke,ke.bi_buf):ke.bi_valid>0&&(ke.pending_buf[ke.pending++]=ke.bi_buf),ke.bi_buf=0,ke.bi_valid=0}function Oa(ke,Ae,Ce,qe){const ze=2*Ae,Ve=2*Ce;return ke[ze]>1;tt>=1;tt--)Fa(ke,Ce,tt);it=Ve;do{tt=ke.heap[1],ke.heap[1]=ke.heap[ke.heap_len--],Fa(ke,Ce,1),rt=ke.heap[1],ke.heap[--ke.heap_max]=tt,ke.heap[--ke.heap_max]=rt,Ce[2*it]=Ce[2*tt]+Ce[2*rt],ke.depth[it]=(ke.depth[tt]>=ke.depth[rt]?ke.depth[tt]:ke.depth[rt])+1,Ce[2*tt+1]=Ce[2*rt+1]=it,ke.heap[1]=it++,Fa(ke,Ce,1)}while(ke.heap_len>=2);ke.heap[--ke.heap_max]=ke.heap[1],function(ke,Ae){const Ce=Ae.dyn_tree,qe=Ae.max_code,ze=Ae.stat_desc.static_tree,Ve=Ae.stat_desc.has_stree,tt=Ae.stat_desc.extra_bits,rt=Ae.stat_desc.extra_base,it=Ae.stat_desc.max_length;let nt,ot,ct,ht,ft,yt,mt=0;for(ht=0;ht<=15;ht++)ke.bl_count[ht]=0;for(Ce[2*ke.heap[ke.heap_max]+1]=0,nt=ke.heap_max+1;nt<573;nt++)ot=ke.heap[nt],ht=Ce[2*Ce[2*ot+1]+1]+1,ht>it&&(ht=it,mt++),Ce[2*ot+1]=ht,ot>qe||(ke.bl_count[ht]++,ft=0,ot>=rt&&(ft=tt[ot-rt]),yt=Ce[2*ot],ke.opt_len+=yt*(ht+ft),Ve&&(ke.static_len+=yt*(ze[2*ot+1]+ft)));if(0!==mt){do{for(ht=it-1;0===ke.bl_count[ht];)ht--;ke.bl_count[ht]--,ke.bl_count[ht+1]+=2,ke.bl_count[it]--,mt-=2}while(mt>0);for(ht=it;0!==ht;ht--)for(ot=ke.bl_count[ht];0!==ot;)ct=ke.heap[--nt],ct>qe||(Ce[2*ct+1]!==ht&&(ke.opt_len+=(ht-Ce[2*ct+1])*Ce[2*ct],Ce[2*ct+1]=ht),ot--)}}(ke,Ae),Ta(Ce,nt,ke.bl_count)}function La(ke,Ae,Ce){let qe,ze,Ve=-1,tt=Ae[1],rt=0,it=7,nt=4;for(0===tt&&(it=138,nt=3),Ae[2*(Ce+1)+1]=65535,qe=0;qe<=Ce;qe++)ze=tt,tt=Ae[2*(qe+1)+1],++rt>=7;qe<30;qe++)for(Tc[qe]=ze<<7,ke=0;ke<1<=8&&(ke.pending_buf[ke.pending++]=255&ke.bi_buf,ke.bi_buf>>=8,ke.bi_valid-=8)}(ke)}function Za(ke,Ae,Ce,qe){let ze,Ve,tt=0;ke.level>0?(2===ke.strm.data_type&&(ke.strm.data_type=function(ke){let Ae,Ce=4093624447;for(Ae=0;Ae<=31;Ae++,Ce>>>=1)if(1&Ce&&0!==ke.dyn_ltree[2*Ae])return 0;if(0!==ke.dyn_ltree[18]||0!==ke.dyn_ltree[20]||0!==ke.dyn_ltree[26])return 1;for(Ae=32;Ae<256;Ae++)if(0!==ke.dyn_ltree[2*Ae])return 1;return 0}(ke)),ja(ke,ke.l_desc),ja(ke,ke.d_desc),tt=function(ke){let Ae;for(La(ke,ke.dyn_ltree,ke.l_desc.max_code),La(ke,ke.dyn_dtree,ke.d_desc.max_code),ja(ke,ke.bl_desc),Ae=18;Ae>=3&&0===ke.bl_tree[2*pc[Ae]+1];Ae--);return ke.opt_len+=3*(Ae+1)+5+5+4,Ae}(ke),ze=ke.opt_len+3+7>>>3,Ve=ke.static_len+3+7>>>3,Ve<=ze&&(ze=Ve)):ze=Ve=Ce+5,Ce+4<=ze&&-1!==Ae?Va(ke,Ae,Ce,qe):4===ke.strategy||Ve===ze?(Ua(ke,2+(qe?1:0),3),Na(ke,gc,Ac)):(Ua(ke,4+(qe?1:0),3),function(ke,Ae,Ce,qe){let ze;for(Ua(ke,Ae-257,5),Ua(ke,Ce-1,5),Ua(ke,qe-4,4),ze=0;ze>>8&255,ke.pending_buf[ke.d_buf+2*ke.last_lit+1]=255&Ae,ke.pending_buf[ke.l_buf+ke.last_lit]=255&Ce,ke.last_lit++,0===Ae?ke.dyn_ltree[2*Ce]++:(ke.matches++,Ae--,ke.dyn_ltree[2*(Dc[Ce]+256+1)]++,ke.dyn_dtree[2*Da(Ae)]++),ke.last_lit===ke.lit_bufsize-1}function Xa(ke,Ae,Ce,qe){let ze=65535&ke|0,Ve=ke>>>16&65535|0,tt=0;for(;0!==Ce;){tt=Ce>2e3?2e3:Ce,Ce-=tt;do{ze=ze+Ae[qe++]|0,Ve=Ve+ze|0}while(--tt);ze%=65521,Ve%=65521}return ze|Ve<<16|0}const su=function(){let ke;const Ae=[];for(let Ce=0;Ce<256;Ce++){ke=Ce;for(let Ae=0;Ae<8;Ae++)ke=1&ke?3988292384^ke>>>1:ke>>>1;Ae[Ce]=ke}return Ae}();function Ja(ke,Ae,Ce,qe){const ze=su,Ve=qe+Ce;ke^=-1;for(let Ce=qe;Ce>>8^ze[255&(ke^Ae[Ce])];return-1^ke}var au={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function ts(ke,Ae){return ke.msg=au[Ae],Ae}function rs(ke){return(ke<<1)-(ke>4?9:0)}function is(ke){let Ae=ke.length;for(;--Ae>=0;)ke[Ae]=0}function ns(ke){const Ae=ke.state;let Ce=Ae.pending;Ce>ke.avail_out&&(Ce=ke.avail_out),0!==Ce&&(ac(ke.output,Ae.pending_buf,Ae.pending_out,Ce,ke.next_out),ke.next_out+=Ce,Ae.pending_out+=Ce,ke.total_out+=Ce,ke.avail_out-=Ce,Ae.pending-=Ce,0===Ae.pending&&(Ae.pending_out=0))}function as(ke,Ae){Za(ke,ke.block_start>=0?ke.block_start:-1,ke.strstart-ke.block_start,Ae),ke.block_start=ke.strstart,ns(ke.strm)}function ss(ke,Ae){ke.pending_buf[ke.pending++]=Ae}function os(ke,Ae){ke.pending_buf[ke.pending++]=Ae>>>8&255,ke.pending_buf[ke.pending++]=255&Ae}function cs(ke,Ae,Ce,qe){let ze=ke.avail_in;return ze>qe&&(ze=qe),0===ze?0:(ke.avail_in-=ze,ac(Ae,ke.input,ke.next_in,ze,Ce),1===ke.state.wrap?ke.adler=Xa(ke.adler,Ae,ze,Ce):2===ke.state.wrap&&(ke.adler=Ja(ke.adler,Ae,ze,Ce)),ke.next_in+=ze,ke.total_in+=ze,ze)}function us(ke,Ae){let Ce,qe,ze=ke.max_chain_length,Ve=ke.strstart,tt=ke.prev_length,rt=ke.nice_match;const it=ke.strstart>ke.w_size-262?ke.strstart-(ke.w_size-262):0,nt=ke.window,ot=ke.w_mask,ct=ke.prev,ht=ke.strstart+258;let ft=nt[Ve+tt-1],yt=nt[Ve+tt];ke.prev_length>=ke.good_match&&(ze>>=2),rt>ke.lookahead&&(rt=ke.lookahead);do{if(Ce=Ae,nt[Ce+tt]===yt&&nt[Ce+tt-1]===ft&&nt[Ce]===nt[Ve]&&nt[++Ce]===nt[Ve+1]){Ve+=2,Ce++;do{}while(nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&nt[++Ve]===nt[++Ce]&&Vett){if(ke.match_start=Ae,tt=qe,qe>=rt)break;ft=nt[Ve+tt-1],yt=nt[Ve+tt]}}}while((Ae=ct[Ae&ot])>it&&0!=--ze);return tt<=ke.lookahead?tt:ke.lookahead}function hs(ke){const Ae=ke.w_size;let Ce,qe,ze,Ve,tt;do{if(Ve=ke.window_size-ke.lookahead-ke.strstart,ke.strstart>=Ae+(Ae-262)){ac(ke.window,ke.window,Ae,Ae,0),ke.match_start-=Ae,ke.strstart-=Ae,ke.block_start-=Ae,qe=ke.hash_size,Ce=qe;do{ze=ke.head[--Ce],ke.head[Ce]=ze>=Ae?ze-Ae:0}while(--qe);qe=Ae,Ce=qe;do{ze=ke.prev[--Ce],ke.prev[Ce]=ze>=Ae?ze-Ae:0}while(--qe);Ve+=Ae}if(0===ke.strm.avail_in)break;if(qe=cs(ke.strm,ke.window,ke.strstart+ke.lookahead,Ve),ke.lookahead+=qe,ke.lookahead+ke.insert>=3)for(tt=ke.strstart-ke.insert,ke.ins_h=ke.window[tt],ke.ins_h=(ke.ins_h<=3&&(ke.ins_h=(ke.ins_h<=3)if(qe=Ya(ke,ke.strstart-ke.match_start,ke.match_length-3),ke.lookahead-=ke.match_length,ke.match_length<=ke.max_lazy_match&&ke.lookahead>=3){ke.match_length--;do{ke.strstart++,ke.ins_h=(ke.ins_h<=3&&(ke.ins_h=(ke.ins_h<4096)&&(ke.match_length=2)),ke.prev_length>=3&&ke.match_length<=ke.prev_length){ze=ke.strstart+ke.lookahead-3,qe=Ya(ke,ke.strstart-1-ke.prev_match,ke.prev_length-3),ke.lookahead-=ke.prev_length-1,ke.prev_length-=2;do{++ke.strstart<=ze&&(ke.ins_h=(ke.ins_h<ke.pending_buf_size-5&&(Ce=ke.pending_buf_size-5);;){if(ke.lookahead<=1){if(hs(ke),0===ke.lookahead&&0===Ae)return 1;if(0===ke.lookahead)break}ke.strstart+=ke.lookahead,ke.lookahead=0;const qe=ke.block_start+Ce;if((0===ke.strstart||ke.strstart>=qe)&&(ke.lookahead=ke.strstart-qe,ke.strstart=qe,as(ke,!1),0===ke.strm.avail_out))return 1;if(ke.strstart-ke.block_start>=ke.w_size-262&&(as(ke,!1),0===ke.strm.avail_out))return 1}return ke.insert=0,4===Ae?(as(ke,!0),0===ke.strm.avail_out?3:4):(ke.strstart>ke.block_start&&(as(ke,!1),ke.strm.avail_out),1)})),new ls(4,4,8,4,fs),new ls(4,5,16,8,fs),new ls(4,6,32,32,fs),new ls(4,4,16,16,ds),new ls(8,16,32,32,ds),new ls(8,16,128,128,ds),new ls(8,32,128,256,ds),new ls(32,128,258,1024,ds),new ls(32,258,258,4096,ds)];class ys{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new zo(1146),this.dyn_dtree=new zo(122),this.bl_tree=new zo(78),is(this.dyn_ltree),is(this.dyn_dtree),is(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new zo(16),this.heap=new zo(573),is(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new zo(573),is(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}}function bs(ke){const Ae=function(ke){let Ae;return ke&&ke.state?(ke.total_in=ke.total_out=0,ke.data_type=2,Ae=ke.state,Ae.pending=0,Ae.pending_out=0,Ae.wrap<0&&(Ae.wrap=-Ae.wrap),Ae.status=Ae.wrap?42:113,ke.adler=2===Ae.wrap?0:1,Ae.last_flush=0,Ga(Ae),0):ts(ke,-2)}(ke);return 0===Ae&&function(ke){ke.window_size=2*ke.w_size,is(ke.head),ke.max_lazy_match=ou[ke.level].max_lazy,ke.good_match=ou[ke.level].good_length,ke.nice_match=ou[ke.level].nice_length,ke.max_chain_length=ou[ke.level].max_chain,ke.strstart=0,ke.block_start=0,ke.lookahead=0,ke.insert=0,ke.match_length=ke.prev_length=2,ke.match_available=0,ke.ins_h=0}(ke.state),Ae}function ms(ke,Ae){let Ce,qe,ze,Ve;if(!ke||!ke.state||Ae>5||Ae<0)return ke?ts(ke,-2):-2;if(qe=ke.state,!ke.output||!ke.input&&0!==ke.avail_in||666===qe.status&&4!==Ae)return ts(ke,0===ke.avail_out?-5:-2);if(qe.strm=ke,Ce=qe.last_flush,qe.last_flush=Ae,42===qe.status)if(2===qe.wrap)ke.adler=0,ss(qe,31),ss(qe,139),ss(qe,8),qe.gzhead?(ss(qe,(qe.gzhead.text?1:0)+(qe.gzhead.hcrc?2:0)+(qe.gzhead.extra?4:0)+(qe.gzhead.name?8:0)+(qe.gzhead.comment?16:0)),ss(qe,255&qe.gzhead.time),ss(qe,qe.gzhead.time>>8&255),ss(qe,qe.gzhead.time>>16&255),ss(qe,qe.gzhead.time>>24&255),ss(qe,9===qe.level?2:qe.strategy>=2||qe.level<2?4:0),ss(qe,255&qe.gzhead.os),qe.gzhead.extra&&qe.gzhead.extra.length&&(ss(qe,255&qe.gzhead.extra.length),ss(qe,qe.gzhead.extra.length>>8&255)),qe.gzhead.hcrc&&(ke.adler=Ja(ke.adler,qe.pending_buf,qe.pending,0)),qe.gzindex=0,qe.status=69):(ss(qe,0),ss(qe,0),ss(qe,0),ss(qe,0),ss(qe,0),ss(qe,9===qe.level?2:qe.strategy>=2||qe.level<2?4:0),ss(qe,3),qe.status=113);else{let Ae=8+(qe.w_bits-8<<4)<<8,Ce=-1;Ce=qe.strategy>=2||qe.level<2?0:qe.level<6?1:6===qe.level?2:3,Ae|=Ce<<6,0!==qe.strstart&&(Ae|=32),Ae+=31-Ae%31,qe.status=113,os(qe,Ae),0!==qe.strstart&&(os(qe,ke.adler>>>16),os(qe,65535&ke.adler)),ke.adler=1}if(69===qe.status)if(qe.gzhead.extra){for(ze=qe.pending;qe.gzindex<(65535&qe.gzhead.extra.length)&&(qe.pending!==qe.pending_buf_size||(qe.gzhead.hcrc&&qe.pending>ze&&(ke.adler=Ja(ke.adler,qe.pending_buf,qe.pending-ze,ze)),ns(ke),ze=qe.pending,qe.pending!==qe.pending_buf_size));)ss(qe,255&qe.gzhead.extra[qe.gzindex]),qe.gzindex++;qe.gzhead.hcrc&&qe.pending>ze&&(ke.adler=Ja(ke.adler,qe.pending_buf,qe.pending-ze,ze)),qe.gzindex===qe.gzhead.extra.length&&(qe.gzindex=0,qe.status=73)}else qe.status=73;if(73===qe.status)if(qe.gzhead.name){ze=qe.pending;do{if(qe.pending===qe.pending_buf_size&&(qe.gzhead.hcrc&&qe.pending>ze&&(ke.adler=Ja(ke.adler,qe.pending_buf,qe.pending-ze,ze)),ns(ke),ze=qe.pending,qe.pending===qe.pending_buf_size)){Ve=1;break}Ve=qe.gzindexze&&(ke.adler=Ja(ke.adler,qe.pending_buf,qe.pending-ze,ze)),0===Ve&&(qe.gzindex=0,qe.status=91)}else qe.status=91;if(91===qe.status)if(qe.gzhead.comment){ze=qe.pending;do{if(qe.pending===qe.pending_buf_size&&(qe.gzhead.hcrc&&qe.pending>ze&&(ke.adler=Ja(ke.adler,qe.pending_buf,qe.pending-ze,ze)),ns(ke),ze=qe.pending,qe.pending===qe.pending_buf_size)){Ve=1;break}Ve=qe.gzindexze&&(ke.adler=Ja(ke.adler,qe.pending_buf,qe.pending-ze,ze)),0===Ve&&(qe.status=103)}else qe.status=103;if(103===qe.status&&(qe.gzhead.hcrc?(qe.pending+2>qe.pending_buf_size&&ns(ke),qe.pending+2<=qe.pending_buf_size&&(ss(qe,255&ke.adler),ss(qe,ke.adler>>8&255),ke.adler=0,qe.status=113)):qe.status=113),0!==qe.pending){if(ns(ke),0===ke.avail_out)return qe.last_flush=-1,0}else if(0===ke.avail_in&&rs(Ae)<=rs(Ce)&&4!==Ae)return ts(ke,-5);if(666===qe.status&&0!==ke.avail_in)return ts(ke,-5);if(0!==ke.avail_in||0!==qe.lookahead||0!==Ae&&666!==qe.status){var tt=2===qe.strategy?function(ke,Ae){let Ce;for(;;){if(0===ke.lookahead&&(hs(ke),0===ke.lookahead)){if(0===Ae)return 1;break}if(ke.match_length=0,Ce=Ya(ke,0,ke.window[ke.strstart]),ke.lookahead--,ke.strstart++,Ce&&(as(ke,!1),0===ke.strm.avail_out))return 1}return ke.insert=0,4===Ae?(as(ke,!0),0===ke.strm.avail_out?3:4):ke.last_lit&&(as(ke,!1),0===ke.strm.avail_out)?1:2}(qe,Ae):3===qe.strategy?function(ke,Ae){let Ce,qe,ze,Ve;const tt=ke.window;for(;;){if(ke.lookahead<=258){if(hs(ke),ke.lookahead<=258&&0===Ae)return 1;if(0===ke.lookahead)break}if(ke.match_length=0,ke.lookahead>=3&&ke.strstart>0&&(ze=ke.strstart-1,qe=tt[ze],qe===tt[++ze]&&qe===tt[++ze]&&qe===tt[++ze])){Ve=ke.strstart+258;do{}while(qe===tt[++ze]&&qe===tt[++ze]&&qe===tt[++ze]&&qe===tt[++ze]&&qe===tt[++ze]&&qe===tt[++ze]&&qe===tt[++ze]&&qe===tt[++ze]&&zeke.lookahead&&(ke.match_length=ke.lookahead)}if(ke.match_length>=3?(Ce=Ya(ke,1,ke.match_length-3),ke.lookahead-=ke.match_length,ke.strstart+=ke.match_length,ke.match_length=0):(Ce=Ya(ke,0,ke.window[ke.strstart]),ke.lookahead--,ke.strstart++),Ce&&(as(ke,!1),0===ke.strm.avail_out))return 1}return ke.insert=0,4===Ae?(as(ke,!0),0===ke.strm.avail_out?3:4):ke.last_lit&&(as(ke,!1),0===ke.strm.avail_out)?1:2}(qe,Ae):ou[qe.level].func(qe,Ae);if(3!==tt&&4!==tt||(qe.status=666),1===tt||3===tt)return 0===ke.avail_out&&(qe.last_flush=-1),0;if(2===tt&&(1===Ae?$a(qe):5!==Ae&&(Va(qe,0,0,!1),3===Ae&&(is(qe.head),0===qe.lookahead&&(qe.strstart=0,qe.block_start=0,qe.insert=0))),ns(ke),0===ke.avail_out))return qe.last_flush=-1,0}return 4!==Ae?0:qe.wrap<=0?1:(2===qe.wrap?(ss(qe,255&ke.adler),ss(qe,ke.adler>>8&255),ss(qe,ke.adler>>16&255),ss(qe,ke.adler>>24&255),ss(qe,255&ke.total_in),ss(qe,ke.total_in>>8&255),ss(qe,ke.total_in>>16&255),ss(qe,ke.total_in>>24&255)):(os(qe,ke.adler>>>16),os(qe,65535&ke.adler)),ns(ke),qe.wrap>0&&(qe.wrap=-qe.wrap),0!==qe.pending?0:1)}try{String.fromCharCode.call(null,0)}catch(qe){}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(qe){}const cu=new Io(256);for(let ke=0;ke<256;ke++)cu[ke]=ke>=252?6:ke>=248?5:ke>=240?4:ke>=224?3:ke>=192?2:1;function ws(ke){let Ae,Ce,qe,ze,Ve=0;const tt=ke.length;for(qe=0;qe>>6,rt[ze++]=128|63&Ae):Ae<65536?(rt[ze++]=224|Ae>>>12,rt[ze++]=128|Ae>>>6&63,rt[ze++]=128|63&Ae):(rt[ze++]=240|Ae>>>18,rt[ze++]=128|Ae>>>12&63,rt[ze++]=128|Ae>>>6&63,rt[ze++]=128|63&Ae);return rt}cu[254]=cu[254]=1;class vs{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}}class _s{constructor(ke){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,...ke||{}};const Ae=this.options;Ae.raw&&Ae.windowBits>0?Ae.windowBits=-Ae.windowBits:Ae.gzip&&Ae.windowBits>0&&Ae.windowBits<16&&(Ae.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vs,this.strm.avail_out=0;var Ce,qe,ze=function(ke,Ae,Ce,qe,ze,Ve){if(!ke)return-2;let tt=1;if(-1===Ae&&(Ae=6),qe<0?(tt=0,qe=-qe):qe>15&&(tt=2,qe-=16),ze<1||ze>9||8!==Ce||qe<8||qe>15||Ae<0||Ae>9||Ve<0||Ve>4)return ts(ke,-2);8===qe&&(qe=9);const rt=new ys;return ke.state=rt,rt.strm=ke,rt.wrap=tt,rt.gzhead=null,rt.w_bits=qe,rt.w_size=1<=Ce.w_size&&(0===Ve&&(is(Ce.head),Ce.strstart=0,Ce.block_start=0,Ce.insert=0),nt=new Io(Ce.w_size),ac(nt,Ae,ot-Ce.w_size,Ce.w_size,0),Ae=nt,ot=Ce.w_size),tt=ke.avail_in,rt=ke.next_in,it=ke.input,ke.avail_in=ot,ke.next_in=0,ke.input=Ae,hs(Ce);Ce.lookahead>=3;){qe=Ce.strstart,ze=Ce.lookahead-2;do{Ce.ins_h=(Ce.ins_h<0||0===Ce.avail_out)&&1!==ze);return 4===Ve?(ze=function(ke){let Ae;return ke&&ke.state?(Ae=ke.state.status,42!==Ae&&69!==Ae&&73!==Ae&&91!==Ae&&103!==Ae&&113!==Ae&&666!==Ae?ts(ke,-2):(ke.state=null,113===Ae?ts(ke,-3):0)):-2}(this.strm),this.onEnd(ze),this.ended=!0,0===ze):2!==Ve||(this.onEnd(0),Ce.avail_out=0,!0)}onData(ke){this.chunks.push(ke)}onEnd(ke){0===ke&&(this.result=nc(this.chunks)),this.chunks=[],this.err=ke,this.msg=this.strm.msg}}function ks(ke,Ae){let Ce,qe,ze,Ve,tt,rt,it,nt,ot,ct;const ht=ke.state;Ce=ke.next_in;const ft=ke.input,yt=Ce+(ke.avail_in-5);qe=ke.next_out;const mt=ke.output,kt=qe-(Ae-ke.avail_out),St=qe+(ke.avail_out-257),Et=ht.dmax,Pt=ht.wsize,Dt=ht.whave,Rt=ht.wnext,Bt=ht.window;ze=ht.hold,Ve=ht.bits;const Tt=ht.lencode,Ut=ht.distcode,Kt=(1<>>24,ze>>>=rt,Ve-=rt,rt=tt>>>16&255,0===rt)mt[qe++]=65535&tt;else{if(!(16&rt)){if(0==(64&rt)){tt=Tt[(65535&tt)+(ze&(1<>>=rt,Ve-=rt),Ve<15&&(ze+=ft[Ce++]<>>24,ze>>>=rt,Ve-=rt,rt=tt>>>16&255,!(16&rt)){if(0==(64&rt)){tt=Ut[(65535&tt)+(ze&(1<Et){ke.msg="invalid distance too far back",ht.mode=30;break e}if(ze>>>=rt,Ve-=rt,rt=qe-kt,nt>rt){if(rt=nt-rt,rt>Dt&&ht.sane){ke.msg="invalid distance too far back",ht.mode=30;break e}if(ot=0,ct=Bt,0===Rt){if(ot+=Pt-rt,rt2;)mt[qe++]=ct[ot++],mt[qe++]=ct[ot++],mt[qe++]=ct[ot++],it-=3;it&&(mt[qe++]=ct[ot++],it>1&&(mt[qe++]=ct[ot++]))}else{ot=qe-nt;do{mt[qe++]=mt[ot++],mt[qe++]=mt[ot++],mt[qe++]=mt[ot++],it-=3}while(it>2);it&&(mt[qe++]=mt[ot++],it>1&&(mt[qe++]=mt[ot++]))}break}}break}}while(Ce>3,Ce-=it,Ve-=it<<3,ze&=(1<=1&&0===It[St];St--);if(Et>St&&(Et=St),0===St)return ze[Ve++]=20971520,ze[Ve++]=20971520,rt.bits=1,0;for(kt=1;kt0&&(0===ke||1!==St))return-1;for(Ot[1]=0,yt=1;yt<15;yt++)Ot[yt+1]=Ot[yt]+It[yt];for(mt=0;mt852||2===ke&&Bt>592)return 1;for(;;){Nt=yt-Dt,tt[mt]ft?(qt=Ft[Lt+tt[mt]],zt=Ut[Kt+tt[mt]]):(qt=96,zt=0),nt=1<>Dt)+ot]=Nt<<24|qt<<16|zt|0}while(0!==ot);for(nt=1<>=1;if(0!==nt?(Tt&=nt-1,Tt+=nt):Tt=0,mt++,0==--It[yt]){if(yt===St)break;yt=Ae[Ce+tt[mt]]}if(yt>Et&&(Tt&Ht)!==ct){for(0===Dt&&(Dt=Et),ht+=kt,Pt=yt-Dt,Rt=1<852||2===ke&&Bt>592)return 1;ct=Tt&Ht,ze[ct]=Et<<24|Pt<<16|ht-Ve|0}}return 0!==Tt&&(ze[ht+Tt]=yt-Dt<<24|64<<16|0),rt.bits=Et,0}function Ms(ke){return(ke>>>24&255)+(ke>>>8&65280)+((65280&ke)<<8)+((255&ke)<<24)}class Cs{constructor(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new zo(320),this.work=new zo(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}}function Ks(ke){let Ae;return ke&&ke.state?(Ae=ke.state,Ae.wsize=0,Ae.whave=0,Ae.wnext=0,function(ke){let Ae;return ke&&ke.state?(Ae=ke.state,ke.total_in=ke.total_out=Ae.total=0,ke.msg="",Ae.wrap&&(ke.adler=1&Ae.wrap),Ae.mode=1,Ae.last=0,Ae.havedict=0,Ae.dmax=32768,Ae.head=null,Ae.hold=0,Ae.bits=0,Ae.lencode=Ae.lendyn=new ic(852),Ae.distcode=Ae.distdyn=new ic(592),Ae.sane=1,Ae.back=-1,0):-2}(ke)):-2}function Ds(ke,Ae){let Ce,qe;return ke?(qe=new Cs,ke.state=qe,qe.window=null,Ce=function(ke,Ae){let Ce,qe;return ke&&ke.state?(qe=ke.state,Ae<0?(Ce=0,Ae=-Ae):(Ce=1+(Ae>>4),Ae<48&&(Ae&=15)),Ae&&(Ae<8||Ae>15)?-2:(null!==qe.window&&qe.wbits!==Ae&&(qe.window=null),qe.wrap=Ce,qe.wbits=Ae,Ks(ke))):-2}(ke,Ae),0!==Ce&&(ke.state=null),Ce):-2}let Iu,jh,hf=!0;function Bs(ke){if(hf){let Ae;for(Iu=new ic(512),jh=new ic(32),Ae=0;Ae<144;)ke.lens[Ae++]=8;for(;Ae<256;)ke.lens[Ae++]=9;for(;Ae<280;)ke.lens[Ae++]=7;for(;Ae<288;)ke.lens[Ae++]=8;for(xs(1,ke.lens,0,288,Iu,0,ke.work,{bits:9}),Ae=0;Ae<32;)ke.lens[Ae++]=5;xs(2,ke.lens,0,32,jh,0,ke.work,{bits:5}),hf=!1}ke.lencode=Iu,ke.lenbits=9,ke.distcode=jh,ke.distbits=5}function Ts(ke,Ae,Ce,qe){let ze;const Ve=ke.state;return null===Ve.window&&(Ve.wsize=1<=Ve.wsize?(ac(Ve.window,Ae,Ce-Ve.wsize,Ve.wsize,0),Ve.wnext=0,Ve.whave=Ve.wsize):(ze=Ve.wsize-Ve.wnext,ze>qe&&(ze=qe),ac(Ve.window,Ae,Ce-qe,ze,Ve.wnext),(qe-=ze)?(ac(Ve.window,Ae,Ce-qe,qe,0),Ve.wnext=qe,Ve.whave=Ve.wsize):(Ve.wnext+=ze,Ve.wnext===Ve.wsize&&(Ve.wnext=0),Ve.whave>>8&255,Ce.check=Ja(Ce.check,Ot,2,0),nt=0,ot=0,Ce.mode=2;break}if(Ce.flags=0,Ce.head&&(Ce.head.done=!1),!(1&Ce.wrap)||(((255&nt)<<8)+(nt>>8))%31){ke.msg="incorrect header check",Ce.mode=30;break}if(8!=(15&nt)){ke.msg="unknown compression method",Ce.mode=30;break}if(nt>>>=4,ot-=4,Bt=8+(15&nt),0===Ce.wbits)Ce.wbits=Bt;else if(Bt>Ce.wbits){ke.msg="invalid window size",Ce.mode=30;break}Ce.dmax=1<>8&1),512&Ce.flags&&(Ot[0]=255&nt,Ot[1]=nt>>>8&255,Ce.check=Ja(Ce.check,Ot,2,0)),nt=0,ot=0,Ce.mode=3;case 3:for(;ot<32;){if(0===rt)break e;rt--,nt+=qe[Ve++]<>>8&255,Ot[2]=nt>>>16&255,Ot[3]=nt>>>24&255,Ce.check=Ja(Ce.check,Ot,4,0)),nt=0,ot=0,Ce.mode=4;case 4:for(;ot<16;){if(0===rt)break e;rt--,nt+=qe[Ve++]<>8),512&Ce.flags&&(Ot[0]=255&nt,Ot[1]=nt>>>8&255,Ce.check=Ja(Ce.check,Ot,2,0)),nt=0,ot=0,Ce.mode=5;case 5:if(1024&Ce.flags){for(;ot<16;){if(0===rt)break e;rt--,nt+=qe[Ve++]<>>8&255,Ce.check=Ja(Ce.check,Ot,2,0)),nt=0,ot=0}else Ce.head&&(Ce.head.extra=null);Ce.mode=6;case 6:if(1024&Ce.flags&&(ft=Ce.length,ft>rt&&(ft=rt),ft&&(Ce.head&&(Bt=Ce.head.extra_len-Ce.length,Ce.head.extra||(Ce.head.extra=Array(Ce.head.extra_len)),ac(Ce.head.extra,qe,Ve,ft,Bt)),512&Ce.flags&&(Ce.check=Ja(Ce.check,qe,ft,Ve)),rt-=ft,Ve+=ft,Ce.length-=ft),Ce.length))break e;Ce.length=0,Ce.mode=7;case 7:if(2048&Ce.flags){if(0===rt)break e;ft=0;do{Bt=qe[Ve+ft++],Ce.head&&Bt&&Ce.length<65536&&(Ce.head.name+=String.fromCharCode(Bt))}while(Bt&&ft>9&1,Ce.head.done=!0),ke.adler=Ce.check=0,Ce.mode=12;break;case 10:for(;ot<32;){if(0===rt)break e;rt--,nt+=qe[Ve++]<>>=7&ot,ot-=7&ot,Ce.mode=27;break}for(;ot<3;){if(0===rt)break e;rt--,nt+=qe[Ve++]<>>=1,ot-=1,3&nt){case 0:Ce.mode=14;break;case 1:if(Bs(Ce),Ce.mode=20,6===Ae){nt>>>=2,ot-=2;break e}break;case 2:Ce.mode=17;break;case 3:ke.msg="invalid block type",Ce.mode=30}nt>>>=2,ot-=2;break;case 14:for(nt>>>=7&ot,ot-=7&ot;ot<32;){if(0===rt)break e;rt--,nt+=qe[Ve++]<>>16^65535)){ke.msg="invalid stored block lengths",Ce.mode=30;break}if(Ce.length=65535&nt,nt=0,ot=0,Ce.mode=15,6===Ae)break e;case 15:Ce.mode=16;case 16:if(ft=Ce.length,ft){if(ft>rt&&(ft=rt),ft>it&&(ft=it),0===ft)break e;ac(ze,qe,Ve,ft,tt),rt-=ft,Ve+=ft,it-=ft,tt+=ft,Ce.length-=ft;break}Ce.mode=12;break;case 17:for(;ot<14;){if(0===rt)break e;rt--,nt+=qe[Ve++]<>>=5,ot-=5,Ce.ndist=1+(31&nt),nt>>>=5,ot-=5,Ce.ncode=4+(15&nt),nt>>>=4,ot-=4,Ce.nlen>286||Ce.ndist>30){ke.msg="too many length or distance symbols",Ce.mode=30;break}Ce.have=0,Ce.mode=18;case 18:for(;Ce.have>>=3,ot-=3}for(;Ce.have<19;)Ce.lens[Nt[Ce.have++]]=0;if(Ce.lencode=Ce.lendyn,Ce.lenbits=7,Ut={bits:Ce.lenbits},Tt=xs(0,Ce.lens,0,19,Ce.lencode,0,Ce.work,Ut),Ce.lenbits=Ut.bits,Tt){ke.msg="invalid code lengths set",Ce.mode=30;break}Ce.have=0,Ce.mode=19;case 19:for(;Ce.have>>24,St=It>>>16&255,Et=65535&It,!(kt<=ot);){if(0===rt)break e;rt--,nt+=qe[Ve++]<>>=kt,ot-=kt,Ce.lens[Ce.have++]=Et;else{if(16===Et){for(Kt=kt+2;ot>>=kt,ot-=kt,0===Ce.have){ke.msg="invalid bit length repeat",Ce.mode=30;break}Bt=Ce.lens[Ce.have-1],ft=3+(3&nt),nt>>>=2,ot-=2}else if(17===Et){for(Kt=kt+3;ot>>=kt,ot-=kt,Bt=0,ft=3+(7&nt),nt>>>=3,ot-=3}else{for(Kt=kt+7;ot>>=kt,ot-=kt,Bt=0,ft=11+(127&nt),nt>>>=7,ot-=7}if(Ce.have+ft>Ce.nlen+Ce.ndist){ke.msg="invalid bit length repeat",Ce.mode=30;break}for(;ft--;)Ce.lens[Ce.have++]=Bt}}if(30===Ce.mode)break;if(0===Ce.lens[256]){ke.msg="invalid code -- missing end-of-block",Ce.mode=30;break}if(Ce.lenbits=9,Ut={bits:Ce.lenbits},Tt=xs(1,Ce.lens,0,Ce.nlen,Ce.lencode,0,Ce.work,Ut),Ce.lenbits=Ut.bits,Tt){ke.msg="invalid literal/lengths set",Ce.mode=30;break}if(Ce.distbits=6,Ce.distcode=Ce.distdyn,Ut={bits:Ce.distbits},Tt=xs(2,Ce.lens,Ce.nlen,Ce.ndist,Ce.distcode,0,Ce.work,Ut),Ce.distbits=Ut.bits,Tt){ke.msg="invalid distances set",Ce.mode=30;break}if(Ce.mode=20,6===Ae)break e;case 20:Ce.mode=21;case 21:if(rt>=6&&it>=258){ke.next_out=tt,ke.avail_out=it,ke.next_in=Ve,ke.avail_in=rt,Ce.hold=nt,Ce.bits=ot,ks(ke,ht),tt=ke.next_out,ze=ke.output,it=ke.avail_out,Ve=ke.next_in,qe=ke.input,rt=ke.avail_in,nt=Ce.hold,ot=Ce.bits,12===Ce.mode&&(Ce.back=-1);break}for(Ce.back=0;It=Ce.lencode[nt&(1<>>24,St=It>>>16&255,Et=65535&It,!(kt<=ot);){if(0===rt)break e;rt--,nt+=qe[Ve++]<>Pt)],kt=It>>>24,St=It>>>16&255,Et=65535&It,!(Pt+kt<=ot);){if(0===rt)break e;rt--,nt+=qe[Ve++]<>>=Pt,ot-=Pt,Ce.back+=Pt}if(nt>>>=kt,ot-=kt,Ce.back+=kt,Ce.length=Et,0===St){Ce.mode=26;break}if(32&St){Ce.back=-1,Ce.mode=12;break}if(64&St){ke.msg="invalid literal/length code",Ce.mode=30;break}Ce.extra=15&St,Ce.mode=22;case 22:if(Ce.extra){for(Kt=Ce.extra;ot>>=Ce.extra,ot-=Ce.extra,Ce.back+=Ce.extra}Ce.was=Ce.length,Ce.mode=23;case 23:for(;It=Ce.distcode[nt&(1<>>24,St=It>>>16&255,Et=65535&It,!(kt<=ot);){if(0===rt)break e;rt--,nt+=qe[Ve++]<>Pt)],kt=It>>>24,St=It>>>16&255,Et=65535&It,!(Pt+kt<=ot);){if(0===rt)break e;rt--,nt+=qe[Ve++]<>>=Pt,ot-=Pt,Ce.back+=Pt}if(nt>>>=kt,ot-=kt,Ce.back+=kt,64&St){ke.msg="invalid distance code",Ce.mode=30;break}Ce.offset=Et,Ce.extra=15&St,Ce.mode=24;case 24:if(Ce.extra){for(Kt=Ce.extra;ot>>=Ce.extra,ot-=Ce.extra,Ce.back+=Ce.extra}if(Ce.offset>Ce.dmax){ke.msg="invalid distance too far back",Ce.mode=30;break}Ce.mode=25;case 25:if(0===it)break e;if(ft=ht-it,Ce.offset>ft){if(ft=Ce.offset-ft,ft>Ce.whave&&Ce.sane){ke.msg="invalid distance too far back",Ce.mode=30;break}ft>Ce.wnext?(ft-=Ce.wnext,yt=Ce.wsize-ft):yt=Ce.wnext-ft,ft>Ce.length&&(ft=Ce.length),mt=Ce.window}else mt=ze,yt=tt-Ce.offset,ft=Ce.length;ft>it&&(ft=it),it-=ft,Ce.length-=ft;do{ze[tt++]=mt[yt++]}while(--ft);0===Ce.length&&(Ce.mode=21);break;case 26:if(0===it)break e;ze[tt++]=Ce.length,it--,Ce.mode=21;break;case 27:if(Ce.wrap){for(;ot<32;){if(0===rt)break e;rt--,nt|=qe[Ve++]<=0&&Ae.windowBits<16&&(Ae.windowBits=-Ae.windowBits,0===Ae.windowBits&&(Ae.windowBits=-15)),!(Ae.windowBits>=0&&Ae.windowBits<16)||ke&&ke.windowBits||(Ae.windowBits+=32),Ae.windowBits>15&&Ae.windowBits<48&&0==(15&Ae.windowBits)&&(Ae.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vs,this.strm.avail_out=0;let Ce=Ds(this.strm,Ae.windowBits);if(0!==Ce)throw Error(au[Ce]);if(this.header=new Os,function(ke,Ae){let Ce;ke&&ke.state&&(Ce=ke.state,0==(2&Ce.wrap)||(Ce.head=Ae,Ae.done=!1))}(this.strm,this.header),Ae.dictionary&&("string"==typeof Ae.dictionary?Ae.dictionary=ws(Ae.dictionary):Ae.dictionary instanceof ArrayBuffer&&(Ae.dictionary=new Uint8Array(Ae.dictionary)),Ae.raw&&(Ce=qs(this.strm,Ae.dictionary),0!==Ce)))throw Error(au[Ce])}push(ke,Ae){const{strm:Ce,options:{chunkSize:qe,dictionary:ze}}=this;let Ve,tt,rt=!1;if(this.ended)return!1;tt=Ae===~~Ae?Ae:!0===Ae?4:0,"string"==typeof ke?Ce.input=function(ke){const Ae=new Io(ke.length);for(let Ce=0,qe=Ae.length;Ce0||0===Ce.avail_out)&&1!==Ve);return 1===Ve&&(tt=4),4===tt?(Ve=function(ke){if(!ke||!ke.state)return-2;const Ae=ke.state;return Ae.window&&(Ae.window=null),ke.state=null,0}(this.strm),this.onEnd(Ve),this.ended=!0,0===Ve):2!==tt||(this.onEnd(0),Ce.avail_out=0,!0)}onData(ke){this.chunks.push(ke)}onEnd(ke){0===ke&&(this.result=nc(this.chunks)),this.chunks=[],this.err=ke,this.msg=this.strm.msg}}var ff=[0,1,3,7,15,31,63,127,255],js=function(ke){this.stream=ke,this.bitOffset=0,this.curByte=0,this.hasByte=!1};js.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},js.prototype.read=function(ke){for(var Ae=0;ke>0;){this._ensureByte();var Ce=8-this.bitOffset;if(ke>=Ce)Ae<<=Ce,Ae|=ff[Ce]&this.curByte,this.hasByte=!1,this.bitOffset=0,ke-=Ce;else{Ae<<=ke;var qe=Ce-ke;Ae|=(this.curByte&ff[ke]<>qe,this.bitOffset+=ke,ke=0}}return Ae},js.prototype.seek=function(ke){var Ae=ke%8,Ce=(ke-Ae)/8;this.bitOffset=Ae,this.stream.seek(Ce),this.hasByte=!1},js.prototype.pi=function(){var ke,Ae=new Uint8Array(6);for(ke=0;ke("00"+ke.toString(16)).slice(-2))).join("")}(Ae)};var tl=js,Ws=function(){};Ws.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},Ws.prototype.read=function(ke,Ae,Ce){for(var qe=0;qe>>0},this.updateCRC=function(Ae){ke=ke<<8^il[255&(ke>>>24^Ae)]},this.updateCRCRun=function(Ae,Ce){for(;Ce-- >0;)ke=ke<<8^il[255&(ke>>>24^Ae)]}}),$s=function(ke,Ae){var Ce,qe=ke[Ae];for(Ce=Ae;Ce>0;Ce--)ke[Ce]=ke[Ce-1];return ke[0]=qe,qe},cl={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},ul={};ul[cl.LAST_BLOCK]="Bad file checksum",ul[cl.NOT_BZIP_DATA]="Not bzip data",ul[cl.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",ul[cl.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",ul[cl.DATA_ERROR]="Data error",ul[cl.OUT_OF_MEMORY]="Out of memory",ul[cl.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var Xs=function(ke,Ae){var Ce=ul[ke]||"unknown error";Ae&&(Ce+=": "+Ae);var qe=new TypeError(Ce);throw qe.errorCode=ke,qe},Qs=function(ke,Ae){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(ke,Ae)};Qs.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new ol,!0):(this.writeCount=-1,!1)},Qs.prototype._start_bunzip=function(ke,Ae){var Ce=new Uint8Array(4);4===ke.read(Ce,0,4)&&"BZh"===String.fromCharCode(Ce[0],Ce[1],Ce[2])||Xs(cl.NOT_BZIP_DATA,"bad magic");var qe=Ce[3]-48;(qe<1||qe>9)&&Xs(cl.NOT_BZIP_DATA,"level out of range"),this.reader=new tl(ke),this.dbufSize=1e5*qe,this.nextoutput=0,this.outputStream=Ae,this.streamCRC=0},Qs.prototype._get_next_block=function(){var ke,Ae,Ce,qe=this.reader,ze=qe.pi();if("177245385090"===ze)return!1;"314159265359"!==ze&&Xs(cl.NOT_BZIP_DATA),this.targetBlockCRC=qe.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,qe.read(1)&&Xs(cl.OBSOLETE_INPUT);var Ve=qe.read(24);Ve>this.dbufSize&&Xs(cl.DATA_ERROR,"initial position out of bounds");var tt=qe.read(16),rt=new Uint8Array(256),it=0;for(ke=0;ke<16;ke++)if(tt&1<<15-ke){var nt=16*ke;for(Ce=qe.read(16),Ae=0;Ae<16;Ae++)Ce&1<<15-Ae&&(rt[it++]=nt+Ae)}var ot=qe.read(3);(ot<2||ot>6)&&Xs(cl.DATA_ERROR);var ct=qe.read(15);0===ct&&Xs(cl.DATA_ERROR);var ht=new Uint8Array(256);for(ke=0;ke=ot&&Xs(cl.DATA_ERROR);ft[ke]=$s(ht,Ae)}var yt,mt=it+2,kt=[];for(Ae=0;Ae20)&&Xs(cl.DATA_ERROR),qe.read(1);)qe.read(1)?tt--:tt++;Pt[ke]=tt}for(St=Et=Pt[0],ke=1;keEt?Et=Pt[ke]:Pt[ke]=ct&&Xs(cl.DATA_ERROR),yt=kt[ft[It++]]),ke=yt.minLen,Ae=qe.read(ke);ke>yt.maxLen&&Xs(cl.DATA_ERROR),!(Ae<=yt.limit[ke]);ke++)Ae=Ae<<1|qe.read(1);((Ae-=yt.base[ke])<0||Ae>=258)&&Xs(cl.DATA_ERROR);var Nt=yt.permute[Ae];if(0!==Nt&&1!==Nt){if(Ut)for(Ut=0,Kt+tt>this.dbufSize&&Xs(cl.DATA_ERROR),Bt[Tt=rt[ht[0]]]+=tt;tt--;)Ot[Kt++]=Tt;if(Nt>it)break;Kt>=this.dbufSize&&Xs(cl.DATA_ERROR),Bt[Tt=rt[Tt=$s(ht,ke=Nt-1)]]++,Ot[Kt++]=Tt}else Ut||(Ut=1,tt=0),tt+=0===Nt?Ut:2*Ut,Ut<<=1}for((Ve<0||Ve>=Kt)&&Xs(cl.DATA_ERROR),Ae=0,ke=0;ke<256;ke++)Ce=Ae+Bt[ke],Bt[ke]=Ae,Ae=Ce;for(ke=0;ke>=8,Ft=-1),this.writePos=qt,this.writeCurrent=zt,this.writeCount=Kt,this.writeRun=Ft,!0},Qs.prototype._read_bunzip=function(ke,Ae){var Ce,qe,ze;if(this.writeCount<0)return 0;var Ve=this.dbuf,tt=this.writePos,rt=this.writeCurrent,it=this.writeCount;this.outputsize;for(var nt=this.writeRun;it;){for(it--,qe=rt,rt=255&(tt=Ve[tt]),tt>>=8,3==nt++?(Ce=rt,ze=qe,rt=-1):(Ce=1,ze=rt),this.blockCRC.updateCRCRun(ze,Ce);Ce--;)this.outputStream.writeByte(ze),this.nextoutput++;rt!=qe&&(nt=0)}return this.writeCount=it,this.blockCRC.getCRC()!==this.targetBlockCRC&&Xs(cl.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var Js=function(ke){if("readByte"in ke)return ke;var Ae=new al;return Ae.pos=0,Ae.readByte=function(){return ke[this.pos++]},Ae.seek=function(ke){this.pos=ke},Ae.eof=function(){return this.pos>=ke.length},Ae},eo=function(ke){var Ae=new al,Ce=!0;if(ke)if("number"==typeof ke)Ae.buffer=new Uint8Array(ke),Ce=!1;else{if("writeByte"in ke)return ke;Ae.buffer=ke,Ce=!1}else Ae.buffer=new Uint8Array(16384);return Ae.pos=0,Ae.writeByte=function(ke){if(Ce&&this.pos>=this.buffer.length){var Ae=new Uint8Array(2*this.buffer.length);Ae.set(this.buffer),this.buffer=Ae}this.buffer[this.pos++]=ke},Ae.getBuffer=function(){if(this.pos!==this.buffer.length){if(!Ce)throw new TypeError("outputsize does not match decoded input");var ke=new Uint8Array(this.pos);ke.set(this.buffer.subarray(0,this.pos)),this.buffer=ke}return this.buffer},Ae._coerced=!0,Ae};var to=function(ke,Ae,Ce){for(var qe=Js(ke),ze=eo(Ae),Ve=new Qs(qe,ze);!("eof"in qe)||!qe.eof();)if(Ve._init_block())Ve._read_bunzip();else{var tt=Ve.reader.read(32)>>>0;if(tt!==Ve.streamCRC&&Xs(cl.DATA_ERROR,"Bad stream CRC (got "+Ve.streamCRC.toString(16)+" expected "+tt.toString(16)+")"),!Ce||!("eof"in qe)||qe.eof())break;Ve._start_bunzip(qe,ze)}if("getBuffer"in ze)return ze.getBuffer()};class ro{static get tag(){return er.packet.literalData}constructor(ke=new Date){this.format=er.literal.utf8,this.date=Zt.normalizeDate(ke),this.text=null,this.data=null,this.filename=""}setText(ke,Ae=er.literal.utf8){this.format=Ae,this.text=ke,this.data=null}getText(ke=!1){return(null===this.text||Zt.isStream(this.text))&&(this.text=Zt.decodeUTF8(Zt.nativeEOL(this.getBytes(ke)))),this.text}setBytes(ke,Ae){this.format=Ae,this.data=ke,this.text=null}getBytes(ke=!1){return null===this.data&&(this.data=Zt.canonicalizeEOL(Zt.encodeUTF8(this.text))),ke?ee(this.data):this.data}setFilename(ke){this.filename=ke}getFilename(){return this.filename}async read(ke){await Q(ke,(async ke=>{const Ae=await ke.readByte(),Ce=await ke.readByte();this.filename=Zt.decodeUTF8(await ke.readBytes(Ce)),this.date=Zt.readDate(await ke.readBytes(4));let qe=ke.remainder();_(qe)&&(qe=await ie(qe)),this.setBytes(qe,Ae)}))}writeHeader(){const ke=Zt.encodeUTF8(this.filename),Ae=new Uint8Array([ke.length]),Ce=new Uint8Array([this.format]),qe=Zt.writeDate(this.date);return Zt.concatUint8Array([Ce,Ae,ke,qe])}write(){const ke=this.writeHeader(),Ae=this.getBytes();return Zt.concat([ke,Ae])}}const hl=Symbol("verified"),fl=new Set([er.signatureSubpacket.issuer,er.signatureSubpacket.issuerFingerprint,er.signatureSubpacket.embeddedSignature]);class ao{static get tag(){return er.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.signedHashValue=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new Me,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.revoked=null,this[hl]=null}read(ke){let Ae=0;if(this.version=ke[Ae++],4!==this.version&&5!==this.version)throw new Ui(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=ke[Ae++],this.publicKeyAlgorithm=ke[Ae++],this.hashAlgorithm=ke[Ae++],Ae+=this.readSubPackets(ke.subarray(Ae,ke.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=ke.subarray(0,Ae),Ae+=this.readSubPackets(ke.subarray(Ae,ke.length),!1),this.signedHashValue=ke.subarray(Ae,Ae+2),Ae+=2,this.params=vo.signature.parseSignatureParams(this.publicKeyAlgorithm,ke.subarray(Ae,ke.length))}writeParams(){return this.params instanceof Promise?ae((async()=>vo.serializeParams(this.publicKeyAlgorithm,await this.params))):vo.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const ke=[];return ke.push(this.signatureData),ke.push(this.writeUnhashedSubPackets()),ke.push(this.signedHashValue),ke.push(this.writeParams()),Zt.concat(ke)}async sign(ke,Ae,Ce=new Date,qe=!1){5===ke.version?this.version=5:this.version=4;const ze=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=Zt.normalizeDate(Ce),this.issuerKeyVersion=ke.version,this.issuerFingerprint=ke.getFingerprintBytes(),this.issuerKeyID=ke.getKeyID(),ze.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=Zt.concat(ze);const Ve=this.toHash(this.signatureType,Ae,qe),tt=await this.hash(this.signatureType,Ae,Ve,qe);this.signedHashValue=re(J(tt),0,2);const o=async()=>vo.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,ke.publicParams,ke.privateParams,Ve,await ie(tt));Zt.isStream(tt)?this.params=o():(this.params=await o(),this[hl]=!0)}writeHashedSubPackets(){const ke=er.signatureSubpacket,Ae=[];let Ce;if(null===this.created)throw Error("Missing signature creation time");Ae.push(so(ke.signatureCreationTime,Zt.writeDate(this.created))),null!==this.signatureExpirationTime&&Ae.push(so(ke.signatureExpirationTime,Zt.writeNumber(this.signatureExpirationTime,4))),null!==this.exportable&&Ae.push(so(ke.exportableCertification,new Uint8Array([this.exportable?1:0]))),null!==this.trustLevel&&(Ce=new Uint8Array([this.trustLevel,this.trustAmount]),Ae.push(so(ke.trustSignature,Ce))),null!==this.regularExpression&&Ae.push(so(ke.regularExpression,this.regularExpression)),null!==this.revocable&&Ae.push(so(ke.revocable,new Uint8Array([this.revocable?1:0]))),null!==this.keyExpirationTime&&Ae.push(so(ke.keyExpirationTime,Zt.writeNumber(this.keyExpirationTime,4))),null!==this.preferredSymmetricAlgorithms&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.preferredSymmetricAlgorithms)),Ae.push(so(ke.preferredSymmetricAlgorithms,Ce))),null!==this.revocationKeyClass&&(Ce=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),Ce=Zt.concat([Ce,this.revocationKeyFingerprint]),Ae.push(so(ke.revocationKey,Ce))),this.issuerKeyID.isNull()||5===this.issuerKeyVersion||Ae.push(so(ke.issuer,this.issuerKeyID.write())),this.rawNotations.forEach((([{name:qe,value:ze,humanReadable:Ve}])=>{Ce=[new Uint8Array([Ve?128:0,0,0,0])],Ce.push(Zt.writeNumber(qe.length,2)),Ce.push(Zt.writeNumber(ze.length,2)),Ce.push(Zt.stringToUint8Array(qe)),Ce.push(ze),Ce=Zt.concat(Ce),Ae.push(so(ke.notationData,Ce))})),null!==this.preferredHashAlgorithms&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.preferredHashAlgorithms)),Ae.push(so(ke.preferredHashAlgorithms,Ce))),null!==this.preferredCompressionAlgorithms&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.preferredCompressionAlgorithms)),Ae.push(so(ke.preferredCompressionAlgorithms,Ce))),null!==this.keyServerPreferences&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.keyServerPreferences)),Ae.push(so(ke.keyServerPreferences,Ce))),null!==this.preferredKeyServer&&Ae.push(so(ke.preferredKeyServer,Zt.stringToUint8Array(this.preferredKeyServer))),null!==this.isPrimaryUserID&&Ae.push(so(ke.primaryUserID,new Uint8Array([this.isPrimaryUserID?1:0]))),null!==this.policyURI&&Ae.push(so(ke.policyURI,Zt.stringToUint8Array(this.policyURI))),null!==this.keyFlags&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.keyFlags)),Ae.push(so(ke.keyFlags,Ce))),null!==this.signersUserID&&Ae.push(so(ke.signersUserID,Zt.stringToUint8Array(this.signersUserID))),null!==this.reasonForRevocationFlag&&(Ce=Zt.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),Ae.push(so(ke.reasonForRevocation,Ce))),null!==this.features&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.features)),Ae.push(so(ke.features,Ce))),null!==this.signatureTargetPublicKeyAlgorithm&&(Ce=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],Ce.push(Zt.stringToUint8Array(this.signatureTargetHash)),Ce=Zt.concat(Ce),Ae.push(so(ke.signatureTarget,Ce))),null!==this.embeddedSignature&&Ae.push(so(ke.embeddedSignature,this.embeddedSignature.write())),null!==this.issuerFingerprint&&(Ce=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],Ce=Zt.concat(Ce),Ae.push(so(ke.issuerFingerprint,Ce))),null!==this.preferredAEADAlgorithms&&(Ce=Zt.stringToUint8Array(Zt.uint8ArrayToString(this.preferredAEADAlgorithms)),Ae.push(so(ke.preferredAEADAlgorithms,Ce)));const qe=Zt.concat(Ae),ze=Zt.writeNumber(qe.length,2);return Zt.concat([ze,qe])}writeUnhashedSubPackets(){const ke=[];this.unhashedSubpackets.forEach((Ae=>{ke.push(xi(Ae.length)),ke.push(Ae)}));const Ae=Zt.concat(ke),Ce=Zt.writeNumber(Ae.length,2);return Zt.concat([Ce,Ae])}readSubPacket(ke,Ae=!0){let Ce=0;const qe=128&ke[Ce],ze=127&ke[Ce];if(Ae||(this.unhashedSubpackets.push(ke.subarray(Ce,ke.length)),fl.has(ze)))switch(Ce++,ze){case er.signatureSubpacket.signatureCreationTime:this.created=Zt.readDate(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.signatureExpirationTime:{const Ae=Zt.readNumber(ke.subarray(Ce,ke.length));this.signatureNeverExpires=0===Ae,this.signatureExpirationTime=Ae;break}case er.signatureSubpacket.exportableCertification:this.exportable=1===ke[Ce++];break;case er.signatureSubpacket.trustSignature:this.trustLevel=ke[Ce++],this.trustAmount=ke[Ce++];break;case er.signatureSubpacket.regularExpression:this.regularExpression=ke[Ce];break;case er.signatureSubpacket.revocable:this.revocable=1===ke[Ce++];break;case er.signatureSubpacket.keyExpirationTime:{const Ae=Zt.readNumber(ke.subarray(Ce,ke.length));this.keyExpirationTime=Ae,this.keyNeverExpires=0===Ae;break}case er.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...ke.subarray(Ce,ke.length)];break;case er.signatureSubpacket.revocationKey:this.revocationKeyClass=ke[Ce++],this.revocationKeyAlgorithm=ke[Ce++],this.revocationKeyFingerprint=ke.subarray(Ce,Ce+20);break;case er.signatureSubpacket.issuer:this.issuerKeyID.read(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.notationData:{const Ae=!!(128&ke[Ce]);Ce+=4;const ze=Zt.readNumber(ke.subarray(Ce,Ce+2));Ce+=2;const Ve=Zt.readNumber(ke.subarray(Ce,Ce+2));Ce+=2;const tt=Zt.uint8ArrayToString(ke.subarray(Ce,Ce+ze)),rt=ke.subarray(Ce+ze,Ce+ze+Ve);this.rawNotations.push({name:tt,humanReadable:Ae,value:rt,critical:qe}),Ae&&(this.notations[tt]=Zt.uint8ArrayToString(rt));break}case er.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...ke.subarray(Ce,ke.length)];break;case er.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...ke.subarray(Ce,ke.length)];break;case er.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...ke.subarray(Ce,ke.length)];break;case er.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=Zt.uint8ArrayToString(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.primaryUserID:this.isPrimaryUserID=0!==ke[Ce++];break;case er.signatureSubpacket.policyURI:this.policyURI=Zt.uint8ArrayToString(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.keyFlags:this.keyFlags=[...ke.subarray(Ce,ke.length)];break;case er.signatureSubpacket.signersUserID:this.signersUserID=Zt.uint8ArrayToString(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=ke[Ce++],this.reasonForRevocationString=Zt.uint8ArrayToString(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.features:this.features=[...ke.subarray(Ce,ke.length)];break;case er.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=ke[Ce++],this.signatureTargetHashAlgorithm=ke[Ce++];const Ae=vo.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=Zt.uint8ArrayToString(ke.subarray(Ce,Ce+Ae));break}case er.signatureSubpacket.embeddedSignature:this.embeddedSignature=new ao,this.embeddedSignature.read(ke.subarray(Ce,ke.length));break;case er.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=ke[Ce++],this.issuerFingerprint=ke.subarray(Ce,ke.length),5===this.issuerKeyVersion?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case er.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...ke.subarray(Ce,ke.length)];break;default:{const ke=Error("Unknown signature subpacket type "+ze);if(qe)throw ke;Zt.printDebug(ke)}}}readSubPackets(ke,Ae=!0,Ce){const qe=Zt.readNumber(ke.subarray(0,2));let ze=2;for(;ze<2+qe;){const qe=Pi(ke.subarray(ze,ke.length));ze+=qe.offset,this.readSubPacket(ke.subarray(ze,ze+qe.len),Ae,Ce),ze+=qe.len}return ze}toSign(ke,Ae){const Ce=er.signature;switch(ke){case Ce.binary:return null!==Ae.text?Zt.encodeUTF8(Ae.getText(!0)):Ae.getBytes(!0);case Ce.text:{const ke=Ae.getBytes(!0);return Zt.canonicalizeEOL(ke)}case Ce.standalone:return new Uint8Array(0);case Ce.certGeneric:case Ce.certPersona:case Ce.certCasual:case Ce.certPositive:case Ce.certRevocation:{let ke,qe;if(Ae.userID)qe=180,ke=Ae.userID;else{if(!Ae.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");qe=209,ke=Ae.userAttribute}const ze=ke.write();return Zt.concat([this.toSign(Ce.key,Ae),new Uint8Array([qe]),Zt.writeNumber(ze.length,4),ze])}case Ce.subkeyBinding:case Ce.subkeyRevocation:case Ce.keyBinding:return Zt.concat([this.toSign(Ce.key,Ae),this.toSign(Ce.key,{key:Ae.bind})]);case Ce.key:if(void 0===Ae.key)throw Error("Key packet is required for this signature.");return Ae.key.writeForHash(this.version);case Ce.keyRevocation:return this.toSign(Ce.key,Ae);case Ce.timestamp:return new Uint8Array(0);case Ce.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(ke,Ae){let Ce=0;return Y(J(this.signatureData),(ke=>{Ce+=ke.length}),(()=>{const qe=[];return 5!==this.version||this.signatureType!==er.signature.binary&&this.signatureType!==er.signature.text||(Ae?qe.push(new Uint8Array(6)):qe.push(ke.writeHeader())),qe.push(new Uint8Array([this.version,255])),5===this.version&&qe.push(new Uint8Array(4)),qe.push(Zt.writeNumber(Ce,4)),Zt.concat(qe)}))}toHash(ke,Ae,Ce=!1){const qe=this.toSign(ke,Ae);return Zt.concat([qe,this.signatureData,this.calculateTrailer(Ae,Ce)])}async hash(ke,Ae,Ce,qe=!1){return Ce||(Ce=this.toHash(ke,Ae,qe)),vo.hash.digest(this.hashAlgorithm,Ce)}async verify(ke,Ae,Ce,qe=new Date,ze=!1,Ve=tr){if(!this.issuerKeyID.equals(ke.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==ke.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const tt=Ae===er.signature.binary||Ae===er.signature.text;if(!(this[hl]&&!tt)){let qe,Ve;if(this.hashed?Ve=await this.hashed:(qe=this.toHash(Ae,Ce,ze),Ve=await this.hash(Ae,Ce,qe)),Ve=await ie(Ve),this.signedHashValue[0]!==Ve[0]||this.signedHashValue[1]!==Ve[1])throw Error("Signed digest did not match");if(this.params=await this.params,this[hl]=await vo.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,ke.publicParams,qe,Ve),!this[hl])throw Error("Signature verification failed")}const rt=Zt.normalizeDate(qe);if(rt&&this.created>rt)throw Error("Signature creation time is in the future");if(rt&&rt>=this.getExpirationTime())throw Error("Signature is expired");if(Ve.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+er.read(er.hash,this.hashAlgorithm).toUpperCase());if(Ve.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[er.signature.binary,er.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+er.read(er.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach((({name:ke,critical:Ae})=>{if(Ae&&Ve.knownNotations.indexOf(ke)<0)throw Error("Unknown critical notation: "+ke)})),null!==this.revocationKeyClass)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(ke=new Date){const Ae=Zt.normalizeDate(ke);return null!==Ae&&!(this.created<=Ae&&Aeao.prototype.calculateTrailer.apply(await this.correspondingSig,ke)))}async verify(){const ke=await this.correspondingSig;if(!ke||ke.constructor.tag!==er.packet.signature)throw Error("Corresponding signature packet missing");if(ke.signatureType!==this.signatureType||ke.hashAlgorithm!==this.hashAlgorithm||ke.publicKeyAlgorithm!==this.publicKeyAlgorithm||!ke.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return ke.hashed=this.hashed,ke.verify.apply(ke,arguments)}}function co(ke,Ae){if(!Ae[ke]){let Ce;try{Ce=er.read(er.packet,ke)}catch(Ae){throw new Ui("Unknown packet type with tag: "+ke)}throw Error("Packet not allowed in this context: "+Ce)}return new Ae[ke]}oo.prototype.hash=ao.prototype.hash,oo.prototype.toHash=ao.prototype.toHash,oo.prototype.toSign=ao.prototype.toSign;class uo extends Array{static async fromBinary(ke,Ae,Ce=tr){const qe=new uo;return await qe.read(ke,Ae,Ce),qe}async read(ke,Ae,Ce=tr){this.stream=X(ke,(async(ke,qe)=>{const ze=G(qe);try{for(;;){await ze.ready;if(await Ri(ke,(async ke=>{try{if(ke.tag===er.packet.marker||ke.tag===er.packet.trust)return;const qe=co(ke.tag,Ae);qe.packets=new uo,qe.fromStream=Zt.isStream(ke.packet),await qe.read(ke.packet,Ce),await ze.write(qe)}catch(Ae){const qe=!Ce.ignoreUnsupportedPackets&&Ae instanceof Ui,Ve=!(Ce.ignoreMalformedPackets||Ae instanceof Ui);if(qe||Ve||Di(ke.tag))await ze.abort(Ae);else{const Ae=new Ii(ke.tag,ke.packet);await ze.write(Ae)}Zt.printDebugError(Ae)}})))return await ze.ready,void await ze.close()}}catch(ke){await ze.abort(ke)}}));const qe=H(this.stream);for(;;){const{done:ke,value:Ae}=await qe.read();if(ke?this.stream=null:this.push(Ae),ke||Di(Ae.constructor.tag))break}qe.releaseLock()}write(){const ke=[];for(let Ae=0;Ae{if(Ae.push(ke),ze+=ke.length,ze>=Ve){const ke=Math.min(Math.log(ze)/Math.LN2|0,30),Ce=2**ke,qe=Zt.concat([Mi(ke)].concat(Ae));return Ae=[qe.subarray(1+Ce)],ze=Ae[0].length,qe.subarray(0,1+Ce)}}),(()=>Zt.concat([xi(ze)].concat(Ae)))))}else{if(Zt.isStream(qe)){let Ae=0;ke.push(Y(J(qe),(ke=>{Ae+=ke.length}),(()=>Ki(Ce,Ae))))}else ke.push(Ki(Ce,qe.length));ke.push(qe)}}return Zt.concat(ke)}filterByTag(...ke){const Ae=new uo,r=ke=>Ae=>ke===Ae;for(let Ce=0;CeAe.constructor.tag===ke))}indexOfTag(...ke){const Ae=[],Ce=this,i=ke=>Ae=>ke===Ae;for(let qe=0;qe{this.algorithm=await ke.readByte(),this.compressed=ke.remainder(),await this.decompress(Ae)}))}write(){return null===this.compressed&&this.compress(),Zt.concat([new Uint8Array([this.algorithm]),this.compressed])}async decompress(ke=tr){const Ae=er.read(er.compression,this.algorithm),Ce=gl[Ae];if(!Ce)throw Error(Ae+" decompression not supported");this.packets=await uo.fromBinary(Ce(this.compressed),ll,ke)}compress(){const ke=er.read(er.compression,this.algorithm),Ae=yl[ke];if(!Ae)throw Error(ke+" compression not supported");this.compressed=Ae(this.packets.write(),this.deflateLevel)}}const dl=Zt.getNodeZlib();function po(ke){return ke}function yo(ke,Ae,Ce={}){return function(qe){return!Zt.isStream(qe)||_(qe)?ae((()=>ie(qe).then((Ae=>new Promise(((qe,ze)=>{ke(Ae,Ce,((ke,Ae)=>{if(ke)return ze(ke);qe(Ae)}))})))))):It(Ot(qe).pipe(Ae(Ce)))}}function bo(ke,Ae={}){return function(Ce){const qe=new ke(Ae);return Y(Ce,(ke=>{if(ke.length)return qe.push(ke,2),qe.result}),(()=>{if(ke===_s)return qe.push([],4),qe.result}))}}function mo(ke){return function(Ae){return ae((async()=>ke(await ie(Ae))))}}const yl=dl?{zip:(ke,Ae)=>yo(dl.deflateRaw,dl.createDeflateRaw,{level:Ae})(ke),zlib:(ke,Ae)=>yo(dl.deflate,dl.createDeflate,{level:Ae})(ke)}:{zip:(ke,Ae)=>bo(_s,{raw:!0,level:Ae})(ke),zlib:(ke,Ae)=>bo(_s,{level:Ae})(ke)},gl=dl?{uncompressed:po,zip:yo(dl.inflateRaw,dl.createInflateRaw),zlib:yo(dl.inflate,dl.createInflate),bzip2:mo(to)}:{uncompressed:po,zip:bo(Fs,{raw:!0}),zlib:bo(Fs),bzip2:mo(to)},bl=Zt.constructAllowedPackets([ro,fo,oo,ao]);class _o{static get tag(){return er.packet.symEncryptedIntegrityProtectedData}constructor(){this.version=1,this.encrypted=null,this.packets=null}async read(ke){await Q(ke,(async ke=>{const Ae=await ke.readByte();if(1!==Ae)throw new Ui(`Version ${Ae} of the SEIP packet is unsupported.`);this.encrypted=ke.remainder()}))}write(){return Zt.concat([new Uint8Array([1]),this.encrypted])}async encrypt(ke,Ae,Ce=tr){const{blockSize:qe}=vo.getCipher(ke);let ze=this.packets.write();_(ze)&&(ze=await ie(ze));const Ve=await vo.getPrefixRandom(ke),tt=new Uint8Array([211,20]),rt=Zt.concat([Ve,ze,tt]),it=await vo.hash.sha1(ee(rt)),nt=Zt.concat([rt,it]);return this.encrypted=await vo.mode.cfb.encrypt(ke,Ae,nt,new Uint8Array(qe),Ce),!0}async decrypt(ke,Ae,Ce=tr){const{blockSize:qe}=vo.getCipher(ke);let ze=J(this.encrypted);_(ze)&&(ze=await ie(ze));const Ve=await vo.mode.cfb.decrypt(ke,Ae,ze,new Uint8Array(qe)),tt=re(ee(Ve),-20),rt=re(Ve,0,-20),it=Promise.all([ie(await vo.hash.sha1(ee(rt))),ie(tt)]).then((([ke,Ae])=>{if(!Zt.equalsUint8Array(ke,Ae))throw Error("Modification detected.");return new Uint8Array})),nt=re(rt,qe+2);let ot=re(nt,0,-2);return ot=W([ot,ae((()=>it))]),Zt.isStream(ze)&&Ce.allowUnauthenticatedStream||(ot=await ie(ot)),this.packets=await uo.fromBinary(ot,bl,Ce),!0}}const vl=Zt.constructAllowedPackets([ro,fo,oo,ao]);class Ao{static get tag(){return er.packet.aeadEncryptedData}constructor(){this.version=1,this.cipherAlgorithm=null,this.aeadAlgorithm=er.aead.eax,this.chunkSizeByte=null,this.iv=null,this.encrypted=null,this.packets=null}async read(ke){await Q(ke,(async ke=>{const Ae=await ke.readByte();if(1!==Ae)throw new Ui(`Version ${Ae} of the AEAD-encrypted data packet is not supported.`);this.cipherAlgorithm=await ke.readByte(),this.aeadAlgorithm=await ke.readByte(),this.chunkSizeByte=await ke.readByte();const Ce=vo.getAEADMode(this.aeadAlgorithm);this.iv=await ke.readBytes(Ce.ivLength),this.encrypted=ke.remainder()}))}write(){return Zt.concat([new Uint8Array([this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte]),this.iv,this.encrypted])}async decrypt(ke,Ae,Ce=tr){this.packets=await uo.fromBinary(await this.crypt("decrypt",Ae,J(this.encrypted)),vl,Ce)}async encrypt(ke,Ae,Ce=tr){this.cipherAlgorithm=ke;const{ivLength:qe}=vo.getAEADMode(this.aeadAlgorithm);this.iv=await vo.random.getRandomBytes(qe),this.chunkSizeByte=Ce.aeadChunkSizeByte;const ze=this.packets.write();this.encrypted=await this.crypt("encrypt",Ae,ze)}async crypt(ke,Ae,Ce){const qe=vo.getAEADMode(this.aeadAlgorithm),ze=await qe(this.cipherAlgorithm,Ae),Ve="decrypt"===ke?qe.tagLength:0,tt="encrypt"===ke?qe.tagLength:0,rt=2**(this.chunkSizeByte+6)+Ve,it=new ArrayBuffer(21),nt=new Uint8Array(it,0,13),ot=new Uint8Array(it),ct=new DataView(it),ht=new Uint8Array(it,5,8);nt.set([192|Ao.tag,this.version,this.cipherAlgorithm,this.aeadAlgorithm,this.chunkSizeByte],0);let ft=0,yt=Promise.resolve(),mt=0,kt=0;const St=this.iv;return X(Ce,(async(Ae,Ce)=>{if("array"!==Zt.isStream(Ae)){const ke=new Gt({},{highWaterMark:Zt.getHardwareConcurrency()*2**(this.chunkSizeByte+6),size:ke=>ke.length});V(ke.readable,Ce),Ce=ke.writable}const it=H(Ae),Et=G(Ce);try{for(;;){let Ae=await it.readBytes(rt+Ve)||new Uint8Array;const Ce=Ae.subarray(Ae.length-Ve);let Pt,Dt;if(Ae=Ae.subarray(0,Ae.length-Ve),!ft||Ae.length?(it.unshift(Ce),Pt=ze[ke](Ae,qe.getNonce(St,ht),nt),kt+=Ae.length-Ve+tt):(ct.setInt32(17,mt),Pt=ze[ke](Ce,qe.getNonce(St,ht),ot),kt+=tt,Dt=!0),mt+=Ae.length-Ve,yt=yt.then((()=>Pt)).then((async ke=>{await Et.ready,await Et.write(ke),kt-=ke.length})).catch((ke=>Et.abort(ke))),(Dt||kt>Et.desiredSize)&&await yt,Dt){await Et.close();break}ct.setInt32(9,++ft)}}catch(ke){await Et.abort(ke)}}))}}class So{static get tag(){return er.packet.publicKeyEncryptedSessionKey}constructor(){this.version=3,this.publicKeyID=new Me,this.publicKeyAlgorithm=null,this.sessionKey=null,this.sessionKeyAlgorithm=null,this.encrypted={}}read(ke){if(this.version=ke[0],3!==this.version)throw new Ui(`Version ${this.version} of the PKESK packet is unsupported.`);this.publicKeyID.read(ke.subarray(1,ke.length)),this.publicKeyAlgorithm=ke[9],this.encrypted=vo.parseEncSessionKeyParams(this.publicKeyAlgorithm,ke.subarray(10))}write(){const ke=[new Uint8Array([this.version]),this.publicKeyID.write(),new Uint8Array([this.publicKeyAlgorithm]),vo.serializeParams(this.publicKeyAlgorithm,this.encrypted)];return Zt.concatUint8Array(ke)}async encrypt(ke){const Ae=Zt.concatUint8Array([new Uint8Array([er.write(er.symmetric,this.sessionKeyAlgorithm)]),this.sessionKey,Zt.writeChecksum(this.sessionKey)]),Ce=er.write(er.publicKey,this.publicKeyAlgorithm);this.encrypted=await vo.publicKeyEncrypt(Ce,ke.publicParams,Ae,ke.getFingerprintBytes())}async decrypt(ke,Ae){if(this.publicKeyAlgorithm!==ke.algorithm)throw Error("Decryption error");const Ce=Ae?Zt.concatUint8Array([new Uint8Array([Ae.sessionKeyAlgorithm]),Ae.sessionKey,Zt.writeChecksum(Ae.sessionKey)]):null,qe=await vo.publicKeyDecrypt(this.publicKeyAlgorithm,ke.publicParams,ke.privateParams,this.encrypted,ke.getFingerprintBytes(),Ce),ze=qe[0],Ve=qe.subarray(1,qe.length-2),tt=qe.subarray(qe.length-2),rt=Zt.writeChecksum(Ve),it=rt[0]===tt[0]&rt[1]===tt[1];if(Ae){const ke=it&ze===Ae.sessionKeyAlgorithm&Ve.length===Ae.sessionKey.length;this.sessionKeyAlgorithm=Zt.selectUint8(ke,ze,Ae.sessionKeyAlgorithm),this.sessionKey=Zt.selectUint8Array(ke,Ve,Ae.sessionKey)}else{if(!(it&&er.read(er.symmetric,ze)))throw Error("Decryption error");this.sessionKey=Ve,this.sessionKeyAlgorithm=ze}}}class Eo{constructor(ke=tr){this.algorithm=er.hash.sha256,this.type="iterated",this.c=ke.s2kIterationCountByte,this.salt=null}getCount(){return 16+(15&this.c)<<6+(this.c>>4)}read(ke){let Ae=0;switch(this.type=er.read(er.s2k,ke[Ae++]),this.algorithm=ke[Ae++],this.type){case"simple":break;case"salted":this.salt=ke.subarray(Ae,Ae+8),Ae+=8;break;case"iterated":this.salt=ke.subarray(Ae,Ae+8),Ae+=8,this.c=ke[Ae++];break;case"gnu":if("GNU"!==Zt.uint8ArrayToString(ke.subarray(Ae,Ae+3)))throw Error("Unknown s2k type.");Ae+=3;if(1001!==1e3+ke[Ae++])throw Error("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw Error("Unknown s2k type.")}return Ae}write(){if("gnu-dummy"===this.type)return new Uint8Array([101,0,...Zt.stringToUint8Array("GNU"),1]);const ke=[new Uint8Array([er.write(er.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":ke.push(this.salt);break;case"iterated":ke.push(this.salt),ke.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return Zt.concatUint8Array(ke)}async produceKey(ke,Ae){ke=Zt.encodeUTF8(ke);const Ce=[];let qe=0,ze=0;for(;qe{this.privateParams[ke].fill(0),delete this.privateParams[ke]})),this.privateParams=null,this.isEncrypted=!0)}}async function Uo(ke,Ae,Ce){const{keySize:qe}=vo.getCipher(Ce);return ke.produceKey(Ae,qe)}var _l=bt((function(ke){!function(Ae){function r(ke){function t(){return Ce0&&(Ae.semantic=" "),Ae}}function b(ke,Ae){return function(){var Ce,qe,ze,Ve,tt;for(Ve=r(),Ce=s("star"),ze=0,tt=void 0===Ae?0:Ae;null!==(qe=ke());)ze+=1,c(Ce,qe);return ze>=tt?Ce:(n(Ve),null)}}function m(ke){return ke.charCodeAt(0)>=128}function g(){return o("cr",h("\r")())}function w(){return o("crlf",f(g,k)())}function v(){return o("dquote",h('"')())}function _(){return o("htab",h("\t")())}function k(){return o("lf",h("\n")())}function A(){return o("sp",h(" ")())}function S(){return o("vchar",u((function(Ae){var Ce=Ae.charCodeAt(0),qe=33<=Ce&&Ce<=126;return ke.rfc6532&&(qe=qe||m(Ae)),qe})))}function E(){return o("wsp",d(A,_)())}function P(){var ke=o("quoted-pair",d(f(h("\\"),d(S,E)),ie)());return null===ke?null:(ke.semantic=ke.semantic[1],ke)}function x(){return o("fws",d(ae,f(l(f(b(E),p(w))),b(E,1)))())}function M(){return o("ctext",d((function(){return u((function(Ae){var Ce=Ae.charCodeAt(0),qe=33<=Ce&&Ce<=39||42<=Ce&&Ce<=91||93<=Ce&&Ce<=126;return ke.rfc6532&&(qe=qe||m(Ae)),qe}))}),te)())}function C(){return o("ccontent",d(M,P,K)())}function K(){return o("comment",f(h("("),b(f(l(x),C)),l(x),h(")"))())}function D(){return o("cfws",d(f(b(f(l(x),K),1),l(x)),x)())}function R(){return o("atext",u((function(Ae){var Ce="a"<=Ae&&Ae<="z"||"A"<=Ae&&Ae<="Z"||"0"<=Ae&&Ae<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(Ae)>=0;return ke.rfc6532&&(Ce=Ce||m(Ae)),Ce})))}function U(){return o("atom",f(y(l(D)),b(R,1),y(l(D)))())}function I(){var ke,Ae;return null===(ke=o("dot-atom-text",b(R,1)()))||null!==(Ae=b(f(h("."),b(R,1)))())&&c(ke,Ae),ke}function B(){return o("dot-atom",f(p(l(D)),I,p(l(D)))())}function T(){return o("qtext",d((function(){return u((function(Ae){var Ce=Ae.charCodeAt(0),qe=33===Ce||35<=Ce&&Ce<=91||93<=Ce&&Ce<=126;return ke.rfc6532&&(qe=qe||m(Ae)),qe}))}),re)())}function z(){return o("qcontent",d(T,P)())}function q(){return o("quoted-string",f(p(l(D)),p(v),b(f(l(y(x)),z)),l(p(x)),p(v),p(l(D)))())}function O(){return o("word",d(U,q)())}function F(){return o("address",d(N,W)())}function N(){return o("mailbox",d(j,J)())}function j(){return o("name-addr",f(l(H),L)())}function L(){return o("angle-addr",d(f(p(l(D)),h("<"),J,h(">"),p(l(D))),se)())}function W(){return o("group",f(H,h(":"),l($),h(";"),p(l(D)))())}function H(){return o("display-name",(null!==(ke=o("phrase",d(ne,b(O,1))()))&&(ke.semantic=function(ke){return ke.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(ke.semantic)),ke));var ke}function G(){return o("mailbox-list",d(f(N,b(f(h(","),N))),ue)())}function V(){return o("address-list",d(f(F,b(f(h(","),F))),he)())}function $(){return o("group-list",d(G,p(D),fe)())}function Z(){return o("local-part",d(de,B,q)())}function Y(){return o("dtext",d((function(){return u((function(Ae){var Ce=Ae.charCodeAt(0),qe=33<=Ce&&Ce<=90||94<=Ce&&Ce<=126;return ke.rfc6532&&(qe=qe||m(Ae)),qe}))}),pe)())}function X(){return o("domain-literal",f(p(l(D)),h("["),b(f(l(x),Y)),l(x),h("]"),p(l(D)))())}function Q(){return o("domain",(Ae=d(le,B,X)(),ke.rejectTLD&&Ae&&Ae.semantic&&Ae.semantic.indexOf(".")<0?null:(Ae&&(Ae.semantic=Ae.semantic.replace(/\s+/g,"")),Ae)));var Ae}function J(){return o("addr-spec",f(Z,h("@"),Q)())}function ee(){return ke.strict?null:o("obs-NO-WS-CTL",u((function(ke){var Ae=ke.charCodeAt(0);return 1<=Ae&&Ae<=8||11===Ae||12===Ae||14<=Ae&&Ae<=31||127===Ae})))}function te(){return ke.strict?null:o("obs-ctext",ee())}function re(){return ke.strict?null:o("obs-qtext",ee())}function ie(){return ke.strict?null:o("obs-qp",f(h("\\"),d(h("\0"),ee,k,g))())}function ne(){return ke.strict?null:ke.atInDisplayName?o("obs-phrase",f(O,b(d(O,h("."),h("@"),y(D))))()):o("obs-phrase",f(O,b(d(O,h("."),y(D))))())}function ae(){return ke.strict?null:o("obs-FWS",b(f(p(l(w)),E),1)())}function se(){return ke.strict?null:o("obs-angle-addr",f(p(l(D)),h("<"),oe,J,h(">"),p(l(D)))())}function oe(){return ke.strict?null:o("obs-route",f(ce,h(":"))())}function ce(){return ke.strict?null:o("obs-domain-list",f(b(d(p(D),h(","))),h("@"),Q,b(f(h(","),p(l(D)),l(f(h("@"),Q)))))())}function ue(){return ke.strict?null:o("obs-mbox-list",f(b(f(p(l(D)),h(","))),N,b(f(h(","),l(f(N,p(D))))))())}function he(){return ke.strict?null:o("obs-addr-list",f(b(f(p(l(D)),h(","))),F,b(f(h(","),l(f(F,p(D))))))())}function fe(){return ke.strict?null:o("obs-group-list",f(b(f(p(l(D)),h(",")),1),p(l(D)))())}function de(){return ke.strict?null:o("obs-local-part",f(O,b(f(h("."),O)))())}function le(){return ke.strict?null:o("obs-domain",f(U,b(f(h("."),U)))())}function pe(){return ke.strict?null:o("obs-dtext",d(ee,P)())}function ye(ke,Ae){var Ce,qe,ze;if(null==Ae)return null;for(qe=[Ae];qe.length>0;){if((ze=qe.pop()).name===ke)return ze;for(Ce=ze.children.length-1;Ce>=0;Ce-=1)qe.push(ze.children[Ce])}return null}function be(ke,Ae){var Ce,qe,ze,Ve,tt;if(null==Ae)return null;for(qe=[Ae],Ve=[],tt={},Ce=0;Ce0;)if((ze=qe.pop()).name in tt)Ve.push(ze);else for(Ce=ze.children.length-1;Ce>=0;Ce-=1)qe.push(ze.children[Ce]);return Ve}function me(Ae){var Ce,qe,ze,Ve,tt;if(null===Ae)return null;for(Ce=[],qe=be(["group","mailbox"],Ae),ze=0;ze1)return null;return Ae.addresses&&Ae.addresses[0]}(tt):ke.simple?tt&&tt.addresses:tt}function ge(ke){var Ae,Ce=ye("display-name",ke),qe=[],ze=be(["mailbox"],ke);for(Ae=0;Ae0;)for((ze=qe.pop()).name===ke&&Ve.push(ze),Ce=ze.children.length-1;Ce>=0;Ce-=1)qe.push(ze.children[Ce]);return Ve}("cfws",ke),ze=be(["comment"],ke),Ve=ye("local-part",Ce),tt=ye("domain",Ce);return{node:ke,parts:{name:Ae,address:Ce,local:Ve,domain:tt,comments:qe},type:ke.name,name:ve(Ae),address:ve(Ce),local:ve(Ve),domain:ve(tt),comments:_e(ze),groupName:ve(ke.groupName)}}function ve(ke){return null!=ke?ke.semantic:null}function _e(ke){var Ae="";if(ke)for(var Ce=0;Ce`),Ae.userID=Ce.join(" "),Ae}read(ke,Ae=tr){const Ce=Zt.decodeUTF8(ke);if(Ce.length>Ae.maxUserIDLength)throw Error("User ID string is too long");try{const{name:ke,address:Ae,comments:qe}=_l.parseOneAddress({input:Ce,atInDisplayName:!0});this.comment=qe.replace(/^\(|\)$/g,""),this.name=ke,this.email=Ae}catch(ke){}this.userID=Ce}write(){return Zt.encodeUTF8(this.userID)}equals(ke){return ke&&ke.userID===this.userID}}class To extends Ro{static get tag(){return er.packet.secretSubkey}constructor(ke=new Date,Ae=tr){super(ke,Ae)}}const Al=Zt.constructAllowedPackets([ao]);class qo{constructor(ke){this.packets=ke||new uo}write(){return this.packets.write()}armor(ke=tr){return xe(er.armor.signature,this.write(),void 0,void 0,void 0,ke)}getSigningKeyIDs(){return this.packets.map((ke=>ke.issuerKeyID))}}async function Oo(ke,Ae){const Ce=new To(ke.date,Ae);return Ce.packets=null,Ce.algorithm=er.write(er.publicKey,ke.algorithm),await Ce.generate(ke.rsaBits,ke.curve),await Ce.computeFingerprintAndKeyID(),Ce}async function Fo(ke,Ae){const Ce=new Ro(ke.date,Ae);return Ce.packets=null,Ce.algorithm=er.write(er.publicKey,ke.algorithm),await Ce.generate(ke.rsaBits,ke.curve,ke.config),await Ce.computeFingerprintAndKeyID(),Ce}async function No(ke,Ae,Ce,qe,ze=new Date,Ve){let tt,rt;for(let it=ke.length-1;it>=0;it--)try{(!tt||ke[it].created>=tt.created)&&(await ke[it].verify(Ae,Ce,qe,ze,void 0,Ve),tt=ke[it])}catch(ke){rt=ke}if(!tt)throw Zt.wrapError(`Could not find valid ${er.read(er.signature,Ce)} signature in key ${Ae.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,((ke,Ae,Ce)=>Ae+" "+Ce.toLowerCase())),rt);return tt}function jo(ke,Ae,Ce=new Date){const qe=Zt.normalizeDate(Ce);if(null!==qe){const Ce=Zo(ke,Ae);return!(ke.created<=qe&&qe0&&(Ve.keyExpirationTime=Ce.keyExpirationTime,Ve.keyNeverExpires=!1),await Ve.sign(Ae,ze,Ce.date),Ve}async function Wo(ke,Ae,Ce=new Date,qe={},ze){let Ve=ze.preferredHashAlgorithm,tt=Ve;if(ke){const Ae=await ke.getPrimaryUser(Ce,qe,ze);Ae.selfCertification.preferredHashAlgorithms&&([tt]=Ae.selfCertification.preferredHashAlgorithms,Ve=vo.hash.getHashByteLength(Ve)<=vo.hash.getHashByteLength(tt)?tt:Ve)}switch(Object.getPrototypeOf(Ae)){case Ro.prototype:case xo.prototype:case To.prototype:case Ko.prototype:switch(Ae.algorithm){case er.publicKey.ecdh:case er.publicKey.ecdsa:case er.publicKey.eddsa:tt=vo.publicKey.elliptic.getPreferredHashAlgo(Ae.publicParams.oid)}}return vo.hash.getHashByteLength(Ve)<=vo.hash.getHashByteLength(tt)?tt:Ve}async function Ho(ke,Ae=[],Ce=new Date,qe=[],ze=tr){const Ve={symmetric:er.symmetric.aes128,aead:er.aead.eax,compression:er.compression.uncompressed}[ke],tt={symmetric:ze.preferredSymmetricAlgorithm,aead:ze.preferredAEADAlgorithm,compression:ze.preferredCompressionAlgorithm}[ke],rt={symmetric:"preferredSymmetricAlgorithms",aead:"preferredAEADAlgorithms",compression:"preferredCompressionAlgorithms"}[ke];return(await Promise.all(Ae.map((async function(ke,Ae){const Ve=(await ke.getPrimaryUser(Ce,qe[Ae],ze)).selfCertification[rt];return!!Ve&&Ve.indexOf(tt)>=0})))).every(Boolean)?tt:Ve}async function Go(ke,Ae,Ce,qe,ze,Ve,tt=!1,rt){if(Ce.isDummy())throw Error("Cannot sign with a gnu-dummy key.");if(!Ce.isDecrypted())throw Error("Signing key is not decrypted.");const it=new ao;return Object.assign(it,qe),it.publicKeyAlgorithm=Ce.algorithm,it.hashAlgorithm=await Wo(Ae,Ce,ze,Ve,rt),await it.sign(Ce,ke,ze,tt),it}async function Vo(ke,Ae,Ce,qe=new Date,ze){(ke=ke[Ce])&&(Ae[Ce].length?await Promise.all(ke.map((async function(ke){ke.isExpired(qe)||ze&&!await ze(ke)||Ae[Ce].some((function(Ae){return Zt.equalsUint8Array(Ae.writeParams(),ke.writeParams())}))||Ae[Ce].push(ke)}))):Ae[Ce]=ke)}async function $o(ke,Ae,Ce,qe,ze,Ve,tt=new Date,rt){Ve=Ve||ke;const it=[];return await Promise.all(qe.map((async function(ke){try{ze&&!ke.issuerKeyID.equals(ze.issuerKeyID)||(await ke.verify(Ve,Ae,Ce,rt.revocationsExpire?tt:null,!1,rt),it.push(ke.issuerKeyID))}catch(ke){}}))),ze?(ze.revoked=!!it.some((ke=>ke.equals(ze.issuerKeyID)))||(ze.revoked||!1),ze.revoked):it.length>0}function Zo(ke,Ae){let Ce;return!1===Ae.keyNeverExpires&&(Ce=ke.created.getTime()+1e3*Ae.keyExpirationTime),Ce?new Date(Ce):1/0}function Yo(ke,Ae={}){switch(ke.type=ke.type||Ae.type,ke.curve=ke.curve||Ae.curve,ke.rsaBits=ke.rsaBits||Ae.rsaBits,ke.keyExpirationTime=void 0!==ke.keyExpirationTime?ke.keyExpirationTime:Ae.keyExpirationTime,ke.passphrase=Zt.isString(ke.passphrase)?ke.passphrase:Ae.passphrase,ke.date=ke.date||Ae.date,ke.sign=ke.sign||!1,ke.type){case"ecc":try{ke.curve=er.write(er.curve,ke.curve)}catch(ke){throw Error("Unknown curve")}ke.curve!==er.curve.ed25519&&ke.curve!==er.curve.curve25519||(ke.curve=ke.sign?er.curve.ed25519:er.curve.curve25519),ke.sign?ke.algorithm=ke.curve===er.curve.ed25519?er.publicKey.eddsa:er.publicKey.ecdsa:ke.algorithm=er.publicKey.ecdh;break;case"rsa":ke.algorithm=er.publicKey.rsaEncryptSign;break;default:throw Error("Unsupported key type "+ke.type)}return ke}function Xo(ke,Ae){const Ce=ke.algorithm;return Ce!==er.publicKey.rsaEncrypt&&Ce!==er.publicKey.elgamal&&Ce!==er.publicKey.ecdh&&(!Ae.keyFlags||0!=(Ae.keyFlags[0]&er.keyFlags.signData))}function Qo(ke,Ae){const Ce=ke.algorithm;return Ce!==er.publicKey.dsa&&Ce!==er.publicKey.rsaSign&&Ce!==er.publicKey.ecdsa&&Ce!==er.publicKey.eddsa&&(!Ae.keyFlags||0!=(Ae.keyFlags[0]&er.keyFlags.encryptCommunication)||0!=(Ae.keyFlags[0]&er.keyFlags.encryptStorage))}function Jo(ke,Ae){return!!Ae.allowInsecureDecryptionWithSigningKeys||(!ke.keyFlags||0!=(ke.keyFlags[0]&er.keyFlags.encryptCommunication)||0!=(ke.keyFlags[0]&er.keyFlags.encryptStorage))}function ec(ke,Ae){const Ce=er.write(er.publicKey,ke.algorithm),qe=ke.getAlgorithmInfo();if(Ae.rejectPublicKeyAlgorithms.has(Ce))throw Error(qe.algorithm+" keys are considered too weak.");switch(Ce){case er.publicKey.rsaEncryptSign:case er.publicKey.rsaSign:case er.publicKey.rsaEncrypt:if(qe.bitske.getKeys(rt).length>0));return 0===it.length?null:(await Promise.all(it.map((async Ae=>{const Ve=await Ae.getSigningKey(rt,ke.created,void 0,qe);if(ke.revoked||await ze.isRevoked(ke,Ve.keyPacket,Ce,qe))throw Error("User certificate is revoked");try{await ke.verify(Ve.keyPacket,er.signature.certGeneric,tt,Ce,void 0,qe)}catch(ke){throw Zt.wrapError("User certificate is invalid",ke)}}))),!0)}async verifyAllCertifications(ke,Ae=new Date,Ce){const qe=this,ze=this.selfCertifications.concat(this.otherCertifications);return Promise.all(ze.map((async ze=>({keyID:ze.issuerKeyID,valid:await qe.verifyCertificate(ze,ke,Ae,Ce).catch((()=>!1))}))))}async verify(ke=new Date,Ae){if(!this.selfCertifications.length)throw Error("No self-certifications found");const Ce=this,qe=this.mainKey.keyPacket,ze={userID:this.userID,userAttribute:this.userAttribute,key:qe};let Ve;for(let tt=this.selfCertifications.length-1;tt>=0;tt--)try{const Ve=this.selfCertifications[tt];if(Ve.revoked||await Ce.isRevoked(Ve,void 0,ke,Ae))throw Error("Self-certification is revoked");try{await Ve.verify(qe,er.signature.certGeneric,ze,ke,void 0,Ae)}catch(ke){throw Zt.wrapError("Self-certification is invalid",ke)}return!0}catch(ke){Ve=ke}throw Ve}async update(ke,Ae,Ce){const qe=this.mainKey.keyPacket,ze={userID:this.userID,userAttribute:this.userAttribute,key:qe};await Vo(ke,this,"selfCertifications",Ae,(async function(ke){try{return await ke.verify(qe,er.signature.certGeneric,ze,Ae,!1,Ce),!0}catch(ke){return!1}})),await Vo(ke,this,"otherCertifications",Ae),await Vo(ke,this,"revocationSignatures",Ae,(function(ke){return $o(qe,er.signature.certRevocation,ze,[ke],void 0,void 0,Ae,Ce)}))}}class rc{constructor(ke,Ae){this.keyPacket=ke,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=Ae}toPacketList(){const ke=new uo;return ke.push(this.keyPacket),ke.push(...this.revocationSignatures),ke.push(...this.bindingSignatures),ke}clone(){const ke=new rc(this.keyPacket,this.mainKey);return ke.bindingSignatures=[...this.bindingSignatures],ke.revocationSignatures=[...this.revocationSignatures],ke}async isRevoked(ke,Ae,Ce=new Date,qe=tr){const ze=this.mainKey.keyPacket;return $o(ze,er.signature.subkeyRevocation,{key:ze,bind:this.keyPacket},this.revocationSignatures,ke,Ae,Ce,qe)}async verify(ke=new Date,Ae=tr){const Ce=this.mainKey.keyPacket,qe={key:Ce,bind:this.keyPacket},ze=await No(this.bindingSignatures,Ce,er.signature.subkeyBinding,qe,ke,Ae);if(ze.revoked||await this.isRevoked(ze,null,ke,Ae))throw Error("Subkey is revoked");if(jo(this.keyPacket,ze,ke))throw Error("Subkey is expired");return ze}async getExpirationTime(ke=new Date,Ae=tr){const Ce=this.mainKey.keyPacket,qe={key:Ce,bind:this.keyPacket};let ze;try{ze=await No(this.bindingSignatures,Ce,er.signature.subkeyBinding,qe,ke,Ae)}catch(ke){return null}const Ve=Zo(this.keyPacket,ze),tt=ze.getExpirationTime();return Veze.bindingSignatures[Ae].created&&(ze.bindingSignatures[Ae]=ke),!1;try{return await ke.verify(qe,er.signature.subkeyBinding,Ve,Ae,void 0,Ce),!0}catch(ke){return!1}})),await Vo(ke,this,"revocationSignatures",Ae,(function(ke){return $o(qe,er.signature.subkeyRevocation,Ve,[ke],void 0,void 0,Ae,Ce)}))}async revoke(ke,{flag:Ae=er.reasonForRevocation.noReason,string:Ce=""}={},qe=new Date,ze=tr){const Ve={key:ke,bind:this.keyPacket},tt=new rc(this.keyPacket,this.mainKey);return tt.revocationSignatures.push(await Go(Ve,null,ke,{signatureType:er.signature.subkeyRevocation,reasonForRevocationFlag:er.write(er.reasonForRevocation,Ae),reasonForRevocationString:Ce},qe,void 0,!1,ze)),await tt.update(this),tt}hasSameFingerprintAs(ke){return this.keyPacket.hasSameFingerprintAs(ke.keyPacket||ke)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach((ke=>{rc.prototype[ke]=function(){return this.keyPacket[ke]()}}));const Sl=Zt.constructAllowedPackets([ao]),Pl=new Set([er.packet.publicKey,er.packet.privateKey]),xl=new Set([er.packet.publicKey,er.packet.privateKey,er.packet.publicSubkey,er.packet.privateSubkey]);class sc{packetListToStructure(ke,Ae=new Set){let Ce,qe,ze,Ve;for(const tt of ke){if(tt instanceof Ii){xl.has(tt.tag)&&!Ve&&(Ve=Pl.has(tt.tag)?Pl:xl);continue}const ke=tt.constructor.tag;if(Ve){if(!Ve.has(ke))continue;Ve=null}if(Ae.has(ke))throw Error("Unexpected packet type: "+ke);switch(ke){case er.packet.publicKey:case er.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=tt,qe=this.getKeyID(),!qe)throw Error("Missing Key ID");break;case er.packet.userID:case er.packet.userAttribute:Ce=new tc(tt,this),this.users.push(Ce);break;case er.packet.publicSubkey:case er.packet.secretSubkey:Ce=null,ze=new rc(tt,this),this.subkeys.push(ze);break;case er.packet.signature:switch(tt.signatureType){case er.signature.certGeneric:case er.signature.certPersona:case er.signature.certCasual:case er.signature.certPositive:if(!Ce){Zt.printDebug("Dropping certification signatures without preceding user packet");continue}tt.issuerKeyID.equals(qe)?Ce.selfCertifications.push(tt):Ce.otherCertifications.push(tt);break;case er.signature.certRevocation:Ce?Ce.revocationSignatures.push(tt):this.directSignatures.push(tt);break;case er.signature.key:this.directSignatures.push(tt);break;case er.signature.subkeyBinding:if(!ze){Zt.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}ze.bindingSignatures.push(tt);break;case er.signature.keyRevocation:this.revocationSignatures.push(tt);break;case er.signature.subkeyRevocation:if(!ze){Zt.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}ze.revocationSignatures.push(tt)}}}}toPacketList(){const ke=new uo;return ke.push(this.keyPacket),ke.push(...this.revocationSignatures),ke.push(...this.directSignatures),this.users.map((Ae=>ke.push(...Ae.toPacketList()))),this.subkeys.map((Ae=>ke.push(...Ae.toPacketList()))),ke}clone(ke=!1){const Ae=new this.constructor(this.toPacketList());return ke&&Ae.getKeys().forEach((ke=>{if(ke.keyPacket=Object.create(Object.getPrototypeOf(ke.keyPacket),Object.getOwnPropertyDescriptors(ke.keyPacket)),!ke.keyPacket.isDecrypted())return;const Ae={};Object.keys(ke.keyPacket.privateParams).forEach((Ce=>{Ae[Ce]=new Uint8Array(ke.keyPacket.privateParams[Ce])})),ke.keyPacket.privateParams=Ae})),Ae}getSubkeys(ke=null){return this.subkeys.filter((Ae=>!ke||Ae.getKeyID().equals(ke,!0)))}getKeys(ke=null){const Ae=[];return ke&&!this.getKeyID().equals(ke,!0)||Ae.push(this),Ae.concat(this.getSubkeys(ke))}getKeyIDs(){return this.getKeys().map((ke=>ke.getKeyID()))}getUserIDs(){return this.users.map((ke=>ke.userID?ke.userID.userID:null)).filter((ke=>null!==ke))}write(){return this.toPacketList().write()}async getSigningKey(ke=null,Ae=new Date,Ce={},qe=tr){await this.verifyPrimaryKey(Ae,Ce,qe);const ze=this.keyPacket,Ve=this.subkeys.slice().sort(((ke,Ae)=>Ae.keyPacket.created-ke.keyPacket.created));let tt;for(const Ce of Ve)if(!ke||Ce.getKeyID().equals(ke))try{await Ce.verify(Ae,qe);const ke={key:ze,bind:Ce.keyPacket},Ve=await No(Ce.bindingSignatures,ze,er.signature.subkeyBinding,ke,Ae,qe);if(!Xo(Ce.keyPacket,Ve))continue;if(!Ve.embeddedSignature)throw Error("Missing embedded signature");return await No([Ve.embeddedSignature],Ce.keyPacket,er.signature.keyBinding,ke,Ae,qe),ec(Ce.keyPacket,qe),Ce}catch(ke){tt=ke}try{const Ve=await this.getPrimaryUser(Ae,Ce,qe);if((!ke||ze.getKeyID().equals(ke))&&Xo(ze,Ve.selfCertification))return ec(ze,qe),this}catch(ke){tt=ke}throw Zt.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),tt)}async getEncryptionKey(ke,Ae=new Date,Ce={},qe=tr){await this.verifyPrimaryKey(Ae,Ce,qe);const ze=this.keyPacket,Ve=this.subkeys.slice().sort(((ke,Ae)=>Ae.keyPacket.created-ke.keyPacket.created));let tt;for(const Ce of Ve)if(!ke||Ce.getKeyID().equals(ke))try{await Ce.verify(Ae,qe);const ke={key:ze,bind:Ce.keyPacket},Ve=await No(Ce.bindingSignatures,ze,er.signature.subkeyBinding,ke,Ae,qe);if(Qo(Ce.keyPacket,Ve))return ec(Ce.keyPacket,qe),Ce}catch(ke){tt=ke}try{const Ve=await this.getPrimaryUser(Ae,Ce,qe);if((!ke||ze.getKeyID().equals(ke))&&Qo(ze,Ve.selfCertification))return ec(ze,qe),this}catch(ke){tt=ke}throw Zt.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),tt)}async isRevoked(ke,Ae,Ce=new Date,qe=tr){return $o(this.keyPacket,er.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,ke,Ae,Ce,qe)}async verifyPrimaryKey(ke=new Date,Ae={},Ce=tr){const qe=this.keyPacket;if(await this.isRevoked(null,null,ke,Ce))throw Error("Primary key is revoked");const{selfCertification:ze}=await this.getPrimaryUser(ke,Ae,Ce);if(jo(qe,ze,ke))throw Error("Primary key is expired");const Ve=await No(this.directSignatures,qe,er.signature.key,{key:qe},ke,Ce).catch((()=>{}));if(Ve&&jo(qe,Ve,ke))throw Error("Primary key is expired")}async getExpirationTime(ke,Ae=tr){let Ce;try{const{selfCertification:qe}=await this.getPrimaryUser(null,ke,Ae),ze=Zo(this.keyPacket,qe),Ve=qe.getExpirationTime(),tt=await No(this.directSignatures,this.keyPacket,er.signature.key,{key:this.keyPacket},null,Ae).catch((()=>{}));if(tt){const ke=Zo(this.keyPacket,tt);Ce=Math.min(ze,Ve,ke)}else Ce=zeke.subkeys.some((ke=>Ae.hasSameFingerprintAs(ke)))))))throw Error("Cannot update public key with private key if subkeys mismatch");return ke.update(this,Ce)}const qe=this.clone();return await Vo(ke,qe,"revocationSignatures",Ae,(ze=>$o(qe.keyPacket,er.signature.keyRevocation,qe,[ze],null,ke.keyPacket,Ae,Ce))),await Vo(ke,qe,"directSignatures",Ae),await Promise.all(ke.users.map((async ke=>{const ze=qe.users.filter((Ae=>ke.userID&&ke.userID.equals(Ae.userID)||ke.userAttribute&&ke.userAttribute.equals(Ae.userAttribute)));if(ze.length>0)await Promise.all(ze.map((qe=>qe.update(ke,Ae,Ce))));else{const Ae=ke.clone();Ae.mainKey=qe,qe.users.push(Ae)}}))),await Promise.all(ke.subkeys.map((async ke=>{const ze=qe.subkeys.filter((Ae=>Ae.hasSameFingerprintAs(ke)));if(ze.length>0)await Promise.all(ze.map((qe=>qe.update(ke,Ae,Ce))));else{const Ae=ke.clone();Ae.mainKey=qe,qe.subkeys.push(Ae)}}))),qe}async getRevocationCertificate(ke=new Date,Ae=tr){const Ce={key:this.keyPacket},qe=await No(this.revocationSignatures,this.keyPacket,er.signature.keyRevocation,Ce,ke,Ae),ze=new uo;return ze.push(qe),xe(er.armor.publicKey,ze.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(ke,Ae=new Date,Ce=tr){const qe=await Pe(ke,Ce),ze=(await uo.fromBinary(qe.data,Sl,Ce)).findPacket(er.packet.signature);if(!ze||ze.signatureType!==er.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!ze.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await ze.verify(this.keyPacket,er.signature.keyRevocation,{key:this.keyPacket},Ae,void 0,Ce)}catch(ke){throw Zt.wrapError("Could not verify revocation signature",ke)}const Ve=this.clone();return Ve.revocationSignatures.push(ze),Ve}async signPrimaryUser(ke,Ae,Ce,qe=tr){const{index:ze,user:Ve}=await this.getPrimaryUser(Ae,Ce,qe),tt=await Ve.certify(ke,Ae,qe),rt=this.clone();return rt.users[ze]=tt,rt}async signAllUsers(ke,Ae=new Date,Ce=tr){const qe=this.clone();return qe.users=await Promise.all(this.users.map((function(qe){return qe.certify(ke,Ae,Ce)}))),qe}async verifyPrimaryUser(ke,Ae=new Date,Ce,qe=tr){const ze=this.keyPacket,{user:Ve}=await this.getPrimaryUser(Ae,Ce,qe);return ke?await Ve.verifyAllCertifications(ke,Ae,qe):[{keyID:ze.getKeyID(),valid:await Ve.verify(Ae,qe).catch((()=>!1))}]}async verifyAllUsers(ke,Ae=new Date,Ce=tr){const qe=this.keyPacket,ze=[];return await Promise.all(this.users.map((async Ve=>{const tt=ke?await Ve.verifyAllCertifications(ke,Ae,Ce):[{keyID:qe.getKeyID(),valid:await Ve.verify(Ae,Ce).catch((()=>!1))}];ze.push(...tt.map((ke=>({userID:Ve.userID.userID,keyID:ke.keyID,valid:ke.valid}))))}))),ze}}function oc(ke){for(const Ae of ke)switch(Ae.constructor.tag){case er.packet.secretKey:return new uc(ke);case er.packet.publicKey:return new cc(ke)}throw Error("No key packet found")}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach((ke=>{sc.prototype[ke]=rc.prototype[ke]}));class cc extends sc{constructor(ke){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],ke&&(this.packetListToStructure(ke,new Set([er.packet.secretKey,er.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(ke=tr){return xe(er.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,ke)}}class uc extends cc{constructor(ke){if(super(),this.packetListToStructure(ke,new Set([er.packet.publicKey,er.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const ke=new uo,Ae=this.toPacketList();for(const Ce of Ae)switch(Ce.constructor.tag){case er.packet.secretKey:{const Ae=xo.fromSecretKeyPacket(Ce);ke.push(Ae);break}case er.packet.secretSubkey:{const Ae=Ko.fromSecretSubkeyPacket(Ce);ke.push(Ae);break}default:ke.push(Ce)}return new cc(ke)}armor(ke=tr){return xe(er.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,ke)}async getDecryptionKeys(ke,Ae=new Date,Ce={},qe=tr){const ze=this.keyPacket,Ve=[];for(let Ce=0;Ceke.isDecrypted()))}async validate(ke=tr){if(!this.isPrivate())throw Error("Cannot validate a public key");let Ae;if(this.keyPacket.isDummy()){const Ce=await this.getSigningKey(null,null,void 0,{...ke,rejectPublicKeyAlgorithms:new Set,minRSABits:0});Ce&&!Ce.keyPacket.isDummy()&&(Ae=Ce.keyPacket)}else Ae=this.keyPacket;if(Ae)return Ae.validate();{const ke=this.getKeys();if(ke.map((ke=>ke.keyPacket.isDummy())).every(Boolean))throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(ke.map((async ke=>ke.keyPacket.validate())))}}clearPrivateParams(){this.getKeys().forEach((({keyPacket:ke})=>{ke.isDecrypted()&&ke.clearPrivateParams()}))}async revoke({flag:ke=er.reasonForRevocation.noReason,string:Ae=""}={},Ce=new Date,qe=tr){if(!this.isPrivate())throw Error("Need private key for revoking");const ze={key:this.keyPacket},Ve=this.clone();return Ve.revocationSignatures.push(await Go(ze,null,this.keyPacket,{signatureType:er.signature.keyRevocation,reasonForRevocationFlag:er.write(er.reasonForRevocation,ke),reasonForRevocationString:Ae},Ce,void 0,void 0,qe)),Ve}async addSubkey(ke={}){const Ae={...tr,...ke.config};if(ke.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(ke.rsaBitske!==Ae))]}const Ve=Bo.fromObject(Ae),tt={};tt.userID=Ve,tt.key=ke;const rt=new ao;return rt.signatureType=er.signature.certGeneric,rt.publicKeyAlgorithm=ke.algorithm,rt.hashAlgorithm=await Wo(null,ke,void 0,void 0,qe),rt.keyFlags=[er.keyFlags.certifyKeys|er.keyFlags.signData],rt.preferredSymmetricAlgorithms=a([er.symmetric.aes256,er.symmetric.aes128,er.symmetric.aes192],qe.preferredSymmetricAlgorithm),qe.aeadProtect&&(rt.preferredAEADAlgorithms=a([er.aead.eax,er.aead.ocb],qe.preferredAEADAlgorithm)),rt.preferredHashAlgorithms=a([er.hash.sha256,er.hash.sha512],qe.preferredHashAlgorithm),rt.preferredCompressionAlgorithms=a([er.compression.zlib,er.compression.zip,er.compression.uncompressed],qe.preferredCompressionAlgorithm),0===ze&&(rt.isPrimaryUserID=!0),rt.features=[0],rt.features[0]|=er.features.modificationDetection,qe.aeadProtect&&(rt.features[0]|=er.features.aead),qe.v5Keys&&(rt.features[0]|=er.features.v5Keys),Ce.keyExpirationTime>0&&(rt.keyExpirationTime=Ce.keyExpirationTime,rt.keyNeverExpires=!1),await rt.sign(ke,tt,Ce.date),{userIDPacket:Ve,signaturePacket:rt}}))).then((ke=>{ke.forEach((({userIDPacket:ke,signaturePacket:Ae})=>{ze.push(ke),ze.push(Ae)}))})),await Promise.all(Ae.map((async function(Ae,ze){const Ve=Ce.subkeys[ze];return{secretSubkeyPacket:Ae,subkeySignaturePacket:await Lo(Ae,ke,Ve,qe)}}))).then((ke=>{ke.forEach((({secretSubkeyPacket:ke,subkeySignaturePacket:Ae})=>{ze.push(ke),ze.push(Ae)}))}));const Ve={key:ke};return ze.push(await Go(Ve,null,ke,{signatureType:er.signature.keyRevocation,reasonForRevocationFlag:er.reasonForRevocation.noReason,reasonForRevocationString:""},Ce.date,void 0,void 0,qe)),Ce.passphrase&&ke.clearPrivateParams(),await Promise.all(Ae.map((async function(ke,Ae){Ce.subkeys[Ae].passphrase&&ke.clearPrivateParams()}))),new uc(ze)}const Tl=Zt.constructAllowedPackets([ro,fo,Ao,_o,Co,So,Po,oo,ao]),Il=Zt.constructAllowedPackets([Po]),Ol=Zt.constructAllowedPackets([ao]);class yc{constructor(ke){this.packets=ke||new uo}getEncryptionKeyIDs(){const ke=[];return this.packets.filterByTag(er.packet.publicKeyEncryptedSessionKey).forEach((function(Ae){ke.push(Ae.publicKeyID)})),ke}getSigningKeyIDs(){const ke=this.unwrapCompressed(),Ae=ke.packets.filterByTag(er.packet.onePassSignature);if(Ae.length>0)return Ae.map((ke=>ke.issuerKeyID));return ke.packets.filterByTag(er.packet.signature).map((ke=>ke.issuerKeyID))}async decrypt(ke,Ae,Ce,qe=new Date,ze=tr){const Ve=Ce||await this.decryptSessionKeys(ke,Ae,qe,ze),tt=this.packets.filterByTag(er.packet.symmetricallyEncryptedData,er.packet.symEncryptedIntegrityProtectedData,er.packet.aeadEncryptedData);if(0===tt.length)throw Error("No encrypted data found");const rt=tt[0];let it=null;const nt=Promise.all(Ve.map((async({algorithm:ke,data:Ae})=>{if(!Zt.isUint8Array(Ae)||!Zt.isString(ke))throw Error("Invalid session key for decryption.");try{const Ce=er.write(er.symmetric,ke);await rt.decrypt(Ce,Ae,ze)}catch(ke){Zt.printDebugError(ke),it=ke}})));if(ne(rt.encrypted),rt.encrypted=null,await nt,!rt.packets||!rt.packets.length)throw it||Error("Decryption failed.");const ot=new yc(rt.packets);return rt.packets=new uo,ot}async decryptSessionKeys(ke,Ae,Ce=new Date,qe=tr){let ze,Ve=[];if(Ae){const ke=this.packets.filterByTag(er.packet.symEncryptedSessionKey);if(0===ke.length)throw Error("No symmetrically encrypted session key packet found.");await Promise.all(Ae.map((async function(Ae,Ce){let ze;ze=Ce?await uo.fromBinary(ke.write(),Il,qe):ke,await Promise.all(ze.map((async function(ke){try{await ke.decrypt(Ae),Ve.push(ke)}catch(ke){Zt.printDebugError(ke)}})))})))}else{if(!ke)throw Error("No key or password specified.");{const Ae=this.packets.filterByTag(er.packet.publicKeyEncryptedSessionKey);if(0===Ae.length)throw Error("No public key encrypted session key packet found.");await Promise.all(Ae.map((async function(Ae){await Promise.all(ke.map((async function(ke){let tt=[er.symmetric.aes256,er.symmetric.aes128,er.symmetric.tripledes,er.symmetric.cast5];try{const Ae=await ke.getPrimaryUser(Ce,void 0,qe);Ae.selfCertification.preferredSymmetricAlgorithms&&(tt=tt.concat(Ae.selfCertification.preferredSymmetricAlgorithms))}catch(ke){}const rt=(await ke.getDecryptionKeys(Ae.publicKeyID,null,void 0,qe)).map((ke=>ke.keyPacket));await Promise.all(rt.map((async function(ke){if(!ke||ke.isDummy())return;if(!ke.isDecrypted())throw Error("Decryption key is not decrypted.");if(qe.constantTimePKCS1Decryption&&(Ae.publicKeyAlgorithm===er.publicKey.rsaEncrypt||Ae.publicKeyAlgorithm===er.publicKey.rsaEncryptSign||Ae.publicKeyAlgorithm===er.publicKey.rsaSign||Ae.publicKeyAlgorithm===er.publicKey.elgamal)){const Ce=Ae.write();await Promise.all(Array.from(qe.constantTimePKCS1DecryptionSupportedSymmetricAlgorithms).map((async Ae=>{const qe=new So;qe.read(Ce);const tt={sessionKeyAlgorithm:Ae,sessionKey:await vo.generateSessionKey(Ae)};try{await qe.decrypt(ke,tt),Ve.push(qe)}catch(ke){Zt.printDebugError(ke),ze=ke}})))}else try{if(await Ae.decrypt(ke),!tt.includes(er.write(er.symmetric,Ae.sessionKeyAlgorithm)))throw Error("A non-preferred symmetric algorithm was used.");Ve.push(Ae)}catch(ke){Zt.printDebugError(ke),ze=ke}})))}))),ne(Ae.encrypted),Ae.encrypted=null})))}}if(Ve.length>0){if(Ve.length>1){const ke=new Set;Ve=Ve.filter((Ae=>{const Ce=Ae.sessionKeyAlgorithm+Zt.uint8ArrayToString(Ae.sessionKey);return!ke.has(Ce)&&(ke.add(Ce),!0)}))}return Ve.map((ke=>({data:ke.sessionKey,algorithm:er.read(er.symmetric,ke.sessionKeyAlgorithm)})))}throw ze||Error("Session key decryption failed.")}getLiteralData(){const ke=this.unwrapCompressed().packets.findPacket(er.packet.literalData);return ke&&ke.getBytes()||null}getFilename(){const ke=this.unwrapCompressed().packets.findPacket(er.packet.literalData);return ke&&ke.getFilename()||null}getText(){const ke=this.unwrapCompressed().packets.findPacket(er.packet.literalData);return ke?ke.getText():null}static async generateSessionKey(ke=[],Ae=new Date,Ce=[],qe=tr){const ze=await Ho("symmetric",ke,Ae,Ce,qe),Ve=er.read(er.symmetric,ze),tt=qe.aeadProtect&&await async function(ke,Ae=new Date,Ce=[],qe=tr){let ze=!0;return await Promise.all(ke.map((async function(ke,Ve){const tt=await ke.getPrimaryUser(Ae,Ce[Ve],qe);tt.selfCertification.features&&tt.selfCertification.features[0]&er.features.aead||(ze=!1)}))),ze}(ke,Ae,Ce,qe)?er.read(er.aead,await Ho("aead",ke,Ae,Ce,qe)):void 0;return{data:await vo.generateSessionKey(ze),algorithm:Ve,aeadAlgorithm:tt}}async encrypt(ke,Ae,Ce,qe=!1,ze=[],Ve=new Date,tt=[],rt=tr){if(Ce){if(!Zt.isUint8Array(Ce.data)||!Zt.isString(Ce.algorithm))throw Error("Invalid session key for encryption.")}else if(ke&&ke.length)Ce=await yc.generateSessionKey(ke,Ve,tt,rt);else{if(!Ae||!Ae.length)throw Error("No keys, passwords, or session key provided.");Ce=await yc.generateSessionKey(void 0,void 0,void 0,rt)}const{data:it,algorithm:nt,aeadAlgorithm:ot}=Ce,ct=await yc.encryptSessionKey(it,nt,ot,ke,Ae,qe,ze,Ve,tt,rt);let ht;ot?(ht=new Ao,ht.aeadAlgorithm=er.write(er.aead,ot)):ht=new _o,ht.packets=this.packets;const ft=er.write(er.symmetric,nt);return await ht.encrypt(ft,it,rt),ct.packets.push(ht),ht.packets=new uo,ct}static async encryptSessionKey(ke,Ae,Ce,qe,ze,Ve=!1,tt=[],rt=new Date,it=[],nt=tr){const ot=new uo,ct=er.write(er.symmetric,Ae),ht=Ce&&er.write(er.aead,Ce);if(qe){const Ae=await Promise.all(qe.map((async function(Ae,Ce){const qe=await Ae.getEncryptionKey(tt[Ce],rt,it,nt),ze=new So;return ze.publicKeyID=Ve?Me.wildcard():qe.getKeyID(),ze.publicKeyAlgorithm=qe.keyPacket.algorithm,ze.sessionKey=ke,ze.sessionKeyAlgorithm=ct,await ze.encrypt(qe.keyPacket),delete ze.sessionKey,ze})));ot.push(...Ae)}if(ze){const t=async function(ke,Ae){try{return await ke.decrypt(Ae),1}catch(ke){return 0}},r=(ke,Ae)=>ke+Ae,i=async function(ke,Ae,Ce,qe){const Ve=new Po(nt);if(Ve.sessionKey=ke,Ve.sessionKeyAlgorithm=Ae,Ce&&(Ve.aeadAlgorithm=Ce),await Ve.encrypt(qe,nt),nt.passwordCollisionCheck){if(1!==(await Promise.all(ze.map((ke=>t(Ve,ke))))).reduce(r))return i(ke,Ae,qe)}return delete Ve.sessionKey,Ve},Ae=await Promise.all(ze.map((Ae=>i(ke,ct,ht,Ae))));ot.push(...Ae)}return new yc(ot)}async sign(ke=[],Ae=null,Ce=[],qe=new Date,ze=[],Ve=tr){const tt=new uo,rt=this.packets.findPacket(er.packet.literalData);if(!rt)throw Error("No literal data packet to sign.");let it,nt;const ot=null===rt.text?er.signature.binary:er.signature.text;if(Ae)for(nt=Ae.packets.filterByTag(er.packet.signature),it=nt.length-1;it>=0;it--){const Ae=nt[it],Ce=new oo;Ce.signatureType=Ae.signatureType,Ce.hashAlgorithm=Ae.hashAlgorithm,Ce.publicKeyAlgorithm=Ae.publicKeyAlgorithm,Ce.issuerKeyID=Ae.issuerKeyID,ke.length||0!==it||(Ce.flags=1),tt.push(Ce)}return await Promise.all(Array.from(ke).reverse().map((async function(Ae,tt){if(!Ae.isPrivate())throw Error("Need private key for signing");const rt=Ce[ke.length-1-tt],it=await Ae.getSigningKey(rt,qe,ze,Ve),nt=new oo;return nt.signatureType=ot,nt.hashAlgorithm=await Wo(Ae,it.keyPacket,qe,ze,Ve),nt.publicKeyAlgorithm=it.keyPacket.algorithm,nt.issuerKeyID=it.getKeyID(),tt===ke.length-1&&(nt.flags=1),nt}))).then((ke=>{ke.forEach((ke=>tt.push(ke)))})),tt.push(rt),tt.push(...await bc(rt,ke,Ae,Ce,qe,ze,!1,Ve)),new yc(tt)}compress(ke,Ae=tr){if(ke===er.compression.uncompressed)return this;const Ce=new fo(Ae);Ce.algorithm=ke,Ce.packets=this.packets;const qe=new uo;return qe.push(Ce),new yc(qe)}async signDetached(ke=[],Ae=null,Ce=[],qe=new Date,ze=[],Ve=tr){const tt=this.packets.findPacket(er.packet.literalData);if(!tt)throw Error("No literal data packet to sign.");return new qo(await bc(tt,ke,Ae,Ce,qe,ze,!0,Ve))}async verify(ke,Ae=new Date,Ce=tr){const qe=this.unwrapCompressed(),ze=qe.packets.filterByTag(er.packet.literalData);if(1!==ze.length)throw Error("Can only verify message with one literal data packet.");_(qe.packets.stream)&&qe.packets.push(...await ie(qe.packets.stream,(ke=>ke||[])));const Ve=qe.packets.filterByTag(er.packet.onePassSignature).reverse(),tt=qe.packets.filterByTag(er.packet.signature);return Ve.length&&!tt.length&&Zt.isStream(qe.packets.stream)&&!_(qe.packets.stream)?(await Promise.all(Ve.map((async ke=>{ke.correspondingSig=new Promise(((Ae,Ce)=>{ke.correspondingSigResolve=Ae,ke.correspondingSigReject=Ce})),ke.signatureData=ae((async()=>(await ke.correspondingSig).signatureData)),ke.hashed=ie(await ke.hash(ke.signatureType,ze[0],void 0,!1)),ke.hashed.catch((()=>{}))}))),qe.packets.stream=X(qe.packets.stream,(async(ke,Ae)=>{const Ce=H(ke),qe=G(Ae);try{for(let ke=0;ke{Ae.correspondingSigReject(ke)})),await qe.abort(ke)}})),mc(Ve,ze,ke,Ae,!1,Ce)):mc(tt,ze,ke,Ae,!1,Ce)}verifyDetached(ke,Ae,Ce=new Date,qe=tr){const ze=this.unwrapCompressed().packets.filterByTag(er.packet.literalData);if(1!==ze.length)throw Error("Can only verify message with one literal data packet.");return mc(ke.packets,ze,Ae,Ce,!0,qe)}unwrapCompressed(){const ke=this.packets.filterByTag(er.packet.compressedData);return ke.length?new yc(ke[0].packets):this}async appendSignature(ke,Ae=tr){await this.packets.read(Zt.isUint8Array(ke)?ke:(await Pe(ke)).data,Ol,Ae)}write(){return this.packets.write()}armor(ke=tr){return xe(er.armor.message,this.write(),null,null,null,ke)}}async function bc(ke,Ae,Ce=null,qe=[],ze=new Date,Ve=[],tt=!1,rt=tr){const it=new uo,nt=null===ke.text?er.signature.binary:er.signature.text;if(await Promise.all(Ae.map((async(Ae,Ce)=>{const it=Ve[Ce];if(!Ae.isPrivate())throw Error("Need private key for signing");const ot=await Ae.getSigningKey(qe[Ce],ze,it,rt);return Go(ke,Ae,ot.keyPacket,{signatureType:nt},ze,it,tt,rt)}))).then((ke=>{it.push(...ke)})),Ce){const ke=Ce.packets.filterByTag(er.packet.signature);it.push(...ke)}return it}async function mc(ke,Ae,Ce,qe=new Date,ze=!1,Ve=tr){return Promise.all(ke.filter((function(ke){return["text","binary"].includes(er.read(er.signature,ke.signatureType))})).map((async function(ke){return async function(ke,Ae,Ce,qe=new Date,ze=!1,Ve=tr){let tt,rt;for(const Ae of Ce){const Ce=Ae.getKeys(ke.issuerKeyID);if(Ce.length>0){tt=Ae,rt=Ce[0];break}}const it=ke instanceof oo?ke.correspondingSig:ke,nt={keyID:ke.issuerKeyID,verified:(async()=>{if(!rt)throw Error("Could not find signing key with key ID "+ke.issuerKeyID.toHex());await ke.verify(rt.keyPacket,ke.signatureType,Ae[0],qe,ze,Ve);const Ce=await it;if(rt.getCreationTime()>Ce.created)throw Error("Key is newer than the signature");try{await tt.getSigningKey(rt.getKeyID(),Ce.created,void 0,Ve)}catch(ke){if(!Ve.allowInsecureVerificationWithReformattedKeys||!ke.message.match(/Signature creation time is in the future/))throw ke;await tt.getSigningKey(rt.getKeyID(),qe,void 0,Ve)}return!0})(),signature:(async()=>{const ke=await it,Ae=new uo;return ke&&Ae.push(ke),new qo(Ae)})()};return nt.signature.catch((()=>{})),nt.verified.catch((()=>{})),nt}(ke,Ae,Ce,qe,ze,Ve)})))}const Nl=Zt.constructAllowedPackets([ao]);class wc{constructor(ke,Ae){if(this.text=Zt.removeTrailingSpaces(ke).replace(/\r?\n/g,"\r\n"),Ae&&!(Ae instanceof qo))throw Error("Invalid signature input");this.signature=Ae||new qo(new uo)}getSigningKeyIDs(){const ke=[];return this.signature.packets.forEach((function(Ae){ke.push(Ae.issuerKeyID)})),ke}async sign(ke,Ae=null,Ce=[],qe=new Date,ze=[],Ve=tr){const tt=new ro;tt.setText(this.text);const rt=new qo(await bc(tt,ke,Ae,Ce,qe,ze,!0,Ve));return new wc(this.text,rt)}verify(ke,Ae=new Date,Ce=tr){const qe=this.signature.packets,ze=new ro;return ze.setText(this.text),mc(qe,[ze],ke,Ae,!0,Ce)}getText(){return this.text.replace(/\r\n/g,"\n")}armor(ke=tr){let Ae=this.signature.packets.map((function(ke){return er.read(er.hash,ke.hashAlgorithm).toUpperCase()}));Ae=Ae.filter((function(ke,Ae,Ce){return Ce.indexOf(ke)===Ae}));const Ce={hash:Ae.join(),text:this.text,data:this.signature.packets.write()};return xe(er.armor.signed,Ce,void 0,void 0,void 0,ke)}}function vc(ke){if(!(ke instanceof yc))throw Error("Parameter [message] needs to be of type Message")}function _c(ke){if(!(ke instanceof wc||ke instanceof yc))throw Error("Parameter [message] needs to be of type Message or CleartextMessage")}function kc(ke){if("armored"!==ke&&"binary"!==ke&&"object"!==ke)throw Error("Unsupported format "+ke)}const ql=Object.keys(tr).length;function Sc(ke){const Ae=Object.keys(ke);if(Ae.length!==ql)for(const ke of Ae)if(void 0===tr[ke])throw Error("Unknown config property: "+ke)}function Ec(ke){return ke&&!Zt.isArray(ke)&&(ke=[ke]),ke}async function Pc(ke,Ae,Ce="utf8"){const qe=Zt.isStream(ke);return"array"===qe?ie(ke):"node"===Ae?(ke=Ot(ke),"binary"!==Ce&&ke.setEncoding(Ce),ke):"web"===Ae&&"ponyfill"===qe?Ft(ke):ke}function xc(ke,Ae){ke.data=X(Ae.packets.stream,(async(Ae,Ce)=>{await V(ke.data,Ce,{preventClose:!0});const qe=G(Ce);try{await ie(Ae,(ke=>ke)),await qe.close()}catch(ke){await qe.abort(ke)}}))}function Mc(ke,Ae,Ce){switch(Ae){case"object":return ke;case"armored":return ke.armor(Ce);case"binary":return ke.write();default:throw Error("Unsupported format "+Ae)}}const jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:ke=>`Symbol(${ke})`;function Kc(){}const zl="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function Rc(ke){return"object"==typeof ke&&null!==ke||"function"==typeof ke}const Ll=Kc,Wl=Promise,Gl=Promise.prototype.then,$l=Promise.resolve.bind(Wl),Vl=Promise.reject.bind(Wl);function qc(ke){return new Wl(ke)}function Oc(ke){return $l(ke)}function Fc(ke){return Vl(ke)}function Nc(ke,Ae,Ce){return Gl.call(ke,Ae,Ce)}function jc(ke,Ae,Ce){Nc(Nc(ke,Ae,Ce),void 0,Ll)}function Lc(ke,Ae){jc(ke,Ae)}function Wc(ke,Ae){jc(ke,void 0,Ae)}function Hc(ke,Ae,Ce){return Nc(ke,Ae,Ce)}function Gc(ke){Nc(ke,void 0,Ll)}const Yl=(()=>{const ke=zl&&zl.queueMicrotask;if("function"==typeof ke)return ke;const Ae=Oc(void 0);return ke=>Nc(Ae,ke)})();function $c(ke,Ae,Ce){if("function"!=typeof ke)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(ke,Ae,Ce)}function Zc(ke,Ae,Ce){try{return Oc($c(ke,Ae,Ce))}catch(ke){return Fc(ke)}}class Yc{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(ke){const Ae=this._back;let Ce=Ae;16383===Ae._elements.length&&(Ce={_elements:[],_next:void 0}),Ae._elements.push(ke),Ce!==Ae&&(this._back=Ce,Ae._next=Ce),++this._size}shift(){const ke=this._front;let Ae=ke;const Ce=this._cursor;let qe=Ce+1;const ze=ke._elements,Ve=ze[Ce];return 16384===qe&&(Ae=ke._next,qe=0),--this._size,this._cursor=qe,ke!==Ae&&(this._front=Ae),ze[Ce]=void 0,Ve}forEach(ke){let Ae=this._cursor,Ce=this._front,qe=Ce._elements;for(;!(Ae===qe.length&&void 0===Ce._next||Ae===qe.length&&(Ce=Ce._next,qe=Ce._elements,Ae=0,0===qe.length));)ke(qe[Ae]),++Ae}peek(){const ke=this._front,Ae=this._cursor;return ke._elements[Ae]}}function Xc(ke,Ae){ke._ownerReadableStream=Ae,Ae._reader=ke,"readable"===Ae._state?tu(ke):"closed"===Ae._state?function(ke){tu(ke),nu(ke)}(ke):ru(ke,Ae._storedError)}function Qc(ke,Ae){return Tf(ke._ownerReadableStream,Ae)}function Jc(ke){"readable"===ke._ownerReadableStream._state?iu(ke,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(ke,Ae){ru(ke,Ae)}(ke,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),ke._ownerReadableStream._reader=void 0,ke._ownerReadableStream=void 0}function eu(ke){return new TypeError("Cannot "+ke+" a stream using a released reader")}function tu(ke){ke._closedPromise=qc(((Ae,Ce)=>{ke._closedPromise_resolve=Ae,ke._closedPromise_reject=Ce}))}function ru(ke,Ae){tu(ke),iu(ke,Ae)}function iu(ke,Ae){void 0!==ke._closedPromise_reject&&(Gc(ke._closedPromise),ke._closedPromise_reject(Ae),ke._closedPromise_resolve=void 0,ke._closedPromise_reject=void 0)}function nu(ke){void 0!==ke._closedPromise_resolve&&(ke._closedPromise_resolve(void 0),ke._closedPromise_resolve=void 0,ke._closedPromise_reject=void 0)}const Jl=jl("[[AbortSteps]]"),Xl=jl("[[ErrorSteps]]"),Ql=jl("[[CancelSteps]]"),hd=jl("[[PullSteps]]"),Ad=Number.isFinite||function(ke){return"number"==typeof ke&&isFinite(ke)},Sd=Math.trunc||function(ke){return ke<0?Math.ceil(ke):Math.floor(ke)};function fu(ke,Ae){if(void 0!==ke&&("object"!=typeof(Ce=ke)&&"function"!=typeof Ce))throw new TypeError(Ae+" is not an object.");var Ce}function du(ke,Ae){if("function"!=typeof ke)throw new TypeError(Ae+" is not a function.")}function lu(ke,Ae){if(!function(ke){return"object"==typeof ke&&null!==ke||"function"==typeof ke}(ke))throw new TypeError(Ae+" is not an object.")}function pu(ke,Ae,Ce){if(void 0===ke)throw new TypeError(`Parameter ${Ae} is required in '${Ce}'.`)}function yu(ke,Ae,Ce){if(void 0===ke)throw new TypeError(`${Ae} is required in '${Ce}'.`)}function bu(ke){return Number(ke)}function mu(ke){return 0===ke?0:ke}function gu(ke,Ae){const Ce=Number.MAX_SAFE_INTEGER;let qe=Number(ke);if(qe=mu(qe),!Ad(qe))throw new TypeError(Ae+" is not a finite number");if(qe=function(ke){return mu(Sd(ke))}(qe),qe<0||qe>Ce)throw new TypeError(`${Ae} is outside the accepted range of 0 to ${Ce}, inclusive`);return Ad(qe)&&0!==qe?qe:0}function wu(ke,Ae){if(!If(ke))throw new TypeError(Ae+" is not a ReadableStream.")}function vu(ke){return new Eu(ke)}function _u(ke,Ae){ke._reader._readRequests.push(Ae)}function ku(ke,Ae,Ce){const qe=ke._reader._readRequests.shift();Ce?qe._closeSteps():qe._chunkSteps(Ae)}function Au(ke){return ke._reader._readRequests.length}function Su(ke){const Ae=ke._reader;return void 0!==Ae&&!!Pu(Ae)}class Eu{constructor(ke){if(pu(ke,1,"ReadableStreamDefaultReader"),wu(ke,"First parameter"),Bf(ke))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Xc(this,ke),this._readRequests=new Yc}get closed(){return Pu(this)?this._closedPromise:Fc(Mu("closed"))}cancel(ke){return Pu(this)?void 0===this._ownerReadableStream?Fc(eu("cancel")):Qc(this,ke):Fc(Mu("cancel"))}read(){if(!Pu(this))return Fc(Mu("read"));if(void 0===this._ownerReadableStream)return Fc(eu("read from"));let ke,Ae;const Ce=qc(((Ce,qe)=>{ke=Ce,Ae=qe}));return xu(this,{_chunkSteps:Ae=>ke({value:Ae,done:!1}),_closeSteps:()=>ke({value:void 0,done:!0}),_errorSteps:ke=>Ae(ke)}),Ce}releaseLock(){if(!Pu(this))throw Mu("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Jc(this)}}}function Pu(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_readRequests")}function xu(ke,Ae){const Ce=ke._ownerReadableStream;Ce._disturbed=!0,"closed"===Ce._state?Ae._closeSteps():"errored"===Ce._state?Ae._errorSteps(Ce._storedError):Ce._readableStreamController[hd](Ae)}function Mu(ke){return new TypeError(`ReadableStreamDefaultReader.prototype.${ke} can only be used on a ReadableStreamDefaultReader`)}let Md;Object.defineProperties(Eu.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(Eu.prototype,jl.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof jl.asyncIterator&&(Md={[jl.asyncIterator](){return this}},Object.defineProperty(Md,jl.asyncIterator,{enumerable:!1}));class Ku{constructor(ke,Ae){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=ke,this._preventCancel=Ae}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?Hc(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(ke){const t=()=>this._returnSteps(ke);return this._ongoingPromise?Hc(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const ke=this._reader;if(void 0===ke._ownerReadableStream)return Fc(eu("iterate"));let Ae,Ce;const qe=qc(((ke,qe)=>{Ae=ke,Ce=qe}));return xu(ke,{_chunkSteps:ke=>{this._ongoingPromise=void 0,Yl((()=>Ae({value:ke,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Jc(ke),Ae({value:void 0,done:!0})},_errorSteps:Ae=>{this._ongoingPromise=void 0,this._isFinished=!0,Jc(ke),Ce(Ae)}}),qe}_returnSteps(ke){if(this._isFinished)return Promise.resolve({value:ke,done:!0});this._isFinished=!0;const Ae=this._reader;if(void 0===Ae._ownerReadableStream)return Fc(eu("finish iterating"));if(!this._preventCancel){const Ce=Qc(Ae,ke);return Jc(Ae),Hc(Ce,(()=>({value:ke,done:!0})))}return Jc(Ae),Oc({value:ke,done:!0})}}const Pd={next(){return Ru(this)?this._asyncIteratorImpl.next():Fc(Uu("next"))},return(ke){return Ru(this)?this._asyncIteratorImpl.return(ke):Fc(Uu("return"))}};function Ru(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_asyncIteratorImpl")}function Uu(ke){return new TypeError(`ReadableStreamAsyncIterator.${ke} can only be used on a ReadableSteamAsyncIterator`)}void 0!==Md&&Object.setPrototypeOf(Pd,Md);const Dd=Number.isNaN||function(ke){return ke!=ke};function Bu(ke){return!!function(ke){if("number"!=typeof ke)return!1;if(Dd(ke))return!1;if(ke<0)return!1;return!0}(ke)&&ke!==1/0}function Tu(ke){const Ae=ke._queue.shift();return ke._queueTotalSize-=Ae.size,ke._queueTotalSize<0&&(ke._queueTotalSize=0),Ae.value}function zu(ke,Ae,Ce){if(!Bu(Ce=Number(Ce)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");ke._queue.push({value:Ae,size:Ce}),ke._queueTotalSize+=Ce}function qu(ke){ke._queue=new Yc,ke._queueTotalSize=0}function Ou(ke){return ke.slice()}class Fu{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Lu(this))throw ah("view");return this._view}respond(ke){if(!Lu(this))throw ah("respond");if(pu(ke,1,"respond"),ke=gu(ke,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(ke,Ae){if(!Bu(Ae=Number(Ae)))throw new RangeError("bytesWritten must be a finite");Ju(ke,Ae)}(this._associatedReadableByteStreamController,ke)}respondWithNewView(ke){if(!Lu(this))throw ah("respondWithNewView");if(pu(ke,1,"respondWithNewView"),!ArrayBuffer.isView(ke))throw new TypeError("You can only respond with array buffer views");if(0===ke.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===ke.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");!function(ke,Ae){const Ce=ke._pendingPullIntos.peek();if(Ce.byteOffset+Ce.bytesFilled!==Ae.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(Ce.byteLength!==Ae.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");Ce.buffer=Ae.buffer,Ju(ke,Ae.byteLength)}(this._associatedReadableByteStreamController,ke)}}Object.defineProperties(Fu.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(Fu.prototype,jl.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Nu{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!ju(this))throw sh("byobRequest");if(null===this._byobRequest&&this._pendingPullIntos.length>0){const ke=this._pendingPullIntos.peek(),Ae=new Uint8Array(ke.buffer,ke.byteOffset+ke.bytesFilled,ke.byteLength-ke.bytesFilled),Ce=Object.create(Fu.prototype);!function(ke,Ae,Ce){ke._associatedReadableByteStreamController=Ae,ke._view=Ce}(Ce,this,Ae),this._byobRequest=Ce}return this._byobRequest}get desiredSize(){if(!ju(this))throw sh("desiredSize");return ih(this)}close(){if(!ju(this))throw sh("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const ke=this._controlledReadableByteStream._state;if("readable"!==ke)throw new TypeError(`The stream (in ${ke} state) is not in the readable state and cannot be closed`);!function(ke){const Ae=ke._controlledReadableByteStream;if(ke._closeRequested||"readable"!==Ae._state)return;if(ke._queueTotalSize>0)return void(ke._closeRequested=!0);if(ke._pendingPullIntos.length>0){if(ke._pendingPullIntos.peek().bytesFilled>0){const Ae=new TypeError("Insufficient bytes to fill elements in the given buffer");throw rh(ke,Ae),Ae}}th(ke),zf(Ae)}(this)}enqueue(ke){if(!ju(this))throw sh("enqueue");if(pu(ke,1,"enqueue"),!ArrayBuffer.isView(ke))throw new TypeError("chunk must be an array buffer view");if(0===ke.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===ke.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const Ae=this._controlledReadableByteStream._state;if("readable"!==Ae)throw new TypeError(`The stream (in ${Ae} state) is not in the readable state and cannot be enqueued to`);!function(ke,Ae){const Ce=ke._controlledReadableByteStream;if(ke._closeRequested||"readable"!==Ce._state)return;const qe=Ae.buffer,ze=Ae.byteOffset,Ve=Ae.byteLength,tt=qe;if(Su(Ce))if(0===Au(Ce))Vu(ke,tt,ze,Ve);else{ku(Ce,new Uint8Array(tt,ze,Ve),!1)}else uh(Ce)?(Vu(ke,tt,ze,Ve),Qu(ke)):Vu(ke,tt,ze,Ve);Wu(ke)}(this,ke)}error(ke){if(!ju(this))throw sh("error");rh(this,ke)}[Ql](ke){if(this._pendingPullIntos.length>0){this._pendingPullIntos.peek().bytesFilled=0}qu(this);const Ae=this._cancelAlgorithm(ke);return th(this),Ae}[hd](ke){const Ae=this._controlledReadableByteStream;if(this._queueTotalSize>0){const Ae=this._queue.shift();this._queueTotalSize-=Ae.byteLength,Yu(this);const Ce=new Uint8Array(Ae.buffer,Ae.byteOffset,Ae.byteLength);return void ke._chunkSteps(Ce)}const Ce=this._autoAllocateChunkSize;if(void 0!==Ce){let qe;try{qe=new ArrayBuffer(Ce)}catch(Ae){return void ke._errorSteps(Ae)}const ze={buffer:qe,byteOffset:0,byteLength:Ce,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(ze)}_u(Ae,ke),Wu(this)}}function ju(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_controlledReadableByteStream")}function Lu(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_associatedReadableByteStreamController")}function Wu(ke){if(!function(ke){const Ae=ke._controlledReadableByteStream;if("readable"!==Ae._state)return!1;if(ke._closeRequested)return!1;if(!ke._started)return!1;if(Su(Ae)&&Au(Ae)>0)return!0;if(uh(Ae)&&ch(Ae)>0)return!0;if(ih(ke)>0)return!0;return!1}(ke))return;if(ke._pulling)return void(ke._pullAgain=!0);ke._pulling=!0;jc(ke._pullAlgorithm(),(()=>{ke._pulling=!1,ke._pullAgain&&(ke._pullAgain=!1,Wu(ke))}),(Ae=>{rh(ke,Ae)}))}function Hu(ke,Ae){let Ce=!1;"closed"===ke._state&&(Ce=!0);const qe=Gu(Ae);"default"===Ae.readerType?ku(ke,qe,Ce):function(ke,Ae,Ce){const qe=ke._reader._readIntoRequests.shift();Ce?qe._closeSteps(Ae):qe._chunkSteps(Ae)}(ke,qe,Ce)}function Gu(ke){const Ae=ke.bytesFilled,Ce=ke.elementSize;return new ke.viewConstructor(ke.buffer,ke.byteOffset,Ae/Ce)}function Vu(ke,Ae,Ce,qe){ke._queue.push({buffer:Ae,byteOffset:Ce,byteLength:qe}),ke._queueTotalSize+=qe}function $u(ke,Ae){const Ce=Ae.elementSize,qe=Ae.bytesFilled-Ae.bytesFilled%Ce,ze=Math.min(ke._queueTotalSize,Ae.byteLength-Ae.bytesFilled),Ve=Ae.bytesFilled+ze,tt=Ve-Ve%Ce;let rt=ze,it=!1;tt>qe&&(rt=tt-Ae.bytesFilled,it=!0);const nt=ke._queue;for(;rt>0;){const Ce=nt.peek(),qe=Math.min(rt,Ce.byteLength),ze=Ae.byteOffset+Ae.bytesFilled;ot=Ae.buffer,ct=ze,ht=Ce.buffer,ft=Ce.byteOffset,yt=qe,new Uint8Array(ot).set(new Uint8Array(ht,ft,yt),ct),Ce.byteLength===qe?nt.shift():(Ce.byteOffset+=qe,Ce.byteLength-=qe),ke._queueTotalSize-=qe,Zu(ke,qe,Ae),rt-=qe}var ot,ct,ht,ft,yt;return it}function Zu(ke,Ae,Ce){Xu(ke),Ce.bytesFilled+=Ae}function Yu(ke){0===ke._queueTotalSize&&ke._closeRequested?(th(ke),zf(ke._controlledReadableByteStream)):Wu(ke)}function Xu(ke){null!==ke._byobRequest&&(ke._byobRequest._associatedReadableByteStreamController=void 0,ke._byobRequest._view=null,ke._byobRequest=null)}function Qu(ke){for(;ke._pendingPullIntos.length>0;){if(0===ke._queueTotalSize)return;const Ae=ke._pendingPullIntos.peek();$u(ke,Ae)&&(eh(ke),Hu(ke._controlledReadableByteStream,Ae))}}function Ju(ke,Ae){const Ce=ke._pendingPullIntos.peek();if("closed"===ke._controlledReadableByteStream._state){if(0!==Ae)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(ke,Ae){Ae.buffer=Ae.buffer;const Ce=ke._controlledReadableByteStream;if(uh(Ce))for(;ch(Ce)>0;)Hu(Ce,eh(ke))}(ke,Ce)}else!function(ke,Ae,Ce){if(Ce.bytesFilled+Ae>Ce.byteLength)throw new RangeError("bytesWritten out of range");if(Zu(ke,Ae,Ce),Ce.bytesFilled0){const Ae=Ce.byteOffset+Ce.bytesFilled,ze=Ce.buffer.slice(Ae-qe,Ae);Vu(ke,ze,0,ze.byteLength)}Ce.buffer=Ce.buffer,Ce.bytesFilled-=qe,Hu(ke._controlledReadableByteStream,Ce),Qu(ke)}(ke,Ae,Ce);Wu(ke)}function eh(ke){const Ae=ke._pendingPullIntos.shift();return Xu(ke),Ae}function th(ke){ke._pullAlgorithm=void 0,ke._cancelAlgorithm=void 0}function rh(ke,Ae){const Ce=ke._controlledReadableByteStream;"readable"===Ce._state&&(!function(ke){Xu(ke),ke._pendingPullIntos=new Yc}(ke),qu(ke),th(ke),qf(Ce,Ae))}function ih(ke){const Ae=ke._controlledReadableByteStream._state;return"errored"===Ae?null:"closed"===Ae?0:ke._strategyHWM-ke._queueTotalSize}function nh(ke,Ae,Ce){const qe=Object.create(Nu.prototype);let n=()=>{},a=()=>Oc(void 0),s=()=>Oc(void 0);void 0!==Ae.start&&(n=()=>Ae.start(qe)),void 0!==Ae.pull&&(a=()=>Ae.pull(qe)),void 0!==Ae.cancel&&(s=ke=>Ae.cancel(ke));const ze=Ae.autoAllocateChunkSize;if(0===ze)throw new TypeError("autoAllocateChunkSize must be greater than 0");!function(ke,Ae,Ce,qe,ze,Ve,tt){Ae._controlledReadableByteStream=ke,Ae._pullAgain=!1,Ae._pulling=!1,Ae._byobRequest=null,Ae._queue=Ae._queueTotalSize=void 0,qu(Ae),Ae._closeRequested=!1,Ae._started=!1,Ae._strategyHWM=Ve,Ae._pullAlgorithm=qe,Ae._cancelAlgorithm=ze,Ae._autoAllocateChunkSize=tt,Ae._pendingPullIntos=new Yc,ke._readableStreamController=Ae,jc(Oc(Ce()),(()=>{Ae._started=!0,Wu(Ae)}),(ke=>{rh(Ae,ke)}))}(ke,qe,n,a,s,Ce,ze)}function ah(ke){return new TypeError(`ReadableStreamBYOBRequest.prototype.${ke} can only be used on a ReadableStreamBYOBRequest`)}function sh(ke){return new TypeError(`ReadableByteStreamController.prototype.${ke} can only be used on a ReadableByteStreamController`)}function oh(ke,Ae){ke._reader._readIntoRequests.push(Ae)}function ch(ke){return ke._reader._readIntoRequests.length}function uh(ke){const Ae=ke._reader;return void 0!==Ae&&!!fh(Ae)}Object.defineProperties(Nu.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(Nu.prototype,jl.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class hh{constructor(ke){if(pu(ke,1,"ReadableStreamBYOBReader"),wu(ke,"First parameter"),Bf(ke))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!ju(ke._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");Xc(this,ke),this._readIntoRequests=new Yc}get closed(){return fh(this)?this._closedPromise:Fc(dh("closed"))}cancel(ke){return fh(this)?void 0===this._ownerReadableStream?Fc(eu("cancel")):Qc(this,ke):Fc(dh("cancel"))}read(ke){if(!fh(this))return Fc(dh("read"));if(!ArrayBuffer.isView(ke))return Fc(new TypeError("view must be an array buffer view"));if(0===ke.byteLength)return Fc(new TypeError("view must have non-zero byteLength"));if(0===ke.buffer.byteLength)return Fc(new TypeError("view's buffer must have non-zero byteLength"));if(void 0===this._ownerReadableStream)return Fc(eu("read from"));let Ae,Ce;const qe=qc(((ke,qe)=>{Ae=ke,Ce=qe}));return function(ke,Ae,Ce){const qe=ke._ownerReadableStream;qe._disturbed=!0,"errored"===qe._state?Ce._errorSteps(qe._storedError):function(ke,Ae,Ce){const qe=ke._controlledReadableByteStream;let ze=1;Ae.constructor!==DataView&&(ze=Ae.constructor.BYTES_PER_ELEMENT);const Ve=Ae.constructor,tt={buffer:Ae.buffer,byteOffset:Ae.byteOffset,byteLength:Ae.byteLength,bytesFilled:0,elementSize:ze,viewConstructor:Ve,readerType:"byob"};if(ke._pendingPullIntos.length>0)return ke._pendingPullIntos.push(tt),void oh(qe,Ce);if("closed"!==qe._state){if(ke._queueTotalSize>0){if($u(ke,tt)){const Ae=Gu(tt);return Yu(ke),void Ce._chunkSteps(Ae)}if(ke._closeRequested){const Ae=new TypeError("Insufficient bytes to fill elements in the given buffer");return rh(ke,Ae),void Ce._errorSteps(Ae)}}ke._pendingPullIntos.push(tt),oh(qe,Ce),Wu(ke)}else{const ke=new Ve(tt.buffer,tt.byteOffset,0);Ce._closeSteps(ke)}}(qe._readableStreamController,Ae,Ce)}(this,ke,{_chunkSteps:ke=>Ae({value:ke,done:!1}),_closeSteps:ke=>Ae({value:ke,done:!0}),_errorSteps:ke=>Ce(ke)}),qe}releaseLock(){if(!fh(this))throw dh("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Jc(this)}}}function fh(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_readIntoRequests")}function dh(ke){return new TypeError(`ReadableStreamBYOBReader.prototype.${ke} can only be used on a ReadableStreamBYOBReader`)}function lh(ke,Ae){const{highWaterMark:Ce}=ke;if(void 0===Ce)return Ae;if(Dd(Ce)||Ce<0)throw new RangeError("Invalid highWaterMark");return Ce}function ph(ke){const{size:Ae}=ke;return Ae||(()=>1)}function yh(ke,Ae){fu(ke,Ae);const Ce=null==ke?void 0:ke.highWaterMark,qe=null==ke?void 0:ke.size;return{highWaterMark:void 0===Ce?void 0:bu(Ce),size:void 0===qe?void 0:bh(qe,Ae+" has member 'size' that")}}function bh(ke,Ae){return du(ke,Ae),Ae=>bu(ke(Ae))}function mh(ke,Ae,Ce){return du(ke,Ce),Ce=>Zc(ke,Ae,[Ce])}function gh(ke,Ae,Ce){return du(ke,Ce),()=>Zc(ke,Ae,[])}function wh(ke,Ae,Ce){return du(ke,Ce),Ce=>$c(ke,Ae,[Ce])}function vh(ke,Ae,Ce){return du(ke,Ce),(Ce,qe)=>Zc(ke,Ae,[Ce,qe])}function _h(ke,Ae){if(!Eh(ke))throw new TypeError(Ae+" is not a WritableStream.")}Object.defineProperties(hh.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(hh.prototype,jl.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});class kh{constructor(ke={},Ae={}){void 0===ke?ke=null:lu(ke,"First parameter");const Ce=yh(Ae,"Second parameter"),qe=function(ke,Ae){fu(ke,Ae);const Ce=null==ke?void 0:ke.abort,qe=null==ke?void 0:ke.close,ze=null==ke?void 0:ke.start,Ve=null==ke?void 0:ke.type,tt=null==ke?void 0:ke.write;return{abort:void 0===Ce?void 0:mh(Ce,ke,Ae+" has member 'abort' that"),close:void 0===qe?void 0:gh(qe,ke,Ae+" has member 'close' that"),start:void 0===ze?void 0:wh(ze,ke,Ae+" has member 'start' that"),write:void 0===tt?void 0:vh(tt,ke,Ae+" has member 'write' that"),type:Ve}}(ke,"First parameter");Sh(this);if(void 0!==qe.type)throw new RangeError("Invalid type is specified");const ze=ph(Ce);!function(ke,Ae,Ce,qe){const ze=Object.create(Lh.prototype);let a=()=>{},s=()=>Oc(void 0),o=()=>Oc(void 0),c=()=>Oc(void 0);void 0!==Ae.start&&(a=()=>Ae.start(ze));void 0!==Ae.write&&(s=ke=>Ae.write(ke,ze));void 0!==Ae.close&&(o=()=>Ae.close());void 0!==Ae.abort&&(c=ke=>Ae.abort(ke));Wh(ke,ze,a,s,o,c,Ce,qe)}(this,qe,lh(Ce,1),ze)}get locked(){if(!Eh(this))throw Xh("locked");return Ph(this)}abort(ke){return Eh(this)?Ph(this)?Fc(new TypeError("Cannot abort a stream that already has a writer")):xh(this,ke):Fc(Xh("abort"))}close(){return Eh(this)?Ph(this)?Fc(new TypeError("Cannot close a stream that already has a writer")):Rh(this)?Fc(new TypeError("Cannot close an already-closing stream")):Mh(this):Fc(Xh("close"))}getWriter(){if(!Eh(this))throw Xh("getWriter");return Ah(this)}}function Ah(ke){return new Bh(ke)}function Sh(ke){ke._state="writable",ke._storedError=void 0,ke._writer=void 0,ke._writableStreamController=void 0,ke._writeRequests=new Yc,ke._inFlightWriteRequest=void 0,ke._closeRequest=void 0,ke._inFlightCloseRequest=void 0,ke._pendingAbortRequest=void 0,ke._backpressure=!1}function Eh(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_writableStreamController")}function Ph(ke){return void 0!==ke._writer}function xh(ke,Ae){const Ce=ke._state;if("closed"===Ce||"errored"===Ce)return Oc(void 0);if(void 0!==ke._pendingAbortRequest)return ke._pendingAbortRequest._promise;let qe=!1;"erroring"===Ce&&(qe=!0,Ae=void 0);const ze=qc(((Ce,ze)=>{ke._pendingAbortRequest={_promise:void 0,_resolve:Ce,_reject:ze,_reason:Ae,_wasAlreadyErroring:qe}}));return ke._pendingAbortRequest._promise=ze,qe||Kh(ke,Ae),ze}function Mh(ke){const Ae=ke._state;if("closed"===Ae||"errored"===Ae)return Fc(new TypeError(`The stream (in ${Ae} state) is not in the writable state and cannot be closed`));const Ce=qc(((Ae,Ce)=>{const qe={_resolve:Ae,_reject:Ce};ke._closeRequest=qe})),qe=ke._writer;var ze;return void 0!==qe&&ke._backpressure&&"writable"===Ae&&uf(qe),zu(ze=ke._writableStreamController,Rd,0),Vh(ze),Ce}function Ch(ke,Ae){"writable"!==ke._state?Dh(ke):Kh(ke,Ae)}function Kh(ke,Ae){const Ce=ke._writableStreamController;ke._state="erroring",ke._storedError=Ae;const qe=ke._writer;void 0!==qe&&Oh(qe,Ae),!function(ke){if(void 0===ke._inFlightWriteRequest&&void 0===ke._inFlightCloseRequest)return!1;return!0}(ke)&&Ce._started&&Dh(ke)}function Dh(ke){ke._state="errored",ke._writableStreamController[Xl]();const Ae=ke._storedError;if(ke._writeRequests.forEach((ke=>{ke._reject(Ae)})),ke._writeRequests=new Yc,void 0===ke._pendingAbortRequest)return void Uh(ke);const Ce=ke._pendingAbortRequest;if(ke._pendingAbortRequest=void 0,Ce._wasAlreadyErroring)return Ce._reject(Ae),void Uh(ke);jc(ke._writableStreamController[Jl](Ce._reason),(()=>{Ce._resolve(),Uh(ke)}),(Ae=>{Ce._reject(Ae),Uh(ke)}))}function Rh(ke){return void 0!==ke._closeRequest||void 0!==ke._inFlightCloseRequest}function Uh(ke){void 0!==ke._closeRequest&&(ke._closeRequest._reject(ke._storedError),ke._closeRequest=void 0);const Ae=ke._writer;void 0!==Ae&&rf(Ae,ke._storedError)}function Ih(ke,Ae){const Ce=ke._writer;void 0!==Ce&&Ae!==ke._backpressure&&(Ae?function(ke){af(ke)}(Ce):uf(Ce)),ke._backpressure=Ae}Object.defineProperties(kh.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(kh.prototype,jl.toStringTag,{value:"WritableStream",configurable:!0});class Bh{constructor(ke){if(pu(ke,1,"WritableStreamDefaultWriter"),_h(ke,"First parameter"),Ph(ke))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=ke,ke._writer=this;const Ae=ke._state;if("writable"===Ae)!Rh(ke)&&ke._backpressure?af(this):of(this),ef(this);else if("erroring"===Ae)sf(this,ke._storedError),ef(this);else if("closed"===Ae)of(this),ef(Ce=this),nf(Ce);else{const Ae=ke._storedError;sf(this,Ae),tf(this,Ae)}var Ce}get closed(){return Th(this)?this._closedPromise:Fc(Qh("closed"))}get desiredSize(){if(!Th(this))throw Qh("desiredSize");if(void 0===this._ownerWritableStream)throw Jh("desiredSize");return function(ke){const Ae=ke._ownerWritableStream,Ce=Ae._state;if("errored"===Ce||"erroring"===Ce)return null;if("closed"===Ce)return 0;return Gh(Ae._writableStreamController)}(this)}get ready(){return Th(this)?this._readyPromise:Fc(Qh("ready"))}abort(ke){return Th(this)?void 0===this._ownerWritableStream?Fc(Jh("abort")):function(ke,Ae){return xh(ke._ownerWritableStream,Ae)}(this,ke):Fc(Qh("abort"))}close(){if(!Th(this))return Fc(Qh("close"));const ke=this._ownerWritableStream;return void 0===ke?Fc(Jh("close")):Rh(ke)?Fc(new TypeError("Cannot close an already-closing stream")):zh(this)}releaseLock(){if(!Th(this))throw Qh("releaseLock");void 0!==this._ownerWritableStream&&Fh(this)}write(ke){return Th(this)?void 0===this._ownerWritableStream?Fc(Jh("write to")):Nh(this,ke):Fc(Qh("write"))}}function Th(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_ownerWritableStream")}function zh(ke){return Mh(ke._ownerWritableStream)}function qh(ke,Ae){"pending"===ke._closedPromiseState?rf(ke,Ae):function(ke,Ae){tf(ke,Ae)}(ke,Ae)}function Oh(ke,Ae){"pending"===ke._readyPromiseState?cf(ke,Ae):function(ke,Ae){sf(ke,Ae)}(ke,Ae)}function Fh(ke){const Ae=ke._ownerWritableStream,Ce=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Oh(ke,Ce),qh(ke,Ce),Ae._writer=void 0,ke._ownerWritableStream=void 0}function Nh(ke,Ae){const Ce=ke._ownerWritableStream,qe=Ce._writableStreamController,ze=function(ke,Ae){try{return ke._strategySizeAlgorithm(Ae)}catch(Ae){return $h(ke,Ae),1}}(qe,Ae);if(Ce!==ke._ownerWritableStream)return Fc(Jh("write to"));const Ve=Ce._state;if("errored"===Ve)return Fc(Ce._storedError);if(Rh(Ce)||"closed"===Ve)return Fc(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===Ve)return Fc(Ce._storedError);const tt=function(ke){return qc(((Ae,Ce)=>{const qe={_resolve:Ae,_reject:Ce};ke._writeRequests.push(qe)}))}(Ce);return function(ke,Ae,Ce){try{zu(ke,Ae,Ce)}catch(Ae){return void $h(ke,Ae)}const qe=ke._controlledWritableStream;if(!Rh(qe)&&"writable"===qe._state){Ih(qe,Zh(ke))}Vh(ke)}(qe,Ae,ze),tt}Object.defineProperties(Bh.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(Bh.prototype,jl.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const Rd={};class Lh{constructor(){throw new TypeError("Illegal constructor")}error(ke){if(!function(ke){if(!Rc(ke))return!1;if(!Object.prototype.hasOwnProperty.call(ke,"_controlledWritableStream"))return!1;return!0}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&Yh(this,ke)}[Jl](ke){const Ae=this._abortAlgorithm(ke);return Hh(this),Ae}[Xl](){qu(this)}}function Wh(ke,Ae,Ce,qe,ze,Ve,tt,rt){Ae._controlledWritableStream=ke,ke._writableStreamController=Ae,Ae._queue=void 0,Ae._queueTotalSize=void 0,qu(Ae),Ae._started=!1,Ae._strategySizeAlgorithm=rt,Ae._strategyHWM=tt,Ae._writeAlgorithm=qe,Ae._closeAlgorithm=ze,Ae._abortAlgorithm=Ve;const it=Zh(Ae);Ih(ke,it);jc(Oc(Ce()),(()=>{Ae._started=!0,Vh(Ae)}),(Ce=>{Ae._started=!0,Ch(ke,Ce)}))}function Hh(ke){ke._writeAlgorithm=void 0,ke._closeAlgorithm=void 0,ke._abortAlgorithm=void 0,ke._strategySizeAlgorithm=void 0}function Gh(ke){return ke._strategyHWM-ke._queueTotalSize}function Vh(ke){const Ae=ke._controlledWritableStream;if(!ke._started)return;if(void 0!==Ae._inFlightWriteRequest)return;if("erroring"===Ae._state)return void Dh(Ae);if(0===ke._queue.length)return;const Ce=ke._queue.peek().value;Ce===Rd?function(ke){const Ae=ke._controlledWritableStream;(function(ke){ke._inFlightCloseRequest=ke._closeRequest,ke._closeRequest=void 0})(Ae),Tu(ke);const Ce=ke._closeAlgorithm();Hh(ke),jc(Ce,(()=>{!function(ke){ke._inFlightCloseRequest._resolve(void 0),ke._inFlightCloseRequest=void 0,"erroring"===ke._state&&(ke._storedError=void 0,void 0!==ke._pendingAbortRequest&&(ke._pendingAbortRequest._resolve(),ke._pendingAbortRequest=void 0)),ke._state="closed";const Ae=ke._writer;void 0!==Ae&&nf(Ae)}(Ae)}),(ke=>{!function(ke,Ae){ke._inFlightCloseRequest._reject(Ae),ke._inFlightCloseRequest=void 0,void 0!==ke._pendingAbortRequest&&(ke._pendingAbortRequest._reject(Ae),ke._pendingAbortRequest=void 0),Ch(ke,Ae)}(Ae,ke)}))}(ke):function(ke,Ae){const Ce=ke._controlledWritableStream;!function(ke){ke._inFlightWriteRequest=ke._writeRequests.shift()}(Ce);jc(ke._writeAlgorithm(Ae),(()=>{!function(ke){ke._inFlightWriteRequest._resolve(void 0),ke._inFlightWriteRequest=void 0}(Ce);const Ae=Ce._state;if(Tu(ke),!Rh(Ce)&&"writable"===Ae){const Ae=Zh(ke);Ih(Ce,Ae)}Vh(ke)}),(Ae=>{"writable"===Ce._state&&Hh(ke),function(ke,Ae){ke._inFlightWriteRequest._reject(Ae),ke._inFlightWriteRequest=void 0,Ch(ke,Ae)}(Ce,Ae)}))}(ke,Ce)}function $h(ke,Ae){"writable"===ke._controlledWritableStream._state&&Yh(ke,Ae)}function Zh(ke){return Gh(ke)<=0}function Yh(ke,Ae){const Ce=ke._controlledWritableStream;Hh(ke),Kh(Ce,Ae)}function Xh(ke){return new TypeError(`WritableStream.prototype.${ke} can only be used on a WritableStream`)}function Qh(ke){return new TypeError(`WritableStreamDefaultWriter.prototype.${ke} can only be used on a WritableStreamDefaultWriter`)}function Jh(ke){return new TypeError("Cannot "+ke+" a stream using a released writer")}function ef(ke){ke._closedPromise=qc(((Ae,Ce)=>{ke._closedPromise_resolve=Ae,ke._closedPromise_reject=Ce,ke._closedPromiseState="pending"}))}function tf(ke,Ae){ef(ke),rf(ke,Ae)}function rf(ke,Ae){void 0!==ke._closedPromise_reject&&(Gc(ke._closedPromise),ke._closedPromise_reject(Ae),ke._closedPromise_resolve=void 0,ke._closedPromise_reject=void 0,ke._closedPromiseState="rejected")}function nf(ke){void 0!==ke._closedPromise_resolve&&(ke._closedPromise_resolve(void 0),ke._closedPromise_resolve=void 0,ke._closedPromise_reject=void 0,ke._closedPromiseState="resolved")}function af(ke){ke._readyPromise=qc(((Ae,Ce)=>{ke._readyPromise_resolve=Ae,ke._readyPromise_reject=Ce})),ke._readyPromiseState="pending"}function sf(ke,Ae){af(ke),cf(ke,Ae)}function of(ke){af(ke),uf(ke)}function cf(ke,Ae){void 0!==ke._readyPromise_reject&&(Gc(ke._readyPromise),ke._readyPromise_reject(Ae),ke._readyPromise_resolve=void 0,ke._readyPromise_reject=void 0,ke._readyPromiseState="rejected")}function uf(ke){void 0!==ke._readyPromise_resolve&&(ke._readyPromise_resolve(void 0),ke._readyPromise_resolve=void 0,ke._readyPromise_reject=void 0,ke._readyPromiseState="fulfilled")}Object.defineProperties(Lh.prototype,{error:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(Lh.prototype,jl.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const Bd="undefined"!=typeof DOMException?DOMException:void 0;const Td=function(ke){if("function"!=typeof ke&&"object"!=typeof ke)return!1;try{return new ke,!0}catch(ke){return!1}}(Bd)?Bd:function(){const e=function(ke,Ae){this.message=ke||"",this.name=Ae||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return Object.defineProperty(e.prototype=Object.create(Error.prototype),"constructor",{value:e,writable:!0,configurable:!0}),e}();function df(ke,Ae,Ce,qe,ze,Ve){const tt=vu(ke),rt=Ah(Ae);ke._disturbed=!0;let it=!1,nt=Oc(void 0);return qc(((ot,ct)=>{let ht;if(void 0!==Ve){if(ht=()=>{const Ce=new Td("Aborted","AbortError"),Ve=[];qe||Ve.push((()=>"writable"===Ae._state?xh(Ae,Ce):Oc(void 0))),ze||Ve.push((()=>"readable"===ke._state?Tf(ke,Ce):Oc(void 0))),y((()=>Promise.all(Ve.map((ke=>ke())))),!0,Ce)},Ve.aborted)return void ht();Ve.addEventListener("abort",ht)}if(p(ke,tt._closedPromise,(ke=>{qe?b(!0,ke):y((()=>xh(Ae,ke)),!0,ke)})),p(Ae,rt._closedPromise,(Ae=>{ze?b(!0,Ae):y((()=>Tf(ke,Ae)),!0,Ae)})),function(ke,Ae,Ce){"closed"===ke._state?Ce():Lc(Ae,Ce)}(ke,tt._closedPromise,(()=>{Ce?b():y((()=>function(ke){const Ae=ke._ownerWritableStream,Ce=Ae._state;return Rh(Ae)||"closed"===Ce?Oc(void 0):"errored"===Ce?Fc(Ae._storedError):zh(ke)}(rt)))})),Rh(Ae)||"closed"===Ae._state){const Ae=new TypeError("the destination writable stream closed before all data could be piped to it");ze?b(!0,Ae):y((()=>Tf(ke,Ae)),!0,Ae)}function l(){const ke=nt;return Nc(nt,(()=>ke!==nt?l():void 0))}function p(ke,Ae,Ce){"errored"===ke._state?Ce(ke._storedError):Wc(Ae,Ce)}function y(ke,Ce,qe){function n(){jc(ke(),(()=>m(Ce,qe)),(ke=>m(!0,ke)))}it||(it=!0,"writable"!==Ae._state||Rh(Ae)?n():Lc(l(),n))}function b(ke,Ce){it||(it=!0,"writable"!==Ae._state||Rh(Ae)?m(ke,Ce):Lc(l(),(()=>m(ke,Ce))))}function m(ke,Ae){Fh(rt),Jc(tt),void 0!==Ve&&Ve.removeEventListener("abort",ht),ke?ct(Ae):ot(void 0)}Gc(qc(((ke,Ae)=>{!function r(Ce){Ce?ke():Nc(it?Oc(!0):Nc(rt._readyPromise,(()=>qc(((ke,Ae)=>{xu(tt,{_chunkSteps:Ae=>{nt=Nc(Nh(rt,Ae),void 0,Kc),ke(!1)},_closeSteps:()=>ke(!0),_errorSteps:Ae})})))),r,Ae)}(!1)})))}))}class lf{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!pf(this))throw Sf("desiredSize");return _f(this)}close(){if(!pf(this))throw Sf("close");if(!kf(this))throw new TypeError("The stream is not in a state that permits close");gf(this)}enqueue(ke){if(!pf(this))throw Sf("enqueue");if(!kf(this))throw new TypeError("The stream is not in a state that permits enqueue");return wf(this,ke)}error(ke){if(!pf(this))throw Sf("error");vf(this,ke)}[Ql](ke){qu(this);const Ae=this._cancelAlgorithm(ke);return mf(this),Ae}[hd](ke){const Ae=this._controlledReadableStream;if(this._queue.length>0){const Ce=Tu(this);this._closeRequested&&0===this._queue.length?(mf(this),zf(Ae)):yf(this),ke._chunkSteps(Ce)}else _u(Ae,ke),yf(this)}}function pf(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_controlledReadableStream")}function yf(ke){if(!bf(ke))return;if(ke._pulling)return void(ke._pullAgain=!0);ke._pulling=!0;jc(ke._pullAlgorithm(),(()=>{ke._pulling=!1,ke._pullAgain&&(ke._pullAgain=!1,yf(ke))}),(Ae=>{vf(ke,Ae)}))}function bf(ke){const Ae=ke._controlledReadableStream;if(!kf(ke))return!1;if(!ke._started)return!1;if(Bf(Ae)&&Au(Ae)>0)return!0;return _f(ke)>0}function mf(ke){ke._pullAlgorithm=void 0,ke._cancelAlgorithm=void 0,ke._strategySizeAlgorithm=void 0}function gf(ke){if(!kf(ke))return;const Ae=ke._controlledReadableStream;ke._closeRequested=!0,0===ke._queue.length&&(mf(ke),zf(Ae))}function wf(ke,Ae){if(!kf(ke))return;const Ce=ke._controlledReadableStream;if(Bf(Ce)&&Au(Ce)>0)ku(Ce,Ae,!1);else{let Ce;try{Ce=ke._strategySizeAlgorithm(Ae)}catch(Ae){throw vf(ke,Ae),Ae}try{zu(ke,Ae,Ce)}catch(Ae){throw vf(ke,Ae),Ae}}yf(ke)}function vf(ke,Ae){const Ce=ke._controlledReadableStream;"readable"===Ce._state&&(qu(ke),mf(ke),qf(Ce,Ae))}function _f(ke){const Ae=ke._controlledReadableStream._state;return"errored"===Ae?null:"closed"===Ae?0:ke._strategyHWM-ke._queueTotalSize}function kf(ke){const Ae=ke._controlledReadableStream._state;return!ke._closeRequested&&"readable"===Ae}function Af(ke,Ae,Ce,qe,ze,Ve,tt){Ae._controlledReadableStream=ke,Ae._queue=void 0,Ae._queueTotalSize=void 0,qu(Ae),Ae._started=!1,Ae._closeRequested=!1,Ae._pullAgain=!1,Ae._pulling=!1,Ae._strategySizeAlgorithm=tt,Ae._strategyHWM=Ve,Ae._pullAlgorithm=qe,Ae._cancelAlgorithm=ze,ke._readableStreamController=Ae;jc(Oc(Ce()),(()=>{Ae._started=!0,yf(Ae)}),(ke=>{vf(Ae,ke)}))}function Sf(ke){return new TypeError(`ReadableStreamDefaultController.prototype.${ke} can only be used on a ReadableStreamDefaultController`)}function Ef(ke,Ae,Ce){return du(ke,Ce),Ce=>Zc(ke,Ae,[Ce])}function Pf(ke,Ae,Ce){return du(ke,Ce),Ce=>Zc(ke,Ae,[Ce])}function xf(ke,Ae,Ce){return du(ke,Ce),Ce=>$c(ke,Ae,[Ce])}function Mf(ke,Ae){if("bytes"!==(ke=""+ke))throw new TypeError(`${Ae} '${ke}' is not a valid enumeration value for ReadableStreamType`);return ke}function Cf(ke,Ae){if("byob"!==(ke=""+ke))throw new TypeError(`${Ae} '${ke}' is not a valid enumeration value for ReadableStreamReaderMode`);return ke}function Kf(ke,Ae){fu(ke,Ae);const Ce=null==ke?void 0:ke.preventAbort,qe=null==ke?void 0:ke.preventCancel,ze=null==ke?void 0:ke.preventClose,Ve=null==ke?void 0:ke.signal;return void 0!==Ve&&function(ke,Ae){if(!function(ke){if("object"!=typeof ke||null===ke)return!1;try{return"boolean"==typeof ke.aborted}catch(ke){return!1}}(ke))throw new TypeError(Ae+" is not an AbortSignal.")}(Ve,Ae+" has member 'signal' that"),{preventAbort:!!Ce,preventCancel:!!qe,preventClose:!!ze,signal:Ve}}Object.defineProperties(lf.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(lf.prototype,jl.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class Df{constructor(ke={},Ae={}){void 0===ke?ke=null:lu(ke,"First parameter");const Ce=yh(Ae,"Second parameter"),qe=function(ke,Ae){fu(ke,Ae);const Ce=ke,qe=null==Ce?void 0:Ce.autoAllocateChunkSize,ze=null==Ce?void 0:Ce.cancel,Ve=null==Ce?void 0:Ce.pull,tt=null==Ce?void 0:Ce.start,rt=null==Ce?void 0:Ce.type;return{autoAllocateChunkSize:void 0===qe?void 0:gu(qe,Ae+" has member 'autoAllocateChunkSize' that"),cancel:void 0===ze?void 0:Ef(ze,Ce,Ae+" has member 'cancel' that"),pull:void 0===Ve?void 0:Pf(Ve,Ce,Ae+" has member 'pull' that"),start:void 0===tt?void 0:xf(tt,Ce,Ae+" has member 'start' that"),type:void 0===rt?void 0:Mf(rt,Ae+" has member 'type' that")}}(ke,"First parameter");if(Uf(this),"bytes"===qe.type){if(void 0!==Ce.size)throw new RangeError("The strategy for a byte stream cannot have a size function");nh(this,qe,lh(Ce,0))}else{const ke=ph(Ce);!function(ke,Ae,Ce,qe){const ze=Object.create(lf.prototype);let a=()=>{},s=()=>Oc(void 0),o=()=>Oc(void 0);void 0!==Ae.start&&(a=()=>Ae.start(ze)),void 0!==Ae.pull&&(s=()=>Ae.pull(ze)),void 0!==Ae.cancel&&(o=ke=>Ae.cancel(ke)),Af(ke,ze,a,s,o,Ce,qe)}(this,qe,lh(Ce,1),ke)}}get locked(){if(!If(this))throw Of("locked");return Bf(this)}cancel(ke){return If(this)?Bf(this)?Fc(new TypeError("Cannot cancel a stream that already has a reader")):Tf(this,ke):Fc(Of("cancel"))}getReader(ke){if(!If(this))throw Of("getReader");return void 0===function(ke,Ae){fu(ke,Ae);const Ce=null==ke?void 0:ke.mode;return{mode:void 0===Ce?void 0:Cf(Ce,Ae+" has member 'mode' that")}}(ke,"First parameter").mode?vu(this):function(ke){return new hh(ke)}(this)}pipeThrough(ke,Ae={}){if(!If(this))throw Of("pipeThrough");pu(ke,1,"pipeThrough");const Ce=function(ke,Ae){fu(ke,Ae);const Ce=null==ke?void 0:ke.readable;yu(Ce,"readable","ReadableWritablePair"),wu(Ce,Ae+" has member 'readable' that");const qe=null==ke?void 0:ke.writable;return yu(qe,"writable","ReadableWritablePair"),_h(qe,Ae+" has member 'writable' that"),{readable:Ce,writable:qe}}(ke,"First parameter"),qe=Kf(Ae,"Second parameter");if(Bf(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Ph(Ce.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Gc(df(this,Ce.writable,qe.preventClose,qe.preventAbort,qe.preventCancel,qe.signal)),Ce.readable}pipeTo(ke,Ae={}){if(!If(this))return Fc(Of("pipeTo"));if(void 0===ke)return Fc("Parameter 1 is required in 'pipeTo'.");if(!Eh(ke))return Fc(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let Ce;try{Ce=Kf(Ae,"Second parameter")}catch(ke){return Fc(ke)}return Bf(this)?Fc(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Ph(ke)?Fc(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):df(this,ke,Ce.preventClose,Ce.preventAbort,Ce.preventCancel,Ce.signal)}tee(){if(!If(this))throw Of("tee");const ke=function(ke,Ae){const Ce=vu(ke);let qe,ze,Ve,tt,rt,it=!1,nt=!1,ot=!1;const ct=qc((ke=>{rt=ke}));function d(){return it||(it=!0,xu(Ce,{_chunkSteps:ke=>{Yl((()=>{it=!1;const Ae=ke,Ce=ke;nt||wf(Ve._readableStreamController,Ae),ot||wf(tt._readableStreamController,Ce)}))},_closeSteps:()=>{it=!1,nt||gf(Ve._readableStreamController),ot||gf(tt._readableStreamController),nt&&ot||rt(void 0)},_errorSteps:()=>{it=!1}})),Oc(void 0)}function l(){}return Ve=Rf(l,d,(function(Ae){if(nt=!0,qe=Ae,ot){const Ae=Ou([qe,ze]),Ce=Tf(ke,Ae);rt(Ce)}return ct})),tt=Rf(l,d,(function(Ae){if(ot=!0,ze=Ae,nt){const Ae=Ou([qe,ze]),Ce=Tf(ke,Ae);rt(Ce)}return ct})),Wc(Ce._closedPromise,(ke=>{vf(Ve._readableStreamController,ke),vf(tt._readableStreamController,ke),nt&&ot||rt(void 0)})),[Ve,tt]}(this);return Ou(ke)}values(ke){if(!If(this))throw Of("values");return function(ke,Ae){const Ce=vu(ke),qe=new Ku(Ce,Ae),ze=Object.create(Pd);return ze._asyncIteratorImpl=qe,ze}(this,function(ke,Ae){return fu(ke,Ae),{preventCancel:!!(null==ke?void 0:ke.preventCancel)}}(ke,"First parameter").preventCancel)}}function Rf(ke,Ae,Ce,qe=1,ze=(()=>1)){const Ve=Object.create(Df.prototype);Uf(Ve);return Af(Ve,Object.create(lf.prototype),ke,Ae,Ce,qe,ze),Ve}function Uf(ke){ke._state="readable",ke._reader=void 0,ke._storedError=void 0,ke._disturbed=!1}function If(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_readableStreamController")}function Bf(ke){return void 0!==ke._reader}function Tf(ke,Ae){if(ke._disturbed=!0,"closed"===ke._state)return Oc(void 0);if("errored"===ke._state)return Fc(ke._storedError);zf(ke);return Hc(ke._readableStreamController[Ql](Ae),Kc)}function zf(ke){ke._state="closed";const Ae=ke._reader;void 0!==Ae&&(nu(Ae),Pu(Ae)&&(Ae._readRequests.forEach((ke=>{ke._closeSteps()})),Ae._readRequests=new Yc))}function qf(ke,Ae){ke._state="errored",ke._storedError=Ae;const Ce=ke._reader;void 0!==Ce&&(iu(Ce,Ae),Pu(Ce)?(Ce._readRequests.forEach((ke=>{ke._errorSteps(Ae)})),Ce._readRequests=new Yc):(Ce._readIntoRequests.forEach((ke=>{ke._errorSteps(Ae)})),Ce._readIntoRequests=new Yc))}function Of(ke){return new TypeError(`ReadableStream.prototype.${ke} can only be used on a ReadableStream`)}function Ff(ke,Ae){fu(ke,Ae);const Ce=null==ke?void 0:ke.highWaterMark;return yu(Ce,"highWaterMark","QueuingStrategyInit"),{highWaterMark:bu(Ce)}}Object.defineProperties(Df.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(Df.prototype,jl.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof jl.asyncIterator&&Object.defineProperty(Df.prototype,jl.asyncIterator,{value:Df.prototype.values,writable:!0,configurable:!0});const Nf=function(ke){return ke.byteLength};class jf{constructor(ke){pu(ke,1,"ByteLengthQueuingStrategy"),ke=Ff(ke,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=ke.highWaterMark}get highWaterMark(){if(!Wf(this))throw Lf("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Wf(this))throw Lf("size");return Nf}}function Lf(ke){return new TypeError(`ByteLengthQueuingStrategy.prototype.${ke} can only be used on a ByteLengthQueuingStrategy`)}function Wf(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_byteLengthQueuingStrategyHighWaterMark")}Object.defineProperties(jf.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(jf.prototype,jl.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});const Hf=function(){return 1};class Gf{constructor(ke){pu(ke,1,"CountQueuingStrategy"),ke=Ff(ke,"First parameter"),this._countQueuingStrategyHighWaterMark=ke.highWaterMark}get highWaterMark(){if(!$f(this))throw Vf("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!$f(this))throw Vf("size");return Hf}}function Vf(ke){return new TypeError(`CountQueuingStrategy.prototype.${ke} can only be used on a CountQueuingStrategy`)}function $f(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_countQueuingStrategyHighWaterMark")}function Zf(ke,Ae,Ce){return du(ke,Ce),Ce=>Zc(ke,Ae,[Ce])}function Yf(ke,Ae,Ce){return du(ke,Ce),Ce=>$c(ke,Ae,[Ce])}function Xf(ke,Ae,Ce){return du(ke,Ce),(Ce,qe)=>Zc(ke,Ae,[Ce,qe])}Object.defineProperties(Gf.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(Gf.prototype,jl.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class Qf{constructor(ke={},Ae={},Ce={}){void 0===ke&&(ke=null);const qe=yh(Ae,"Second parameter"),ze=yh(Ce,"Third parameter"),Ve=function(ke,Ae){fu(ke,Ae);const Ce=null==ke?void 0:ke.flush,qe=null==ke?void 0:ke.readableType,ze=null==ke?void 0:ke.start,Ve=null==ke?void 0:ke.transform,tt=null==ke?void 0:ke.writableType;return{flush:void 0===Ce?void 0:Zf(Ce,ke,Ae+" has member 'flush' that"),readableType:qe,start:void 0===ze?void 0:Yf(ze,ke,Ae+" has member 'start' that"),transform:void 0===Ve?void 0:Xf(Ve,ke,Ae+" has member 'transform' that"),writableType:tt}}(ke,"First parameter");if(void 0!==Ve.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==Ve.writableType)throw new RangeError("Invalid writableType specified");const tt=lh(ze,0),rt=ph(ze),it=lh(qe,1),nt=ph(qe);let ot;!function(ke,Ae,Ce,qe,ze,Ve){function s(){return Ae}function o(Ae){return function(ke,Ae){const Ce=ke._transformStreamController;if(ke._backpressure){return Hc(ke._backpressureChangePromise,(()=>{const qe=ke._writable;if("erroring"===qe._state)throw qe._storedError;return od(Ce,Ae)}))}return od(Ce,Ae)}(ke,Ae)}function c(Ae){return function(ke,Ae){return ed(ke,Ae),Oc(void 0)}(ke,Ae)}function u(){return function(ke){const Ae=ke._readable,Ce=ke._transformStreamController,qe=Ce._flushAlgorithm();return ad(Ce),Hc(qe,(()=>{if("errored"===Ae._state)throw Ae._storedError;gf(Ae._readableStreamController)}),(Ce=>{throw ed(ke,Ce),Ae._storedError}))}(ke)}function h(){return function(ke){return rd(ke,!1),ke._backpressureChangePromise}(ke)}function f(Ae){return td(ke,Ae),Oc(void 0)}ke._writable=function(ke,Ae,Ce,qe,ze=1,Ve=(()=>1)){const tt=Object.create(kh.prototype);return Sh(tt),Wh(tt,Object.create(Lh.prototype),ke,Ae,Ce,qe,ze,Ve),tt}(s,o,u,c,Ce,qe),ke._readable=Rf(s,h,f,ze,Ve),ke._backpressure=void 0,ke._backpressureChangePromise=void 0,ke._backpressureChangePromise_resolve=void 0,rd(ke,!0),ke._transformStreamController=void 0}(this,qc((ke=>{ot=ke})),it,nt,tt,rt),function(ke,Ae){const Ce=Object.create(id.prototype);let i=ke=>{try{return sd(Ce,ke),Oc(void 0)}catch(ke){return Fc(ke)}},n=()=>Oc(void 0);void 0!==Ae.transform&&(i=ke=>Ae.transform(ke,Ce));void 0!==Ae.flush&&(n=()=>Ae.flush(Ce));!function(ke,Ae,Ce,qe){Ae._controlledTransformStream=ke,ke._transformStreamController=Ae,Ae._transformAlgorithm=Ce,Ae._flushAlgorithm=qe}(ke,Ce,i,n)}(this,Ve),void 0!==Ve.start?ot(Ve.start(this._transformStreamController)):ot(void 0)}get readable(){if(!Jf(this))throw ud("readable");return this._readable}get writable(){if(!Jf(this))throw ud("writable");return this._writable}}function Jf(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_transformStreamController")}function ed(ke,Ae){vf(ke._readable._readableStreamController,Ae),td(ke,Ae)}function td(ke,Ae){ad(ke._transformStreamController),$h(ke._writable._writableStreamController,Ae),ke._backpressure&&rd(ke,!1)}function rd(ke,Ae){void 0!==ke._backpressureChangePromise&&ke._backpressureChangePromise_resolve(),ke._backpressureChangePromise=qc((Ae=>{ke._backpressureChangePromise_resolve=Ae})),ke._backpressure=Ae}Object.defineProperties(Qf.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(Qf.prototype,jl.toStringTag,{value:"TransformStream",configurable:!0});class id{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!nd(this))throw cd("desiredSize");return _f(this._controlledTransformStream._readable._readableStreamController)}enqueue(ke){if(!nd(this))throw cd("enqueue");sd(this,ke)}error(ke){if(!nd(this))throw cd("error");var Ae;Ae=ke,ed(this._controlledTransformStream,Ae)}terminate(){if(!nd(this))throw cd("terminate");!function(ke){const Ae=ke._controlledTransformStream;gf(Ae._readable._readableStreamController);td(Ae,new TypeError("TransformStream terminated"))}(this)}}function nd(ke){return!!Rc(ke)&&!!Object.prototype.hasOwnProperty.call(ke,"_controlledTransformStream")}function ad(ke){ke._transformAlgorithm=void 0,ke._flushAlgorithm=void 0}function sd(ke,Ae){const Ce=ke._controlledTransformStream,qe=Ce._readable._readableStreamController;if(!kf(qe))throw new TypeError("Readable side is not in a state that permits enqueue");try{wf(qe,Ae)}catch(ke){throw td(Ce,ke),Ce._readable._storedError}(function(ke){return!bf(ke)})(qe)!==Ce._backpressure&&rd(Ce,!0)}function od(ke,Ae){return Hc(ke._transformAlgorithm(Ae),void 0,(Ae=>{throw ed(ke._controlledTransformStream,Ae),Ae}))}function cd(ke){return new TypeError(`TransformStreamDefaultController.prototype.${ke} can only be used on a TransformStreamDefaultController`)}function ud(ke){return new TypeError(`TransformStream.prototype.${ke} can only be used on a TransformStream`)}Object.defineProperties(id.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof jl.toStringTag&&Object.defineProperty(id.prototype,jl.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var Ud=Object.freeze({__proto__:null,ByteLengthQueuingStrategy:jf,CountQueuingStrategy:Gf,ReadableByteStreamController:Nu,ReadableStream:Df,ReadableStreamBYOBReader:hh,ReadableStreamBYOBRequest:Fu,ReadableStreamDefaultController:lf,ReadableStreamDefaultReader:Eu,TransformStream:Qf,TransformStreamDefaultController:id,WritableStream:kh,WritableStreamDefaultController:Lh,WritableStreamDefaultWriter:Bh}),fd=function(ke,Ae){return(fd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ke,Ae){ke.__proto__=Ae}||function(ke,Ae){for(var Ce in Ae)Object.prototype.hasOwnProperty.call(Ae,Ce)&&(ke[Ce]=Ae[Ce])})(ke,Ae)}; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function dd(ke,Ae){if("function"!=typeof Ae&&null!==Ae)throw new TypeError("Class extends value "+Ae+" is not a constructor or null");function r(){this.constructor=ke}fd(ke,Ae),ke.prototype=null===Ae?Object.create(Ae):(r.prototype=Ae.prototype,new r)}function ld(ke){if(!ke)throw new TypeError("Assertion failed")}function pd(){}function yd(ke){return"object"==typeof ke&&null!==ke||"function"==typeof ke}function bd(ke){if("function"!=typeof ke)return!1;var Ae=!1;try{new ke({start:function(){Ae=!0}})}catch(ke){}return Ae}function md(ke){return!!yd(ke)&&"function"==typeof ke.getReader}function gd(ke){return!!yd(ke)&&"function"==typeof ke.getWriter}function wd(ke){return!!yd(ke)&&(!!md(ke.readable)&&!!gd(ke.writable))}function vd(ke){try{return ke.getReader({mode:"byob"}).releaseLock(),!0}catch(ke){return!1}}function _d(ke,Ae){var Ce=(void 0===Ae?{}:Ae).type;return ld(md(ke)),ld(!1===ke.locked),"bytes"===(Ce=kd(Ce))?new qd(ke):new Nd(ke)}function kd(ke){var Ae=ke+"";if("bytes"===Ae)return Ae;if(void 0===ke)return ke;throw new RangeError("Invalid type is specified")}var Kd=function(){function e(ke){this._underlyingReader=void 0,this._readerMode=void 0,this._readableStreamController=void 0,this._pendingRead=void 0,this._underlyingStream=ke,this._attachDefaultReader()}return e.prototype.start=function(ke){this._readableStreamController=ke},e.prototype.cancel=function(ke){return ld(void 0!==this._underlyingReader),this._underlyingReader.cancel(ke)},e.prototype._attachDefaultReader=function(){if("default"!==this._readerMode){this._detachReader();var ke=this._underlyingStream.getReader();this._readerMode="default",this._attachReader(ke)}},e.prototype._attachReader=function(ke){var Ae=this;ld(void 0===this._underlyingReader),this._underlyingReader=ke;var Ce=this._underlyingReader.closed;Ce&&Ce.then((function(){return Ae._finishPendingRead()})).then((function(){ke===Ae._underlyingReader&&Ae._readableStreamController.close()}),(function(Ce){ke===Ae._underlyingReader&&Ae._readableStreamController.error(Ce)})).catch(pd)},e.prototype._detachReader=function(){void 0!==this._underlyingReader&&(this._underlyingReader.releaseLock(),this._underlyingReader=void 0,this._readerMode=void 0)},e.prototype._pullWithDefaultReader=function(){var ke=this;this._attachDefaultReader();var Ae=this._underlyingReader.read().then((function(Ae){var Ce=ke._readableStreamController;Ae.done?ke._tryClose():Ce.enqueue(Ae.value)}));return this._setPendingRead(Ae),Ae},e.prototype._tryClose=function(){try{this._readableStreamController.close()}catch(ke){}},e.prototype._setPendingRead=function(ke){var Ae,Ce=this,i=function(){Ce._pendingRead===Ae&&(Ce._pendingRead=void 0)};this._pendingRead=Ae=ke.then(i,i)},e.prototype._finishPendingRead=function(){var ke=this;if(this._pendingRead){var t=function(){return ke._finishPendingRead()};return this._pendingRead.then(t,t)}},e}(),Nd=function(ke){function t(){return null!==ke&&ke.apply(this,arguments)||this}return dd(t,ke),t.prototype.pull=function(){return this._pullWithDefaultReader()},t}(Kd);function Ed(ke){return new Uint8Array(ke.buffer,ke.byteOffset,ke.byteLength)}var qd=function(ke){function t(Ae){var Ce=this,qe=vd(Ae);return(Ce=ke.call(this,Ae)||this)._supportsByob=qe,Ce}return dd(t,ke),Object.defineProperty(t.prototype,"type",{get:function(){return"bytes"},enumerable:!1,configurable:!0}),t.prototype._attachByobReader=function(){if("byob"!==this._readerMode){ld(this._supportsByob),this._detachReader();var ke=this._underlyingStream.getReader({mode:"byob"});this._readerMode="byob",this._attachReader(ke)}},t.prototype.pull=function(){if(this._supportsByob){var ke=this._readableStreamController.byobRequest;if(ke)return this._pullWithByobRequest(ke)}return this._pullWithDefaultReader()},t.prototype._pullWithByobRequest=function(ke){var Ae=this;this._attachByobReader();var Ce=new Uint8Array(ke.view.byteLength),qe=this._underlyingReader.read(Ce).then((function(Ce){var qe,ze,Ve;Ae._readableStreamController,Ce.done?(Ae._tryClose(),ke.respond(0)):(qe=Ce.value,ze=ke.view,Ve=Ed(qe),Ed(ze).set(Ve,0),ke.respond(Ce.value.byteLength))}));return this._setPendingRead(qe),qe},t}(Kd);function xd(ke){ld(gd(ke)),ld(!1===ke.locked);var Ae=ke.getWriter();return new jd(Ae)}var jd=function(){function e(ke){var Ae=this;this._writableStreamController=void 0,this._pendingWrite=void 0,this._state="writable",this._storedError=void 0,this._underlyingWriter=ke,this._errorPromise=new Promise((function(ke,Ce){Ae._errorPromiseReject=Ce})),this._errorPromise.catch(pd)}return e.prototype.start=function(ke){var Ae=this;this._writableStreamController=ke,this._underlyingWriter.closed.then((function(){Ae._state="closed"})).catch((function(ke){return Ae._finishErroring(ke)}))},e.prototype.write=function(ke){var Ae=this,Ce=this._underlyingWriter;if(null===Ce.desiredSize)return Ce.ready;var qe=Ce.write(ke);qe.catch((function(ke){return Ae._finishErroring(ke)})),Ce.ready.catch((function(ke){return Ae._startErroring(ke)}));var ze=Promise.race([qe,this._errorPromise]);return this._setPendingWrite(ze),ze},e.prototype.close=function(){var ke=this;return void 0===this._pendingWrite?this._underlyingWriter.close():this._finishPendingWrite().then((function(){return ke.close()}))},e.prototype.abort=function(ke){if("errored"!==this._state)return this._underlyingWriter.abort(ke)},e.prototype._setPendingWrite=function(ke){var Ae,Ce=this,i=function(){Ce._pendingWrite===Ae&&(Ce._pendingWrite=void 0)};this._pendingWrite=Ae=ke.then(i,i)},e.prototype._finishPendingWrite=function(){var ke=this;if(void 0===this._pendingWrite)return Promise.resolve();var t=function(){return ke._finishPendingWrite()};return this._pendingWrite.then(t,t)},e.prototype._startErroring=function(ke){var Ae=this;if("writable"===this._state){this._state="erroring",this._storedError=ke;var r=function(){return Ae._finishErroring(ke)};void 0===this._pendingWrite?r():this._finishPendingWrite().then(r,r),this._writableStreamController.error(ke)}},e.prototype._finishErroring=function(ke){"writable"===this._state&&this._startErroring(ke),"erroring"===this._state&&(this._state="errored",this._errorPromiseReject(this._storedError))},e}();function Cd(ke){ld(wd(ke));var Ae=ke.readable,Ce=ke.writable;ld(!1===Ae.locked),ld(!1===Ce.locked);var qe,ze=Ae.getReader();try{qe=Ce.getWriter()}catch(ke){throw ze.releaseLock(),ke}return new zd(ze,qe)}var zd=function(){function e(ke,Ae){var Ce=this;this._transformStreamController=void 0,this._onRead=function(ke){if(!ke.done)return Ce._transformStreamController.enqueue(ke.value),Ce._reader.read().then(Ce._onRead)},this._onError=function(ke){Ce._flushReject(ke),Ce._transformStreamController.error(ke),Ce._reader.cancel(ke).catch(pd),Ce._writer.abort(ke).catch(pd)},this._onTerminate=function(){Ce._flushResolve(),Ce._transformStreamController.terminate();var ke=new TypeError("TransformStream terminated");Ce._writer.abort(ke).catch(pd)},this._reader=ke,this._writer=Ae,this._flushPromise=new Promise((function(ke,Ae){Ce._flushResolve=ke,Ce._flushReject=Ae}))}return e.prototype.start=function(ke){this._transformStreamController=ke,this._reader.read().then(this._onRead).then(this._onTerminate,this._onError);var Ae=this._reader.closed;Ae&&Ae.then(this._onTerminate,this._onError)},e.prototype.transform=function(ke){return this._writer.write(ke)},e.prototype.flush=function(){var ke=this;return this._writer.close().then((function(){return ke._flushPromise}))},e}(),Ld=Object.freeze({__proto__:null,createReadableStreamWrapper:function(ke){ld(function(ke){return!!bd(ke)&&!!md(new ke)}(ke));var Ae=function(ke){try{return new ke({type:"bytes"}),!0}catch(ke){return!1}}(ke);return function(Ce,qe){var ze=(void 0===qe?{}:qe).type;if("bytes"!==(ze=kd(ze))||Ae||(ze=void 0),Ce.constructor===ke&&("bytes"!==ze||vd(Ce)))return Ce;if("bytes"===ze){var Ve=_d(Ce,{type:ze});return new ke(Ve)}Ve=_d(Ce);return new ke(Ve)}},createTransformStreamWrapper:function(ke){return ld(function(ke){return!!bd(ke)&&!!wd(new ke)}(ke)),function(Ae){if(Ae.constructor===ke)return Ae;var Ce=Cd(Ae);return new ke(Ce)}},createWrappingReadableSource:_d,createWrappingTransformer:Cd,createWrappingWritableSink:xd,createWritableStreamWrapper:function(ke){return ld(function(ke){return!!bd(ke)&&!!gd(new ke)}(ke)),function(Ae){if(Ae.constructor===ke)return Ae;var Ce=xd(Ae);return new ke(Ce)}}}),Hd=bt((function(ke){!function(ke,Ae){function r(ke,Ae){if(!ke)throw Error(Ae||"Assertion failed")}function i(ke,Ae){ke.super_=Ae;var r=function(){};r.prototype=Ae.prototype,ke.prototype=new r,ke.prototype.constructor=ke}function n(ke,Ae,Ce){if(n.isBN(ke))return ke;this.negative=0,this.words=null,this.length=0,this.red=null,null!==ke&&("le"!==Ae&&"be"!==Ae||(Ce=Ae,Ae=10),this._init(ke||0,Ae||10,Ce||"be"))}var Ce;"object"==typeof ke?ke.exports=n:Ae.BN=n,n.BN=n,n.wordSize=26;try{Ce=ct.default.Buffer}catch(ke){}function s(ke,Ae,Ce){for(var qe=0,ze=Math.min(ke.length,Ce),Ve=Ae;Ve=49&&tt<=54?tt-49+10:tt>=17&&tt<=22?tt-17+10:15&tt}return qe}function o(ke,Ae,Ce,qe){for(var ze=0,Ve=Math.min(ke.length,Ce),tt=Ae;tt=49?rt-49+10:rt>=17?rt-17+10:rt}return ze}n.isBN=function(ke){return ke instanceof n||null!==ke&&"object"==typeof ke&&ke.constructor.wordSize===n.wordSize&&Array.isArray(ke.words)},n.max=function(ke,Ae){return ke.cmp(Ae)>0?ke:Ae},n.min=function(ke,Ae){return ke.cmp(Ae)<0?ke:Ae},n.prototype._init=function(ke,Ae,Ce){if("number"==typeof ke)return this._initNumber(ke,Ae,Ce);if("object"==typeof ke)return this._initArray(ke,Ae,Ce);"hex"===Ae&&(Ae=16),r(Ae===(0|Ae)&&Ae>=2&&Ae<=36);var qe=0;"-"===(ke=ke.toString().replace(/\s+/g,""))[0]&&qe++,16===Ae?this._parseHex(ke,qe):this._parseBase(ke,Ae,qe),"-"===ke[0]&&(this.negative=1),this.strip(),"le"===Ce&&this._initArray(this.toArray(),Ae,Ce)},n.prototype._initNumber=function(ke,Ae,Ce){ke<0&&(this.negative=1,ke=-ke),ke<67108864?(this.words=[67108863&ke],this.length=1):ke<4503599627370496?(this.words=[67108863&ke,ke/67108864&67108863],this.length=2):(r(ke<9007199254740992),this.words=[67108863&ke,ke/67108864&67108863,1],this.length=3),"le"===Ce&&this._initArray(this.toArray(),Ae,Ce)},n.prototype._initArray=function(ke,Ae,Ce){if(r("number"==typeof ke.length),ke.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(ke.length/3),this.words=Array(this.length);for(var qe=0;qe=0;qe-=3)Ve=ke[qe]|ke[qe-1]<<8|ke[qe-2]<<16,this.words[ze]|=Ve<>>26-tt&67108863,(tt+=24)>=26&&(tt-=26,ze++);else if("le"===Ce)for(qe=0,ze=0;qe>>26-tt&67108863,(tt+=24)>=26&&(tt-=26,ze++);return this.strip()},n.prototype._parseHex=function(ke,Ae){this.length=Math.ceil((ke.length-Ae)/6),this.words=Array(this.length);for(var Ce=0;Ce=Ae;Ce-=6)ze=s(ke,Ce,Ce+6),this.words[qe]|=ze<>>26-Ve&4194303,(Ve+=24)>=26&&(Ve-=26,qe++);Ce+6!==Ae&&(ze=s(ke,Ae,Ce+6),this.words[qe]|=ze<>>26-Ve&4194303),this.strip()},n.prototype._parseBase=function(ke,Ae,Ce){this.words=[0],this.length=1;for(var qe=0,ze=1;ze<=67108863;ze*=Ae)qe++;qe--,ze=ze/Ae|0;for(var Ve=ke.length-Ce,tt=Ve%qe,rt=Math.min(Ve,Ve-tt)+Ce,it=0,nt=Ce;nt1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var qe=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],ze=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],Ve=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(ke,Ae,Ce){Ce.negative=Ae.negative^ke.negative;var qe=ke.length+Ae.length|0;Ce.length=qe,qe=qe-1|0;var ze=0|ke.words[0],Ve=0|Ae.words[0],tt=ze*Ve,rt=67108863&tt,it=tt/67108864|0;Ce.words[0]=rt;for(var nt=1;nt>>26,ct=67108863&it,ht=Math.min(nt,Ae.length-1),ft=Math.max(0,nt-ke.length+1);ft<=ht;ft++){var yt=nt-ft|0;ot+=(tt=(ze=0|ke.words[yt])*(Ve=0|Ae.words[ft])+ct)/67108864|0,ct=67108863&tt}Ce.words[nt]=0|ct,it=0|ot}return 0!==it?Ce.words[nt]=0|it:Ce.length--,Ce.strip()}n.prototype.toString=function(ke,Ae){var Ce;if(Ae=0|Ae||1,16===(ke=ke||10)||"hex"===ke){Ce="";for(var tt=0,rt=0,it=0;it>>24-tt&16777215)||it!==this.length-1?qe[6-ot.length]+ot+Ce:ot+Ce,(tt+=2)>=26&&(tt-=26,it--)}for(0!==rt&&(Ce=rt.toString(16)+Ce);Ce.length%Ae!=0;)Ce="0"+Ce;return 0!==this.negative&&(Ce="-"+Ce),Ce}if(ke===(0|ke)&&ke>=2&&ke<=36){var ct=ze[ke],ht=Ve[ke];Ce="";var ft=this.clone();for(ft.negative=0;!ft.isZero();){var yt=ft.modn(ht).toString(ke);Ce=(ft=ft.idivn(ht)).isZero()?yt+Ce:qe[ct-yt.length]+yt+Ce}for(this.isZero()&&(Ce="0"+Ce);Ce.length%Ae!=0;)Ce="0"+Ce;return 0!==this.negative&&(Ce="-"+Ce),Ce}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var ke=this.words[0];return 2===this.length?ke+=67108864*this.words[1]:3===this.length&&1===this.words[2]?ke+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-ke:ke},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(ke,Ae){return r(void 0!==Ce),this.toArrayLike(Ce,ke,Ae)},n.prototype.toArray=function(ke,Ae){return this.toArrayLike(Array,ke,Ae)},n.prototype.toArrayLike=function(ke,Ae,Ce){var qe=this.byteLength(),ze=Ce||Math.max(1,qe);r(qe<=ze,"byte array longer than desired length"),r(ze>0,"Requested array length <= 0"),this.strip();var Ve,tt,rt="le"===Ae,it=new ke(ze),nt=this.clone();if(rt){for(tt=0;!nt.isZero();tt++)Ve=nt.andln(255),nt.iushrn(8),it[tt]=Ve;for(;tt=4096&&(Ce+=13,Ae>>>=13),Ae>=64&&(Ce+=7,Ae>>>=7),Ae>=8&&(Ce+=4,Ae>>>=4),Ae>=2&&(Ce+=2,Ae>>>=2),Ce+Ae},n.prototype._zeroBits=function(ke){if(0===ke)return 26;var Ae=ke,Ce=0;return 0==(8191&Ae)&&(Ce+=13,Ae>>>=13),0==(127&Ae)&&(Ce+=7,Ae>>>=7),0==(15&Ae)&&(Ce+=4,Ae>>>=4),0==(3&Ae)&&(Ce+=2,Ae>>>=2),0==(1&Ae)&&Ce++,Ce},n.prototype.bitLength=function(){var ke=this.words[this.length-1],Ae=this._countBits(ke);return 26*(this.length-1)+Ae},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ke=0,Ae=0;Aeke.length?this.clone().ior(ke):ke.clone().ior(this)},n.prototype.uor=function(ke){return this.length>ke.length?this.clone().iuor(ke):ke.clone().iuor(this)},n.prototype.iuand=function(ke){var Ae;Ae=this.length>ke.length?ke:this;for(var Ce=0;Ceke.length?this.clone().iand(ke):ke.clone().iand(this)},n.prototype.uand=function(ke){return this.length>ke.length?this.clone().iuand(ke):ke.clone().iuand(this)},n.prototype.iuxor=function(ke){var Ae,Ce;this.length>ke.length?(Ae=this,Ce=ke):(Ae=ke,Ce=this);for(var qe=0;qeke.length?this.clone().ixor(ke):ke.clone().ixor(this)},n.prototype.uxor=function(ke){return this.length>ke.length?this.clone().iuxor(ke):ke.clone().iuxor(this)},n.prototype.inotn=function(ke){r("number"==typeof ke&&ke>=0);var Ae=0|Math.ceil(ke/26),Ce=ke%26;this._expand(Ae),Ce>0&&Ae--;for(var qe=0;qe0&&(this.words[qe]=~this.words[qe]&67108863>>26-Ce),this.strip()},n.prototype.notn=function(ke){return this.clone().inotn(ke)},n.prototype.setn=function(ke,Ae){r("number"==typeof ke&&ke>=0);var Ce=ke/26|0,qe=ke%26;return this._expand(Ce+1),this.words[Ce]=Ae?this.words[Ce]|1<ke.length?(Ce=this,qe=ke):(Ce=ke,qe=this);for(var ze=0,Ve=0;Ve>>26;for(;0!==ze&&Ve>>26;if(this.length=Ce.length,0!==ze)this.words[this.length]=ze,this.length++;else if(Ce!==this)for(;Veke.length?this.clone().iadd(ke):ke.clone().iadd(this)},n.prototype.isub=function(ke){if(0!==ke.negative){ke.negative=0;var Ae=this.iadd(ke);return ke.negative=1,Ae._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(ke),this.negative=1,this._normSign();var Ce,qe,ze=this.cmp(ke);if(0===ze)return this.negative=0,this.length=1,this.words[0]=0,this;ze>0?(Ce=this,qe=ke):(Ce=ke,qe=this);for(var Ve=0,tt=0;tt>26,this.words[tt]=67108863&Ae;for(;0!==Ve&&tt>26,this.words[tt]=67108863&Ae;if(0===Ve&&tt>>13,ft=0|tt[1],yt=8191&ft,mt=ft>>>13,kt=0|tt[2],St=8191&kt,Et=kt>>>13,Pt=0|tt[3],Dt=8191&Pt,Rt=Pt>>>13,Bt=0|tt[4],Tt=8191&Bt,Ut=Bt>>>13,Kt=0|tt[5],It=8191&Kt,Ot=Kt>>>13,Nt=0|tt[6],qt=8191&Nt,zt=Nt>>>13,Ft=0|tt[7],Lt=8191&Ft,Ht=Ft>>>13,Gt=0|tt[8],$t=8191&Gt,Vt=Gt>>>13,Zt=0|tt[9],Yt=8191&Zt,Jt=Zt>>>13,Xt=0|rt[0],Qt=8191&Xt,er=Xt>>>13,tr=0|rt[1],rr=8191&tr,ir=tr>>>13,nr=0|rt[2],sr=8191&nr,vr=nr>>>13,_r=0|rt[3],kr=8191&_r,Ar=_r>>>13,Sr=0|rt[4],Er=8191&Sr,xr=Sr>>>13,Dr=0|rt[5],Rr=8191&Dr,Br=Dr>>>13,Ur=0|rt[6],Ir=8191&Ur,Lr=Ur>>>13,Gr=0|rt[7],$r=8191&Gr,Vr=Gr>>>13,Jr=0|rt[8],Qr=8191&Jr,ti=Jr>>>13,ri=0|rt[9],si=8191&ri,ai=ri>>>13;Ce.negative=ke.negative^Ae.negative,Ce.length=19;var ui=(nt+(qe=Math.imul(ct,Qt))|0)+((8191&(ze=(ze=Math.imul(ct,er))+Math.imul(ht,Qt)|0))<<13)|0;nt=((Ve=Math.imul(ht,er))+(ze>>>13)|0)+(ui>>>26)|0,ui&=67108863,qe=Math.imul(yt,Qt),ze=(ze=Math.imul(yt,er))+Math.imul(mt,Qt)|0,Ve=Math.imul(mt,er);var hi=(nt+(qe=qe+Math.imul(ct,rr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,ir)|0)+Math.imul(ht,rr)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,ir)|0)+(ze>>>13)|0)+(hi>>>26)|0,hi&=67108863,qe=Math.imul(St,Qt),ze=(ze=Math.imul(St,er))+Math.imul(Et,Qt)|0,Ve=Math.imul(Et,er),qe=qe+Math.imul(yt,rr)|0,ze=(ze=ze+Math.imul(yt,ir)|0)+Math.imul(mt,rr)|0,Ve=Ve+Math.imul(mt,ir)|0;var pi=(nt+(qe=qe+Math.imul(ct,sr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,vr)|0)+Math.imul(ht,sr)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,vr)|0)+(ze>>>13)|0)+(pi>>>26)|0,pi&=67108863,qe=Math.imul(Dt,Qt),ze=(ze=Math.imul(Dt,er))+Math.imul(Rt,Qt)|0,Ve=Math.imul(Rt,er),qe=qe+Math.imul(St,rr)|0,ze=(ze=ze+Math.imul(St,ir)|0)+Math.imul(Et,rr)|0,Ve=Ve+Math.imul(Et,ir)|0,qe=qe+Math.imul(yt,sr)|0,ze=(ze=ze+Math.imul(yt,vr)|0)+Math.imul(mt,sr)|0,Ve=Ve+Math.imul(mt,vr)|0;var yi=(nt+(qe=qe+Math.imul(ct,kr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,Ar)|0)+Math.imul(ht,kr)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,Ar)|0)+(ze>>>13)|0)+(yi>>>26)|0,yi&=67108863,qe=Math.imul(Tt,Qt),ze=(ze=Math.imul(Tt,er))+Math.imul(Ut,Qt)|0,Ve=Math.imul(Ut,er),qe=qe+Math.imul(Dt,rr)|0,ze=(ze=ze+Math.imul(Dt,ir)|0)+Math.imul(Rt,rr)|0,Ve=Ve+Math.imul(Rt,ir)|0,qe=qe+Math.imul(St,sr)|0,ze=(ze=ze+Math.imul(St,vr)|0)+Math.imul(Et,sr)|0,Ve=Ve+Math.imul(Et,vr)|0,qe=qe+Math.imul(yt,kr)|0,ze=(ze=ze+Math.imul(yt,Ar)|0)+Math.imul(mt,kr)|0,Ve=Ve+Math.imul(mt,Ar)|0;var mi=(nt+(qe=qe+Math.imul(ct,Er)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,xr)|0)+Math.imul(ht,Er)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,xr)|0)+(ze>>>13)|0)+(mi>>>26)|0,mi&=67108863,qe=Math.imul(It,Qt),ze=(ze=Math.imul(It,er))+Math.imul(Ot,Qt)|0,Ve=Math.imul(Ot,er),qe=qe+Math.imul(Tt,rr)|0,ze=(ze=ze+Math.imul(Tt,ir)|0)+Math.imul(Ut,rr)|0,Ve=Ve+Math.imul(Ut,ir)|0,qe=qe+Math.imul(Dt,sr)|0,ze=(ze=ze+Math.imul(Dt,vr)|0)+Math.imul(Rt,sr)|0,Ve=Ve+Math.imul(Rt,vr)|0,qe=qe+Math.imul(St,kr)|0,ze=(ze=ze+Math.imul(St,Ar)|0)+Math.imul(Et,kr)|0,Ve=Ve+Math.imul(Et,Ar)|0,qe=qe+Math.imul(yt,Er)|0,ze=(ze=ze+Math.imul(yt,xr)|0)+Math.imul(mt,Er)|0,Ve=Ve+Math.imul(mt,xr)|0;var gi=(nt+(qe=qe+Math.imul(ct,Rr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,Br)|0)+Math.imul(ht,Rr)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,Br)|0)+(ze>>>13)|0)+(gi>>>26)|0,gi&=67108863,qe=Math.imul(qt,Qt),ze=(ze=Math.imul(qt,er))+Math.imul(zt,Qt)|0,Ve=Math.imul(zt,er),qe=qe+Math.imul(It,rr)|0,ze=(ze=ze+Math.imul(It,ir)|0)+Math.imul(Ot,rr)|0,Ve=Ve+Math.imul(Ot,ir)|0,qe=qe+Math.imul(Tt,sr)|0,ze=(ze=ze+Math.imul(Tt,vr)|0)+Math.imul(Ut,sr)|0,Ve=Ve+Math.imul(Ut,vr)|0,qe=qe+Math.imul(Dt,kr)|0,ze=(ze=ze+Math.imul(Dt,Ar)|0)+Math.imul(Rt,kr)|0,Ve=Ve+Math.imul(Rt,Ar)|0,qe=qe+Math.imul(St,Er)|0,ze=(ze=ze+Math.imul(St,xr)|0)+Math.imul(Et,Er)|0,Ve=Ve+Math.imul(Et,xr)|0,qe=qe+Math.imul(yt,Rr)|0,ze=(ze=ze+Math.imul(yt,Br)|0)+Math.imul(mt,Rr)|0,Ve=Ve+Math.imul(mt,Br)|0;var bi=(nt+(qe=qe+Math.imul(ct,Ir)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,Lr)|0)+Math.imul(ht,Ir)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,Lr)|0)+(ze>>>13)|0)+(bi>>>26)|0,bi&=67108863,qe=Math.imul(Lt,Qt),ze=(ze=Math.imul(Lt,er))+Math.imul(Ht,Qt)|0,Ve=Math.imul(Ht,er),qe=qe+Math.imul(qt,rr)|0,ze=(ze=ze+Math.imul(qt,ir)|0)+Math.imul(zt,rr)|0,Ve=Ve+Math.imul(zt,ir)|0,qe=qe+Math.imul(It,sr)|0,ze=(ze=ze+Math.imul(It,vr)|0)+Math.imul(Ot,sr)|0,Ve=Ve+Math.imul(Ot,vr)|0,qe=qe+Math.imul(Tt,kr)|0,ze=(ze=ze+Math.imul(Tt,Ar)|0)+Math.imul(Ut,kr)|0,Ve=Ve+Math.imul(Ut,Ar)|0,qe=qe+Math.imul(Dt,Er)|0,ze=(ze=ze+Math.imul(Dt,xr)|0)+Math.imul(Rt,Er)|0,Ve=Ve+Math.imul(Rt,xr)|0,qe=qe+Math.imul(St,Rr)|0,ze=(ze=ze+Math.imul(St,Br)|0)+Math.imul(Et,Rr)|0,Ve=Ve+Math.imul(Et,Br)|0,qe=qe+Math.imul(yt,Ir)|0,ze=(ze=ze+Math.imul(yt,Lr)|0)+Math.imul(mt,Ir)|0,Ve=Ve+Math.imul(mt,Lr)|0;var vi=(nt+(qe=qe+Math.imul(ct,$r)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,Vr)|0)+Math.imul(ht,$r)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,Vr)|0)+(ze>>>13)|0)+(vi>>>26)|0,vi&=67108863,qe=Math.imul($t,Qt),ze=(ze=Math.imul($t,er))+Math.imul(Vt,Qt)|0,Ve=Math.imul(Vt,er),qe=qe+Math.imul(Lt,rr)|0,ze=(ze=ze+Math.imul(Lt,ir)|0)+Math.imul(Ht,rr)|0,Ve=Ve+Math.imul(Ht,ir)|0,qe=qe+Math.imul(qt,sr)|0,ze=(ze=ze+Math.imul(qt,vr)|0)+Math.imul(zt,sr)|0,Ve=Ve+Math.imul(zt,vr)|0,qe=qe+Math.imul(It,kr)|0,ze=(ze=ze+Math.imul(It,Ar)|0)+Math.imul(Ot,kr)|0,Ve=Ve+Math.imul(Ot,Ar)|0,qe=qe+Math.imul(Tt,Er)|0,ze=(ze=ze+Math.imul(Tt,xr)|0)+Math.imul(Ut,Er)|0,Ve=Ve+Math.imul(Ut,xr)|0,qe=qe+Math.imul(Dt,Rr)|0,ze=(ze=ze+Math.imul(Dt,Br)|0)+Math.imul(Rt,Rr)|0,Ve=Ve+Math.imul(Rt,Br)|0,qe=qe+Math.imul(St,Ir)|0,ze=(ze=ze+Math.imul(St,Lr)|0)+Math.imul(Et,Ir)|0,Ve=Ve+Math.imul(Et,Lr)|0,qe=qe+Math.imul(yt,$r)|0,ze=(ze=ze+Math.imul(yt,Vr)|0)+Math.imul(mt,$r)|0,Ve=Ve+Math.imul(mt,Vr)|0;var wi=(nt+(qe=qe+Math.imul(ct,Qr)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,ti)|0)+Math.imul(ht,Qr)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,ti)|0)+(ze>>>13)|0)+(wi>>>26)|0,wi&=67108863,qe=Math.imul(Yt,Qt),ze=(ze=Math.imul(Yt,er))+Math.imul(Jt,Qt)|0,Ve=Math.imul(Jt,er),qe=qe+Math.imul($t,rr)|0,ze=(ze=ze+Math.imul($t,ir)|0)+Math.imul(Vt,rr)|0,Ve=Ve+Math.imul(Vt,ir)|0,qe=qe+Math.imul(Lt,sr)|0,ze=(ze=ze+Math.imul(Lt,vr)|0)+Math.imul(Ht,sr)|0,Ve=Ve+Math.imul(Ht,vr)|0,qe=qe+Math.imul(qt,kr)|0,ze=(ze=ze+Math.imul(qt,Ar)|0)+Math.imul(zt,kr)|0,Ve=Ve+Math.imul(zt,Ar)|0,qe=qe+Math.imul(It,Er)|0,ze=(ze=ze+Math.imul(It,xr)|0)+Math.imul(Ot,Er)|0,Ve=Ve+Math.imul(Ot,xr)|0,qe=qe+Math.imul(Tt,Rr)|0,ze=(ze=ze+Math.imul(Tt,Br)|0)+Math.imul(Ut,Rr)|0,Ve=Ve+Math.imul(Ut,Br)|0,qe=qe+Math.imul(Dt,Ir)|0,ze=(ze=ze+Math.imul(Dt,Lr)|0)+Math.imul(Rt,Ir)|0,Ve=Ve+Math.imul(Rt,Lr)|0,qe=qe+Math.imul(St,$r)|0,ze=(ze=ze+Math.imul(St,Vr)|0)+Math.imul(Et,$r)|0,Ve=Ve+Math.imul(Et,Vr)|0,qe=qe+Math.imul(yt,Qr)|0,ze=(ze=ze+Math.imul(yt,ti)|0)+Math.imul(mt,Qr)|0,Ve=Ve+Math.imul(mt,ti)|0;var _i=(nt+(qe=qe+Math.imul(ct,si)|0)|0)+((8191&(ze=(ze=ze+Math.imul(ct,ai)|0)+Math.imul(ht,si)|0))<<13)|0;nt=((Ve=Ve+Math.imul(ht,ai)|0)+(ze>>>13)|0)+(_i>>>26)|0,_i&=67108863,qe=Math.imul(Yt,rr),ze=(ze=Math.imul(Yt,ir))+Math.imul(Jt,rr)|0,Ve=Math.imul(Jt,ir),qe=qe+Math.imul($t,sr)|0,ze=(ze=ze+Math.imul($t,vr)|0)+Math.imul(Vt,sr)|0,Ve=Ve+Math.imul(Vt,vr)|0,qe=qe+Math.imul(Lt,kr)|0,ze=(ze=ze+Math.imul(Lt,Ar)|0)+Math.imul(Ht,kr)|0,Ve=Ve+Math.imul(Ht,Ar)|0,qe=qe+Math.imul(qt,Er)|0,ze=(ze=ze+Math.imul(qt,xr)|0)+Math.imul(zt,Er)|0,Ve=Ve+Math.imul(zt,xr)|0,qe=qe+Math.imul(It,Rr)|0,ze=(ze=ze+Math.imul(It,Br)|0)+Math.imul(Ot,Rr)|0,Ve=Ve+Math.imul(Ot,Br)|0,qe=qe+Math.imul(Tt,Ir)|0,ze=(ze=ze+Math.imul(Tt,Lr)|0)+Math.imul(Ut,Ir)|0,Ve=Ve+Math.imul(Ut,Lr)|0,qe=qe+Math.imul(Dt,$r)|0,ze=(ze=ze+Math.imul(Dt,Vr)|0)+Math.imul(Rt,$r)|0,Ve=Ve+Math.imul(Rt,Vr)|0,qe=qe+Math.imul(St,Qr)|0,ze=(ze=ze+Math.imul(St,ti)|0)+Math.imul(Et,Qr)|0,Ve=Ve+Math.imul(Et,ti)|0;var Bi=(nt+(qe=qe+Math.imul(yt,si)|0)|0)+((8191&(ze=(ze=ze+Math.imul(yt,ai)|0)+Math.imul(mt,si)|0))<<13)|0;nt=((Ve=Ve+Math.imul(mt,ai)|0)+(ze>>>13)|0)+(Bi>>>26)|0,Bi&=67108863,qe=Math.imul(Yt,sr),ze=(ze=Math.imul(Yt,vr))+Math.imul(Jt,sr)|0,Ve=Math.imul(Jt,vr),qe=qe+Math.imul($t,kr)|0,ze=(ze=ze+Math.imul($t,Ar)|0)+Math.imul(Vt,kr)|0,Ve=Ve+Math.imul(Vt,Ar)|0,qe=qe+Math.imul(Lt,Er)|0,ze=(ze=ze+Math.imul(Lt,xr)|0)+Math.imul(Ht,Er)|0,Ve=Ve+Math.imul(Ht,xr)|0,qe=qe+Math.imul(qt,Rr)|0,ze=(ze=ze+Math.imul(qt,Br)|0)+Math.imul(zt,Rr)|0,Ve=Ve+Math.imul(zt,Br)|0,qe=qe+Math.imul(It,Ir)|0,ze=(ze=ze+Math.imul(It,Lr)|0)+Math.imul(Ot,Ir)|0,Ve=Ve+Math.imul(Ot,Lr)|0,qe=qe+Math.imul(Tt,$r)|0,ze=(ze=ze+Math.imul(Tt,Vr)|0)+Math.imul(Ut,$r)|0,Ve=Ve+Math.imul(Ut,Vr)|0,qe=qe+Math.imul(Dt,Qr)|0,ze=(ze=ze+Math.imul(Dt,ti)|0)+Math.imul(Rt,Qr)|0,Ve=Ve+Math.imul(Rt,ti)|0;var Ti=(nt+(qe=qe+Math.imul(St,si)|0)|0)+((8191&(ze=(ze=ze+Math.imul(St,ai)|0)+Math.imul(Et,si)|0))<<13)|0;nt=((Ve=Ve+Math.imul(Et,ai)|0)+(ze>>>13)|0)+(Ti>>>26)|0,Ti&=67108863,qe=Math.imul(Yt,kr),ze=(ze=Math.imul(Yt,Ar))+Math.imul(Jt,kr)|0,Ve=Math.imul(Jt,Ar),qe=qe+Math.imul($t,Er)|0,ze=(ze=ze+Math.imul($t,xr)|0)+Math.imul(Vt,Er)|0,Ve=Ve+Math.imul(Vt,xr)|0,qe=qe+Math.imul(Lt,Rr)|0,ze=(ze=ze+Math.imul(Lt,Br)|0)+Math.imul(Ht,Rr)|0,Ve=Ve+Math.imul(Ht,Br)|0,qe=qe+Math.imul(qt,Ir)|0,ze=(ze=ze+Math.imul(qt,Lr)|0)+Math.imul(zt,Ir)|0,Ve=Ve+Math.imul(zt,Lr)|0,qe=qe+Math.imul(It,$r)|0,ze=(ze=ze+Math.imul(It,Vr)|0)+Math.imul(Ot,$r)|0,Ve=Ve+Math.imul(Ot,Vr)|0,qe=qe+Math.imul(Tt,Qr)|0,ze=(ze=ze+Math.imul(Tt,ti)|0)+Math.imul(Ut,Qr)|0,Ve=Ve+Math.imul(Ut,ti)|0;var Oi=(nt+(qe=qe+Math.imul(Dt,si)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Dt,ai)|0)+Math.imul(Rt,si)|0))<<13)|0;nt=((Ve=Ve+Math.imul(Rt,ai)|0)+(ze>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,qe=Math.imul(Yt,Er),ze=(ze=Math.imul(Yt,xr))+Math.imul(Jt,Er)|0,Ve=Math.imul(Jt,xr),qe=qe+Math.imul($t,Rr)|0,ze=(ze=ze+Math.imul($t,Br)|0)+Math.imul(Vt,Rr)|0,Ve=Ve+Math.imul(Vt,Br)|0,qe=qe+Math.imul(Lt,Ir)|0,ze=(ze=ze+Math.imul(Lt,Lr)|0)+Math.imul(Ht,Ir)|0,Ve=Ve+Math.imul(Ht,Lr)|0,qe=qe+Math.imul(qt,$r)|0,ze=(ze=ze+Math.imul(qt,Vr)|0)+Math.imul(zt,$r)|0,Ve=Ve+Math.imul(zt,Vr)|0,qe=qe+Math.imul(It,Qr)|0,ze=(ze=ze+Math.imul(It,ti)|0)+Math.imul(Ot,Qr)|0,Ve=Ve+Math.imul(Ot,ti)|0;var qi=(nt+(qe=qe+Math.imul(Tt,si)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Tt,ai)|0)+Math.imul(Ut,si)|0))<<13)|0;nt=((Ve=Ve+Math.imul(Ut,ai)|0)+(ze>>>13)|0)+(qi>>>26)|0,qi&=67108863,qe=Math.imul(Yt,Rr),ze=(ze=Math.imul(Yt,Br))+Math.imul(Jt,Rr)|0,Ve=Math.imul(Jt,Br),qe=qe+Math.imul($t,Ir)|0,ze=(ze=ze+Math.imul($t,Lr)|0)+Math.imul(Vt,Ir)|0,Ve=Ve+Math.imul(Vt,Lr)|0,qe=qe+Math.imul(Lt,$r)|0,ze=(ze=ze+Math.imul(Lt,Vr)|0)+Math.imul(Ht,$r)|0,Ve=Ve+Math.imul(Ht,Vr)|0,qe=qe+Math.imul(qt,Qr)|0,ze=(ze=ze+Math.imul(qt,ti)|0)+Math.imul(zt,Qr)|0,Ve=Ve+Math.imul(zt,ti)|0;var zi=(nt+(qe=qe+Math.imul(It,si)|0)|0)+((8191&(ze=(ze=ze+Math.imul(It,ai)|0)+Math.imul(Ot,si)|0))<<13)|0;nt=((Ve=Ve+Math.imul(Ot,ai)|0)+(ze>>>13)|0)+(zi>>>26)|0,zi&=67108863,qe=Math.imul(Yt,Ir),ze=(ze=Math.imul(Yt,Lr))+Math.imul(Jt,Ir)|0,Ve=Math.imul(Jt,Lr),qe=qe+Math.imul($t,$r)|0,ze=(ze=ze+Math.imul($t,Vr)|0)+Math.imul(Vt,$r)|0,Ve=Ve+Math.imul(Vt,Vr)|0,qe=qe+Math.imul(Lt,Qr)|0,ze=(ze=ze+Math.imul(Lt,ti)|0)+Math.imul(Ht,Qr)|0,Ve=Ve+Math.imul(Ht,ti)|0;var Fi=(nt+(qe=qe+Math.imul(qt,si)|0)|0)+((8191&(ze=(ze=ze+Math.imul(qt,ai)|0)+Math.imul(zt,si)|0))<<13)|0;nt=((Ve=Ve+Math.imul(zt,ai)|0)+(ze>>>13)|0)+(Fi>>>26)|0,Fi&=67108863,qe=Math.imul(Yt,$r),ze=(ze=Math.imul(Yt,Vr))+Math.imul(Jt,$r)|0,Ve=Math.imul(Jt,Vr),qe=qe+Math.imul($t,Qr)|0,ze=(ze=ze+Math.imul($t,ti)|0)+Math.imul(Vt,Qr)|0,Ve=Ve+Math.imul(Vt,ti)|0;var Gi=(nt+(qe=qe+Math.imul(Lt,si)|0)|0)+((8191&(ze=(ze=ze+Math.imul(Lt,ai)|0)+Math.imul(Ht,si)|0))<<13)|0;nt=((Ve=Ve+Math.imul(Ht,ai)|0)+(ze>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,qe=Math.imul(Yt,Qr),ze=(ze=Math.imul(Yt,ti))+Math.imul(Jt,Qr)|0,Ve=Math.imul(Jt,ti);var Vi=(nt+(qe=qe+Math.imul($t,si)|0)|0)+((8191&(ze=(ze=ze+Math.imul($t,ai)|0)+Math.imul(Vt,si)|0))<<13)|0;nt=((Ve=Ve+Math.imul(Vt,ai)|0)+(ze>>>13)|0)+(Vi>>>26)|0,Vi&=67108863;var Yi=(nt+(qe=Math.imul(Yt,si))|0)+((8191&(ze=(ze=Math.imul(Yt,ai))+Math.imul(Jt,si)|0))<<13)|0;return nt=((Ve=Math.imul(Jt,ai))+(ze>>>13)|0)+(Yi>>>26)|0,Yi&=67108863,it[0]=ui,it[1]=hi,it[2]=pi,it[3]=yi,it[4]=mi,it[5]=gi,it[6]=bi,it[7]=vi,it[8]=wi,it[9]=_i,it[10]=Bi,it[11]=Ti,it[12]=Oi,it[13]=qi,it[14]=zi,it[15]=Fi,it[16]=Gi,it[17]=Vi,it[18]=Yi,0!==nt&&(it[19]=nt,Ce.length++),Ce};function p(ke,Ae,Ce){return(new y).mulp(ke,Ae,Ce)}function y(ke,Ae){this.x=ke,this.y=Ae}Math.imul||(l=d),n.prototype.mulTo=function(ke,Ae){var Ce=this.length+ke.length;return 10===this.length&&10===ke.length?l(this,ke,Ae):Ce<63?d(this,ke,Ae):Ce<1024?function(ke,Ae,Ce){Ce.negative=Ae.negative^ke.negative,Ce.length=ke.length+Ae.length;for(var qe=0,ze=0,Ve=0;Ve>>26)|0)>>>26,tt&=67108863}Ce.words[Ve]=rt,qe=tt,tt=ze}return 0!==qe?Ce.words[Ve]=qe:Ce.length--,Ce.strip()}(this,ke,Ae):p(this,ke,Ae)},y.prototype.makeRBT=function(ke){for(var Ae=Array(ke),Ce=n.prototype._countBits(ke)-1,qe=0;qe>=1;return qe},y.prototype.permute=function(ke,Ae,Ce,qe,ze,Ve){for(var tt=0;tt>>=1)ze++;return 1<>>=13,Ce[2*Ve+1]=8191&ze,ze>>>=13;for(Ve=2*Ae;Ve>=26,Ae+=qe/67108864|0,Ae+=ze>>>26,this.words[Ce]=67108863&ze}return 0!==Ae&&(this.words[Ce]=Ae,this.length++),this},n.prototype.muln=function(ke){return this.clone().imuln(ke)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(ke){var Ae=function(ke){for(var Ae=Array(ke.bitLength()),Ce=0;Ce>>ze}return Ae}(ke);if(0===Ae.length)return new n(1);for(var Ce=this,qe=0;qe=0);var Ae,Ce=ke%26,qe=(ke-Ce)/26,ze=67108863>>>26-Ce<<26-Ce;if(0!==Ce){var Ve=0;for(Ae=0;Ae>>26-Ce}Ve&&(this.words[Ae]=Ve,this.length++)}if(0!==qe){for(Ae=this.length-1;Ae>=0;Ae--)this.words[Ae+qe]=this.words[Ae];for(Ae=0;Ae=0),qe=Ae?(Ae-Ae%26)/26:0;var ze=ke%26,Ve=Math.min((ke-ze)/26,this.length),tt=67108863^67108863>>>ze<Ve)for(this.length-=Ve,it=0;it=0&&(0!==nt||it>=qe);it--){var ot=0|this.words[it];this.words[it]=nt<<26-ze|ot>>>ze,nt=ot&tt}return rt&&0!==nt&&(rt.words[rt.length++]=nt),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(ke,Ae,Ce){return r(0===this.negative),this.iushrn(ke,Ae,Ce)},n.prototype.shln=function(ke){return this.clone().ishln(ke)},n.prototype.ushln=function(ke){return this.clone().iushln(ke)},n.prototype.shrn=function(ke){return this.clone().ishrn(ke)},n.prototype.ushrn=function(ke){return this.clone().iushrn(ke)},n.prototype.testn=function(ke){r("number"==typeof ke&&ke>=0);var Ae=ke%26,Ce=(ke-Ae)/26,qe=1<=0);var Ae=ke%26,Ce=(ke-Ae)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=Ce)return this;if(0!==Ae&&Ce++,this.length=Math.min(Ce,this.length),0!==Ae){var qe=67108863^67108863>>>Ae<=67108864;Ae++)this.words[Ae]-=67108864,Ae===this.length-1?this.words[Ae+1]=1:this.words[Ae+1]++;return this.length=Math.max(this.length,Ae+1),this},n.prototype.isubn=function(ke){if(r("number"==typeof ke),r(ke<67108864),ke<0)return this.iaddn(-ke);if(0!==this.negative)return this.negative=0,this.iaddn(ke),this.negative=1,this;if(this.words[0]-=ke,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Ae=0;Ae>26)-(rt/67108864|0),this.words[qe+Ce]=67108863&ze}for(;qe>26,this.words[qe+Ce]=67108863&ze;if(0===tt)return this.strip();for(r(-1===tt),tt=0,qe=0;qe>26,this.words[qe]=67108863&ze;return this.negative=1,this.strip()},n.prototype._wordDiv=function(ke,Ae){var Ce=(this.length,ke.length),qe=this.clone(),ze=ke,Ve=0|ze.words[ze.length-1];0!==(Ce=26-this._countBits(Ve))&&(ze=ze.ushln(Ce),qe.iushln(Ce),Ve=0|ze.words[ze.length-1]);var tt,rt=qe.length-ze.length;if("mod"!==Ae){(tt=new n(null)).length=rt+1,tt.words=Array(tt.length);for(var it=0;it=0;ot--){var ct=67108864*(0|qe.words[ze.length+ot])+(0|qe.words[ze.length+ot-1]);for(ct=Math.min(ct/Ve|0,67108863),qe._ishlnsubmul(ze,ct,ot);0!==qe.negative;)ct--,qe.negative=0,qe._ishlnsubmul(ze,1,ot),qe.isZero()||(qe.negative^=1);tt&&(tt.words[ot]=ct)}return tt&&tt.strip(),qe.strip(),"div"!==Ae&&0!==Ce&&qe.iushrn(Ce),{div:tt||null,mod:qe}},n.prototype.divmod=function(ke,Ae,Ce){return r(!ke.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===ke.negative?(Ve=this.neg().divmod(ke,Ae),"mod"!==Ae&&(qe=Ve.div.neg()),"div"!==Ae&&(ze=Ve.mod.neg(),Ce&&0!==ze.negative&&ze.iadd(ke)),{div:qe,mod:ze}):0===this.negative&&0!==ke.negative?(Ve=this.divmod(ke.neg(),Ae),"mod"!==Ae&&(qe=Ve.div.neg()),{div:qe,mod:Ve.mod}):0!=(this.negative&ke.negative)?(Ve=this.neg().divmod(ke.neg(),Ae),"div"!==Ae&&(ze=Ve.mod.neg(),Ce&&0!==ze.negative&&ze.isub(ke)),{div:Ve.div,mod:ze}):ke.length>this.length||this.cmp(ke)<0?{div:new n(0),mod:this}:1===ke.length?"div"===Ae?{div:this.divn(ke.words[0]),mod:null}:"mod"===Ae?{div:null,mod:new n(this.modn(ke.words[0]))}:{div:this.divn(ke.words[0]),mod:new n(this.modn(ke.words[0]))}:this._wordDiv(ke,Ae);var qe,ze,Ve},n.prototype.div=function(ke){return this.divmod(ke,"div",!1).div},n.prototype.mod=function(ke){return this.divmod(ke,"mod",!1).mod},n.prototype.umod=function(ke){return this.divmod(ke,"mod",!0).mod},n.prototype.divRound=function(ke){var Ae=this.divmod(ke);if(Ae.mod.isZero())return Ae.div;var Ce=0!==Ae.div.negative?Ae.mod.isub(ke):Ae.mod,qe=ke.ushrn(1),ze=ke.andln(1),Ve=Ce.cmp(qe);return Ve<0||1===ze&&0===Ve?Ae.div:0!==Ae.div.negative?Ae.div.isubn(1):Ae.div.iaddn(1)},n.prototype.modn=function(ke){r(ke<=67108863);for(var Ae=(1<<26)%ke,Ce=0,qe=this.length-1;qe>=0;qe--)Ce=(Ae*Ce+(0|this.words[qe]))%ke;return Ce},n.prototype.idivn=function(ke){r(ke<=67108863);for(var Ae=0,Ce=this.length-1;Ce>=0;Ce--){var qe=(0|this.words[Ce])+67108864*Ae;this.words[Ce]=qe/ke|0,Ae=qe%ke}return this.strip()},n.prototype.divn=function(ke){return this.clone().idivn(ke)},n.prototype.egcd=function(ke){r(0===ke.negative),r(!ke.isZero());var Ae=this,Ce=ke.clone();Ae=0!==Ae.negative?Ae.umod(ke):Ae.clone();for(var qe=new n(1),ze=new n(0),Ve=new n(0),tt=new n(1),rt=0;Ae.isEven()&&Ce.isEven();)Ae.iushrn(1),Ce.iushrn(1),++rt;for(var it=Ce.clone(),nt=Ae.clone();!Ae.isZero();){for(var ot=0,ct=1;0==(Ae.words[0]&ct)&&ot<26;++ot,ct<<=1);if(ot>0)for(Ae.iushrn(ot);ot-- >0;)(qe.isOdd()||ze.isOdd())&&(qe.iadd(it),ze.isub(nt)),qe.iushrn(1),ze.iushrn(1);for(var ht=0,ft=1;0==(Ce.words[0]&ft)&&ht<26;++ht,ft<<=1);if(ht>0)for(Ce.iushrn(ht);ht-- >0;)(Ve.isOdd()||tt.isOdd())&&(Ve.iadd(it),tt.isub(nt)),Ve.iushrn(1),tt.iushrn(1);Ae.cmp(Ce)>=0?(Ae.isub(Ce),qe.isub(Ve),ze.isub(tt)):(Ce.isub(Ae),Ve.isub(qe),tt.isub(ze))}return{a:Ve,b:tt,gcd:Ce.iushln(rt)}},n.prototype._invmp=function(ke){r(0===ke.negative),r(!ke.isZero());var Ae=this,Ce=ke.clone();Ae=0!==Ae.negative?Ae.umod(ke):Ae.clone();for(var qe,ze=new n(1),Ve=new n(0),tt=Ce.clone();Ae.cmpn(1)>0&&Ce.cmpn(1)>0;){for(var rt=0,it=1;0==(Ae.words[0]&it)&&rt<26;++rt,it<<=1);if(rt>0)for(Ae.iushrn(rt);rt-- >0;)ze.isOdd()&&ze.iadd(tt),ze.iushrn(1);for(var nt=0,ot=1;0==(Ce.words[0]&ot)&&nt<26;++nt,ot<<=1);if(nt>0)for(Ce.iushrn(nt);nt-- >0;)Ve.isOdd()&&Ve.iadd(tt),Ve.iushrn(1);Ae.cmp(Ce)>=0?(Ae.isub(Ce),ze.isub(Ve)):(Ce.isub(Ae),Ve.isub(ze))}return(qe=0===Ae.cmpn(1)?ze:Ve).cmpn(0)<0&&qe.iadd(ke),qe},n.prototype.gcd=function(ke){if(this.isZero())return ke.abs();if(ke.isZero())return this.abs();var Ae=this.clone(),Ce=ke.clone();Ae.negative=0,Ce.negative=0;for(var qe=0;Ae.isEven()&&Ce.isEven();qe++)Ae.iushrn(1),Ce.iushrn(1);for(;;){for(;Ae.isEven();)Ae.iushrn(1);for(;Ce.isEven();)Ce.iushrn(1);var ze=Ae.cmp(Ce);if(ze<0){var Ve=Ae;Ae=Ce,Ce=Ve}else if(0===ze||0===Ce.cmpn(1))break;Ae.isub(Ce)}return Ce.iushln(qe)},n.prototype.invm=function(ke){return this.egcd(ke).a.umod(ke)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(ke){return this.words[0]&ke},n.prototype.bincn=function(ke){r("number"==typeof ke);var Ae=ke%26,Ce=(ke-Ae)/26,qe=1<>>26,tt&=67108863,this.words[Ve]=tt}return 0!==ze&&(this.words[Ve]=ze,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(ke){var Ae,Ce=ke<0;if(0!==this.negative&&!Ce)return-1;if(0===this.negative&&Ce)return 1;if(this.strip(),this.length>1)Ae=1;else{Ce&&(ke=-ke),r(ke<=67108863,"Number is too big");var qe=0|this.words[0];Ae=qe===ke?0:qeke.length)return 1;if(this.length=0;Ce--){var qe=0|this.words[Ce],ze=0|ke.words[Ce];if(qe!==ze){qeze&&(Ae=1);break}}return Ae},n.prototype.gtn=function(ke){return 1===this.cmpn(ke)},n.prototype.gt=function(ke){return 1===this.cmp(ke)},n.prototype.gten=function(ke){return this.cmpn(ke)>=0},n.prototype.gte=function(ke){return this.cmp(ke)>=0},n.prototype.ltn=function(ke){return-1===this.cmpn(ke)},n.prototype.lt=function(ke){return-1===this.cmp(ke)},n.prototype.lten=function(ke){return this.cmpn(ke)<=0},n.prototype.lte=function(ke){return this.cmp(ke)<=0},n.prototype.eqn=function(ke){return 0===this.cmpn(ke)},n.prototype.eq=function(ke){return 0===this.cmp(ke)},n.red=function(ke){return new k(ke)},n.prototype.toRed=function(ke){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),ke.convertTo(this)._forceRed(ke)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(ke){return this.red=ke,this},n.prototype.forceRed=function(ke){return r(!this.red,"Already a number in reduction context"),this._forceRed(ke)},n.prototype.redAdd=function(ke){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,ke)},n.prototype.redIAdd=function(ke){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ke)},n.prototype.redSub=function(ke){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,ke)},n.prototype.redISub=function(ke){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,ke)},n.prototype.redShl=function(ke){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,ke)},n.prototype.redMul=function(ke){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,ke),this.red.mul(this,ke)},n.prototype.redIMul=function(ke){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,ke),this.red.imul(this,ke)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(ke){return r(this.red&&!ke.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ke)};var tt={k256:null,p224:null,p192:null,p25519:null};function m(ke,Ae){this.name=ke,this.p=new n(Ae,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(ke){if("string"==typeof ke){var Ae=n._prime(ke);this.m=Ae.p,this.prime=Ae}else r(ke.gtn(1),"modulus must be greater than 1"),this.m=ke,this.prime=null}function A(ke){k.call(this,ke),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var ke=new n(null);return ke.words=Array(Math.ceil(this.n/13)),ke},m.prototype.ireduce=function(ke){var Ae,Ce=ke;do{this.split(Ce,this.tmp),Ae=(Ce=(Ce=this.imulK(Ce)).iadd(this.tmp)).bitLength()}while(Ae>this.n);var qe=Ae0?Ce.isub(this.p):Ce.strip(),Ce},m.prototype.split=function(ke,Ae){ke.iushrn(this.n,0,Ae)},m.prototype.imulK=function(ke){return ke.imul(this.k)},i(g,m),g.prototype.split=function(ke,Ae){for(var Ce=4194303,qe=Math.min(ke.length,9),ze=0;ze>>22,Ve=tt}Ve>>>=22,ke.words[ze-10]=Ve,0===Ve&&ke.length>10?ke.length-=10:ke.length-=9},g.prototype.imulK=function(ke){ke.words[ke.length]=0,ke.words[ke.length+1]=0,ke.length+=2;for(var Ae=0,Ce=0;Ce>>=26,ke.words[Ce]=ze,Ae=qe}return 0!==Ae&&(ke.words[ke.length++]=Ae),ke},n._prime=function(ke){if(tt[ke])return tt[ke];var Ae;if("k256"===ke)Ae=new g;else if("p224"===ke)Ae=new w;else if("p192"===ke)Ae=new v;else{if("p25519"!==ke)throw Error("Unknown prime "+ke);Ae=new _}return tt[ke]=Ae,Ae},k.prototype._verify1=function(ke){r(0===ke.negative,"red works only with positives"),r(ke.red,"red works only with red numbers")},k.prototype._verify2=function(ke,Ae){r(0==(ke.negative|Ae.negative),"red works only with positives"),r(ke.red&&ke.red===Ae.red,"red works only with red numbers")},k.prototype.imod=function(ke){return this.prime?this.prime.ireduce(ke)._forceRed(this):ke.umod(this.m)._forceRed(this)},k.prototype.neg=function(ke){return ke.isZero()?ke.clone():this.m.sub(ke)._forceRed(this)},k.prototype.add=function(ke,Ae){this._verify2(ke,Ae);var Ce=ke.add(Ae);return Ce.cmp(this.m)>=0&&Ce.isub(this.m),Ce._forceRed(this)},k.prototype.iadd=function(ke,Ae){this._verify2(ke,Ae);var Ce=ke.iadd(Ae);return Ce.cmp(this.m)>=0&&Ce.isub(this.m),Ce},k.prototype.sub=function(ke,Ae){this._verify2(ke,Ae);var Ce=ke.sub(Ae);return Ce.cmpn(0)<0&&Ce.iadd(this.m),Ce._forceRed(this)},k.prototype.isub=function(ke,Ae){this._verify2(ke,Ae);var Ce=ke.isub(Ae);return Ce.cmpn(0)<0&&Ce.iadd(this.m),Ce},k.prototype.shl=function(ke,Ae){return this._verify1(ke),this.imod(ke.ushln(Ae))},k.prototype.imul=function(ke,Ae){return this._verify2(ke,Ae),this.imod(ke.imul(Ae))},k.prototype.mul=function(ke,Ae){return this._verify2(ke,Ae),this.imod(ke.mul(Ae))},k.prototype.isqr=function(ke){return this.imul(ke,ke.clone())},k.prototype.sqr=function(ke){return this.mul(ke,ke)},k.prototype.sqrt=function(ke){if(ke.isZero())return ke.clone();var Ae=this.m.andln(3);if(r(Ae%2==1),3===Ae){var Ce=this.m.add(new n(1)).iushrn(2);return this.pow(ke,Ce)}for(var qe=this.m.subn(1),ze=0;!qe.isZero()&&0===qe.andln(1);)ze++,qe.iushrn(1);r(!qe.isZero());var Ve=new n(1).toRed(this),tt=Ve.redNeg(),rt=this.m.subn(1).iushrn(1),it=this.m.bitLength();for(it=new n(2*it*it).toRed(this);0!==this.pow(it,rt).cmp(tt);)it.redIAdd(tt);for(var nt=this.pow(it,qe),ot=this.pow(ke,qe.addn(1).iushrn(1)),ct=this.pow(ke,qe),ht=ze;0!==ct.cmp(Ve);){for(var ft=ct,yt=0;0!==ft.cmp(Ve);yt++)ft=ft.redSqr();r(yt=0;qe--){for(var it=Ae.words[qe],nt=rt-1;nt>=0;nt--){var ot=it>>nt&1;ze!==Ce[0]&&(ze=this.sqr(ze)),0!==ot||0!==Ve?(Ve<<=1,Ve|=ot,(4===++tt||0===qe&&0===nt)&&(ze=this.mul(ze,Ce[Ve]),tt=0,Ve=0)):tt=0}rt=26}return ze},k.prototype.convertTo=function(ke){var Ae=ke.umod(this.m);return Ae===ke?Ae.clone():Ae},k.prototype.convertFrom=function(ke){var Ae=ke.clone();return Ae.red=null,Ae},n.mont=function(ke){return new A(ke)},i(A,k),A.prototype.convertTo=function(ke){return this.imod(ke.ushln(this.shift))},A.prototype.convertFrom=function(ke){var Ae=this.imod(ke.mul(this.rinv));return Ae.red=null,Ae},A.prototype.imul=function(ke,Ae){if(ke.isZero()||Ae.isZero())return ke.words[0]=0,ke.length=1,ke;var Ce=ke.imul(Ae),qe=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ze=Ce.isub(qe).iushrn(this.shift),Ve=ze;return ze.cmp(this.m)>=0?Ve=ze.isub(this.m):ze.cmpn(0)<0&&(Ve=ze.iadd(this.m)),Ve._forceRed(this)},A.prototype.mul=function(ke,Ae){if(ke.isZero()||Ae.isZero())return new n(0)._forceRed(this);var Ce=ke.mul(Ae),qe=Ce.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ze=Ce.isub(qe).iushrn(this.shift),Ve=ze;return ze.cmp(this.m)>=0?Ve=ze.isub(this.m):ze.cmpn(0)<0&&(Ve=ze.iadd(this.m)),Ve._forceRed(this)},A.prototype.invm=function(ke){return this.imod(ke._invmp(this.m).mul(this.r2))._forceRed(this)}}(ke,Ir)})),Wd=Object.freeze({__proto__:null,default:Hd,__moduleExports:Hd});class Id{constructor(ke){if(void 0===ke)throw Error("Invalid BigInteger input");this.value=new Hd(ke)}clone(){const ke=new Id(null);return this.value.copy(ke.value),ke}iinc(){return this.value.iadd(new Hd(1)),this}inc(){return this.clone().iinc()}idec(){return this.value.isub(new Hd(1)),this}dec(){return this.clone().idec()}iadd(ke){return this.value.iadd(ke.value),this}add(ke){return this.clone().iadd(ke)}isub(ke){return this.value.isub(ke.value),this}sub(ke){return this.clone().isub(ke)}imul(ke){return this.value.imul(ke.value),this}mul(ke){return this.clone().imul(ke)}imod(ke){return this.value=this.value.umod(ke.value),this}mod(ke){return this.clone().imod(ke)}modExp(ke,Ae){const Ce=Ae.isEven()?Hd.red(Ae.value):Hd.mont(Ae.value),qe=this.clone();return qe.value=qe.value.toRed(Ce).redPow(ke.value).fromRed(),qe}modInv(ke){if(!this.gcd(ke).isOne())throw Error("Inverse does not exist");return new Id(this.value.invm(ke.value))}gcd(ke){return new Id(this.value.gcd(ke.value))}ileftShift(ke){return this.value.ishln(ke.value.toNumber()),this}leftShift(ke){return this.clone().ileftShift(ke)}irightShift(ke){return this.value.ishrn(ke.value.toNumber()),this}rightShift(ke){return this.clone().irightShift(ke)}equal(ke){return this.value.eq(ke.value)}lt(ke){return this.value.lt(ke.value)}lte(ke){return this.value.lte(ke.value)}gt(ke){return this.value.gt(ke.value)}gte(ke){return this.value.gte(ke.value)}isZero(){return this.value.isZero()}isOne(){return this.value.eq(new Hd(1))}isNegative(){return this.value.isNeg()}isEven(){return this.value.isEven()}abs(){const ke=this.clone();return ke.value=ke.value.abs(),ke}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}getBit(ke){return this.value.testn(ke)?1:0}bitLength(){return this.value.bitLength()}byteLength(){return this.value.byteLength()}toUint8Array(ke="be",Ae){return this.value.toArrayLike(Uint8Array,ke,Ae)}}var Vd,Zd=Object.freeze({__proto__:null,default:Id}),Xd=bt((function(ke,Ae){var Ce=Ae;function i(ke){return 1===ke.length?"0"+ke:ke}function n(ke){for(var Ae="",Ce=0;Ce>8,tt=255&ze;Ve?Ce.push(Ve,tt):Ce.push(tt)}return Ce},Ce.zero2=i,Ce.toHex=n,Ce.encode=function(ke,Ae){return"hex"===Ae?n(ke):ke}})),ep=bt((function(ke,Ae){var Ce=Ae;Ce.assert=Ur,Ce.toArray=Xd.toArray,Ce.zero2=Xd.zero2,Ce.toHex=Xd.toHex,Ce.encode=Xd.encode,Ce.getNAF=function(ke,Ae){for(var Ce=[],qe=1<=0;){var Ve;if(ze.isOdd()){var tt=ze.andln(qe-1);Ve=tt>(qe>>1)-1?(qe>>1)-tt:tt,ze.isubn(Ve)}else Ve=0;Ce.push(Ve);for(var rt=0!==ze.cmpn(0)&&0===ze.andln(qe-1)?Ae+1:1,it=1;it0||Ae.cmpn(-ze)>0;){var Ve,tt,rt,it=ke.andln(3)+qe&3,nt=Ae.andln(3)+ze&3;if(3===it&&(it=-1),3===nt&&(nt=-1),0==(1&it))Ve=0;else Ve=3!==(rt=ke.andln(7)+qe&7)&&5!==rt||2!==nt?it:-it;if(Ce[0].push(Ve),0==(1&nt))tt=0;else tt=3!==(rt=Ae.andln(7)+ze&7)&&5!==rt||2!==it?nt:-nt;Ce[1].push(tt),2*qe===Ve+1&&(qe=1-qe),2*ze===tt+1&&(ze=1-ze),ke.iushrn(1),Ae.iushrn(1)}return Ce},Ce.cachedProperty=function(ke,Ae,Ce){var qe="_"+Ae;ke.prototype[Ae]=function(){return void 0!==this[qe]?this[qe]:this[qe]=Ce.call(this)}},Ce.parseBytes=function(ke){return"string"==typeof ke?Ce.toArray(ke,"hex"):ke},Ce.intFromLE=function(ke){return new Hd(ke,"hex","le")}})),Od=function(ke){return Vd||(Vd=new Fd(null)),Vd.generate(ke)};function Fd(ke){this.rand=ke}var tp=Fd;if(Fd.prototype.generate=function(ke){return this._rand(ke)},Fd.prototype._rand=function(ke){if(this.rand.getBytes)return this.rand.getBytes(ke);for(var Ae=new Uint8Array(ke),Ce=0;Ce0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ap=Gd;function $d(ke,Ae){this.curve=ke,this.type=Ae,this.precomputed=null}Gd.prototype.point=function(){throw Error("Not implemented")},Gd.prototype.validate=function(){throw Error("Not implemented")},Gd.prototype._fixedNafMul=function(ke,Ae){sp(ke.precomputed);var Ce=ke._getDoubles(),qe=ip(Ae,1),ze=(1<=tt;Ae--)rt=(rt<<1)+qe[Ae];Ve.push(rt)}for(var it=this.jpoint(null,null,null),nt=this.jpoint(null,null,null),ot=ze;ot>0;ot--){for(tt=0;tt=0;rt--){for(Ae=0;rt>=0&&0===Ve[rt];rt--)Ae++;if(rt>=0&&Ae++,tt=tt.dblp(Ae),rt<0)break;var it=Ve[rt];sp(0!==it),tt="affine"===ke.type?it>0?tt.mixedAdd(ze[it-1>>1]):tt.mixedAdd(ze[-it-1>>1].neg()):it>0?tt.add(ze[it-1>>1]):tt.add(ze[-it-1>>1].neg())}return"affine"===ke.type?tt.toP():tt},Gd.prototype._wnafMulAdd=function(ke,Ae,Ce,qe,ze){for(var Ve=this._wnafT1,tt=this._wnafT2,rt=this._wnafT3,it=0,nt=0;nt=1;nt-=2){var ct=nt-1,ht=nt;if(1===Ve[ct]&&1===Ve[ht]){var ft=[Ae[ct],null,null,Ae[ht]];0===Ae[ct].y.cmp(Ae[ht].y)?(ft[1]=Ae[ct].add(Ae[ht]),ft[2]=Ae[ct].toJ().mixedAdd(Ae[ht].neg())):0===Ae[ct].y.cmp(Ae[ht].y.redNeg())?(ft[1]=Ae[ct].toJ().mixedAdd(Ae[ht]),ft[2]=Ae[ct].add(Ae[ht].neg())):(ft[1]=Ae[ct].toJ().mixedAdd(Ae[ht]),ft[2]=Ae[ct].toJ().mixedAdd(Ae[ht].neg()));var yt=[-3,-1,-5,-7,0,7,5,1,3],mt=np(Ce[ct],Ce[ht]);it=Math.max(mt[0].length,it),rt[ct]=Array(it),rt[ht]=Array(it);for(var kt=0;kt=0;nt--){for(var Rt=0;nt>=0;){var Bt=!0;for(kt=0;kt=0&&Rt++,Pt=Pt.dblp(Rt),nt<0)break;for(kt=0;kt0?Tt=tt[kt][Ut-1>>1]:Ut<0&&(Tt=tt[kt][-Ut-1>>1].neg()),Pt="affine"===Tt.type?Pt.mixedAdd(Tt):Pt.add(Tt))}}for(nt=0;nt=Math.ceil((ke.bitLength()+1)/Ae.step)},$d.prototype._getDoubles=function(ke,Ae){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var Ce=[this],qe=this,ze=0;ze=0&&(Ve=Ae,tt=Ce),qe.negative&&(qe=qe.neg(),ze=ze.neg()),Ve.negative&&(Ve=Ve.neg(),tt=tt.neg()),[{a:qe,b:ze},{a:Ve,b:tt}]},Yd.prototype._endoSplit=function(ke){var Ae=this.endo.basis,Ce=Ae[0],qe=Ae[1],ze=qe.b.mul(ke).divRound(this.n),Ve=Ce.b.neg().mul(ke).divRound(this.n),tt=ze.mul(Ce.a),rt=Ve.mul(qe.a),it=ze.mul(Ce.b),nt=Ve.mul(qe.b);return{k1:ke.sub(tt).sub(rt),k2:it.add(nt).neg()}},Yd.prototype.pointFromX=function(ke,Ae){(ke=new Hd(ke,16)).red||(ke=ke.toRed(this.red));var Ce=ke.redSqr().redMul(ke).redIAdd(ke.redMul(this.a)).redIAdd(this.b),qe=Ce.redSqrt();if(0!==qe.redSqr().redSub(Ce).cmp(this.zero))throw Error("invalid point");var ze=qe.fromRed().isOdd();return(Ae&&!ze||!Ae&&ze)&&(qe=qe.redNeg()),this.point(ke,qe)},Yd.prototype.validate=function(ke){if(ke.inf)return!0;var Ae=ke.x,Ce=ke.y,qe=this.a.redMul(Ae),ze=Ae.redSqr().redMul(Ae).redIAdd(qe).redIAdd(this.b);return 0===Ce.redSqr().redISub(ze).cmpn(0)},Yd.prototype._endoWnafMulAdd=function(ke,Ae,Ce){for(var qe=this._endoWnafT1,ze=this._endoWnafT2,Ve=0;Ve":""},Qd.prototype.isInfinity=function(){return this.inf},Qd.prototype.add=function(ke){if(this.inf)return ke;if(ke.inf)return this;if(this.eq(ke))return this.dbl();if(this.neg().eq(ke))return this.curve.point(null,null);if(0===this.x.cmp(ke.x))return this.curve.point(null,null);var Ae=this.y.redSub(ke.y);0!==Ae.cmpn(0)&&(Ae=Ae.redMul(this.x.redSub(ke.x).redInvm()));var Ce=Ae.redSqr().redISub(this.x).redISub(ke.x),qe=Ae.redMul(this.x.redSub(Ce)).redISub(this.y);return this.curve.point(Ce,qe)},Qd.prototype.dbl=function(){if(this.inf)return this;var ke=this.y.redAdd(this.y);if(0===ke.cmpn(0))return this.curve.point(null,null);var Ae=this.curve.a,Ce=this.x.redSqr(),qe=ke.redInvm(),ze=Ce.redAdd(Ce).redIAdd(Ce).redIAdd(Ae).redMul(qe),Ve=ze.redSqr().redISub(this.x.redAdd(this.x)),tt=ze.redMul(this.x.redSub(Ve)).redISub(this.y);return this.curve.point(Ve,tt)},Qd.prototype.getX=function(){return this.x.fromRed()},Qd.prototype.getY=function(){return this.y.fromRed()},Qd.prototype.mul=function(ke){return ke=new Hd(ke,16),this.isInfinity()?this:this._hasDoubles(ke)?this.curve._fixedNafMul(this,ke):this.curve.endo?this.curve._endoWnafMulAdd([this],[ke]):this.curve._wnafMul(this,ke)},Qd.prototype.mulAdd=function(ke,Ae,Ce){var qe=[this,Ae],ze=[ke,Ce];return this.curve.endo?this.curve._endoWnafMulAdd(qe,ze):this.curve._wnafMulAdd(1,qe,ze,2)},Qd.prototype.jmulAdd=function(ke,Ae,Ce){var qe=[this,Ae],ze=[ke,Ce];return this.curve.endo?this.curve._endoWnafMulAdd(qe,ze,!0):this.curve._wnafMulAdd(1,qe,ze,2,!0)},Qd.prototype.eq=function(ke){return this===ke||this.inf===ke.inf&&(this.inf||0===this.x.cmp(ke.x)&&0===this.y.cmp(ke.y))},Qd.prototype.neg=function(ke){if(this.inf)return this;var Ae=this.curve.point(this.x,this.y.redNeg());if(ke&&this.precomputed){var Ce=this.precomputed,i=function(ke){return ke.neg()};Ae.precomputed={naf:Ce.naf&&{wnd:Ce.naf.wnd,points:Ce.naf.points.map(i)},doubles:Ce.doubles&&{step:Ce.doubles.step,points:Ce.doubles.points.map(i)}}}return Ae},Qd.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Gr(Jd,ap.BasePoint),Yd.prototype.jpoint=function(ke,Ae,Ce){return new Jd(this,ke,Ae,Ce)},Jd.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var ke=this.z.redInvm(),Ae=ke.redSqr(),Ce=this.x.redMul(Ae),qe=this.y.redMul(Ae).redMul(ke);return this.curve.point(Ce,qe)},Jd.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Jd.prototype.add=function(ke){if(this.isInfinity())return ke;if(ke.isInfinity())return this;var Ae=ke.z.redSqr(),Ce=this.z.redSqr(),qe=this.x.redMul(Ae),ze=ke.x.redMul(Ce),Ve=this.y.redMul(Ae.redMul(ke.z)),tt=ke.y.redMul(Ce.redMul(this.z)),rt=qe.redSub(ze),it=Ve.redSub(tt);if(0===rt.cmpn(0))return 0!==it.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var nt=rt.redSqr(),ot=nt.redMul(rt),ct=qe.redMul(nt),ht=it.redSqr().redIAdd(ot).redISub(ct).redISub(ct),ft=it.redMul(ct.redISub(ht)).redISub(Ve.redMul(ot)),yt=this.z.redMul(ke.z).redMul(rt);return this.curve.jpoint(ht,ft,yt)},Jd.prototype.mixedAdd=function(ke){if(this.isInfinity())return ke.toJ();if(ke.isInfinity())return this;var Ae=this.z.redSqr(),Ce=this.x,qe=ke.x.redMul(Ae),ze=this.y,Ve=ke.y.redMul(Ae).redMul(this.z),tt=Ce.redSub(qe),rt=ze.redSub(Ve);if(0===tt.cmpn(0))return 0!==rt.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var it=tt.redSqr(),nt=it.redMul(tt),ot=Ce.redMul(it),ct=rt.redSqr().redIAdd(nt).redISub(ot).redISub(ot),ht=rt.redMul(ot.redISub(ct)).redISub(ze.redMul(nt)),ft=this.z.redMul(tt);return this.curve.jpoint(ct,ht,ft)},Jd.prototype.dblp=function(ke){if(0===ke)return this;if(this.isInfinity())return this;if(!ke)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var Ae=this,Ce=0;Ce=0)return!1;if(Ce.redIAdd(ze),0===this.x.cmp(Ce))return!0}},Jd.prototype.inspect=function(){return this.isInfinity()?"":""},Jd.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Gr(el,ap);var hp=el;function rl(ke,Ae,Ce){ap.BasePoint.call(this,ke,"projective"),null===Ae&&null===Ce?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Hd(Ae,16),this.z=new Hd(Ce,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}el.prototype.validate=function(ke){var Ae=ke.normalize().x,Ce=Ae.redSqr(),qe=Ce.redMul(Ae).redAdd(Ce.redMul(this.a)).redAdd(Ae);return 0===qe.redSqrt().redSqr().cmp(qe)},Gr(rl,ap.BasePoint),el.prototype.decodePoint=function(ke,Ae){if(33===(ke=ep.toArray(ke,Ae)).length&&64===ke[0]&&(ke=ke.slice(1,33).reverse()),32!==ke.length)throw Error("Unknown point compression format");return this.point(ke,1)},el.prototype.point=function(ke,Ae){return new rl(this,ke,Ae)},el.prototype.pointFromJSON=function(ke){return rl.fromJSON(this,ke)},rl.prototype.precompute=function(){},rl.prototype._encode=function(ke){var Ae=this.curve.p.byteLength();return ke?[64].concat(this.getX().toArray("le",Ae)):this.getX().toArray("be",Ae)},rl.fromJSON=function(ke,Ae){return new rl(ke,Ae[0],Ae[1]||ke.one)},rl.prototype.inspect=function(){return this.isInfinity()?"":""},rl.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},rl.prototype.dbl=function(){var ke=this.x.redAdd(this.z).redSqr(),Ae=this.x.redSub(this.z).redSqr(),Ce=ke.redSub(Ae),qe=ke.redMul(Ae),ze=Ce.redMul(Ae.redAdd(this.curve.a24.redMul(Ce)));return this.curve.point(qe,ze)},rl.prototype.add=function(){throw Error("Not supported on Montgomery curve")},rl.prototype.diffAdd=function(ke,Ae){var Ce=this.x.redAdd(this.z),qe=this.x.redSub(this.z),ze=ke.x.redAdd(ke.z),Ve=ke.x.redSub(ke.z).redMul(Ce),tt=ze.redMul(qe),rt=Ae.z.redMul(Ve.redAdd(tt).redSqr()),it=Ae.x.redMul(Ve.redISub(tt).redSqr());return this.curve.point(rt,it)},rl.prototype.mul=function(ke){for(var Ae=(ke=new Hd(ke,16)).clone(),Ce=this,qe=this.curve.point(null,null),ze=[];0!==Ae.cmpn(0);Ae.iushrn(1))ze.push(Ae.andln(1));for(var Ve=ze.length-1;Ve>=0;Ve--)0===ze[Ve]?(Ce=Ce.diffAdd(qe,this),qe=qe.dbl()):(qe=Ce.diffAdd(qe,this),Ce=Ce.dbl());return qe},rl.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},rl.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},rl.prototype.eq=function(ke){return 0===this.getX().cmp(ke.getX())},rl.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},rl.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var fp=ep.assert;function nl(ke){this.twisted=1!=(0|ke.a),this.mOneA=this.twisted&&-1==(0|ke.a),this.extended=this.mOneA,ap.call(this,"edwards",ke),this.a=new Hd(ke.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Hd(ke.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Hd(ke.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),fp(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|ke.c)}Gr(nl,ap);var lp=nl;function sl(ke,Ae,Ce,qe,ze){ap.BasePoint.call(this,ke,"projective"),null===Ae&&null===Ce&&null===qe?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Hd(Ae,16),this.y=new Hd(Ce,16),this.z=qe?new Hd(qe,16):this.curve.one,this.t=ze&&new Hd(ze,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}nl.prototype._mulA=function(ke){return this.mOneA?ke.redNeg():this.a.redMul(ke)},nl.prototype._mulC=function(ke){return this.oneC?ke:this.c.redMul(ke)},nl.prototype.jpoint=function(ke,Ae,Ce,qe){return this.point(ke,Ae,Ce,qe)},nl.prototype.pointFromX=function(ke,Ae){(ke=new Hd(ke,16)).red||(ke=ke.toRed(this.red));var Ce=ke.redSqr(),qe=this.c2.redSub(this.a.redMul(Ce)),ze=this.one.redSub(this.c2.redMul(this.d).redMul(Ce)),Ve=qe.redMul(ze.redInvm()),tt=Ve.redSqrt();if(0!==tt.redSqr().redSub(Ve).cmp(this.zero))throw Error("invalid point");var rt=tt.fromRed().isOdd();return(Ae&&!rt||!Ae&&rt)&&(tt=tt.redNeg()),this.point(ke,tt)},nl.prototype.pointFromY=function(ke,Ae){(ke=new Hd(ke,16)).red||(ke=ke.toRed(this.red));var Ce=ke.redSqr(),qe=Ce.redSub(this.c2),ze=Ce.redMul(this.d).redMul(this.c2).redSub(this.a),Ve=qe.redMul(ze.redInvm());if(0===Ve.cmp(this.zero)){if(Ae)throw Error("invalid point");return this.point(this.zero,ke)}var tt=Ve.redSqrt();if(0!==tt.redSqr().redSub(Ve).cmp(this.zero))throw Error("invalid point");return tt.fromRed().isOdd()!==Ae&&(tt=tt.redNeg()),this.point(tt,ke)},nl.prototype.validate=function(ke){if(ke.isInfinity())return!0;ke.normalize();var Ae=ke.x.redSqr(),Ce=ke.y.redSqr(),qe=Ae.redMul(this.a).redAdd(Ce),ze=this.c2.redMul(this.one.redAdd(this.d.redMul(Ae).redMul(Ce)));return 0===qe.cmp(ze)},Gr(sl,ap.BasePoint),nl.prototype.pointFromJSON=function(ke){return sl.fromJSON(this,ke)},nl.prototype.point=function(ke,Ae,Ce,qe){return new sl(this,ke,Ae,Ce,qe)},sl.fromJSON=function(ke,Ae){return new sl(ke,Ae[0],Ae[1],Ae[2])},sl.prototype.inspect=function(){return this.isInfinity()?"":""},sl.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},sl.prototype._extDbl=function(){var ke=this.x.redSqr(),Ae=this.y.redSqr(),Ce=this.z.redSqr();Ce=Ce.redIAdd(Ce);var qe=this.curve._mulA(ke),ze=this.x.redAdd(this.y).redSqr().redISub(ke).redISub(Ae),Ve=qe.redAdd(Ae),tt=Ve.redSub(Ce),rt=qe.redSub(Ae),it=ze.redMul(tt),nt=Ve.redMul(rt),ot=ze.redMul(rt),ct=tt.redMul(Ve);return this.curve.point(it,nt,ct,ot)},sl.prototype._projDbl=function(){var ke,Ae,Ce,qe=this.x.redAdd(this.y).redSqr(),ze=this.x.redSqr(),Ve=this.y.redSqr();if(this.curve.twisted){var tt=(nt=this.curve._mulA(ze)).redAdd(Ve);if(this.zOne)ke=qe.redSub(ze).redSub(Ve).redMul(tt.redSub(this.curve.two)),Ae=tt.redMul(nt.redSub(Ve)),Ce=tt.redSqr().redSub(tt).redSub(tt);else{var rt=this.z.redSqr(),it=tt.redSub(rt).redISub(rt);ke=qe.redSub(ze).redISub(Ve).redMul(it),Ae=tt.redMul(nt.redSub(Ve)),Ce=tt.redMul(it)}}else{var nt=ze.redAdd(Ve);rt=this.curve._mulC(this.z).redSqr(),it=nt.redSub(rt).redSub(rt);ke=this.curve._mulC(qe.redISub(nt)).redMul(it),Ae=this.curve._mulC(nt).redMul(ze.redISub(Ve)),Ce=nt.redMul(it)}return this.curve.point(ke,Ae,Ce)},sl.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},sl.prototype._extAdd=function(ke){var Ae=this.y.redSub(this.x).redMul(ke.y.redSub(ke.x)),Ce=this.y.redAdd(this.x).redMul(ke.y.redAdd(ke.x)),qe=this.t.redMul(this.curve.dd).redMul(ke.t),ze=this.z.redMul(ke.z.redAdd(ke.z)),Ve=Ce.redSub(Ae),tt=ze.redSub(qe),rt=ze.redAdd(qe),it=Ce.redAdd(Ae),nt=Ve.redMul(tt),ot=rt.redMul(it),ct=Ve.redMul(it),ht=tt.redMul(rt);return this.curve.point(nt,ot,ht,ct)},sl.prototype._projAdd=function(ke){var Ae,Ce,qe=this.z.redMul(ke.z),ze=qe.redSqr(),Ve=this.x.redMul(ke.x),tt=this.y.redMul(ke.y),rt=this.curve.d.redMul(Ve).redMul(tt),it=ze.redSub(rt),nt=ze.redAdd(rt),ot=this.x.redAdd(this.y).redMul(ke.x.redAdd(ke.y)).redISub(Ve).redISub(tt),ct=qe.redMul(it).redMul(ot);return this.curve.twisted?(Ae=qe.redMul(nt).redMul(tt.redSub(this.curve._mulA(Ve))),Ce=it.redMul(nt)):(Ae=qe.redMul(nt).redMul(tt.redSub(Ve)),Ce=this.curve._mulC(it).redMul(nt)),this.curve.point(ct,Ae,Ce)},sl.prototype.add=function(ke){return this.isInfinity()?ke:ke.isInfinity()?this:this.curve.extended?this._extAdd(ke):this._projAdd(ke)},sl.prototype.mul=function(ke){return this._hasDoubles(ke)?this.curve._fixedNafMul(this,ke):this.curve._wnafMul(this,ke)},sl.prototype.mulAdd=function(ke,Ae,Ce){return this.curve._wnafMulAdd(1,[this,Ae],[ke,Ce],2,!1)},sl.prototype.jmulAdd=function(ke,Ae,Ce){return this.curve._wnafMulAdd(1,[this,Ae],[ke,Ce],2,!0)},sl.prototype.normalize=function(){if(this.zOne)return this;var ke=this.z.redInvm();return this.x=this.x.redMul(ke),this.y=this.y.redMul(ke),this.t&&(this.t=this.t.redMul(ke)),this.z=this.curve.one,this.zOne=!0,this},sl.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},sl.prototype.getX=function(){return this.normalize(),this.x.fromRed()},sl.prototype.getY=function(){return this.normalize(),this.y.fromRed()},sl.prototype.eq=function(ke){return this===ke||0===this.getX().cmp(ke.getX())&&0===this.getY().cmp(ke.getY())},sl.prototype.eqXToP=function(ke){var Ae=ke.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(Ae))return!0;for(var Ce=ke.clone(),qe=this.curve.redN.redMul(this.z);;){if(Ce.iadd(this.curve.n),Ce.cmp(this.curve.p)>=0)return!1;if(Ae.redIAdd(qe),0===this.x.cmp(Ae))return!0}},sl.prototype.toP=sl.prototype.normalize,sl.prototype.mixedAdd=sl.prototype.add;var dp=bt((function(ke,Ae){var Ce=Ae;Ce.base=ap,Ce.short=up,Ce.mont=hp,Ce.edwards=lp})),pp=$r.rotl32,yp=$r.sum32,mp=$r.sum32_5,gp=ti.ft_1,bp=Jr.BlockHash,vp=[1518500249,1859775393,2400959708,3395469782];function pl(){if(!(this instanceof pl))return new pl;bp.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}$r.inherits(pl,bp);var wp=pl;pl.blockSize=512,pl.outSize=160,pl.hmacStrength=80,pl.padLength=64,pl.prototype._update=function(ke,Ae){for(var Ce=this.W,qe=0;qe<16;qe++)Ce[qe]=ke[Ae+qe];for(;qethis.blockSize&&(ke=(new this.Hash).update(ke).digest()),Ur(ke.length<=this.blockSize);for(var Ae=ke.length;Ae=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(Ae,Ce,qe)}var Mp=kl;kl.prototype._init=function(ke,Ae,Ce){var qe=ke.concat(Ae).concat(Ce);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var ze=0;ze=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(ke.concat(Ce||[])),this._reseed=1},kl.prototype.generate=function(ke,Ae,Ce,qe){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof Ae&&(qe=Ce,Ce=Ae,Ae=null),Ce&&(Ce=Xd.toArray(Ce,qe||"hex"),this._update(Ce));for(var ze=[];ze.length"};var Cp=ep.assert;function Ml(ke,Ae){if(ke instanceof Ml)return ke;this._importDER(ke,Ae)||(Cp(ke.r&&ke.s,"Signature without r or s"),this.r=new Hd(ke.r,16),this.s=new Hd(ke.s,16),void 0===ke.recoveryParam?this.recoveryParam=null:this.recoveryParam=ke.recoveryParam)}var Dp=Ml;function Kl(){this.place=0}function Dl(ke,Ae){var Ce=ke[Ae.place++];if(!(128&Ce))return Ce;for(var qe=15&Ce,ze=0,Ve=0,tt=Ae.place;Ve>>3);for(ke.push(128|Ce);--Ce;)ke.push(Ae>>>(Ce<<3)&255);ke.push(Ae)}}Ml.prototype._importDER=function(ke,Ae){ke=ep.toArray(ke,Ae);var Ce=new Kl;if(48!==ke[Ce.place++])return!1;if(Dl(ke,Ce)+Ce.place!==ke.length)return!1;if(2!==ke[Ce.place++])return!1;var qe=Dl(ke,Ce),ze=ke.slice(Ce.place,qe+Ce.place);if(Ce.place+=qe,2!==ke[Ce.place++])return!1;var Ve=Dl(ke,Ce);if(ke.length!==Ve+Ce.place)return!1;var tt=ke.slice(Ce.place,Ve+Ce.place);return 0===ze[0]&&128&ze[1]&&(ze=ze.slice(1)),0===tt[0]&&128&tt[1]&&(tt=tt.slice(1)),this.r=new Hd(ze),this.s=new Hd(tt),this.recoveryParam=null,!0},Ml.prototype.toDER=function(ke){var Ae=this.r.toArray(),Ce=this.s.toArray();for(128&Ae[0]&&(Ae=[0].concat(Ae)),128&Ce[0]&&(Ce=[0].concat(Ce)),Ae=Rl(Ae),Ce=Rl(Ce);!(Ce[0]||128&Ce[1]);)Ce=Ce.slice(1);var qe=[2];Ul(qe,Ae.length),(qe=qe.concat(Ae)).push(2),Ul(qe,Ce.length);var ze=qe.concat(Ce),Ve=[48];return Ul(Ve,ze.length),Ve=Ve.concat(ze),ep.encode(Ve,ke)};var Rp=ep.assert;function Bl(ke){if(!(this instanceof Bl))return new Bl(ke);"string"==typeof ke&&(Rp(Ep.hasOwnProperty(ke),"Unknown curve "+ke),ke=Ep[ke]),ke instanceof Ep.PresetCurve&&(ke={curve:ke}),this.curve=ke.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=ke.curve.g,this.g.precompute(ke.curve.n.bitLength()+1),this.hash=ke.hash||ke.curve.hash}var Bp=Bl;Bl.prototype.keyPair=function(ke){return new xp(this,ke)},Bl.prototype.keyFromPrivate=function(ke,Ae){return xp.fromPrivate(this,ke,Ae)},Bl.prototype.keyFromPublic=function(ke,Ae){return xp.fromPublic(this,ke,Ae)},Bl.prototype.genKeyPair=function(ke){ke||(ke={});var Ae=new Mp({hash:this.hash,pers:ke.pers,persEnc:ke.persEnc||"utf8",entropy:ke.entropy||Od(this.hash.hmacStrength),entropyEnc:ke.entropy&&ke.entropyEnc||"utf8",nonce:this.n.toArray()});if("mont"===this.curve.type){var Ce=new Hd(Ae.generate(32));return this.keyFromPrivate(Ce)}for(var qe=this.n.byteLength(),ze=this.n.sub(new Hd(2));;){if(!((Ce=new Hd(Ae.generate(qe))).cmp(ze)>0))return Ce.iaddn(1),this.keyFromPrivate(Ce)}},Bl.prototype._truncateToN=function(ke,Ae,Ce){var qe=(Ce=Ce||8*ke.byteLength())-this.n.bitLength();return qe>0&&(ke=ke.ushrn(qe)),!Ae&&ke.cmp(this.n)>=0?ke.sub(this.n):ke},Bl.prototype.truncateMsg=function(ke){var Ae;return ke instanceof Uint8Array?(Ae=8*ke.byteLength,ke=this._truncateToN(new Hd(ke,16),!1,Ae)):"string"==typeof ke?(Ae=4*ke.length,ke=this._truncateToN(new Hd(ke,16),!1,Ae)):ke=this._truncateToN(new Hd(ke,16)),ke},Bl.prototype.sign=function(ke,Ae,Ce,qe){"object"==typeof Ce&&(qe=Ce,Ce=null),qe||(qe={}),Ae=this.keyFromPrivate(Ae,Ce),ke=this.truncateMsg(ke);for(var ze=this.n.byteLength(),Ve=Ae.getPrivate().toArray("be",ze),tt=ke.toArray("be",ze),rt=new Mp({hash:this.hash,entropy:Ve,nonce:tt,pers:qe.pers,persEnc:qe.persEnc||"utf8"}),it=this.n.sub(new Hd(1)),nt=0;;nt++){var ot=qe.k?qe.k(nt):new Hd(rt.generate(this.n.byteLength()));if(!((ot=this._truncateToN(ot,!0)).cmpn(1)<=0||ot.cmp(it)>=0)){var ct=this.g.mul(ot);if(!ct.isInfinity()){var ht=ct.getX(),ft=ht.umod(this.n);if(0!==ft.cmpn(0)){var yt=ot.invm(this.n).mul(ft.mul(Ae.getPrivate()).iadd(ke));if(0!==(yt=yt.umod(this.n)).cmpn(0)){var mt=(ct.getY().isOdd()?1:0)|(0!==ht.cmp(ft)?2:0);return qe.canonical&&yt.cmp(this.nh)>0&&(yt=this.n.sub(yt),mt^=1),new Dp({r:ft,s:yt,recoveryParam:mt})}}}}}},Bl.prototype.verify=function(ke,Ae,Ce,qe){return Ce=this.keyFromPublic(Ce,qe),Ae=new Dp(Ae,"hex"),this._verify(this.truncateMsg(ke),Ae,Ce)||this._verify(this._truncateToN(new Hd(ke,16)),Ae,Ce)},Bl.prototype._verify=function(ke,Ae,Ce){var qe=Ae.r,ze=Ae.s;if(qe.cmpn(1)<0||qe.cmp(this.n)>=0)return!1;if(ze.cmpn(1)<0||ze.cmp(this.n)>=0)return!1;var Ve,tt=ze.invm(this.n),rt=tt.mul(ke).umod(this.n),it=tt.mul(qe).umod(this.n);return this.curve._maxwellTrick?!(Ve=this.g.jmulAdd(rt,Ce.getPublic(),it)).isInfinity()&&Ve.eqXToP(qe):!(Ve=this.g.mulAdd(rt,Ce.getPublic(),it)).isInfinity()&&0===Ve.getX().umod(this.n).cmp(qe)},Bl.prototype.recoverPubKey=function(ke,Ae,Ce,qe){Rp((3&Ce)===Ce,"The recovery param is more than two bits"),Ae=new Dp(Ae,qe);var ze=this.n,Ve=new Hd(ke),tt=Ae.r,rt=Ae.s,it=1&Ce,nt=Ce>>1;if(tt.cmp(this.curve.p.umod(this.curve.n))>=0&&nt)throw Error("Unable to find sencond key candinate");tt=nt?this.curve.pointFromX(tt.add(this.curve.n),it):this.curve.pointFromX(tt,it);var ot=Ae.r.invm(ze),ct=ze.sub(Ve).mul(ot).umod(ze),ht=rt.mul(ot).umod(ze);return this.g.mulAdd(ct,tt,ht)},Bl.prototype.getKeyRecoveryParam=function(ke,Ae,Ce,qe){if(null!==(Ae=new Dp(Ae,qe)).recoveryParam)return Ae.recoveryParam;for(var ze=0;ze<4;ze++){var Ve;try{Ve=this.recoverPubKey(ke,Ae,ze)}catch(ke){continue}if(Ve.eq(Ce))return ze}throw Error("Unable to find valid recovery factor")};var Tp=ep.assert,Up=ep.parseBytes,Kp=ep.cachedProperty;function Fl(ke,Ae){if(this.eddsa=ke,Ae.hasOwnProperty("secret")&&(this._secret=Up(Ae.secret)),ke.isPoint(Ae.pub))this._pub=Ae.pub;else if(this._pubBytes=Up(Ae.pub),this._pubBytes&&33===this._pubBytes.length&&64===this._pubBytes[0]&&(this._pubBytes=this._pubBytes.slice(1,33)),this._pubBytes&&32!==this._pubBytes.length)throw Error("Unknown point compression format")}Fl.fromPublic=function(ke,Ae){return Ae instanceof Fl?Ae:new Fl(ke,{pub:Ae})},Fl.fromSecret=function(ke,Ae){return Ae instanceof Fl?Ae:new Fl(ke,{secret:Ae})},Fl.prototype.secret=function(){return this._secret},Kp(Fl,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Kp(Fl,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Kp(Fl,"privBytes",(function(){var ke=this.eddsa,Ae=this.hash(),Ce=ke.encodingLength-1,qe=Ae.slice(0,ke.encodingLength);return qe[0]&=248,qe[Ce]&=127,qe[Ce]|=64,qe})),Kp(Fl,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Kp(Fl,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Kp(Fl,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Fl.prototype.sign=function(ke){return Tp(this._secret,"KeyPair can only verify"),this.eddsa.sign(ke,this)},Fl.prototype.verify=function(ke,Ae){return this.eddsa.verify(ke,Ae,this)},Fl.prototype.getSecret=function(ke){return Tp(this._secret,"KeyPair is public only"),ep.encode(this.secret(),ke)},Fl.prototype.getPublic=function(ke,Ae){return ep.encode((Ae?[64]:[]).concat(this.pubBytes()),ke)};var Ip=Fl,Op=ep.assert,Np=ep.cachedProperty,qp=ep.parseBytes;function Hl(ke,Ae){this.eddsa=ke,"object"!=typeof Ae&&(Ae=qp(Ae)),Array.isArray(Ae)&&(Ae={R:Ae.slice(0,ke.encodingLength),S:Ae.slice(ke.encodingLength)}),Op(Ae.R&&Ae.S,"Signature without R or S"),ke.isPoint(Ae.R)&&(this._R=Ae.R),Ae.S instanceof Hd&&(this._S=Ae.S),this._Rencoded=Array.isArray(Ae.R)?Ae.R:Ae.Rencoded,this._Sencoded=Array.isArray(Ae.S)?Ae.S:Ae.Sencoded}Np(Hl,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Np(Hl,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Np(Hl,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Np(Hl,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Hl.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Hl.prototype.toHex=function(){return ep.encode(this.toBytes(),"hex").toUpperCase()};var jp=Hl,zp=ep.assert,Fp=ep.parseBytes;function Zl(ke){if(zp("ed25519"===ke,"only tested with ed25519 so far"),!(this instanceof Zl))return new Zl(ke);ke=Ep[ke].curve;this.curve=ke,this.g=ke.g,this.g.precompute(ke.n.bitLength()+1),this.pointClass=ke.point().constructor,this.encodingLength=Math.ceil(ke.n.bitLength()/8),this.hash=Ap.sha512}var Lp=Zl;Zl.prototype.sign=function(ke,Ae){ke=Fp(ke);var Ce=this.keyFromSecret(Ae),qe=this.hashInt(Ce.messagePrefix(),ke),ze=this.g.mul(qe),Ve=this.encodePoint(ze),tt=this.hashInt(Ve,Ce.pubBytes(),ke).mul(Ce.priv()),rt=qe.add(tt).umod(this.curve.n);return this.makeSignature({R:ze,S:rt,Rencoded:Ve})},Zl.prototype.verify=function(ke,Ae,Ce){ke=Fp(ke),Ae=this.makeSignature(Ae);var qe=this.keyFromPublic(Ce),ze=this.hashInt(Ae.Rencoded(),qe.pubBytes(),ke),Ve=this.g.mul(Ae.S());return Ae.R().add(qe.pub().mul(ze)).eq(Ve)},Zl.prototype.hashInt=function(){for(var ke=this.hash(),Ae=0;Ae0)throw Error("Unknown option: "+Ce.join(", "));return new wc(ke)},Ae.createMessage=async function({text:ke,binary:Ae,filename:Ce,date:qe=new Date,format:ze=(void 0!==ke?"utf8":"binary"),...Ve}){let tt=void 0!==ke?ke:Ae;if(void 0===tt)throw Error("createMessage: must pass options object containing `text` or `binary`");if(ke&&!Zt.isString(ke)&&!Zt.isStream(ke))throw Error("createMessage: options.text must be a string or stream");if(Ae&&!Zt.isUint8Array(Ae)&&!Zt.isStream(Ae))throw Error("createMessage: options.binary must be a Uint8Array or stream");const rt=Object.keys(Ve);if(rt.length>0)throw Error("Unknown option: "+rt.join(", "));const it=Zt.isStream(tt);it&&(await F(),tt=j(tt));const nt=new ro(qe);void 0!==ke?nt.setText(tt,er.write(er.literal,ze)):nt.setBytes(tt,er.write(er.literal,ze)),void 0!==Ce&&nt.setFilename(Ce);const ot=new uo;ot.push(nt);const ct=new yc(ot);return ct.fromStream=it,ct},Ae.decrypt=async function({message:ke,decryptionKeys:Ae,passwords:Ce,sessionKeys:qe,verificationKeys:ze,expectSigned:Ve=!1,format:tt="utf8",signature:rt=null,date:it=new Date,config:nt,...ot}){if(Sc(nt={...tr,...nt}),vc(ke),ze=Ec(ze),Ae=Ec(Ae),Ce=Ec(Ce),qe=Ec(qe),ot.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decrypt, pass `decryptionKeys` instead");if(ot.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.decrypt, pass `verificationKeys` instead");const ct=Object.keys(ot);if(ct.length>0)throw Error("Unknown option: "+ct.join(", "));try{const ot=await ke.decrypt(Ae,Ce,qe,it,nt);ze||(ze=[]);const ct={};if(ct.signatures=rt?await ot.verifyDetached(rt,ze,it,nt):await ot.verify(ze,it,nt),ct.data="binary"===tt?ot.getLiteralData():ot.getText(),ct.filename=ot.getFilename(),xc(ct,ke),Ve){if(0===ze.length)throw Error("Verification keys are required to verify message signatures");if(0===ct.signatures.length)throw Error("Message is not signed");ct.data=W([ct.data,ae((async()=>{await Zt.anyPromise(ct.signatures.map((ke=>ke.verified)))}))])}return ct.data=await Pc(ct.data,ke.fromStream,tt),ct}catch(ke){throw Zt.wrapError("Error decrypting message",ke)}},Ae.decryptKey=async function({privateKey:ke,passphrase:Ae,config:Ce,...qe}){Sc(Ce={...tr,...Ce});const ze=Object.keys(qe);if(ze.length>0)throw Error("Unknown option: "+ze.join(", "));if(!ke.isPrivate())throw Error("Cannot decrypt a public key");const Ve=ke.clone(!0),tt=Zt.isArray(Ae)?Ae:[Ae];try{return await Promise.all(Ve.getKeys().map((ke=>Zt.anyPromise(tt.map((Ae=>ke.keyPacket.decrypt(Ae))))))),await Ve.validate(Ce),Ve}catch(ke){throw Ve.clearPrivateParams(),Zt.wrapError("Error decrypting private key",ke)}},Ae.decryptSessionKeys=async function({message:ke,decryptionKeys:Ae,passwords:Ce,date:qe=new Date,config:ze,...Ve}){if(Sc(ze={...tr,...ze}),vc(ke),Ae=Ec(Ae),Ce=Ec(Ce),Ve.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.decryptSessionKeys, pass `decryptionKeys` instead");const tt=Object.keys(Ve);if(tt.length>0)throw Error("Unknown option: "+tt.join(", "));try{return await ke.decryptSessionKeys(Ae,Ce,qe,ze)}catch(ke){throw Zt.wrapError("Error decrypting session keys",ke)}},Ae.encrypt=async function({message:ke,encryptionKeys:Ae,signingKeys:Ce,passwords:qe,sessionKey:ze,format:Ve="armored",signature:tt=null,wildcard:rt=!1,signingKeyIDs:it=[],encryptionKeyIDs:nt=[],date:ot=new Date,signingUserIDs:ct=[],encryptionUserIDs:ht=[],config:ft,...yt}){if(Sc(ft={...tr,...ft}),vc(ke),kc(Ve),Ae=Ec(Ae),Ce=Ec(Ce),qe=Ec(qe),it=Ec(it),nt=Ec(nt),ct=Ec(ct),ht=Ec(ht),yt.detached)throw Error("The `detached` option has been removed from openpgp.encrypt, separately call openpgp.sign instead. Don't forget to remove the `privateKeys` option as well.");if(yt.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encrypt, pass `encryptionKeys` instead");if(yt.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.encrypt, pass `signingKeys` instead");if(void 0!==yt.armor)throw Error("The `armor` option has been removed from openpgp.encrypt, pass `format` instead.");const mt=Object.keys(yt);if(mt.length>0)throw Error("Unknown option: "+mt.join(", "));Ce||(Ce=[]);const kt=ke.fromStream;try{if((Ce.length||tt)&&(ke=await ke.sign(Ce,tt,it,ot,ct,ft)),ke=ke.compress(await Ho("compression",Ae,ot,ht,ft),ft),ke=await ke.encrypt(Ae,qe,ze,rt,nt,ot,ht,ft),"object"===Ve)return ke;const yt="armored"===Ve;return Pc(yt?ke.armor(ft):ke.write(),kt,yt?"utf8":"binary")}catch(ke){throw Zt.wrapError("Error encrypting message",ke)}},Ae.encryptKey=async function({privateKey:ke,passphrase:Ae,config:Ce,...qe}){Sc(Ce={...tr,...Ce});const ze=Object.keys(qe);if(ze.length>0)throw Error("Unknown option: "+ze.join(", "));if(!ke.isPrivate())throw Error("Cannot encrypt a public key");const Ve=ke.clone(!0),tt=Ve.getKeys(),rt=Zt.isArray(Ae)?Ae:Array(tt.length).fill(Ae);if(rt.length!==tt.length)throw Error("Invalid number of passphrases given for key encryption");try{return await Promise.all(tt.map((async(ke,Ae)=>{const{keyPacket:qe}=ke;await qe.encrypt(rt[Ae],Ce),qe.clearPrivateParams()}))),Ve}catch(ke){throw Ve.clearPrivateParams(),Zt.wrapError("Error encrypting private key",ke)}},Ae.encryptSessionKey=async function({data:ke,algorithm:Ae,aeadAlgorithm:Ce,encryptionKeys:qe,passwords:ze,format:Ve="armored",wildcard:tt=!1,encryptionKeyIDs:rt=[],date:it=new Date,encryptionUserIDs:nt=[],config:ot,...ct}){if(Sc(ot={...tr,...ot}),function(ke,Ae){if(!Zt.isUint8Array(ke))throw Error("Parameter ["+(Ae||"data")+"] must be of type Uint8Array")}(ke),function(ke,Ae){if(!Zt.isString(ke))throw Error("Parameter ["+(Ae||"data")+"] must be of type String")}(Ae,"algorithm"),kc(Ve),qe=Ec(qe),ze=Ec(ze),rt=Ec(rt),nt=Ec(nt),ct.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.encryptSessionKey, pass `encryptionKeys` instead");const ht=Object.keys(ct);if(ht.length>0)throw Error("Unknown option: "+ht.join(", "));if(!(qe&&0!==qe.length||ze&&0!==ze.length))throw Error("No encryption keys or passwords provided.");try{return Mc(await yc.encryptSessionKey(ke,Ae,Ce,qe,ze,tt,rt,it,nt,ot),Ve,ot)}catch(ke){throw Zt.wrapError("Error encrypting session key",ke)}},Ae.enums=er,Ae.generateKey=async function({userIDs:ke=[],passphrase:Ae,type:Ce="ecc",rsaBits:qe=4096,curve:ze="curve25519",keyExpirationTime:Ve=0,date:tt=new Date,subkeys:rt=[{}],format:it="armored",config:nt,...ot}){Sc(nt={...tr,...nt}),ke=Ec(ke);const ct=Object.keys(ot);if(ct.length>0)throw Error("Unknown option: "+ct.join(", "));if(0===ke.length)throw Error("UserIDs are required for key generation");if("rsa"===Ce&&qeYo(ke.subkeys[Ce],ke)));let Ce=[Fo(ke,Ae)];Ce=Ce.concat(ke.subkeys.map((ke=>Oo(ke,Ae))));const qe=await Promise.all(Ce),ze=await fc(qe[0],qe.slice(1),ke,Ae),Ve=await ze.getRevocationCertificate(ke.date,Ae);return ze.revocationSignatures=[],{key:ze,revocationCertificate:Ve}}(ht,nt);return ke.getKeys().forEach((({keyPacket:ke})=>ec(ke,nt))),{privateKey:Mc(ke,it,nt),publicKey:Mc(ke.toPublic(),it,nt),revocationCertificate:Ae}}catch(ke){throw Zt.wrapError("Error generating keypair",ke)}},Ae.generateSessionKey=async function({encryptionKeys:ke,date:Ae=new Date,encryptionUserIDs:Ce=[],config:qe,...ze}){if(Sc(qe={...tr,...qe}),ke=Ec(ke),Ce=Ec(Ce),ze.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.generateSessionKey, pass `encryptionKeys` instead");const Ve=Object.keys(ze);if(Ve.length>0)throw Error("Unknown option: "+Ve.join(", "));try{return await yc.generateSessionKey(ke,Ae,Ce,qe)}catch(ke){throw Zt.wrapError("Error generating session key",ke)}},Ae.readCleartextMessage=async function({cleartextMessage:ke,config:Ae,...Ce}){if(Ae={...tr,...Ae},!ke)throw Error("readCleartextMessage: must pass options object containing `cleartextMessage`");if(!Zt.isString(ke))throw Error("readCleartextMessage: options.cleartextMessage must be a string");const qe=Object.keys(Ce);if(qe.length>0)throw Error("Unknown option: "+qe.join(", "));const ze=await Pe(ke);if(ze.type!==er.armor.signed)throw Error("No cleartext signed message.");const Ve=await uo.fromBinary(ze.data,Nl,Ae);!function(ke,Ae){const r=function(ke){const r=ke=>Ae=>ke.hashAlgorithm===Ae;for(let Ce=0;Ce0)throw Error("Unknown option: "+ze.join(", "));let Ve;if(ke){const{type:Ae,data:qe}=await Pe(ke,Ce);if(Ae!==er.armor.publicKey&&Ae!==er.armor.privateKey)throw Error("Armored text not of type key");Ve=qe}else Ve=Ae;return oc(await uo.fromBinary(Ve,Cl,Ce))},Ae.readKeys=async function({armoredKeys:ke,binaryKeys:Ae,config:Ce,...qe}){Ce={...tr,...Ce};let ze=ke||Ae;if(!ze)throw Error("readKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(ke&&!Zt.isString(ke))throw Error("readKeys: options.armoredKeys must be a string");if(Ae&&!Zt.isUint8Array(Ae))throw Error("readKeys: options.binaryKeys must be a Uint8Array");const Ve=Object.keys(qe);if(Ve.length>0)throw Error("Unknown option: "+Ve.join(", "));if(ke){const{type:Ae,data:qe}=await Pe(ke,Ce);if(Ae!==er.armor.publicKey&&Ae!==er.armor.privateKey)throw Error("Armored text not of type key");ze=qe}const tt=[],rt=await uo.fromBinary(ze,Cl,Ce),it=rt.indexOfTag(er.packet.publicKey,er.packet.secretKey);if(0===it.length)throw Error("No key packet found");for(let ke=0;ke0)throw Error("Unknown option: "+Ve.join(", "));const tt=Zt.isStream(ze);if(tt&&(await F(),ze=j(ze)),ke){const{type:ke,data:Ae}=await Pe(ze,Ce);if(ke!==er.armor.message)throw Error("Armored text not of type message");ze=Ae}const rt=await uo.fromBinary(ze,Tl,Ce),it=new yc(rt);return it.fromStream=tt,it},Ae.readPrivateKey=async function({armoredKey:ke,binaryKey:Ae,config:Ce,...qe}){if(Ce={...tr,...Ce},!ke&&!Ae)throw Error("readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`");if(ke&&!Zt.isString(ke))throw Error("readPrivateKey: options.armoredKey must be a string");if(Ae&&!Zt.isUint8Array(Ae))throw Error("readPrivateKey: options.binaryKey must be a Uint8Array");const ze=Object.keys(qe);if(ze.length>0)throw Error("Unknown option: "+ze.join(", "));let Ve;if(ke){const{type:Ae,data:qe}=await Pe(ke,Ce);if(Ae!==er.armor.privateKey)throw Error("Armored text not of type private key");Ve=qe}else Ve=Ae;const tt=await uo.fromBinary(Ve,Cl,Ce);return new uc(tt)},Ae.readPrivateKeys=async function({armoredKeys:ke,binaryKeys:Ae,config:Ce}){Ce={...tr,...Ce};let qe=ke||Ae;if(!qe)throw Error("readPrivateKeys: must pass options object containing `armoredKeys` or `binaryKeys`");if(ke&&!Zt.isString(ke))throw Error("readPrivateKeys: options.armoredKeys must be a string");if(Ae&&!Zt.isUint8Array(Ae))throw Error("readPrivateKeys: options.binaryKeys must be a Uint8Array");if(ke){const{type:Ae,data:ze}=await Pe(ke,Ce);if(Ae!==er.armor.privateKey)throw Error("Armored text not of type private key");qe=ze}const ze=[],Ve=await uo.fromBinary(qe,Cl,Ce),tt=Ve.indexOfTag(er.packet.secretKey);if(0===tt.length)throw Error("No secret key packet found");for(let ke=0;ke0)throw Error("Unknown option: "+Ve.join(", "));if(ke){const{type:ke,data:Ae}=await Pe(ze,Ce);if(ke!==er.armor.signature)throw Error("Armored text not of type signature");ze=Ae}const tt=await uo.fromBinary(ze,Al,Ce);return new qo(tt)},Ae.reformatKey=async function({privateKey:ke,userIDs:Ae=[],passphrase:Ce,keyExpirationTime:qe=0,date:ze,format:Ve="armored",config:tt,...rt}){Sc(tt={...tr,...tt}),Ae=Ec(Ae);const it=Object.keys(rt);if(it.length>0)throw Error("Unknown option: "+it.join(", "));if(0===Ae.length)throw Error("UserIDs are required for key reformat");const nt={privateKey:ke,userIDs:Ae,passphrase:Ce,keyExpirationTime:qe,date:ze};try{const{key:ke,revocationCertificate:Ae}=await async function(ke,Ae){ke=o(ke);const{privateKey:Ce}=ke;if(!Ce.isPrivate())throw Error("Cannot reformat a public key");if(Ce.keyPacket.isDummy())throw Error("Cannot reformat a gnu-dummy primary key");if(!Ce.getKeys().every((({keyPacket:ke})=>ke.isDecrypted())))throw Error("Key is not decrypted");const qe=Ce.keyPacket;ke.subkeys||(ke.subkeys=await Promise.all(Ce.subkeys.map((async ke=>{const Ce=ke.keyPacket,ze={key:qe,bind:Ce},Ve=await No(ke.bindingSignatures,qe,er.signature.subkeyBinding,ze,null,Ae).catch((()=>({})));return{sign:Ve.keyFlags&&Ve.keyFlags[0]&er.keyFlags.signData}}))));const ze=Ce.subkeys.map((ke=>ke.keyPacket));if(ke.subkeys.length!==ze.length)throw Error("Number of subkey options does not match number of subkeys");ke.subkeys=ke.subkeys.map((Ae=>o(Ae,ke)));const Ve=await fc(qe,ze,ke,Ae),tt=await Ve.getRevocationCertificate(ke.date,Ae);return Ve.revocationSignatures=[],{key:Ve,revocationCertificate:tt};function o(ke,Ae={}){return ke.keyExpirationTime=ke.keyExpirationTime||Ae.keyExpirationTime,ke.passphrase=Zt.isString(ke.passphrase)?ke.passphrase:Ae.passphrase,ke.date=ke.date||Ae.date,ke}}(nt,tt);return{privateKey:Mc(ke,Ve,tt),publicKey:Mc(ke.toPublic(),Ve,tt),revocationCertificate:Ae}}catch(ke){throw Zt.wrapError("Error reformatting keypair",ke)}},Ae.revokeKey=async function({key:ke,revocationCertificate:Ae,reasonForRevocation:Ce,date:qe=new Date,format:ze="armored",config:Ve,...tt}){Sc(Ve={...tr,...Ve});const rt=Object.keys(tt);if(rt.length>0)throw Error("Unknown option: "+rt.join(", "));try{const tt=Ae?await ke.applyRevocationCertificate(Ae,qe,Ve):await ke.revoke(Ce,qe,Ve);return tt.isPrivate()?{privateKey:Mc(tt,ze,Ve),publicKey:Mc(tt.toPublic(),ze,Ve)}:{privateKey:null,publicKey:Mc(tt,ze,Ve)}}catch(ke){throw Zt.wrapError("Error revoking key",ke)}},Ae.sign=async function({message:ke,signingKeys:Ae,format:Ce="armored",detached:qe=!1,signingKeyIDs:ze=[],date:Ve=new Date,signingUserIDs:tt=[],config:rt,...it}){if(Sc(rt={...tr,...rt}),_c(ke),kc(Ce),Ae=Ec(Ae),ze=Ec(ze),tt=Ec(tt),it.privateKeys)throw Error("The `privateKeys` option has been removed from openpgp.sign, pass `signingKeys` instead");if(void 0!==it.armor)throw Error("The `armor` option has been removed from openpgp.sign, pass `format` instead.");const nt=Object.keys(it);if(nt.length>0)throw Error("Unknown option: "+nt.join(", "));if(ke instanceof wc&&"binary"===Ce)throw Error("Cannot return signed cleartext message in binary format");if(ke instanceof wc&&qe)throw Error("Cannot detach-sign a cleartext message");if(!Ae||0===Ae.length)throw Error("No signing keys provided");try{let it;if(it=qe?await ke.signDetached(Ae,void 0,ze,Ve,tt,rt):await ke.sign(Ae,void 0,ze,Ve,tt,rt),"object"===Ce)return it;const nt="armored"===Ce;return it=nt?it.armor(rt):it.write(),qe&&(it=X(ke.packets.write(),(async(ke,Ae)=>{await Promise.all([V(it,Ae),ie(ke).catch((()=>{}))])}))),Pc(it,ke.fromStream,nt?"utf8":"binary")}catch(ke){throw Zt.wrapError("Error signing message",ke)}},Ae.unarmor=Pe,Ae.verify=async function({message:ke,verificationKeys:Ae,expectSigned:Ce=!1,format:qe="utf8",signature:ze=null,date:Ve=new Date,config:tt,...rt}){if(Sc(tt={...tr,...tt}),_c(ke),Ae=Ec(Ae),rt.publicKeys)throw Error("The `publicKeys` option has been removed from openpgp.verify, pass `verificationKeys` instead");const it=Object.keys(rt);if(it.length>0)throw Error("Unknown option: "+it.join(", "));if(ke instanceof wc&&"binary"===qe)throw Error("Can't return cleartext message data as binary");if(ke instanceof wc&&ze)throw Error("Can't verify detached cleartext signature");try{const rt={};if(rt.signatures=ze?await ke.verifyDetached(ze,Ae,Ve,tt):await ke.verify(Ae,Ve,tt),rt.data="binary"===qe?ke.getLiteralData():ke.getText(),ke.fromStream&&xc(rt,ke),Ce){if(0===rt.signatures.length)throw Error("Message is not signed");rt.data=W([rt.data,ae((async()=>{await Zt.anyPromise(rt.signatures.map((ke=>ke.verified)))}))])}return rt.data=await Pc(rt.data,ke.fromStream,qe),rt}catch(ke){throw Zt.wrapError("Error verifying signed message",ke)}}},5118:(ke,Ae,Ce)=>{"use strict";var qe=Ce(4300);var ze=qe.Buffer;var Ve={};var tt;for(tt in qe){if(!qe.hasOwnProperty(tt))continue;if(tt==="SlowBuffer"||tt==="Buffer")continue;Ve[tt]=qe[tt]}var rt=Ve.Buffer={};for(tt in ze){if(!ze.hasOwnProperty(tt))continue;if(tt==="allocUnsafe"||tt==="allocUnsafeSlow")continue;rt[tt]=ze[tt]}Ve.Buffer.prototype=ze.prototype;if(!rt.from||rt.from===Uint8Array.from){rt.from=function(ke,Ae,Ce){if(typeof ke==="number"){throw new TypeError('The "value" argument must not be of type number. Received type '+typeof ke)}if(ke&&typeof ke.length==="undefined"){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ke)}return ze(ke,Ae,Ce)}}if(!rt.alloc){rt.alloc=function(ke,Ae,Ce){if(typeof ke!=="number"){throw new TypeError('The "size" argument must be of type number. Received type '+typeof ke)}if(ke<0||ke>=2*(1<<30)){throw new RangeError('The value "'+ke+'" is invalid for option "size"')}var qe=ze(ke);if(!Ae||Ae.length===0){qe.fill(0)}else if(typeof Ce==="string"){qe.fill(Ae,Ce)}else{qe.fill(Ae)}return qe}}if(!Ve.kStringMaxLength){try{Ve.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(ke){}}if(!Ve.constants){Ve.constants={MAX_LENGTH:Ve.kMaxLength};if(Ve.kStringMaxLength){Ve.constants.MAX_STRING_LENGTH=Ve.kStringMaxLength}}ke.exports=Ve},4294:(ke,Ae,Ce)=>{ke.exports=Ce(4219)},4219:(ke,Ae,Ce)=>{"use strict";var qe=Ce(1808);var ze=Ce(4404);var Ve=Ce(3685);var tt=Ce(5687);var rt=Ce(2361);var it=Ce(9491);var nt=Ce(3837);Ae.httpOverHttp=httpOverHttp;Ae.httpsOverHttp=httpsOverHttp;Ae.httpOverHttps=httpOverHttps;Ae.httpsOverHttps=httpsOverHttps;function httpOverHttp(ke){var Ae=new TunnelingAgent(ke);Ae.request=Ve.request;return Ae}function httpsOverHttp(ke){var Ae=new TunnelingAgent(ke);Ae.request=Ve.request;Ae.createSocket=createSecureSocket;Ae.defaultPort=443;return Ae}function httpOverHttps(ke){var Ae=new TunnelingAgent(ke);Ae.request=tt.request;return Ae}function httpsOverHttps(ke){var Ae=new TunnelingAgent(ke);Ae.request=tt.request;Ae.createSocket=createSecureSocket;Ae.defaultPort=443;return Ae}function TunnelingAgent(ke){var Ae=this;Ae.options=ke||{};Ae.proxyOptions=Ae.options.proxy||{};Ae.maxSockets=Ae.options.maxSockets||Ve.Agent.defaultMaxSockets;Ae.requests=[];Ae.sockets=[];Ae.on("free",(function onFree(ke,Ce,qe,ze){var Ve=toOptions(Ce,qe,ze);for(var tt=0,rt=Ae.requests.length;tt=this.maxSockets){ze.requests.push(Ve);return}ze.createSocket(Ve,(function(Ae){Ae.on("free",onFree);Ae.on("close",onCloseOrRemove);Ae.on("agentRemove",onCloseOrRemove);ke.onSocket(Ae);function onFree(){ze.emit("free",Ae,Ve)}function onCloseOrRemove(ke){ze.removeSocket(Ae);Ae.removeListener("free",onFree);Ae.removeListener("close",onCloseOrRemove);Ae.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(ke,Ae){var Ce=this;var qe={};Ce.sockets.push(qe);var ze=mergeOptions({},Ce.proxyOptions,{method:"CONNECT",path:ke.host+":"+ke.port,agent:false,headers:{host:ke.host+":"+ke.port}});if(ke.localAddress){ze.localAddress=ke.localAddress}if(ze.proxyAuth){ze.headers=ze.headers||{};ze.headers["Proxy-Authorization"]="Basic "+new Buffer(ze.proxyAuth).toString("base64")}ot("making CONNECT request");var Ve=Ce.request(ze);Ve.useChunkedEncodingByDefault=false;Ve.once("response",onResponse);Ve.once("upgrade",onUpgrade);Ve.once("connect",onConnect);Ve.once("error",onError);Ve.end();function onResponse(ke){ke.upgrade=true}function onUpgrade(ke,Ae,Ce){process.nextTick((function(){onConnect(ke,Ae,Ce)}))}function onConnect(ze,tt,rt){Ve.removeAllListeners();tt.removeAllListeners();if(ze.statusCode!==200){ot("tunneling socket could not be established, statusCode=%d",ze.statusCode);tt.destroy();var it=new Error("tunneling socket could not be established, "+"statusCode="+ze.statusCode);it.code="ECONNRESET";ke.request.emit("error",it);Ce.removeSocket(qe);return}if(rt.length>0){ot("got illegal response body from proxy");tt.destroy();var it=new Error("got illegal response body from proxy");it.code="ECONNRESET";ke.request.emit("error",it);Ce.removeSocket(qe);return}ot("tunneling connection has established");Ce.sockets[Ce.sockets.indexOf(qe)]=tt;return Ae(tt)}function onError(Ae){Ve.removeAllListeners();ot("tunneling socket could not be established, cause=%s\n",Ae.message,Ae.stack);var ze=new Error("tunneling socket could not be established, "+"cause="+Ae.message);ze.code="ECONNRESET";ke.request.emit("error",ze);Ce.removeSocket(qe)}};TunnelingAgent.prototype.removeSocket=function removeSocket(ke){var Ae=this.sockets.indexOf(ke);if(Ae===-1){return}this.sockets.splice(Ae,1);var Ce=this.requests.shift();if(Ce){this.createSocket(Ce,(function(ke){Ce.request.onSocket(ke)}))}};function createSecureSocket(ke,Ae){var Ce=this;TunnelingAgent.prototype.createSocket.call(Ce,ke,(function(qe){var Ve=ke.request.getHeader("host");var tt=mergeOptions({},Ce.options,{socket:qe,servername:Ve?Ve.replace(/:.*$/,""):ke.host});var rt=ze.connect(0,tt);Ce.sockets[Ce.sockets.indexOf(qe)]=rt;Ae(rt)}))}function toOptions(ke,Ae,Ce){if(typeof ke==="string"){return{host:ke,port:Ae,localAddress:Ce}}return ke}function mergeOptions(ke){for(var Ae=1,Ce=arguments.length;Ae{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Object.defineProperty(Ae,"v1",{enumerable:true,get:function(){return qe.default}});Object.defineProperty(Ae,"v3",{enumerable:true,get:function(){return ze.default}});Object.defineProperty(Ae,"v4",{enumerable:true,get:function(){return Ve.default}});Object.defineProperty(Ae,"v5",{enumerable:true,get:function(){return tt.default}});Object.defineProperty(Ae,"NIL",{enumerable:true,get:function(){return rt.default}});Object.defineProperty(Ae,"version",{enumerable:true,get:function(){return it.default}});Object.defineProperty(Ae,"validate",{enumerable:true,get:function(){return nt.default}});Object.defineProperty(Ae,"stringify",{enumerable:true,get:function(){return ot.default}});Object.defineProperty(Ae,"parse",{enumerable:true,get:function(){return ct.default}});var qe=_interopRequireDefault(Ce(8628));var ze=_interopRequireDefault(Ce(6409));var Ve=_interopRequireDefault(Ce(5122));var tt=_interopRequireDefault(Ce(9120));var rt=_interopRequireDefault(Ce(5332));var it=_interopRequireDefault(Ce(1595));var nt=_interopRequireDefault(Ce(6900));var ot=_interopRequireDefault(Ce(8950));var ct=_interopRequireDefault(Ce(2746));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}},4569:(ke,Ae,Ce)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=void 0;var qe=_interopRequireDefault(Ce(6113));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}function md5(ke){if(Array.isArray(ke)){ke=Buffer.from(ke)}else if(typeof ke==="string"){ke=Buffer.from(ke,"utf8")}return qe.default.createHash("md5").update(ke).digest()}var ze=md5;Ae["default"]=ze},5332:(ke,Ae)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=void 0;var Ce="00000000-0000-0000-0000-000000000000";Ae["default"]=Ce},2746:(ke,Ae,Ce)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=void 0;var qe=_interopRequireDefault(Ce(6900));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}function parse(ke){if(!(0,qe.default)(ke)){throw TypeError("Invalid UUID")}let Ae;const Ce=new Uint8Array(16);Ce[0]=(Ae=parseInt(ke.slice(0,8),16))>>>24;Ce[1]=Ae>>>16&255;Ce[2]=Ae>>>8&255;Ce[3]=Ae&255;Ce[4]=(Ae=parseInt(ke.slice(9,13),16))>>>8;Ce[5]=Ae&255;Ce[6]=(Ae=parseInt(ke.slice(14,18),16))>>>8;Ce[7]=Ae&255;Ce[8]=(Ae=parseInt(ke.slice(19,23),16))>>>8;Ce[9]=Ae&255;Ce[10]=(Ae=parseInt(ke.slice(24,36),16))/1099511627776&255;Ce[11]=Ae/4294967296&255;Ce[12]=Ae>>>24&255;Ce[13]=Ae>>>16&255;Ce[14]=Ae>>>8&255;Ce[15]=Ae&255;return Ce}var ze=parse;Ae["default"]=ze},814:(ke,Ae)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=void 0;var Ce=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;Ae["default"]=Ce},807:(ke,Ae,Ce)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=rng;var qe=_interopRequireDefault(Ce(6113));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}const ze=new Uint8Array(256);let Ve=ze.length;function rng(){if(Ve>ze.length-16){qe.default.randomFillSync(ze);Ve=0}return ze.slice(Ve,Ve+=16)}},5274:(ke,Ae,Ce)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=void 0;var qe=_interopRequireDefault(Ce(6113));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}function sha1(ke){if(Array.isArray(ke)){ke=Buffer.from(ke)}else if(typeof ke==="string"){ke=Buffer.from(ke,"utf8")}return qe.default.createHash("sha1").update(ke).digest()}var ze=sha1;Ae["default"]=ze},8950:(ke,Ae,Ce)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=void 0;var qe=_interopRequireDefault(Ce(6900));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}const ze=[];for(let ke=0;ke<256;++ke){ze.push((ke+256).toString(16).substr(1))}function stringify(ke,Ae=0){const Ce=(ze[ke[Ae+0]]+ze[ke[Ae+1]]+ze[ke[Ae+2]]+ze[ke[Ae+3]]+"-"+ze[ke[Ae+4]]+ze[ke[Ae+5]]+"-"+ze[ke[Ae+6]]+ze[ke[Ae+7]]+"-"+ze[ke[Ae+8]]+ze[ke[Ae+9]]+"-"+ze[ke[Ae+10]]+ze[ke[Ae+11]]+ze[ke[Ae+12]]+ze[ke[Ae+13]]+ze[ke[Ae+14]]+ze[ke[Ae+15]]).toLowerCase();if(!(0,qe.default)(Ce)){throw TypeError("Stringified UUID is invalid")}return Ce}var Ve=stringify;Ae["default"]=Ve},8628:(ke,Ae,Ce)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=void 0;var qe=_interopRequireDefault(Ce(807));var ze=_interopRequireDefault(Ce(8950));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}let Ve;let tt;let rt=0;let it=0;function v1(ke,Ae,Ce){let nt=Ae&&Ce||0;const ot=Ae||new Array(16);ke=ke||{};let ct=ke.node||Ve;let ht=ke.clockseq!==undefined?ke.clockseq:tt;if(ct==null||ht==null){const Ae=ke.random||(ke.rng||qe.default)();if(ct==null){ct=Ve=[Ae[0]|1,Ae[1],Ae[2],Ae[3],Ae[4],Ae[5]]}if(ht==null){ht=tt=(Ae[6]<<8|Ae[7])&16383}}let ft=ke.msecs!==undefined?ke.msecs:Date.now();let yt=ke.nsecs!==undefined?ke.nsecs:it+1;const mt=ft-rt+(yt-it)/1e4;if(mt<0&&ke.clockseq===undefined){ht=ht+1&16383}if((mt<0||ft>rt)&&ke.nsecs===undefined){yt=0}if(yt>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}rt=ft;it=yt;tt=ht;ft+=122192928e5;const kt=((ft&268435455)*1e4+yt)%4294967296;ot[nt++]=kt>>>24&255;ot[nt++]=kt>>>16&255;ot[nt++]=kt>>>8&255;ot[nt++]=kt&255;const St=ft/4294967296*1e4&268435455;ot[nt++]=St>>>8&255;ot[nt++]=St&255;ot[nt++]=St>>>24&15|16;ot[nt++]=St>>>16&255;ot[nt++]=ht>>>8|128;ot[nt++]=ht&255;for(let ke=0;ke<6;++ke){ot[nt+ke]=ct[ke]}return Ae||(0,ze.default)(ot)}var nt=v1;Ae["default"]=nt},6409:(ke,Ae,Ce)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=void 0;var qe=_interopRequireDefault(Ce(5998));var ze=_interopRequireDefault(Ce(4569));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}const Ve=(0,qe.default)("v3",48,ze.default);var tt=Ve;Ae["default"]=tt},5998:(ke,Ae,Ce)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=_default;Ae.URL=Ae.DNS=void 0;var qe=_interopRequireDefault(Ce(8950));var ze=_interopRequireDefault(Ce(2746));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}function stringToBytes(ke){ke=unescape(encodeURIComponent(ke));const Ae=[];for(let Ce=0;Ce{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=void 0;var qe=_interopRequireDefault(Ce(807));var ze=_interopRequireDefault(Ce(8950));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}function v4(ke,Ae,Ce){ke=ke||{};const Ve=ke.random||(ke.rng||qe.default)();Ve[6]=Ve[6]&15|64;Ve[8]=Ve[8]&63|128;if(Ae){Ce=Ce||0;for(let ke=0;ke<16;++ke){Ae[Ce+ke]=Ve[ke]}return Ae}return(0,ze.default)(Ve)}var Ve=v4;Ae["default"]=Ve},9120:(ke,Ae,Ce)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=void 0;var qe=_interopRequireDefault(Ce(5998));var ze=_interopRequireDefault(Ce(5274));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}const Ve=(0,qe.default)("v5",80,ze.default);var tt=Ve;Ae["default"]=tt},6900:(ke,Ae,Ce)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=void 0;var qe=_interopRequireDefault(Ce(814));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}function validate(ke){return typeof ke==="string"&&qe.default.test(ke)}var ze=validate;Ae["default"]=ze},1595:(ke,Ae,Ce)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:true});Ae["default"]=void 0;var qe=_interopRequireDefault(Ce(6900));function _interopRequireDefault(ke){return ke&&ke.__esModule?ke:{default:ke}}function version(ke){if(!(0,qe.default)(ke)){throw TypeError("Invalid UUID")}return parseInt(ke.substr(14,1),16)}var ze=version;Ae["default"]=ze},8954:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;var ze=Object.getOwnPropertyDescriptor(Ae,Ce);if(!ze||("get"in ze?!Ae.__esModule:ze.writable||ze.configurable)){ze={enumerable:true,get:function(){return Ae[Ce]}}}Object.defineProperty(ke,qe,ze)}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.getInputs=void 0;const rt=Ve(Ce(2186));function getInputs(){return tt(this,void 0,void 0,(function*(){return{gpgPrivateKey:rt.getInput("gpg_private_key",{required:true}),passphrase:rt.getInput("passphrase"),gitConfigGlobal:rt.getBooleanInput("git_config_global"),gitUserSigningkey:rt.getBooleanInput("git_user_signingkey"),gitCommitGpgsign:rt.getBooleanInput("git_commit_gpgsign"),gitTagGpgsign:rt.getBooleanInput("git_tag_gpgsign"),gitPushGpgsign:rt.getInput("git_push_gpgsign")||"if-asked",gitCommitterName:rt.getInput("git_committer_name"),gitCommitterEmail:rt.getInput("git_committer_email"),workdir:rt.getInput("workdir")||".",fingerprint:rt.getInput("fingerprint")}}))}Ae.getInputs=getInputs},6350:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;var ze=Object.getOwnPropertyDescriptor(Ae,Ce);if(!ze||("get"in ze?!Ae.__esModule:ze.writable||ze.configurable)){ze={enumerable:true,get:function(){return Ae[Ce]}}}Object.defineProperty(ke,qe,ze)}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.setConfig=void 0;const rt=Ve(Ce(1514));const git=(ke=[])=>tt(void 0,void 0,void 0,(function*(){return yield rt.getExecOutput(`git`,ke,{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}return ke.stdout.trim()}))}));function setConfig(ke,Ae,Ce){return tt(this,void 0,void 0,(function*(){const qe=["config"];if(Ce){qe.push("--global")}qe.push(ke,Ae);yield git(qe)}))}Ae.setConfig=setConfig},3759:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;var ze=Object.getOwnPropertyDescriptor(Ae,Ce);if(!ze||("get"in ze?!Ae.__esModule:ze.writable||ze.configurable)){ze={enumerable:true,get:function(){return Ae[Ce]}}}Object.defineProperty(ke,qe,ze)}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});Ae.killAgent=Ae.deleteKey=Ae.presetPassphrase=Ae.configureAgent=Ae.getKeygrip=Ae.parseKeygripFromGpgColonsOutput=Ae.getKeygrips=Ae.importKey=Ae.getDirs=Ae.getVersion=Ae.agentConfig=void 0;const rt=Ve(Ce(1514));const it=Ve(Ce(7147));const nt=Ve(Ce(1017));const ot=Ve(Ce(2037));const ct=Ve(Ce(5728));Ae.agentConfig=`default-cache-ttl 21600\nmax-cache-ttl 31536000\nallow-preset-passphrase`;const getGnupgHome=()=>tt(void 0,void 0,void 0,(function*(){if(process.env.GNUPGHOME){return process.env.GNUPGHOME}let ke=nt.join(process.env.HOME||"",".gnupg");if(ot.platform()=="win32"&&!process.env.HOME){ke=nt.join(process.env.USERPROFILE||"",".gnupg")}return ke}));const gpgConnectAgent=ke=>tt(void 0,void 0,void 0,(function*(){return yield rt.getExecOutput(`gpg-connect-agent "${ke}" /bye`,[],{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}for(const Ae of ke.stdout.replace(/\r/g,"").trim().split(/\n/g)){if(Ae.startsWith("ERR")){throw new Error(Ae)}}return ke.stdout.trim()}))}));const getVersion=()=>tt(void 0,void 0,void 0,(function*(){return yield rt.getExecOutput("gpg",["--version"],{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}let Ae="";let Ce="";for(const qe of ke.stdout.replace(/\r/g,"").trim().split(/\n/g)){if(qe.startsWith("gpg (GnuPG) ")){Ae=qe.substr("gpg (GnuPG) ".length).trim()}else if(qe.startsWith("gpg (GnuPG/MacGPG2) ")){Ae=qe.substr("gpg (GnuPG/MacGPG2) ".length).trim()}else if(qe.startsWith("libgcrypt ")){Ce=qe.substr("libgcrypt ".length).trim()}}return{gnupg:Ae,libgcrypt:Ce}}))}));Ae.getVersion=getVersion;const getDirs=()=>tt(void 0,void 0,void 0,(function*(){return yield rt.getExecOutput("gpgconf",["--list-dirs"],{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}let Ae="";let Ce="";let qe="";let ze="";for(const Ve of ke.stdout.replace(/\r/g,"").trim().split(/\n/g)){if(Ve.startsWith("libdir:")){Ae=Ve.substr("libdir:".length).replace("%3a",":").trim()}else if(Ve.startsWith("libexecdir:")){Ce=Ve.substr("libexecdir:".length).replace("%3a",":").trim()}else if(Ve.startsWith("datadir:")){qe=Ve.substr("datadir:".length).replace("%3a",":").trim()}else if(Ve.startsWith("homedir:")){ze=Ve.substr("homedir:".length).replace("%3a",":").trim()}}return{libdir:Ae,libexecdir:Ce,datadir:qe,homedir:ze}}))}));Ae.getDirs=getDirs;const importKey=ke=>tt(void 0,void 0,void 0,(function*(){const Ae=it.mkdtempSync(nt.join(ot.tmpdir(),"ghaction-import-gpg-"));const Ce=`${Ae}/key.pgp`;it.writeFileSync(Ce,(yield ct.isArmored(ke))?ke:Buffer.from(ke,"base64").toString(),{mode:384});return yield rt.getExecOutput("gpg",["--import","--batch","--yes",Ce],{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}if(ke.stderr!=""){return ke.stderr.trim()}return ke.stdout.trim()})).finally((()=>{it.unlinkSync(Ce)}))}));Ae.importKey=importKey;const getKeygrips=ke=>tt(void 0,void 0,void 0,(function*(){return yield rt.getExecOutput("gpg",["--batch","--with-colons","--with-keygrip","--list-secret-keys",ke],{ignoreReturnCode:true,silent:true}).then((ke=>{const Ae=[];for(const Ce of ke.stdout.replace(/\r/g,"").trim().split(/\n/g)){if(Ce.startsWith("grp")){Ae.push(Ce.replace(/(grp|:)/g,"").trim())}}return Ae}))}));Ae.getKeygrips=getKeygrips;const parseKeygripFromGpgColonsOutput=(ke,Ae)=>{let Ce="";let qe=false;const ze=ke.replace(/\r/g,"").trim().split(/\n/g);for(const ke of ze){if(ke.startsWith(`fpr:`)&&ke.includes(`:${Ae}:`)){qe=true;continue}if(ke.startsWith("grp:")&&qe){Ce=ke.replace(/(grp|:)/g,"").trim();break}}return Ce};Ae.parseKeygripFromGpgColonsOutput=parseKeygripFromGpgColonsOutput;const getKeygrip=ke=>tt(void 0,void 0,void 0,(function*(){return yield rt.getExecOutput("gpg",["--batch","--with-colons","--with-keygrip","--list-secret-keys",ke],{ignoreReturnCode:true,silent:true}).then((Ce=>(0,Ae.parseKeygripFromGpgColonsOutput)(Ce.stdout,ke)))}));Ae.getKeygrip=getKeygrip;const configureAgent=ke=>tt(void 0,void 0,void 0,(function*(){const Ae=nt.join(yield getGnupgHome(),"gpg-agent.conf");yield it.writeFile(Ae,ke,(function(ke){if(ke)throw ke}));yield gpgConnectAgent("RELOADAGENT")}));Ae.configureAgent=configureAgent;const presetPassphrase=(ke,Ae)=>tt(void 0,void 0,void 0,(function*(){const Ce=Buffer.from(Ae,"utf8").toString("hex").toUpperCase();yield gpgConnectAgent(`PRESET_PASSPHRASE ${ke} -1 ${Ce}`);return yield gpgConnectAgent(`KEYINFO ${ke}`)}));Ae.presetPassphrase=presetPassphrase;const deleteKey=ke=>tt(void 0,void 0,void 0,(function*(){yield rt.getExecOutput("gpg",["--batch","--yes","--delete-secret-keys",ke],{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}}));yield rt.getExecOutput("gpg",["--batch","--yes","--delete-keys",ke],{ignoreReturnCode:true,silent:true}).then((ke=>{if(ke.stderr.length>0&&ke.exitCode!=0){throw new Error(ke.stderr)}}))}));Ae.deleteKey=deleteKey;const killAgent=()=>tt(void 0,void 0,void 0,(function*(){yield gpgConnectAgent("KILLAGENT")}));Ae.killAgent=killAgent},399:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;var ze=Object.getOwnPropertyDescriptor(Ae,Ce);if(!ze||("get"in ze?!Ae.__esModule:ze.writable||ze.configurable)){ze={enumerable:true,get:function(){return Ae[Ce]}}}Object.defineProperty(ke,qe,ze)}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};Object.defineProperty(Ae,"__esModule",{value:true});const rt=Ve(Ce(2186));const it=Ve(Ce(8954));const nt=Ve(Ce(6350));const ot=Ve(Ce(3759));const ct=Ve(Ce(5728));const ht=Ve(Ce(963));function run(){return tt(this,void 0,void 0,(function*(){try{const ke=yield it.getInputs();if(ke.workdir&&ke.workdir!=="."){rt.info(`Using ${ke.workdir} as working directory...`);process.chdir(ke.workdir)}const Ae=yield ot.getVersion();const Ce=yield ot.getDirs();yield rt.group(`GnuPG info`,(()=>tt(this,void 0,void 0,(function*(){rt.info(`Version : ${Ae.gnupg} (libgcrypt ${Ae.libgcrypt})`);rt.info(`Libdir : ${Ce.libdir}`);rt.info(`Libexecdir : ${Ce.libexecdir}`);rt.info(`Datadir : ${Ce.datadir}`);rt.info(`Homedir : ${Ce.homedir}`)}))));const qe=yield ct.readPrivateKey(ke.gpgPrivateKey);yield rt.group(`GPG private key info`,(()=>tt(this,void 0,void 0,(function*(){rt.info(`Fingerprint : ${qe.fingerprint}`);rt.info(`KeyID : ${qe.keyID}`);rt.info(`Name : ${qe.name}`);rt.info(`Email : ${qe.email}`);rt.info(`CreationTime : ${qe.creationTime}`)}))));ht.setFingerprint(qe.fingerprint);let ze=qe.fingerprint;if(ke.fingerprint){ze=ke.fingerprint}yield rt.group(`Fingerprint to use`,(()=>tt(this,void 0,void 0,(function*(){rt.info(ze)}))));yield rt.group(`Importing GPG private key`,(()=>tt(this,void 0,void 0,(function*(){yield ot.importKey(ke.gpgPrivateKey).then((ke=>{rt.info(ke)}))}))));if(ke.passphrase&&!ke.fingerprint){rt.info("Configuring GnuPG agent");yield ot.configureAgent(ot.agentConfig);yield rt.group(`Getting keygrips`,(()=>tt(this,void 0,void 0,(function*(){for(const Ae of yield ot.getKeygrips(ze)){rt.info(`Presetting passphrase for ${Ae}`);yield ot.presetPassphrase(Ae,ke.passphrase).then((ke=>{rt.debug(ke)}))}}))))}if(ke.passphrase&&ke.fingerprint){rt.info("Configuring GnuPG agent");yield ot.configureAgent(ot.agentConfig);yield rt.group(`Getting keygrip for fingerprint`,(()=>tt(this,void 0,void 0,(function*(){const Ae=yield ot.getKeygrip(ze);rt.info(`Presetting passphrase for key ${ze} with keygrip ${Ae}`);yield ot.presetPassphrase(Ae,ke.passphrase).then((ke=>{rt.debug(ke)}))}))))}yield rt.group(`Setting outputs`,(()=>tt(this,void 0,void 0,(function*(){rt.info(`fingerprint=${ze}`);rt.setOutput("fingerprint",ze);rt.info(`keyid=${qe.keyID}`);rt.setOutput("keyid",qe.keyID);rt.info(`name=${qe.name}`);rt.setOutput("name",qe.name);rt.info(`email=${qe.email}`);rt.setOutput("email",qe.email)}))));if(ke.gitUserSigningkey){rt.info("Setting GPG signing keyID for this Git repository");yield nt.setConfig("user.signingkey",qe.keyID,ke.gitConfigGlobal);const Ae=ke.gitCommitterEmail||qe.email;const Ce=ke.gitCommitterName||qe.name;if(Ae!=qe.email){rt.setFailed(`Committer email "${ke.gitCommitterEmail}" (name: "${ke.gitCommitterName}") does not match GPG private key email "${qe.email}" (name: "${qe.name}")`);return}rt.info(`Configuring Git committer (${Ce} <${Ae}>)`);yield nt.setConfig("user.name",Ce,ke.gitConfigGlobal);yield nt.setConfig("user.email",Ae,ke.gitConfigGlobal);if(ke.gitCommitGpgsign){rt.info("Sign all commits automatically");yield nt.setConfig("commit.gpgsign","true",ke.gitConfigGlobal)}if(ke.gitTagGpgsign){rt.info("Sign all tags automatically");yield nt.setConfig("tag.gpgsign","true",ke.gitConfigGlobal)}if(ke.gitPushGpgsign){rt.info("Sign all pushes automatically");yield nt.setConfig("push.gpgsign",ke.gitPushGpgsign,ke.gitConfigGlobal)}}}catch(ke){rt.setFailed(ke.message)}}))}function cleanup(){return tt(this,void 0,void 0,(function*(){if(ht.fingerprint.length<=0){rt.debug("Primary key fingerprint is not defined. Skipping cleanup.");return}try{rt.info(`Removing key ${ht.fingerprint}`);yield ot.deleteKey(ht.fingerprint);rt.info("Killing GnuPG agent");yield ot.killAgent()}catch(ke){rt.warning(ke.message)}}))}if(!ht.IsPost){run()}else{cleanup()}},5728:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;var ze=Object.getOwnPropertyDescriptor(Ae,Ce);if(!ze||("get"in ze?!Ae.__esModule:ze.writable||ze.configurable)){ze={enumerable:true,get:function(){return Ae[Ce]}}}Object.defineProperty(ke,qe,ze)}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};var tt=this&&this.__awaiter||function(ke,Ae,Ce,qe){function adopt(ke){return ke instanceof Ce?ke:new Ce((function(Ae){Ae(ke)}))}return new(Ce||(Ce=Promise))((function(Ce,ze){function fulfilled(ke){try{step(qe.next(ke))}catch(ke){ze(ke)}}function rejected(ke){try{step(qe["throw"](ke))}catch(ke){ze(ke)}}function step(ke){ke.done?Ce(ke.value):adopt(ke.value).then(fulfilled,rejected)}step((qe=qe.apply(ke,Ae||[])).next())}))};var rt=this&&this.__importDefault||function(ke){return ke&&ke.__esModule?ke:{default:ke}};Object.defineProperty(Ae,"__esModule",{value:true});Ae.isArmored=Ae.generateKeyPair=Ae.readPrivateKey=void 0;const it=Ve(Ce(7946));const nt=rt(Ce(2764));const readPrivateKey=ke=>tt(void 0,void 0,void 0,(function*(){const Ce=yield it.readKey({armoredKey:(yield(0,Ae.isArmored)(ke))?ke:Buffer.from(ke,"base64").toString()});const qe=yield Ce.getPrimaryUser().then((ke=>{var Ae;return(0,nt.default)((Ae=ke.user.userID)===null||Ae===void 0?void 0:Ae.userID)[0]}));return{fingerprint:Ce.getFingerprint().toUpperCase(),keyID:Ce.getKeyID().toHex().toUpperCase(),name:qe.name,email:qe.address,creationTime:Ce.getCreationTime()}}));Ae.readPrivateKey=readPrivateKey;const generateKeyPair=(ke,Ae,Ce,qe)=>tt(void 0,void 0,void 0,(function*(){const ze=yield it.generateKey({userIDs:[{name:ke,email:Ae}],passphrase:Ce,type:qe});return{publicKey:ze.publicKey.replace(/\r\n/g,"\n").trim(),privateKey:ze.privateKey.replace(/\r\n/g,"\n").trim()}}));Ae.generateKeyPair=generateKeyPair;const isArmored=ke=>tt(void 0,void 0,void 0,(function*(){return ke.trimLeft().startsWith("---")}));Ae.isArmored=isArmored},963:function(ke,Ae,Ce){"use strict";var qe=this&&this.__createBinding||(Object.create?function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;var ze=Object.getOwnPropertyDescriptor(Ae,Ce);if(!ze||("get"in ze?!Ae.__esModule:ze.writable||ze.configurable)){ze={enumerable:true,get:function(){return Ae[Ce]}}}Object.defineProperty(ke,qe,ze)}:function(ke,Ae,Ce,qe){if(qe===undefined)qe=Ce;ke[qe]=Ae[Ce]});var ze=this&&this.__setModuleDefault||(Object.create?function(ke,Ae){Object.defineProperty(ke,"default",{enumerable:true,value:Ae})}:function(ke,Ae){ke["default"]=Ae});var Ve=this&&this.__importStar||function(ke){if(ke&&ke.__esModule)return ke;var Ae={};if(ke!=null)for(var Ce in ke)if(Ce!=="default"&&Object.prototype.hasOwnProperty.call(ke,Ce))qe(Ae,ke,Ce);ze(Ae,ke);return Ae};Object.defineProperty(Ae,"__esModule",{value:true});Ae.setFingerprint=Ae.fingerprint=Ae.IsPost=void 0;const tt=Ve(Ce(2186));Ae.IsPost=!!process.env["STATE_isPost"];Ae.fingerprint=process.env["STATE_fingerprint"]||"";function setFingerprint(ke){tt.saveState("fingerprint",ke)}Ae.setFingerprint=setFingerprint;if(!Ae.IsPost){tt.saveState("isPost","true")}},9491:ke=>{"use strict";ke.exports=require("assert")},4300:ke=>{"use strict";ke.exports=require("buffer")},2081:ke=>{"use strict";ke.exports=require("child_process")},6113:ke=>{"use strict";ke.exports=require("crypto")},2361:ke=>{"use strict";ke.exports=require("events")},7147:ke=>{"use strict";ke.exports=require("fs")},3685:ke=>{"use strict";ke.exports=require("http")},5687:ke=>{"use strict";ke.exports=require("https")},1808:ke=>{"use strict";ke.exports=require("net")},2037:ke=>{"use strict";ke.exports=require("os")},1017:ke=>{"use strict";ke.exports=require("path")},2781:ke=>{"use strict";ke.exports=require("stream")},1576:ke=>{"use strict";ke.exports=require("string_decoder")},9512:ke=>{"use strict";ke.exports=require("timers")},4404:ke=>{"use strict";ke.exports=require("tls")},3837:ke=>{"use strict";ke.exports=require("util")},9796:ke=>{"use strict";ke.exports=require("zlib")}};var Ae={};function __nccwpck_require__(Ce){var qe=Ae[Ce];if(qe!==undefined){return qe.exports}var ze=Ae[Ce]={id:Ce,loaded:false,exports:{}};var Ve=true;try{ke[Ce].call(ze.exports,ze,ze.exports,__nccwpck_require__);Ve=false}finally{if(Ve)delete Ae[Ce]}ze.loaded=true;return ze.exports}(()=>{__nccwpck_require__.nmd=ke=>{ke.paths=[];if(!ke.children)ke.children=[];return ke}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var Ce=__nccwpck_require__(399);module.exports=Ce})(); //# sourceMappingURL=index.js.map