1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="26e4fd4b-751d-d4ed-8970-445eb51db54e")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,704040,e=>{"use strict";var t=e.i(720057);e.s(["authIdentity",()=>t.authIdentity_exports])},887005,e=>{"use strict";let t;var r,i=e.i(987750),n=e.i(472074),a=e.i(563146);let s=new Uint8Array([86,40,246,198]),o=n.object({salt:n.array(n.number()),inner:n.object({deadline:n.bigint(),nonce:n.array(n.number())})});var l=class e{constructor(e,t){this.version=e,this.value=t}static latest(t){return new e(0,t)}};let u={struct:{salt:{array:{type:"u8",len:4}},inner:{struct:{deadline:"u64",nonce:{array:{type:"u8",len:15}}}}}};(r=t||(t={})).createTimestampedNonceBytes=function(e){let t=new Uint8Array(15);return new DataView(t.buffer).setBigInt64(0,1000000n*BigInt(e.getTime()),!0),crypto.getRandomValues(t.subarray(8)),t},r.encodeNonce=function(e,t,r=crypto.getRandomValues(new Uint8Array(15))){if(4!==e.length)throw Error(`Invalid salt length: ${e.length}, expected 4`);if(15!==r.length)throw Error(`Invalid randomBytes length: ${r.length}, expected 15`);let n=1000000n*BigInt(t.getTime()),a=new Uint8Array(27);a.set(e,0),new DataView(a.buffer,a.byteOffset,a.byteLength).setBigUint64(4,n,!0),a.set(r,12);let o=new Uint8Array(5+a.length);return o.set(s,0),o.set([0],4),o.set(a,5),i.base64.encode(o)},r.decodeNonce=function(e){let t=i.base64.decode(e);if(32!==t.length)throw Error("Nonce too short");let r=t.slice(0,4),n=t[4],o=t.slice(5);if(!r.every((e,t)=>e===s[t]))throw Error("Invalid magic prefix");return new l(n,(0,a.deserialize)(u,o))},e.s(["VersionedNonceBuilder",0,t,"saltedNonceSchema",0,o])},364516,e=>{"use strict";var t=e.i(324137),r=e.i(854449),i=e.i(514425),n=e.i(987750),a=e.i(198537),s=(0,t.__exportAll)({makeChallenge:()=>d,makeEmptyMessage:()=>u,makeInnerSwapMessage:()=>o,makeInnerTransferMessage:()=>f,makeSwapMessage:()=>l,randomDefuseNonce:()=>c});function o({tokenDeltas:e,signerId:t,deadlineTimestamp:r,referral:i,memo:n,appFee:a,appFeeRecipient:s}){let l={},u={},c=[{intent:"token_diff",diff:l,referral:i,memo:n}];for(let[t,r]of(a.length&&c.push({intent:"transfer",tokens:Object.fromEntries(a.map(([e,t])=>[e,t.toString()])),receiver_id:s,memo:"APP_FEE"}),e))u[t]??=0n,u[t]+=r,l[t]=u[t].toString();return 0===Object.keys(l).length?{deadline:new Date(r).toISOString(),intents:[],signer_id:t}:{deadline:new Date(r).toISOString(),intents:c,signer_id:t}}function l({innerMessage:e,nonce:t=c()}){let i={signer_id:e.signer_id,verifying_contract:r.config.env.contractID,deadline:e.deadline,nonce:n.base64.encode(t),intents:e.intents},a=JSON.stringify(i),s=new TextEncoder().encode(a);return{NEP413:{message:JSON.stringify(e),recipient:r.config.env.contractID,nonce:t},ERC191:{message:JSON.stringify(i,null,2)},SOLANA:{message:s},STELLAR:{message:JSON.stringify(i,null,2)},WEBAUTHN:{challenge:d(s),payload:a,parsedPayload:i},TON_CONNECT:{message:{type:"text",text:JSON.stringify(i,null,2)}},TRON:{message:JSON.stringify(i,null,2)}}}function u({signerId:e,deadlineTimestamp:t,nonce:r=c()}){return l({innerMessage:{deadline:new Date(t).toISOString(),intents:[],signer_id:e},nonce:r})}function c(){return crypto.getRandomValues(new Uint8Array(32))}function d(e){return new Uint8Array((0,a.sha256)(e))}function f({tokenDeltas:e,signerId:t,deadlineTimestamp:r,receiverId:n,memo:a}){let s={},o=new Set;for(let[t,r]of e)(0,i.assert)(!o.has(t),`Duplicate token found: ${t}`),o.add(t),(0,i.assert)(r>0n,`Transfer amount must be positive, got: ${r} for token ${t}`),s[t]=r.toString();return{deadline:new Date(r).toISOString(),intents:[{intent:"transfer",tokens:s,receiver_id:n,...a?{memo:a}:{}}],signer_id:t}}e.s(["messageFactory",0,s],364516)},881837,325118,391836,e=>{"use strict";var t=e.i(134932);let r=Object.prototype.toString,i=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);var n=e.i(711136),a=e.i(116453);function s(e,{errorInstance:t=Error("timed out"),timeout:r,signal:i}){return new Promise((n,a)=>{(async()=>{let s;try{let l=new AbortController;r>0&&(s=setTimeout(()=>{i?l.abort(new o):a(t)},r)),n(await e({signal:i?l.signal:null}))}catch(e){e instanceof o&&a(t),a(e)}finally{clearTimeout(s)}})()})}var o=class extends a.BaseError{constructor(){super("Special internal timeout error.",{name:"SpecialInternalTimeoutError",details:"This error should be never be caught since another error instance is rethrown."})}};async function l(e){return new Promise(t=>setTimeout(t,e))}function u(e,t){let r=t.delay;if(0===r)return 0;if(t.factor&&(r*=Math.pow(t.factor,e.attemptNum-1),0!==t.maxDelay&&(r=Math.min(r,t.maxDelay))),t.jitter){let e=Math.ceil(t.minDelay);r=Math.floor(Math.random()*(Math.floor(r)-e+1))+e}return Math.round(r)}async function c(e,t){var r;let i=((r=t)||(r={}),{delay:void 0===r.delay?200:r.delay,initialDelay:void 0===r.initialDelay?0:r.initialDelay,minDelay:void 0===r.minDelay?0:r.minDelay,maxDelay:void 0===r.maxDelay?0:r.maxDelay,factor:void 0===r.factor?0:r.factor,maxAttempts:void 0===r.maxAttempts?3:r.maxAttempts,timeout:void 0===r.timeout?0:r.timeout,jitter:!0===r.jitter,initialJitter:!0===r.initialJitter,handleError:void 0===r.handleError?null:r.handleError,handleTimeout:void 0===r.handleTimeout?null:r.handleTimeout,beforeAttempt:void 0===r.beforeAttempt?null:r.beforeAttempt,calculateDelay:void 0===r.calculateDelay?null:r.calculateDelay});for(let e of["delay","initialDelay","minDelay","maxDelay","maxAttempts","timeout"]){let t=i[e];if(!Number.isInteger(t)||t<0)throw Error(`Value for ${e} must be an integer greater than or equal to 0`)}if(i.factor.constructor!==Number||i.factor<0)throw Error("Value for factor must be a number greater than or equal to 0");if(i.delay<i.minDelay)throw Error(`delay cannot be less than minDelay (delay: ${i.delay}, minDelay: ${i.minDelay}`);let n={attemptNum:0,attemptsRemaining:i.maxAttempts?i.maxAttempts:-1,aborted:!1,abort(){n.aborted=!0}},a=i.calculateDelay||u;async function s(){if(i.beforeAttempt&&i.beforeAttempt(n,i),n.aborted){let e=Error("Attempt aborted");throw e.code="ATTEMPT_ABORTED",e}let t=async e=>{if(i.handleError&&await i.handleError(e,n,i),n.aborted||0===n.attemptsRemaining)throw e;n.attemptNum++;let t=a(n,i);return t&&await l(t),s()};return(n.attemptsRemaining>0&&n.attemptsRemaining--,i.timeout)?new Promise((r,a)=>{let s=setTimeout(()=>{if(i.handleTimeout)try{r(i.handleTimeout(n,i))}catch(e){a(e)}else{let e=Error(`Retry timeout (attemptNum: ${n.attemptNum}, timeout: ${i.timeout})`);e.code="ATTEMPT_TIMEOUT",a(e)}},i.timeout);e(n,i).then(e=>{clearTimeout(s),r(e)}).catch(e=>{clearTimeout(s),t(e).then(r).catch(a)})}):e(n,i).catch(t)}let o=i.calculateDelay?i.calculateDelay(n,i):i.initialDelay;
2if(o&&await l(o),n.attemptNum<1&&i.initialJitter){let e=a(n,i);e&&await l(e)}return s()}async function d({retryOptions:e={maxAttempts:1},logger:r,...i}){let a=performance.now(),s=0,o=0,l=await c(async e=>{o=e.attemptNum+1;let t=performance.now();r?.debug("Sending HTTP request",{url:i.url.toString(),method:i.fetchOptions?.method||"GET",body:JSON.stringify(i.body),attempt:e.attemptNum});let n=await f(i),a=performance.now()-t;return s+=a,r?.debug("HTTP request attempt completed",{attempt:e.attemptNum,attemptDuration:Math.floor(a),statusCode:n.status,success:n.ok,responseSize:n.headers.get("content-length")}),n},{...e,handleError:(e,a)=>{var s;r?.error("HTTP request attempt failed",{attempt:a.attemptNum,errorMessage:(0,n.toError)(e).message}),((s=e)instanceof t.HttpRequestError&&null!=s.status&&403!==s.status&&408!==s.status&&413!==s.status&&429!==s.status&&500!==s.status&&502!==s.status&&503!==s.status&&504!==s.status&&1||i.fetchOptions?.signal?.reason===e)&&a.abort()}}),u=performance.now()-a,h=u-s;return r?.[o>1?"info":"debug"]("HTTP request completed",{statusCode:l.status,success:l.ok,totalDuration:Math.floor(u),networkTime:Math.floor(s),retryOverhead:Math.floor(h),attempts:o,responseSize:l.headers.get("content-length")}),l}async function f({url:e,body:n,timeout:a=1e4,fetchOptions:o}){let{headers:l,method:u,signal:c}=o??{};try{let r=new Headers(l);r.set("Content-Type","application/json");let i=await s(({signal:t})=>fetch(e,{...o,method:u,headers:r,body:JSON.stringify(n),signal:function(e){if(1===e.length)return e[0];let t=new AbortController;for(let r of e)if(r.aborted){t.abort(r.reason);break}let r=e=>{let r=e.target;t.abort(r.reason)};for(let t of e)t.addEventListener("abort",r,{once:!0});return t.signal}([c,a>0?t:null].filter(Boolean))}),{errorInstance:new t.TimeoutError({body:n,url:e.toString()}),timeout:a,signal:!0});if(!i.ok)throw new t.HttpRequestError({body:n,details:i.statusText,headers:i.headers,status:i.status,url:e.toString()});return i}catch(a){if(a instanceof t.HttpRequestError||a instanceof t.TimeoutError)throw a;if(a instanceof Error,a&&("[object Error]"===r.call(a)||a instanceof Error)&&"TypeError"===a.name&&"string"==typeof a.message&&("Load failed"===a.message?void 0===a.stack:i.has(a.message)))throw new t.HttpRequestError({body:n,cause:a,url:e.toString()});throw a}}e.s(["withTimeout",0,s],325118),e.s(["retry",0,c],391836),e.s(["request",0,d],881837)},569871,885258,772693,552181,607300,760061,268793,632570,192328,e=>{"use strict";var t=e.i(116453),r=class extends t.BaseError{constructor(e,t){super("Amount too small to pay fee.",{metaMessages:[`Required fee: ${e.amount}`,`Withdrawal amount: ${t}`],name:"FeeExceedsAmountError"}),this.feeEstimation=e,this.amount=t}},i=class extends t.BaseError{constructor(e,t,r){super("Withdrawal amount is below minimum required by the bridge.",{metaMessages:[`Asset ID: ${r}`,`Minimum amount: ${e}`,`Requested amount: ${t}`],name:"MinWithdrawalAmountError"}),this.minAmount=e,this.requestedAmount=t,this.assetId=r}},n=class extends t.BaseError{constructor(e,t){super("Destination memo is not supported for this blockchain.",{details:"Destination memo is only supported for XRP Ledger withdrawals.",metaMessages:[`Blockchain: ${e}`,`Asset ID: ${t}`],name:"UnsupportedDestinationMemoError"}),this.blockchain=e,this.assetId=t}}
2,a=class extends t.BaseError{constructor(e,t,r,i){super("Destination address does not have a trustline for this asset.",{details:"The destination address must establish a trustline before receiving this asset.",metaMessages:[`Blockchain: ${r}`,`Asset ID: ${t}`,`Destination address: ${e}`,`Token address: ${i}`],name:"TrustlineNotFoundError"}),this.destinationAddress=e,this.assetId=t,this.blockchain=r,this.tokenAddress=i}},s=class extends t.BaseError{constructor(e,t){super("Asset ID is not supported.",{details:t,metaMessages:[`Asset ID: ${e}`],name:"UnsupportedAssetIdError"}),this.assetId=e}},o=class extends t.BaseError{constructor(e,t){super("Invalid destination address.",{metaMessages:[`Destination address: ${e}`,`Destination chain: ${t}`],name:"InvalidDestinationAddressForWithdrawalError",details:`Destination address ${e} is not valid for withdrawal to ${t}.`}),this.destinationAddress=e,this.destinationChain=t}};e.s(["FeeExceedsAmountError",0,r,"InvalidDestinationAddressForWithdrawalError",0,o,"MinWithdrawalAmountError",0,i,"TrustlineNotFoundError",0,a,"UnsupportedAssetIdError",0,s,"UnsupportedDestinationMemoError",0,n],569871),e.s(["RouteEnum",0,{HotBridge:"hot_bridge",PoaBridge:"poa_bridge",OmniBridge:"omni_bridge",NearWithdrawal:"near_withdrawal",VirtualChain:"virtual_chain",InternalTransfer:"internal_transfer"}],885258);var l=e.i(881837);async function u(e){return(await (0,l.request)({url:new URL("tokens",e.envConfig.managerConsoleBaseURL),...e,fetchOptions:{...e.fetchOptions,method:"GET"}})).json()}e.s(["tokens",0,u],772693);var c=e.i(438239),d=t,f=class extends d.BaseError{constructor({quote:e,quoteParams:t}){super("Quote error.",{details:null==e?"NO_QUOTE":e.type,metaMessages:[`Quote: ${(0,c.serialize)(e)}`,`Quote params: ${(0,c.serialize)(t)}`],name:"QuoteError"}),this.quote=e,this.quoteParams=t}};e.s(["QuoteError",0,f],552181);var h=e.i(854449),p=e.i(738993),g=e.i(712291),m=e.i(472074);let y=m.union([m.object({jsonrpc:m.literal("2.0"),id:m.string(),result:m.unknown()}),m.object({jsonrpc:m.literal("2.0"),id:m.string(),error:m.pipe(m.union([m.string(),m.object({code:m.number(),message:m.string()})]),m.transform(e=>"string"==typeof e?{code:-1,data:null,message:e}:{code:e.code,data:null,message:e.message}))})]);async function v(e,t,r){let i=new URL("rpc",r?.baseURL??h.config.env.solverRelayBaseURL);i.searchParams.set("method",String(e));let n={id:r?.requestId??"dontcare",jsonrpc:"2.0",method:e,params:void 0!==t?[t]:void 0},a={...r?.fetchOptions,method:"POST",headers:new Headers(r?.fetchOptions?.headers)};return r?.solverRelayApiKey&&a.headers.append("Authorization",`Bearer ${r.solverRelayApiKey}`),(0,p.handleRPCResponse)(await (0,l.request)({url:i,body:n,...r,fetchOptions:a,retryOptions:r?.retryOptions??g.RETRY_CONFIGS.THIRTY_SECS_AGGRESSIVE,logger:r?.logger}),n,y)}async function b(e,t={}){return await v("quote",e,t)}async function w(e,t={}){return await v("publish_intent",e,t)}async function _(e,t={}){return await v("publish_intents",e,t)}async function A(e,t={}){return await v("get_status",e,t)}e.s(["getStatus",0,A,"publishIntent",0,w,"publishIntents",0,_,"quote",0,b],607300);var S=(0,e.i(324137).__exportAll)({getStatus:()=>A,publishIntent:()=>w,publishIntents:()=>_,quote:()=>b});e.s(["solverRelayHttpClient_exports",0,S],760061);var E=e.i(514425);async function x(e,{logBalanceSufficient:t,...r}){let i=crypto.randomUUID(),n=await b(e,{...r,requestId:i});return null==n&&(r.logger?.warn("quote: No liquidity available",{quoteParams:e}),t&&(null==e.wait_ms||e.wait_ms>2500)&&r.logger?.warn("quote: No liquidity available for user with sufficient balance",{quoteParams:e,quoteRequestInfo:{requestId:i}})),n}async function T(e){return function(e,t,r){var i,n,a,s;if(null==e)throw new f({quote:null,quoteParams:t});let o=null!=t.exact_amount_in;(0,E.assert)(o!==(null!=t.exact_amount_out),`Invalid quoteParams: exactly one of exact_amount_in or exact_amount_out must be set (got exact_amount_in=${t.exact_amount_in}, exact_amount_out=${t.exact_amount_out}).`);let l=[],u=[];for(let a of e){if("type"in a){l.push(a);continue}if(i=a,n=t,i.defuse_asset_identifier_in!==n.defuse_asset_identifier_in||i.defuse_asset_identifier_out!==n.defuse_asset_identifier_out||(null!=n.exact_amount_in?BigInt(i.amount_in)!==BigInt(n.exact_amount_in):BigInt(i.amount_out)!==BigInt(n.exact_amount_out))){r?.warn("quote: dropping quote that doesn't match the request",{quoteParams:t,quote:a});continue}u.push(a)}let c=(a=u,s=o?"exact_in":"exact_out",a.slice().sort((e,t)=>
2"exact_in"===s?BigInt(e.amount_out)>BigInt(t.amount_out)?-1:+(BigInt(e.amount_out)<BigInt(t.amount_out)):BigInt(e.amount_in)<BigInt(t.amount_in)?-1:+(BigInt(e.amount_in)>BigInt(t.amount_in))))[0];if(null!=c)return c;let d=l[0];if(null!=d)throw new f({quote:d,quoteParams:t});throw new f({quote:null,quoteParams:t})}(await x(e.quoteParams,{timeout:(e.quoteParams?.wait_ms??0)+1e4,...e.config}),e.quoteParams,e.config.logger)}async function I(...e){return A(...e).then(e=>{let t=e.status;switch(t){case"SETTLED":case"TX_BROADCASTED":return{status:t,intentHash:e.intent_hash,txHash:e.data.hash};case"PENDING":case"NOT_FOUND_OR_NOT_VALID":return{status:t,intentHash:e.intent_hash};default:(0,E.assert)(!1,`Unexpected intent status = ${t}`)}})}e.s(["getQuote",0,T],268793),e.s(["getStatus",0,I],632570);var k=t,O=class extends k.BaseError{constructor({cause:e,metaMessages:t,name:r,publishParams:i,reason:n}){super("Failed to publish intent.",{details:n,metaMessages:[...t??[],`Publish params: ${(0,c.serialize)(i)}`],name:r,cause:e}),this.publishParams=i}},C=class extends O{constructor({reason:e,code:t,publishParams:r}){super({reason:e,metaMessages:[`Code: ${t}`],name:"RelayPublishRejectedError",publishParams:r}),this.name="RelayPublishRejectedError",this.code=t}},N=class extends O{constructor({reason:e,publishParams:t,cause:r}){super({reason:e,name:"RelayPublishResultUnknownError",publishParams:t,cause:r}),this.name="RelayPublishResultUnknownError"}};e.s(["RelayPublishRejectedError",0,C,"RelayPublishResultUnknownError",0,N,"toRelayPublishError",0,function(e,t){var r;return(0,E.assert)("FAILED"===t.status,"Expected response to be failed"),new C({reason:t.reason,code:(r=t,((0,E.assert)("FAILED"===r.status,"Expected response to be failed"),"expired"===r.reason||r.reason.includes("deadline has expired"))?"SIGNATURE_EXPIRED":"internal"===r.reason?"INTERNAL_ERROR":r.reason.includes("invalid signature")?"SIGNATURE_INVALID":r.reason.includes("nonce was already used")?"NONCE_USED":r.reason.includes("insufficient balance or overflow")?"INSUFFICIENT_BALANCE":r.reason.includes("public key doesn't exist")?"PUBLIC_KEY_NOT_EXIST":r.reason.includes("invalid salt")?"INVALID_SALT":"UNKNOWN_ERROR"),publishParams:e})}],192328)},579930,e=>{"use strict";let t={Some:Symbol(":some"),None:Symbol(":none")};class r{val;constructor(e){this.val=e}get type(){return t.Some}isSome(){return!0}isNone(){return!1}match(e){return e.some(this.val)}map(e){return new r(e(this.val))}andThen(e){return e(this.val)}or(e){return this}and(e){return e}unwrapOr(e){return this.val}unwrap(){return this.val}}class i{get type(){return t.None}isSome(){return!1}isNone(){return!0}match({none:e}){return"function"==typeof e?e():e}map(e){return new i}andThen(e){return new i}or(e){return e}and(e){return new i}unwrapOr(e){return e}unwrap(){throw ReferenceError("Trying to unwrap None.")}}let n=new i;Symbol(":left"),Symbol(":right");let a={Ok:Symbol(":ok"),Err:Symbol(":err")};class s{val;constructor(e){this.val=e}get type(){return a.Ok}isOk(){return!0}isErr(){return!1}ok(){return new r(this.val)}err(){return n}match(e){return e.ok(this.val)}map(e){return l(e(this.val))}mapErr(e){return l(this.val)}andThen(e){return e(this.val)}orElse(e){return l(this.val)}unwrap(){return this.val}unwrapErr(){throw ReferenceError("Cannot unwrap Err value of Result.Ok")}unwrapOr(e){return this.val}}class o{val;constructor(e){this.val=e}get type(){return a.Err}isOk(){return!1}isErr(){return!0}ok(){return n}err(){return new r(this.val)}match(e){return e.err(this.val)}map(e){return u(this.val)}mapErr(e){return u(e(this.val))}andThen(e){return u(this.val)}orElse(e){return e(this.val)}unwrap(){throw ReferenceError("Cannot unwrap Ok value of Result.Err")}unwrapErr(){return this.val}unwrapOr(e){return e}}function l(e){return new s(e)}function u(e){return new o(e)}e.s(["Err",0,u,"Ok",0,l])},119226,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.equal=r.concat=r.HEX_REGEX=void 0;let i=e.r(922543);r.HEX_REGEX=/^[A-F0-9]*$/iu,r.concat=function(e){return(0,i.concatBytes)(...e)},r.equal=function(e,t){if(e.byteLength!==t.byteLength)return!1;let r=new Int8Array(e),i=new Int8Array(t);for(let t=0;t!==e.byteLength;t++)if(r[t]!==i[t])return!1;return!0}},575280,(e,t,r)=>{"use strict";var i=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);
2(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.randomBytes=r.stringToHex=r.hexToString=r.hexToBytes=r.bytesToHex=void 0;let a=e.r(922543),s=e.r(119226);r.bytesToHex=e=>(0,a.bytesToHex)(e instanceof Uint8Array?e:Uint8Array.from(e)).toUpperCase(),r.hexToBytes=e=>{let t=new Uint8Array(e.length/2);if(!s.HEX_REGEX.test(e))throw Error("Invalid hex string");for(let r=0;r<t.length;r++){let i=2*r,n=Number.parseInt(e.slice(i,i+2),16);if(Number.isNaN(n)||n<0)throw Error("Invalid byte sequence");t[r]=n}return t},r.hexToString=(e,t="utf8")=>new TextDecoder(t).decode((0,r.hexToBytes)(e)),r.stringToHex=e=>(0,r.bytesToHex)(new TextEncoder().encode(e)),r.randomBytes=a.randomBytes,n(e.r(119226),r)},940188,e=>{"use strict";var t=e.i(922543);let r=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),i=Uint32Array.from([0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]),n=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),a=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]);e.s(["Chi",0,function(e,t,r){return e&t^~e&r},"HashMD",0,class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,r,i,n){this.blockLen=e,this.outputLen=r,this.padOffset=i,this.isLE=n,this.buffer=new Uint8Array(e),this.view=(0,t.createView)(this.buffer)}update(e){(0,t.aexists)(this),(0,t.abytes)(e);let{view:r,buffer:i,blockLen:n}=this,a=e.length;for(let s=0;s<a;){let o=Math.min(n-this.pos,a-s);if(o===n){let r=(0,t.createView)(e);for(;n<=a-s;s+=n)this.process(r,s);continue}i.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===n&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,t.aexists)(this),(0,t.aoutput)(e,this),this.finished=!0;let{buffer:r,view:i,blockLen:n,isLE:a}=this,{pos:s}=this;r[s++]=128,(0,t.clean)(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(i,0),s=0);for(let e=s;e<n;e++)r[e]=0;i.setBigUint64(n-8,BigInt(8*this.length),a),this.process(i,0);let o=(0,t.createView)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen must be aligned to 32bit");let u=l/4,c=this.get();if(u>c.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<u;e++)o.setUint32(4*e,c[e],a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){(e||=new this.constructor).set(...this.get());let{blockLen:t,buffer:r,length:i,finished:n,destroyed:a,pos:s}=this;return e.destroyed=a,e.finished=n,e.length=i,e.pos=s,i%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}},"Maj",0,function(e,t,r){return e&t^e&r^t&r},"SHA224_IV",0,i,"SHA256_IV",0,r,"SHA384_IV",0,n,"SHA512_IV",0,a])},993882,e=>{"use strict";var t=e.i(940188),r=e.i(297198),i=e.i(922543);let n=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),a=new Uint32Array(64);class s extends t.HashMD{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:r,D:i,E:n,F:a,G:s,H:o}=this;return[e,t,r,i,n,a,s,o]}set(e,t,r,i,n,a,s,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|a,this.G=0|s,this.H=0|o}process(e,r){for(let t=0;t<16;t++,r+=4)a[t]=e.getUint32(r,!1);for(let e=16;e<64;e++){let t=a[e-15],r=a[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,s=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;a[e]=s+a[e-7]+n+a[e-16]|0}let{A:s,B:o,C:l,D:u,E:c,F:d,G:f,H:h}=this;for(let e=0;e<64;e++){let r=h+((0,i.rotr)(c,6)^(0,i.rotr)(c,11)^(0,i.rotr)(c,25))+(0,t.Chi)(c,d,f)+n[e]+a[e]|0,p=((0,i.rotr)(s,2)^(0,i.rotr)(s,13)^(0,i.rotr)(s,22))+(0,t.Maj)(s,o,l)|0;h=f,f=d,d=c,c=u+r|0,u=l,l=o,o=s,s=r+p|0}s=s+this.A|0,o=o+this.B|0,l=l+this.C|0,u=u+this.D|0,c=c+this.E|0,d=d+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(s,o,l,u,c,d,f,h)}roundClean(){(0,i.clean)(a)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),(0,i.clean)(this.buffer)}}class o extends s{A=0|t.SHA256_IV[0];B=0|t.SHA256_IV[1];C=0|t.SHA256_IV[2];D=0|t.SHA256_IV[3];E=0|t.SHA256_IV[4];F=0|t.SHA256_IV[5];G=0|t.SHA256_IV[6];H=0|t.SHA256_IV[7];constructor(){super(32)}}class l extends s{A=0|t.SHA224_IV[0];B=0|t.SHA224_IV[1];C=0|t.SHA224_IV[2];D=0|t.SHA224_IV[3];E=0|t.SHA224_IV[4];F=0|t.SHA224_IV[5];G=0|t.SHA224_IV[6];H=0|t.SHA224_IV[7];constructor(){super(28)}}let u=r.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b89
26f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),c=u[0],d=u[1],f=new Uint32Array(80),h=new Uint32Array(80);class p extends t.HashMD{constructor(e){super(128,e,16,!1)}get(){let{Ah:e,Al:t,Bh:r,Bl:i,Ch:n,Cl:a,Dh:s,Dl:o,Eh:l,El:u,Fh:c,Fl:d,Gh:f,Gl:h,Hh:p,Hl:g}=this;return[e,t,r,i,n,a,s,o,l,u,c,d,f,h,p,g]}set(e,t,r,i,n,a,s,o,l,u,c,d,f,h,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|a,this.Dh=0|s,this.Dl=0|o,this.Eh=0|l,this.El=0|u,this.Fh=0|c,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)f[r]=e.getUint32(t),h[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|f[e-15],i=0|h[e-15],n=r.rotrSH(t,i,1)^r.rotrSH(t,i,8)^r.shrSH(t,i,7),a=r.rotrSL(t,i,1)^r.rotrSL(t,i,8)^r.shrSL(t,i,7),s=0|f[e-2],o=0|h[e-2],l=r.rotrSH(s,o,19)^r.rotrBH(s,o,61)^r.shrSH(s,o,6),u=r.rotrSL(s,o,19)^r.rotrBL(s,o,61)^r.shrSL(s,o,6),c=r.add4L(a,u,h[e-7],h[e-16]),d=r.add4H(c,n,l,f[e-7],f[e-16]);f[e]=0|d,h[e]=0|c}let{Ah:i,Al:n,Bh:a,Bl:s,Ch:o,Cl:l,Dh:u,Dl:p,Eh:g,El:m,Fh:y,Fl:v,Gh:b,Gl:w,Hh:_,Hl:A}=this;for(let e=0;e<80;e++){let t=r.rotrSH(g,m,14)^r.rotrSH(g,m,18)^r.rotrBH(g,m,41),S=r.rotrSL(g,m,14)^r.rotrSL(g,m,18)^r.rotrBL(g,m,41),E=g&y^~g&b,x=m&v^~m&w,T=r.add5L(A,S,x,d[e],h[e]),I=r.add5H(T,_,t,E,c[e],f[e]),k=0|T,O=r.rotrSH(i,n,28)^r.rotrBH(i,n,34)^r.rotrBH(i,n,39),C=r.rotrSL(i,n,28)^r.rotrBL(i,n,34)^r.rotrBL(i,n,39),N=i&a^i&o^a&o,P=n&s^n&l^s&l;_=0|b,A=0|w,b=0|y,w=0|v,y=0|g,v=0|m,({h:g,l:m}=r.add(0|u,0|p,0|I,0|k)),u=0|o,p=0|l,o=0|a,l=0|s,a=0|i,s=0|n;let D=r.add3L(k,C,P);i=r.add3H(D,I,O,N),n=0|D}({h:i,l:n}=r.add(0|this.Ah,0|this.Al,0|i,0|n)),({h:a,l:s}=r.add(0|this.Bh,0|this.Bl,0|a,0|s)),({h:o,l:l}=r.add(0|this.Ch,0|this.Cl,0|o,0|l)),({h:u,l:p}=r.add(0|this.Dh,0|this.Dl,0|u,0|p)),({h:g,l:m}=r.add(0|this.Eh,0|this.El,0|g,0|m)),({h:y,l:v}=r.add(0|this.Fh,0|this.Fl,0|y,0|v)),({h:b,l:w}=r.add(0|this.Gh,0|this.Gl,0|b,0|w)),({h:_,l:A}=r.add(0|this.Hh,0|this.Hl,0|_,0|A)),this.set(i,n,a,s,o,l,u,p,g,m,y,v,b,w,_,A)}roundClean(){(0,i.clean)(f,h)}destroy(){this.destroyed=!0,(0,i.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class g extends p{Ah=0|t.SHA512_IV[0];Al=0|t.SHA512_IV[1];Bh=0|t.SHA512_IV[2];Bl=0|t.SHA512_IV[3];Ch=0|t.SHA512_IV[4];Cl=0|t.SHA512_IV[5];Dh=0|t.SHA512_IV[6];Dl=0|t.SHA512_IV[7];Eh=0|t.SHA512_IV[8];El=0|t.SHA512_IV[9];Fh=0|t.SHA512_IV[10];Fl=0|t.SHA512_IV[11];Gh=0|t.SHA512_IV[12];Gl=0|t.SHA512_IV[13];Hh=0|t.SHA512_IV[14];Hl=0|t.SHA512_IV[15];constructor(){super(64)}}class m extends p{Ah=0|t.SHA384_IV[0];Al=0|t.SHA384_IV[1];Bh=0|t.SHA384_IV[2];Bl=0|t.SHA384_IV[3];Ch=0|t.SHA384_IV[4];Cl=0|t.SHA384_IV[5];Dh=0|t.SHA384_IV[6];Dl=0|t.SHA384_IV[7];Eh=0|t.SHA384_IV[8];El=0|t.SHA384_IV[9];Fh=0|t.SHA384_IV[10];Fl=0|t.SHA384_IV[11];Gh=0|t.SHA384_IV[12];Gl=0|t.SHA384_IV[13];Hh=0|t.SHA384_IV[14];Hl=0|t.SHA384_IV[15];constructor(){super(48)}}let y=Uint32Array.from([0x8c3d37c8,0x19544da2,0x73e19966,0x89dcd4d6,0x1dfab7ae,0x32ff9c82,0x679dd514,0x582f9fcf,0xf6d2b69,0x7bd44da8,0x77e36f73,0x4c48942,0x3f9d85a8,0x6a1d36c8,0x1112e6ad,0x91d692a1]),v=Uint32Array.from([0x22312194,0xfc2bf72c,0x9f555fa3,0xc84c64c2,0x2393b8
26b,0x6f53b151,0x96387719,0x5940eabd,0x96283ee2,0xa88effe3,0xbe5e1e25,0x53863992,0x2b0199fc,0x2c85b8aa,0xeb72ddc,0x81c52ca2]);class b extends p{Ah=0|y[0];Al=0|y[1];Bh=0|y[2];Bl=0|y[3];Ch=0|y[4];Cl=0|y[5];Dh=0|y[6];Dl=0|y[7];Eh=0|y[8];El=0|y[9];Fh=0|y[10];Fl=0|y[11];Gh=0|y[12];Gl=0|y[13];Hh=0|y[14];Hl=0|y[15];constructor(){super(28)}}class w extends p{Ah=0|v[0];Al=0|v[1];Bh=0|v[2];Bl=0|v[3];Ch=0|v[4];Cl=0|v[5];Dh=0|v[6];Dl=0|v[7];Eh=0|v[8];El=0|v[9];Fh=0|v[10];Fl=0|v[11];Gh=0|v[12];Gl=0|v[13];Hh=0|v[14];Hl=0|v[15];constructor(){super(32)}}let _=(0,i.createHasher)(()=>new o,(0,i.oidNist)(1)),A=(0,i.createHasher)(()=>new l,(0,i.oidNist)(4)),S=(0,i.createHasher)(()=>new g,(0,i.oidNist)(3)),E=(0,i.createHasher)(()=>new m,(0,i.oidNist)(2)),x=(0,i.createHasher)(()=>new w,(0,i.oidNist)(6)),T=(0,i.createHasher)(()=>new b,(0,i.oidNist)(5));e.s(["_SHA224",0,l,"_SHA256",0,o,"_SHA384",0,m,"_SHA512",0,g,"_SHA512_224",0,b,"_SHA512_256",0,w,"sha224",0,A,"sha256",0,_,"sha384",0,E,"sha512",0,S,"sha512_224",0,T,"sha512_256",0,x])},999590,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let i=e.r(922543);r.default=function(e){return Array.isArray(e)?new Uint8Array(e):"string"==typeof e?(0,i.utf8ToBytes)(e):e}},677580,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});let n=i(e.r(999590));r.default=function(e){function t(t){return e((0,n.default)(t))}return t.create=()=>{let t=e.create();return{update(e){return t.update((0,n.default)(e)),this},digest:()=>t.digest()}},t}},555263,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.sha256=void 0;let n=e.r(993882);r.sha256=(0,i(e.r(677580)).default)(n.sha256)},514808,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.concatArgs=r.arrayEqual=void 0,r.arrayEqual=function(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i<e.length;i++)r|=e[i]^t[i];return 0===r},r.concatArgs=function(...e){return e.flatMap(e=>"number"==typeof e?[e]:Array.from(e))}},698548,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isValidClassicAddress=r.decodeAccountPublic=r.encodeAccountPublic=r.encodeNodePublic=r.decodeNodePublic=r.decodeAddress=r.decodeAccountID=r.encodeAddress=r.encodeAccountID=r.decodeSeed=r.encodeSeed=r.codec=void 0;let i=e.r(424243),n=e.r(555263),a=e.r(514808),s=[1,225,75],o={sha256:n.sha256},l=new class{constructor(e){this._sha256=e.sha256,this._codec=i.base58xrp}encode(e,t){let r=t.versions;return this._encodeVersioned(e,r,t.expectedLength)}decode(e,t){var r;let i=t.versions,n=t.versionTypes,s=this.decodeChecked(e);if(i.length>1&&!t.expectedLength)throw Error("expectedLength is required because there are >= 2 possible versions");let o="number"==typeof i[0]?1:i[0].length,l=null!=(r=t.expectedLength)?r:s.length-o,u=s.slice(0,-l),c=s.slice(-l);for(let e=0;e<i.length;e++){let t=Array.isArray(i[e])?i[e]:[i[e]];if((0,a.arrayEqual)(u,t))return{version:t,bytes:c,type:n?n[e]:null}}throw Error("version_invalid: version bytes do not match any of the provided version(s)")}encodeChecked(e){let t=this._sha256(this._sha256(e)).slice(0,4);return this._encodeRaw(Uint8Array.from((0,a.concatArgs)(e,t)))}decodeChecked(e){let t=this._decodeRaw(e);if(t.byteLength<5)throw Error("invalid_input_size: decoded data must have length >= 5");if(!this._verifyCheckSum(t))throw Error("checksum_invalid");return t.slice(0,-4)}_encodeVersioned(e,t,r){if(!d(e,r))throw Error("unexpected_payload_length: bytes.length does not match expectedLength. Ensure that the bytes are a Uint8Array.");return this.encodeChecked((0,a.concatArgs)(t,e))}_encodeRaw(e){return this._codec.encode(Uint8Array.from(e))}_decodeRaw(e){return this._codec.decode(e)}_verifyCheckSum(e){let t=this._sha256(this._sha256(e.slice(0,-4))).slice(0,4),r=e.slice(-4);return(0,a.arrayEqual)(t,r)}}(o);function u(e){return l.encode(e,{versions:[0],expectedLength:20})}function c(e){return l.decode(e,{versions:[0],expectedLength:20}).bytes}function d(e,t){return"byteLength"in e?e.byteLength===t:e.length===t}r.codec=l,r.encodeSeed=function(e,t){if(!d(e,16))throw Error("entropy must have length 16");return l.encode(e,{expectedLength:16,versions:"ed25519"===t?s:[33]})},r.decodeSeed=function(e,t={versionTypes:["ed25519","secp256k1"],versions:[s,33],expectedLength:16}){return l.decode(e,t)},r.encodeAccountID=u,r.encodeAddress=u,r.decodeAccountID=c,r.decodeAddress=c,r.decodeNo
2dePublic=function(e){return l.decode(e,{versions:[28],expectedLength:33}).bytes},r.encodeNodePublic=function(e){return l.encode(e,{versions:[28],expectedLength:33})},r.encodeAccountPublic=function(e){return l.encode(e,{versions:[35],expectedLength:33})},r.decodeAccountPublic=function(e){return l.decode(e,{versions:[35],expectedLength:33}).bytes},r.isValidClassicAddress=function(e){try{c(e)}catch(e){return!1}return!0}},848924,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isValidXAddress=r.decodeXAddress=r.xAddressToClassicAddress=r.encodeXAddress=r.classicAddressToXAddress=r.isValidClassicAddress=r.decodeAccountPublic=r.encodeAccountPublic=r.decodeNodePublic=r.encodeNodePublic=r.decodeAccountID=r.encodeAccountID=r.decodeSeed=r.encodeSeed=r.codec=void 0;let i=e.r(575280),n=e.r(698548);Object.defineProperty(r,"codec",{enumerable:!0,get:function(){return n.codec}}),Object.defineProperty(r,"encodeSeed",{enumerable:!0,get:function(){return n.encodeSeed}}),Object.defineProperty(r,"decodeSeed",{enumerable:!0,get:function(){return n.decodeSeed}}),Object.defineProperty(r,"encodeAccountID",{enumerable:!0,get:function(){return n.encodeAccountID}}),Object.defineProperty(r,"decodeAccountID",{enumerable:!0,get:function(){return n.decodeAccountID}}),Object.defineProperty(r,"encodeNodePublic",{enumerable:!0,get:function(){return n.encodeNodePublic}}),Object.defineProperty(r,"decodeNodePublic",{enumerable:!0,get:function(){return n.decodeNodePublic}}),Object.defineProperty(r,"encodeAccountPublic",{enumerable:!0,get:function(){return n.encodeAccountPublic}}),Object.defineProperty(r,"decodeAccountPublic",{enumerable:!0,get:function(){return n.decodeAccountPublic}}),Object.defineProperty(r,"isValidClassicAddress",{enumerable:!0,get:function(){return n.isValidClassicAddress}});let a={main:Uint8Array.from([5,68]),test:Uint8Array.from([4,147])};function s(e,t,r){if(20!==e.length)throw Error("Account ID must be 20 bytes");if(!1!==t&&t>0xffffffff)throw Error("Invalid tag");let s=t||0,o=(0,i.concat)([r?a.test:a.main,e,Uint8Array.from([+(!1!==t&&null!=t),255&s,s>>8&255,s>>16&255,s>>24&255,0,0,0,0])]);return n.codec.encodeChecked(o)}function o(e){let t=n.codec.decodeChecked(e),r=function(e){let t=e.slice(0,2);if((0,i.equal)(a.main,t))return!1;if((0,i.equal)(a.test,t))return!0;throw Error("Invalid X-address: bad prefix")}(t);return{accountId:t.slice(2,22),tag:function(e){let t=e[22];if(t>=2)throw Error("Unsupported X-address");if(1===t)return e[23]+256*e[24]+65536*e[25]+0x1000000*e[26];if(0!==t)throw Error("flag must be zero to indicate no tag");if(!(0,i.equal)((0,i.hexToBytes)("0000000000000000"),e.slice(23,31)))throw Error("remaining bytes must be zero");return!1}(t),test:r}}r.classicAddressToXAddress=function(e,t,r){return s((0,n.decodeAccountID)(e),t,r)},r.encodeXAddress=s,r.xAddressToClassicAddress=function(e){let{accountId:t,tag:r,test:i}=o(e);return{classicAddress:(0,n.encodeAccountID)(t),tag:r,test:i}},r.decodeXAddress=o,r.isValidXAddress=function(e){try{o(e)}catch(e){return!1}return!0}},114402,936959,314259,929707,e=>{"use strict";var t=e.i(514425);let r={Bitcoin:"bip122:000000000019d6689c085ae165831e93",BitcoinCash:"bip122:000000000000000000651ef99cb9fcbe",Zcash:"bip122:00040fe8ec8471911baa1db1266ea15d",Dogecoin:"bip122:1a91e3dace36e2be3bf030a65679fe82",Litecoin:"bip122:12a765e31ffd4059bada1e25190f6e98",Ethereum:"eip155:1",Optimism:"eip155:10",BNB:"eip155:56",Gnosis:"eip155:100",Polygon:"eip155:137",Monad:"eip155:143",LayerX:"eip155:196",Adi:"eip155:36900",Base:"eip155:8453",Arbitrum:"eip155:42161",Avalanche:"eip155:43114",Berachain:"eip155:80085",Near:"near:mainnet",Solana:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",Fogo:"solana:CDLtwKnaCoK157uaHQDj4fHu72AyD251",Tron:"tron:27Lqcw",XRPL:"xrpl:0",TON:"tvm:-239",Sui:"sui:mainnet",Aptos:"aptos:mainnet",Movement:"move-mvmt:126",Stellar:"stellar:pubnet",Cardano:"cip34:1-764824073",Starknet:"starknet:SN_MAIN",Plasma:"eip155:9745",Scroll:"eip155:534352",Aleo:"aleo:0",Dash:"bip122:00000ffd590b1485b3caadc19b22e637",Abstract:"eip155:2741",HyperCore:"hlcore:mainnet"};e.s(["Chains",0,r,"getEIP155ChainId",0,function(e){(0,t.assert)(e.startsWith("eip155:"),"Chain is not an EIP-155 chain");let r=e.slice(7);(0,t.assert)(r.length>0,"Chain is not an EIP-155 chain");let i=Number(r);return(0,t.assert)(!Number.isNaN(i),"Chain is not an EIP-155 chain"),i}],114402);var i=e.i(987750);function n(e){return e.includes(":")?function(e){let t=e.split(":");if(2!==t.length)return null;let r=parseInt(t[0],10);if(Number.isNaN(r))return null;let i=t[1];if(i.startsWith("0x")&&(i=i.slice(2)),64!==i.length||!/^[0-9a-fA-F]+$/.test(i))return null;let n=new Uint8Array(32);for(let e=0;e<32;e++)n[e]=parseInt(i.slice(2*e,2*e+2),16);return{workchainId:r,address:n,tag:null}}(e):function(e){let t,r=e.replace(/\+/g,"-").replace(/\//g,"_");try{t=i.base64urlnopad.decode(r)}catch{return null}if(36!==t.length)return null;let[n,a]=function(e){let t=0;for(let r of e){t^=r<<8;for(let e=0;e<8;e++)t=32768&t?t<<1^4129:t<<1;t&=65535}return[t>>8&255,255&t]}(t.subarray(0,34));if(t[34]!==n||t[35]!==a)return null;let s=t[0],o=t[1];return{tag:s,workchainId:o>127?o-256:o,address:t.slice(2,34)}}(e)}e.s(["TON_ADDRESS_TAG_BOUNCEABLE_MAINNET",0,17,"TON_ADDRESS_TAG_NON_BOUNCEABLE_MAINNET",0,81,"TON_WORKCHAIN_BASECHAIN",0,0,"TON_WORKCHAIN_MASTERCHAIN",0,-1,"tryParseTonAddress",0,n],936959);var a=e.i(104147);class s extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,t)),t}set(e,t){if(super.has(e)&&super.delete(e),super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=super.keys().next().value;void 0!==e&&super.delete(e)}return this}}e.s(["checksumAddress",()=>E,"getAddress",()=>x],314259);let o="2.55.2",l={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${o}`};
2class u extends Error{constructor(e,t={}){const r=t.cause instanceof u?t.cause.details:t.cause?.message?t.cause.message:t.details,i=t.cause instanceof u&&t.cause.docsPath||t.docsPath,n=l.getDocsUrl?.({...t,docsPath:i});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...n?[`Docs: ${n}`]:[],...r?[`Details: ${r}`]:[],...l.version?[`Version: ${l.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=i,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=o}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&void 0!==t.cause?e(t.cause,r):r?null:t}(this,e)}}class c extends u{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}function d(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}class f extends u{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function h(e,{dir:t,size:r=32}={}){return"string"==typeof e?function(e,{dir:t,size:r=32}={}){if(null===r)return e;let i=e.replace("0x","");if(i.length>2*r)throw new f({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i["right"===t?"padEnd":"padStart"](2*r,"0")}`}(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new f({size:e.length,targetSize:r,type:"bytes"});let i=new Uint8Array(r);for(let n=0;n<r;n++){let a="right"===t;i[a?n:r-n-1]=e[a?n:e.length-n-1]}return i}(e,{dir:t,size:r})}class p extends u{constructor({max:e,min:t,signed:r,size:i,value:n}){super(`Number "${n}" is not in safe ${i?`${8*i}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class g extends u{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function m(e){return d(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function y(e,{size:t}){if(m(e)>t)throw new g({givenSize:m(e),maxSize:t})}(e,t)=>t.toString(16).padStart(2,"0");let v=new TextEncoder;function b(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function w(e,t={}){let r=e;t.size&&(y(r,{size:t.size}),r=h(r,{dir:"right",size:t.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);let n=i.length/2,a=new Uint8Array(n);for(let e=0,t=0;e<n;e++){let r=b(i.charCodeAt(t++)),n=b(i.charCodeAt(t++));if(void 0===r||void 0===n)throw new u(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);a[e]=16*r+n}return a}function _(e,t={}){let r=v.encode(e);return"number"==typeof t.size?(y(r,{size:t.size}),h(r,{dir:"right",size:t.size})):r}var A=e.i(96157);let S=new s(8192);function E(e,t){var r;if(S.has(`${e}.${t}`))return S.get(`${e}.${t}`);let i=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=(r=_(i),(0,A.keccak_256)(d(r,{strict:!1})?function(e,t={}){return"number"==typeof e||"bigint"==typeof e?w(function(e,t={}){let r,{signed:i,size:n}=t,a=BigInt(e);n?r=i?(1n<<8n*BigInt(n)-1n)-1n:2n**(8n*BigInt(n))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let s="bigint"==typeof r&&i?-r-1n:0;if(r&&a>r||a<s){let t="bigint"==typeof e?"n":"";throw new p({max:r?`${r}${t}`:void 0,min:`${s}${t}`,signed:i,size:n,value:`${e}${t}`})}let o=`0x${(i&&a<0?(1n<<BigInt(8*n))+BigInt(a):a).toString(16)}`;return n?h(o,{size:n}):o}(e,t)):"boolean"==typeof e?function(e,t={}){let r=new Uint8Array(1);return(r[0]=Number(e),"number"==typeof t.size)?(y(r,{size:t.size}),h(r,{size:t.size})):r}(e,t):d(e)?w(e,t):_(e,t)}(r):r)),a=(t?i.substring(`${t}0x`.length):i).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&a[e]&&(a[e]=a[e].toUpperCase()),(15&n[e>>1])>=8&&a[e+1]&&(a[e+1]=a[e+1].toUpperCase());let s=`0x${a.join("")}`;return S.set(`${e}.${t}`,s),s}function x(e,t){if(!k(e,{strict:!1}))throw new c({address:e});return E(e,t)}let T=/^0x[a-fA-F0-9]{40}$/,I=new s(8192);function k(e,t){let{strict:r=!0}=t??{},i=`${e}.${r}`;if(I.has(i))return I.get(i);let n=!!T.test(e)&&(e.toLowerCase()===e||!r||E(e)===e);return I.set(i,n),n}var O=e.i(117956),C=e.i(679844),N=e.i(848924);function P(e,t){let r;try{r=i.base58.decode(e)}catch{return!1}if(25!==r.length||r[0]!==t)return!1;let n=r.subarray(0,21),a=r.subarray(21,25),s=(0,O.sha256)((0,O.sha256)(n)).subarray(0,4);for(let e=0;e<4;e++)if(a[e]!==s[e])return!1;return!0}function D(e,t,r){let i=1n;for(e=(e%r+r)%r;t>0n;)1n&t&&(i=i*e%r),t>>=1n,e=e*e%r;return i}let R=[0n,1n,0n,1n];e.s(["validateAddress",0,function(e,t){switch(t){case r.Near:return a.utils.validateNearAddress(e);case r.Bitcoin:var s,o,l,u,c,d,f,h,p,g=e;try{if(g.toLowerCase().startsWith("bc1"))return function(e){let t,r=!1;try{t=i.bech32.decode(e)}catch{try{t=i.bech32m.decode(e),r=!0}catch{return!1}}if("bc"!==t.prefix.toLowerCase())return!1;let{words:n}=t;if(!n||n.length<1)return!1;let a=n[0];if(void 0===a||a<0||a>16)return!1;let s=i.bech32.fromWords(n.slice(1)).length;return!(s<2)&&!(s>40)&&(0===a?!r&&(20===s||32===s):1===a&&!!r&&32===s)}(g);return function(e){let t=i.base58.decode(e);if(25!==t.length)return!1;let r=t[0];if(0!==r&&5!==r)return!1;let n=t.subarray(0,21),a=t.subarray(21,25),s=(0,O.sha256)((0,O.sha256)(n)).subarray(0,4);for(let e=0;e<4;e++)if(a[e]!==s[e])return!1;return!0}(g)}catch{return!1}case r.BitcoinCash:return s=e,!!(/^1[1-9A-HJ-NP-Za-km-z]{25,34}$/.test(s)||/^3[1-9A-HJ-NP-Za-km-z]{25,34}$/.test(s))||function(e){let t=e.toLowerCase();if(t.includes(":")||(t=`bitcoincash:${t}`),!t.startsWith("bitcoincash:"))return!1;let r=t.slice(12);if(!r.startsWith("q")&&!r.startsWith("p"))return!1;
2for(let e of r)if(!"qpzry9x8gf2tvdw0s3jn54khce6mua7l".includes(e))return!1;return(42===r.length||61===r.length)&&function(e){let t=e.indexOf(":"),r=e.slice(0,t),i=e.slice(t+1),n=[];for(let e of r)n.push(31&e.charCodeAt(0));n.push(0);let a=[];for(let e of i){let t="qpzry9x8gf2tvdw0s3jn54khce6mua7l".indexOf(e);if(-1===t)return!1;a.push(t)}let s=1n;for(let e of[...n,...a]){let t=s>>35n;s=(34359738367n&s)<<5n^BigInt(e),1n&t&&(s^=656907472481n),2n&t&&(s^=522768456162n),4n&t&&(s^=1044723512260n),8n&t&&(s^=748107326120n),16n&t&&(s^=130178868336n)}return(1n^s)===0n}(t)}(s);case r.Solana:case r.Fogo:var m=e;try{return C.PublicKey.isOnCurve(m)}catch{return!1}case r.Dogecoin:return o=e,/^[DA][1-9A-HJ-NP-Za-km-z]{25,33}$/.test(o);case r.Litecoin:let y;return"L"===(y=(l=e)[0])?P(l,48):"M"===y?P(l,50):"3"===y?P(l,5):!!l.toLowerCase().startsWith("ltc1")&&function(e){let t,r=!1;try{t=i.bech32.decode(e)}catch{try{t=i.bech32m.decode(e),r=!0}catch{return!1}}if("ltc"!==t.prefix.toLowerCase())return!1;let{words:n}=t;if(!n||n.length<1)return!1;let a=n[0];if(null==a||a<0||a>16)return!1;let s=i.bech32.fromWords(n.slice(1)).length;return!(s<2)&&!(s>40)&&(0===a?!r&&(20===s||32===s):1===a&&!!r&&32===s)}(l);case r.XRPL:return u=e,(0,N.isValidClassicAddress)(u)||(0,N.isValidXAddress)(u);case r.Zcash:var v=e;if(v.startsWith("t1")||v.startsWith("t3"))return/^t[13][a-km-zA-HJ-NP-Z1-9]{33}$/.test(v);if(v.startsWith("tex1"))try{let e=i.bech32m.decodeToBytes(v);if("tex"!==e.prefix)return!1;return 20===e.bytes.length}catch{return!1}if(v.startsWith("u1"))try{return"u"===i.bech32m.decodeToBytes(v).prefix}catch{}return!1;case r.Tron:return function(e){try{let t=i.base58.decode(e);if(25!==t.length)return!1;let r=t.slice(0,21),n=t.slice(21),a=(0,O.sha256)((0,O.sha256)(r)).slice(0,4);for(let e=0;e<4;e++)if(n[e]!==a[e])return!1;return 65===r[0]}catch{return!1}}(c=e)||function(e){try{let t=i.hex.decode(e);return 21===t.length&&65===t[0]}catch{return!1}}(c);case r.TON:let b;return null!==(b=n(e))&&(0===b.workchainId||-1===b.workchainId)&&(null===b.tag||17===b.tag||81===b.tag);case r.Sui:return d=e,/^(?:0x)?[a-fA-F0-9]{64}$/.test(d);case r.Stellar:return f=e,/^G[A-Z0-9]{55}$/.test(f);case r.Aptos:return h=e,/^0x[a-fA-F0-9]{64}$/.test(h);case r.Movement:var w=e;let _=w;if(w.startsWith("0x")&&(_=w.slice(2)),0===_.length||_.length>64||!/^[a-fA-F0-9]+$/.test(_))return!1;if(_.length>=60)return!0;let A=_.padStart(64,"0");return/^0{63}[0-9a-fA-F]$/.test(A);case r.Cardano:var S=e;try{let{prefix:e,words:t}=i.bech32.decode(S,120);if("addr"!==e)return!1;let r=i.bech32.fromWords(t)[0]>>4;return r>=0&&r<=7}catch{return!1}case r.Starknet:return p=e,/^0x[a-fA-F0-9]{1,64}$/.test(p);case r.Ethereum:case r.Optimism:case r.BNB:case r.Gnosis:case r.Polygon:case r.Monad:case r.LayerX:case r.Adi:case r.Base:case r.Arbitrum:case r.Avalanche:case r.Berachain:case r.Plasma:case r.Scroll:case r.Abstract:case r.HyperCore:return k(e,{strict:!0});case r.Aleo:return function(e){try{let r=i.bech32m.decodeToBytes(e);if("aleo"!==r.prefix||32!==r.bytes.length)return!1;let n=new Uint8Array(r.bytes);n[31]=127&n[31];let a=0n;for(let e=31;e>=0;e--)a=a<<8n|BigInt(n[e]);if(a>=0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)return!1;let s=a*a%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,o=((1n-3021n*s%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n+0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n;if(0n===o)return!1;let l=function(e){if(0n===(e=(e%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n+0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n))return 0n;if(1n!==D(e,(0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n-1n)/2n,0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n))return null;let t=0,r=0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n-1n;for(;(1n&r)===0n;)t++,r>>=1n;let i=2n;for(;D(i,(0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n-1n)/2n,0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)!==0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n-1n;)i++;let n=t,a=D(i,r,0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n),s=D(e,r,0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n),o=D(e,(r+1n)/2n,0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n);for(;;){if(1n===s)return o;let e=1,t=s*s%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n;for(;1n!==t;)t=t*t%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,e++;let r=a;for(let t=0;t<n-e-1;t++)r=r*r%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n;n=e,s=s*(a=r*r%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,o=o*r%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n}}((1n+s)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n*D(o,0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n-2n,0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n);if(null===l)return!1;let u=0n===l?0n:0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n-l,c=[a,l,a*l%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,1n],d=[a,u,a*u%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,1n];for(let e of[c,d]){var t;if(t=function(e){let t=R,r=e,i=0x4aad957a68b2955982d1347970dec00
25293a3afc43c8afeb95aee9ac33fd9ffn;for(;i>0n;)1n&i&&(t=function(e,t){let[r,i,n,a]=e,[s,o,l,u]=t,c=r*s%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,d=i*o%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,f=3021n*n%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n*l%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,h=a*u%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,p=((r+i)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n*((s+o)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n-c-d+2n*0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,g=((h-f)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n+0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,m=(h+f)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,y=(d+c)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n;return[p*g%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,m*y%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,p*y%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,g*m%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n]}(t,r)),r=function(e){let[t,r,i,n]=e,a=t*t%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,s=r*r%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,o=(0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n-a)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,l=((t+r)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n*((t+r)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n-a-s+2n*0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,u=(o+s)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,c=((u-n*n%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n*2n%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n+0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,d=((o-s)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n+0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n)%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n;return[l*c%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,u*d%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,l*d%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n,c*u%0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001n]}(r),i>>=1n;return t}(e),0n===t[0]&&t[1]===t[3])return!0}return!1}catch{return!1}}(e);case r.Dash:return function(e){try{let t=i.base58.decode(e);if(25!==t.length)return!1;let r=t[0];if(76!==r&&16!==r)return!1;let n=t.subarray(0,21),a=t.subarray(21,25),s=(0,O.sha256)((0,O.sha256)(n)).subarray(0,4);for(let e=0;e<4;e++)if(a[e]!==s[e])return!1;return!0}catch{return!1}}(e);default:return!1}}],929707)},964155,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BinaryReader=r.BinaryWriter=void 0,r.BinaryWriter=class{buffer;view;offset=0;constructor(e=1024){this.buffer=new Uint8Array(e),this.view=new DataView(this.buffer.buffer)}ensureCapacity(e){let t=this.offset+e;if(t<=this.buffer.length)return;let r=this.buffer.length;for(;r<t;)r*=2;let i=new Uint8Array(r);i.set(this.buffer),this.buffer=i,this.view=new DataView(this.buffer.buffer)}writeUint8(e){this.ensureCapacity(1),this.view.setUint8(this.offset,e),this.offset+=1}writeUint16(e){this.ensureCapacity(2),this.view.setUint16(this.offset,e,!0),this.offset+=2}writeUint32(e){this.ensureCapacity(4),this.view.setUint32(this.offset,e,!0),this.offset+=4}writeUint64(e){this.ensureCapacity(8),this.view.setBigUint64(this.offset,e,!0),this.offset+=8}writeUint128(e){this.ensureCapacity(16);let t=e&BigInt("0xFFFFFFFFFFFFFFFF"),r=e>>BigInt(64);this.writeUint64(t),this.writeUint64(r)}writeInt8(e){this.ensureCapacity(1),this.view.setInt8(this.offset,e),this.offset+=1}writeInt16(e){this.ensureCapacity(2),this.view.setInt16(this.offset,e,!0),this.offset+=2}writeInt32(e){this.ensureCapacity(4),this.view.setInt32(this.offset,e,!0),this.offset+=4}writeInt64(e){this.ensureCapacity(8),this.view.setBigInt64(this.offset,e,!0),this.offset+=8}writeInt128(e){this.ensureCapacity(16);let t=e&BigInt("0xFFFFFFFFFFFFFFFF"),r=e>>BigInt(64);this.writeInt64(t),this.writeInt64(r)}writeFloat32(e){this.ensureCapacity(4),this.view.setFloat32(this.offset,e,!0),this.offset+=4}writeFloat64(e){this.ensureCapacity(8),this.view.setFloat64(this.offset,e,!0),this.offset+=8}writeBool(e){this.writeUint8(+!!e)}writeString(e){let t=new TextEncoder().encode(e);this.writeUint32(t.length),this.ensureCapacity(t.length),this.buffer.set(t,this.offset),this.offset+=t.length}getBuffer(){return this.buffer.slice(0,this.offset)}},r.BinaryReader=class{buffer;view;offset=0;constructor(e){this.buffer=e,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}readUint8(){let e=this.view.getUint8(this.offset);return this.offset+=1,e}readUint16(){let e=this.view.getUint16(this.offset,!0);return this.offset+=2,e}readUint32(){let e=this.view.getUint32(this.offset,!0);return this.offset+=4,e}readUint64(){let e=this.view.getBigUint64(this.offset,!0);return this.offset+=8,e}readUint128(){let e=this.readUint64();return this.readUint64()<<BigInt(64)|e}readInt8(){let e=this.view.getInt8(this.offset);return this.offset+=1,e}readInt16(){let e=this.view.getInt16(this.offset,!0);return this.offset+=2,e}readInt32(){let e=this.view.getInt32(this.offset,!0);return this.offset+=4,e}readInt64(){let e=this.view.getBigInt64(this.offset,!0);return this.offset+=8,e}readInt128(){let e=this.readUint64();return this.readInt64()<<BigInt(64)|e}readFloat32(){let e=this.view.getFloat32(this.offset,!0);return this.offset+=4,e}readFloat64(){let e=this.view.getFloat64(this.offset,!0);return this.offset+=8,e}readBool(){return!!this.readUint8()}readString(){let e=this.readUint32(),t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,new TextDecoder().decode(t)}getOffset(){return this.offset}}},26610,(e,t,r)=>{"use strict";
2Object.defineProperty(r,"__esModule",{value:!0}),r.registry=r.TypeRegistry=void 0;class i{handlers=new Map;register(e,t){this.handlers.set(e,t)}getHandler(e){let t=this.handlers.get(e);if(!t)throw Error(`No handler registered for type: ${e}`);return t}}r.TypeRegistry=i,r.registry=new i,r.registry.register("u8",{write:(e,t)=>{if(t<0||t>255||!Number.isInteger(t))throw Error("Value out of range for u8");e.writeUint8(t)},read:e=>e.readUint8()}),r.registry.register("u16",{write:(e,t)=>{if(t<0||t>65535||!Number.isInteger(t))throw Error("Value out of range for u16");e.writeUint16(t)},read:e=>e.readUint16()}),r.registry.register("u32",{write:(e,t)=>{if(t<0||t>0xffffffff||!Number.isInteger(t))throw Error("Value out of range for u32");e.writeUint32(t)},read:e=>e.readUint32()}),r.registry.register("u64",{write:(e,t)=>{if(t<0n||t>0xffffffffffffffffn)throw Error("Value out of range for u64");e.writeUint64(t)},read:e=>e.readUint64()}),r.registry.register("u128",{write:(e,t)=>{if(t<0n||t>0xffffffffffffffffffffffffffffffffn)throw Error("Value out of range for u128");e.writeUint128(t)},read:e=>e.readUint128()}),r.registry.register("i8",{write:(e,t)=>{if(t<-128||t>127||!Number.isInteger(t))throw Error("Value out of range for i8");e.writeInt8(t)},read:e=>e.readInt8()}),r.registry.register("i16",{write:(e,t)=>{if(t<-32768||t>32767||!Number.isInteger(t))throw Error("Value out of range for i16");e.writeInt16(t)},read:e=>e.readInt16()}),r.registry.register("i32",{write:(e,t)=>{if(t<-0x80000000||t>0x7fffffff||!Number.isInteger(t))throw Error("Value out of range for i32");e.writeInt32(t)},read:e=>e.readInt32()}),r.registry.register("i64",{write:(e,t)=>{if(t<-0x8000000000000000n||t>0x7fffffffffffffffn)throw Error("Value out of range for i64");e.writeInt64(t)},read:e=>e.readInt64()}),r.registry.register("i128",{write:(e,t)=>{if(t<-0x80000000000000000000000000000000n||t>0x7fffffffffffffffffffffffffffffffn)throw Error("Value out of range for i128");e.writeInt128(t)},read:e=>e.readInt128()}),r.registry.register("f32",{write:(e,t)=>e.writeFloat32(t),read:e=>e.readFloat32()}),r.registry.register("f64",{write:(e,t)=>{if(Number.isNaN(t))throw Error("For portability reasons we do not allow serializing NaN values.");e.writeFloat64(t)},read:e=>e.readFloat64()}),r.registry.register("bool",{write:(e,t)=>e.writeBool(t),read:e=>e.readBool()}),r.registry.register("string",{write:(e,t)=>e.writeString(t),read:e=>e.readString()}),r.registry.register("unit",{write:()=>{},read:()=>({})}),r.registry.register("struct",{write:(e,t,i)=>{if(i)for(let[n,a]of Object.entries(i))r.registry.getHandler(a.type).write(e,t[n],a.options)},read:(e,t)=>{if(!t)return{};let i={};for(let[n,a]of Object.entries(t)){let t=r.registry.getHandler(a.type);i[n]=t.read(e,a.options)}return i}}),r.registry.register("vec",{write:(e,t,i)=>{if(!i)return;let{elementType:n,elementOptions:a}=i,s=(ArrayBuffer.isView(t),t.length);e.writeUint32(s);let o=r.registry.getHandler(n);if(ArrayBuffer.isView(t))for(let r=0;r<s;r++)o.write(e,t[r],a);else for(let r of t)o.write(e,r,a)},read:(e,t)=>{if(!t)return[];let{elementType:i,elementOptions:n}=t,a=e.readUint32(),s=r.registry.getHandler(i),o=Array.from({length:a},()=>s.read(e,n));switch(i){case"u8":return new Uint8Array(o);case"u16":return new Uint16Array(o);case"u32":return new Uint32Array(o);case"i8":return new Int8Array(o);case"i16":return new Int16Array(o);case"i32":return new Int32Array(o);case"i64":return new BigInt64Array(o);case"f32":return new Float32Array(o);case"f64":return new Float64Array(o);default:return o}}}),r.registry.register("set",{write:(e,t,i)=>{if(!i)return;let{elementType:n,elementOptions:a}=i,s=Array.from(t).sort();e.writeUint32(s.length);let o=r.registry.getHandler(n);for(let t of s)o.write(e,t,a)},read:(e,t)=>{if(!t)return new Set;let{elementType:i,elementOptions:n}=t,a=e.readUint32(),s=r.registry.getHandler(i);return new Set(Array.from({length:a},()=>s.read(e,n)))}}),r.registry.register("map",{write:(e,t,i)=>{if(!i)return;let{keyType:n,keyOptions:a,valueType:s,valueOptions:o}=i,l=Array.from(t.entries()).sort();e.writeUint32(l.length);let u=r.registry.getHandler(n),c=r.registry.getHandler(s);for(let[t,r]of l)u.write(e,t,a),c.write(e,r,o)},read:(e,t)=>{if(!t)return new Map;let{keyType:i,keyOptions:n,valueType:a,valueOptions:s}=t,o=e.readUint32(),l=r.registry.getHandler(i),u=r.registry.getHandler(a);return new Map(Array.from({length:o},()=>[l.read(e,n),u.read(e,s)]))}}),r.registry.register("option",{write:(e,t,i)=>{if(!i)return;let{valueType:n,valueOptions:a}=i,s=null!==t;e.writeUint8(+!!s),s&&r.registry.getHandler(n).write(e,t,a)},read:(e,t)=>{if(!t)return null;let{valueType:i,valueOptions:n}=t;return 1===e.readUint8()?r.registry.getHandler(i).read(e,n):null}}),r.registry.register("enum",{write:(e,t,i)=>{if(!i)return;let n=Object.keys(t)[0],a=t[n],s=i.variants.find(e=>e.name===n);if(!s)throw Error(`Unknown enum variant: ${n}`);e.writeUint8(s.index),"unit"!==s.type&&r.registry.getHandler(s.type).write(e,a,s.options)},read:(e,t)=>{if(!t)return{};let i=e.readUint8(),n=t.variants.find(e=>e.index===i);if(!n)throw Error(`Unknown enum variant index: ${i}`);if("unit"===n.type)return{[n.name]:{}};let a=r.registry.getHandler(n.type).read(e,n.options);return{[n.name]:a}}}),r.registry.register("tuple",{write:(e,t,i)=>{if(i){if(t.length!==i.length)throw Error(`Tuple length mismatch: expected ${i.length}, got ${t.length}`);for(let n=0;n<i.length;n++){let a=i[n];if(!a)throw Error(`Missing type information for tuple element at index ${n}`);r.registry.getHandler(a.type).write(e,t[n],a.options)}}},read:(e,t)=>{if(!t)return[];let i=[];for(let n of t){let t=r.registry.getHandler(n.type);i.push(t.read(e,n.options))}return i}}),r.registry.register("array",{write:(e,t,i)=>{if(!i)return;let{elementType:n,elementOptions:a,length:s}=i;
2if(t.length!==s)throw Error(`Array length mismatch: expected ${s}, got ${t.length}`);let o=r.registry.getHandler(n);for(let r of t)o.write(e,r,a)},read:(e,t)=>{if(!t)return[];let{elementType:i,elementOptions:n,length:a}=t,s=r.registry.getHandler(i);return Array.from({length:a},()=>s.read(e,n))}}),r.registry.register("bytes",{write:(e,t,r)=>{let i=t.length;if(r?.length!=null){if(i!==r.length)throw Error(`Bytes length mismatch: expected ${r.length}, got ${i}`);for(let r=0;r<i;r++)e.writeUint8(t[r])}else{e.writeUint32(i);for(let r=0;r<i;r++)e.writeUint8(t[r])}},read:(e,t)=>{let r=t?.length!=null?t.length:e.readUint32(),i=new Uint8Array(r);for(let t=0;t<r;t++)i[t]=e.readUint8();return i}}),r.registry.register("nativeEnum",{write:(e,t,r)=>{if(!r)return;let{valueToIndexMap:i}=r,n=i.get(t);if(void 0===n)throw Error(`Invalid enum value: ${String(t)}`);e.writeUint8(n)},read:(e,t)=>{if(!t)return null;let{indexToValueMap:r}=t,i=e.readUint8(),n=r.get(i);if(void 0===n)throw Error(`Invalid enum index: ${i}`);return n}})},851710,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.b=r.Schema=void 0;let i=e.r(964155),n=e.r(26610);class a{type;options;registry;constructor(e,t,r){this.type=e,this.options=t,this.registry=r}serialize(e){let t=new i.BinaryWriter;return this.registry.getHandler(this.type).write(t,e,this.options),t.getBuffer()}deserialize(e){let t=new i.BinaryReader(e);return this.registry.getHandler(this.type).read(t,this.options)}}r.Schema=a,r.b={u8:()=>new a("u8",null,n.registry),u16:()=>new a("u16",null,n.registry),u32:()=>new a("u32",null,n.registry),u64:()=>new a("u64",null,n.registry),u128:()=>new a("u128",null,n.registry),i8:()=>new a("i8",null,n.registry),i16:()=>new a("i16",null,n.registry),i32:()=>new a("i32",null,n.registry),i64:()=>new a("i64",null,n.registry),i128:()=>new a("i128",null,n.registry),f32:()=>new a("f32",null,n.registry),f64:()=>new a("f64",null,n.registry),bool:()=>new a("bool",null,n.registry),string:()=>new a("string",null,n.registry),unit:()=>new a("unit",null,n.registry),vec:e=>new a("vec",{elementType:e.type,elementOptions:e.options},n.registry),hashSet:e=>new a("set",{elementType:e.type,elementOptions:e.options},n.registry),hashMap:(e,t)=>new a("map",{keyType:e.type,keyOptions:e.options,valueType:t.type,valueOptions:t.options},n.registry),option:e=>new a("option",{valueType:e.type,valueOptions:e.options},n.registry),array:(e,t)=>new a("array",{elementType:e.type,elementOptions:e.options,length:t},n.registry),bytes:e=>new a("bytes",null!=e?{length:e}:{},n.registry),enum:e=>new a("enum",{variants:Object.entries(e).map(([e,t],r)=>({index:r,name:e,type:t.type,options:t.options}))},n.registry),struct:e=>new a("struct",Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{type:t.type,options:t.options}])),n.registry),tuple:(...e)=>new a("tuple",e.map(e=>({type:e.type,options:e.options})),n.registry),nativeEnum:e=>{let t=Object.entries(e).filter(([e])=>"string"==typeof e&&Number.isNaN(Number(e))),r=t.map(([e,t])=>t),i=r.some(e=>"string"==typeof e),s=r.some(e=>"number"==typeof e);if(i&&s)throw Error("Mixed string/numeric enums are not supported");let o=new Map,l=new Map;if(t.forEach(([e,t],r)=>{o.set(t,r),l.set(r,t)}),t.length>255)throw Error("Borsh only supports enums with up to 255 variants");return new a("nativeEnum",{enumObj:e,valueToIndexMap:o,indexToValueMap:l},n.registry)}}},695443,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Schema=r.b=void 0;var i=e.r(851710);Object.defineProperty(r,"b",{enumerable:!0,get:function(){return i.b}}),Object.defineProperty(r,"Schema",{enumerable:!0,get:function(){return i.Schema}})},390778,(e,t,r)=>{var i=e.i(335292);!function(){"use strict";var r="input is invalid type",n="object"==typeof window,a=n?window:{};a.JS_SHA512_NO_WINDOW&&(n=!1);var s=!n&&"object"==typeof self;!a.JS_SHA512_NO_NODE_JS&&"object"==typeof i.default&&i.default.versions&&i.default.versions.node?a=e.g:s&&(a=self);var o=!a.JS_SHA512_NO_COMMON_JS&&t.exports,l="function"==typeof define&&define.amd,u=!a.JS_SHA512_NO_ARRAY_BUFFER&&"u">typeof ArrayBuffer,c="0123456789abcdef".split(""),d=[-0x80000000,8388608,32768,128],f=[24,16,8,0],h=[0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817],p=["hex","array","digest","arrayBuffer"],g=[];(a.JS_SHA512_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),u&&(a.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var m=function(e,t){return function(r){return new w(t,!0).update(r)[e]()}},y=function(e){var t=m("hex",e);t.create=function(){return new w(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<p.length;++r){var i=p[r];t[i]=m(i,e)}return t},v=function(e,t){return function(r,i){return new _(r,t,!0).update(i)[e]()}},b=function(e){var t=v("hex",e);t.create=function(t){return new _(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<p.length;++r){var i=p[r];t[i]=v(i,e)}return t};function w(e,t){t?(g[0]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=g[16]=g[17]=g[18]=g[19]=g[20]=g[21]=g[22]=g[23]=g[24]=g[25]=g[26]=g[27]=g[28]=g[29]=g[30]=g[31]=g[32]=0,this.blocks=g):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],384==e?(this.h0h=0xcbbb9d5d,this.h0l=0xc1059ed8,this.h1h=0x629a292a,this.h1l=0x367cd507,this.h2h=0x9159015a,this.h2l=0x3070dd17,this.h3h=0x152fecd8,this.h3l=0xf70e5939,this.h4h=0x67332667,this.h4l=0xffc00b31,this.h5h=0x8eb44a87,this.h5l=0x68581511,this.h6h=0xdb0c2e0d,this.h6l=0x64f98fa7,this.h7h=0x47b5481d,this.h7l=0xbefa4fa4):256==e?(this.h0h=0x22312194,this.h0l=0xf
2c2bf72c,this.h1h=0x9f555fa3,this.h1l=0xc84c64c2,this.h2h=0x2393b86b,this.h2l=0x6f53b151,this.h3h=0x96387719,this.h3l=0x5940eabd,this.h4h=0x96283ee2,this.h4l=0xa88effe3,this.h5h=0xbe5e1e25,this.h5l=0x53863992,this.h6h=0x2b0199fc,this.h6l=0x2c85b8aa,this.h7h=0xeb72ddc,this.h7l=0x81c52ca2):224==e?(this.h0h=0x8c3d37c8,this.h0l=0x19544da2,this.h1h=0x73e19966,this.h1l=0x89dcd4d6,this.h2h=0x1dfab7ae,this.h2l=0x32ff9c82,this.h3h=0x679dd514,this.h3l=0x582f9fcf,this.h4h=0xf6d2b69,this.h4l=0x7bd44da8,this.h5h=0x77e36f73,this.h5l=0x4c48942,this.h6h=0x3f9d85a8,this.h6l=0x6a1d36c8,this.h7h=0x1112e6ad,this.h7l=0x91d692a1):(this.h0h=0x6a09e667,this.h0l=0xf3bcc908,this.h1h=0xbb67ae85,this.h1l=0x84caa73b,this.h2h=0x3c6ef372,this.h2l=0xfe94f82b,this.h3h=0xa54ff53a,this.h3l=0x5f1d36f1,this.h4h=0x510e527f,this.h4l=0xade682d1,this.h5h=0x9b05688c,this.h5l=0x2b3e6c1f,this.h6h=0x1f83d9ab,this.h6l=0xfb41bd6b,this.h7h=0x5be0cd19,this.h7l=0x137e2179),this.bits=e,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}function _(e,t,i){var n,a=typeof e;if("string"!==a){if("object"===a){if(null===e)throw Error(r);else if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!u||!ArrayBuffer.isView(e)))throw Error(r)}else throw Error(r);n=!0}var s=e.length;if(!n){for(var o,l=[],s=e.length,c=0,d=0;d<s;++d)(o=e.charCodeAt(d))<128?l[c++]=o:(o<2048?l[c++]=192|o>>6:(o<55296||o>=57344?l[c++]=224|o>>12:(o=65536+((1023&o)<<10|1023&e.charCodeAt(++d)),l[c++]=240|o>>18,l[c++]=128|o>>12&63),l[c++]=128|o>>6&63),l[c++]=128|63&o);e=l}e.length>128&&(e=new w(t,!0).update(e).array());for(var f=[],h=[],d=0;d<128;++d){var p=e[d]||0;f[d]=92^p,h[d]=54^p}w.call(this,t,i),this.update(h),this.oKeyPad=f,this.inner=!0,this.sharedMemory=i}w.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var t,i=typeof e;if("string"!==i){if("object"===i){if(null===e)throw Error(r);else if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!u||!ArrayBuffer.isView(e)))throw Error(r)}else throw Error(r);t=!0}for(var n,a,s=0,o=e.length,l=this.blocks;s<o;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=l[16]=l[17]=l[18]=l[19]=l[20]=l[21]=l[22]=l[23]=l[24]=l[25]=l[26]=l[27]=l[28]=l[29]=l[30]=l[31]=l[32]=0),t)for(a=this.start;s<o&&a<128;++s)l[a>>2]|=e[s]<<f[3&a++];else for(a=this.start;s<o&&a<128;++s)(n=e.charCodeAt(s))<128?l[a>>2]|=n<<f[3&a++]:(n<2048?l[a>>2]|=(192|n>>6)<<f[3&a++]:(n<55296||n>=57344?l[a>>2]|=(224|n>>12)<<f[3&a++]:(n=65536+((1023&n)<<10|1023&e.charCodeAt(++s)),l[a>>2]|=(240|n>>18)<<f[3&a++],l[a>>2]|=(128|n>>12&63)<<f[3&a++]),l[a>>2]|=(128|n>>6&63)<<f[3&a++]),l[a>>2]|=(128|63&n)<<f[3&a++]);this.lastByteIndex=a,this.bytes+=a-this.start,a>=128?(this.block=l[32],this.start=a-128,this.hash(),this.hashed=!0):this.start=a}return this.bytes>0xffffffff&&(this.hBytes+=this.bytes/0x100000000|0,this.bytes=this.bytes%0x100000000),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[32]=this.block,e[t>>2]|=d[3&t],this.block=e[32],t>=112&&(this.hashed||this.hash(),e[0]=this.block,e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=e[16]=e[17]=e[18]=e[19]=e[20]=e[21]=e[22]=e[23]=e[24]=e[25]=e[26]=e[27]=e[28]=e[29]=e[30]=e[31]=e[32]=0),e[30]=this.hBytes<<3|this.bytes>>>29,e[31]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var e,t,r,i,n,a,s,o,l,u,c,d,f,p,g,m,y,v,b,w,_,A,S,E,x,T=this.h0h,I=this.h0l,k=this.h1h,O=this.h1l,C=this.h2h,N=this.h2l,P=this.h3h,D=this.h3l,R=this.h4h,$=this.h4l,B=this.h5h,L=this.h5l,U=this.h6h,F=this.h6l,M=this.h7h,j=this.h7l,z=this.blocks;for(e=32;e<160;e+=2)t=((w=z[e-30])>>>1|(_=z[e-29])<<31)^(w>>>8|_<<24)^w>>>7,r=(_>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25),i=((w=z[e-4])>>>19|(_=z[e-3])<<13)^(_>>>29|w<<3)^w>>>6,n=(_>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26),w=z[e-32],_=z[e-31],A=z[e-14],a=(65535&(S=z[e-13]))+(65535&_)+(65535&r)+(65535&n),o=(65535&A)+(65535&w)+(65535&t)+(65535&i)+((s=(S>>>16)+(_>>>16)+(r>>>16)+(n>>>16)+(a>>>16))>>>16),l=(A>>>16)+(w>>>16)+(t>>>16)+(i>>>16)+(o>>>16),z[e]=l<<16|65535&o,z[e+1]=s<<16|65535&a;var V=T,H=I,q=k,W=O,K=C,G=N,Z=P,X=D,J=R,Y=$,Q=B,ee=L,et=U,er=F,ei=M,en=j;for(e=0,m=q&K,y=W&G;e<160;e+=8)t=(V>>>28|H<<4)^(H>>>2|V<<30)^(H>>>7|V<<25),r=(H>>>28|V<<4)^(V>>>2|H<<30)^(V>>>7|H<<25),i=(J>>>14|Y<<18)^(J>>>18|Y<<14)^(Y>>>9|J<<23),n=(Y>>>14|J<<18)^(Y>>>18|J<<14)^(J>>>9|Y<<23),u=V&q,c=H&W,v=u^V&K^m,b=c^H&G^y,E=J&Q^~J&et,x=Y&ee^~Y&er,w=z[e],_=z[e+1],A=h[e],a=(65535&(S=h[e+1]))+(65535&_)+(65535&x)+(65535&n)+(65535&en),o=(65535&A)+(65535&w)+(65535&E)+(65535&i)+(65535&ei)+((s=(S>>>16)+(_>>>16)+(x>>>16)+(n>>>16)+(en>>>16)+(a>>>16))>>>16),w=(l=(A>>>16)+(w>>>16)+(E>>>16)+(i>>>16)+(ei>>>16)+(o>>>16))<<16|65535&o,_=s<<16|65535&a,a=(65535&b)+(65535&r),o=(65535&v)+(65535&t)+((s=(b>>>16)+(r>>>16)+(a>>>16))>>>16),A=(l=(v>>>16)+(t>>>16)+(o>>>16))<<16|65535&o,S=s<<16|65535&a,a=(65535&X)+(65535&_),o=(65535&Z)+(65535&w)+((s=(X>>>16)+(_>>>16)+(a>>>16))>>>16),ei=(l=(Z>>>16)+(w>>>16)+(o>>>16))<<16|65535&o,en=s<<16|65535&a,a=(65535&S)+(65535&_),o=(65535&A)+(65535&w)+((s=(S>>>16)+(_>>>16)+(a>>>16))>>>16),t=((Z=(l=(A>>>16)+(w>>>16)+(o>>>16))<<16|65535&o)>>>28|(X=s<<16|65535&a)<<4)^(X>>>2|Z<<30)^(X>>>7|Z<<25),r=(X>>>28|Z<<4)^(Z>>>2|X<<30)^(Z>>>7|X<<25),i=(ei>>>14|en<<18)^(ei>>>18|en<<14)^(en>>>9|ei<<23),n=(en>>>14|ei<<18)^(en>>>18|ei<<14)^(ei>>>9|en<<23),d=Z&V,f=X&H,v=d^Z&q^u,b=f^X&W^c,E=ei&J^~ei&Q,x=en&Y^~en&ee,w=z[e+2],_=z[e+3],A=h[e+2],a=(65535&(S=h[e+3]))+(65535&_)+(65535&x)+(65535&n)+(65535&er),o=(65535&A)+(65535&w)+(65535&E)+(65535&i)+(65535&et)+((s=(S>>>16)+(_>>>16)+(x>>>16)+(n>>>16)+(er>>>16)+(a>>>16))>>>16),w=(l=(A>>>16)+(w>>>16)+(E>>>16)+(i>>>16)+(et>>>16)+(o>>>16))<<16|65535&o,_=s<<16|65535&a,a=(65535&b)+(65535&r),o=(65535&v)+(65535&t)+((s=(b>>>16)+(r>>>16)+(a>>>16))>>>16),A=(l=(v>>>16)+(t>>>16)+(o>>>16))<<16|65535&o,S=s<<16|65535&a,a=(65535&G)+(65535&_),o=(65535&K)+(65535&w)+((s=(G>>>16)+(_>>>16)+(a>>>16))>>>16),et=(l=(K>>>16)+(w>>>16)+(o>>>16))<<16|65535&o,er=s<<16|65535&a,a=(65535&S)+(65535&_),o=(65535&A)+(65535&w)+((s=(S>>>16)+(_>>>16)+(a>>>16))>>>16),t=((K=(l=(A>>>16)+(w>>>16)+(o>>>16))<<16|65535&o)>>>28|(G=s<<16|65535&a)<<4)^(G>>>2|K<<30)^(G>>>7|K<<25),r=(G>>>28|K<<4)^(K>>>2|G<<30)^(K>>>7|G<<25),i=(et>>>14|er<<18)^(et>>>18|er<<14)^(er>>>9|et<<23),n=(er>>>14|et<<18)^(er>>>18|et<<14)^(et>>>9|er<<23),p=K&Z,g=G&X,v=p^K&V^d,b=g^G&H^f,E=et&ei^~et&J,x=er&en^~er&Y,w=z[e+4],_=z[e+5],A=h[e+4],a=(65535&(S=h[e+5]))+(65535&_)+(65535&x)+(65535&n)+(65535&ee),o=(65535&A)+(65535&w)+(65535&E)+(65535&i)+(65535&Q)+((s=(S>>>16)+(_>>>16)+(x>>>16)+(n>>>16)+(ee>>>16)+(a>>>16))>>>16),w=(l=(A>>>16)+(w>>>16)+(E>>>16)+(i>>>16)+(Q>>>16)+(o>>>16))<<16|65535&o,_=s<<16|65535&a,a=(65535&b)+(65535&r),o=(65535&v)+(65535&t)+((s=(b>>>16)+(r>>>16)+(a>>>16))>>>16),A=(l=(v>>>16)+(t>>>16)+(o>>>16))<<16|65535&o,S=s<<16|65535&a,a=(65535&W)+(65535&_),o=(65535&q)+(65535&w)+((s=(W>>>16)+(_>>>16)+(a>>>16))>>>16),Q=(l=(q>>>16)+(w>>>16)+(o>>>16))<<16|65535&o,ee=s<<16|65535&a,a=(65535&S)+(65535&_),o=(65535&A)+(65535&w)+((s=(S>>>16)+(_>>>16)+(a>>>16))>>>16),t=((q=(l=(A>>>16)+(w>>>16)+(o>>>16))<<16|65535&o)>>>28|(W=s<<16|65535&a)<<4)^(W>>>2|q<<30)^(W>>>7|q<<25),r=(W>>>28|q<<4)^(q>>>2|W<<30)^(q>>>7|W<<25),i=(Q>>>14|ee<<18)^(Q>>>18|ee<<14)^(ee>>>9|Q<<23),n=(ee>>>14|Q<<18)^(ee>>>18|Q<<14)^(Q>>>9|ee<<23),m=q&K,y=W&G,v=m^q&Z^p,b=y^W&X^g,E=Q&et^~Q&ei,x=ee&er^~ee&en,w=z[e+6],_=z[e+7],A=h[e+6],a=(65535&(S=h[e+7]))+(65535&_)+(65535&x)+(65535&n)+(65535&Y),o=(65535&A)+(65535&w)+(65535&E)+(65535&i)+(65535&J)+((s=(S>>>16)+(_>>>16)+(x>>>16)+(n>>>16)+(Y>>>16)+(a>>>16))>>>16),w=(l=(A>>>16)+(w>>>16)+(E>>>16)+(i>>>16)+(J>>>16)+(o>>>16))<<16|65535&o,_=s<<16|65535&a,a=(65535&b)+(65535&r),o=(65535&v)+(65535&t)+((s=(b>>>16)+(r>>>16)+(a>>>16))>>>16),A=(l=(v>>>16)+(t>>>16)+(o>>>16))<<16|65535&o,S=s<<16|65535&a,a=(65535&H)+(65535&_),o=(65535&V)+(65535&w)+((s=(H>>>16)+(_>>>16)+(a>>>16))>>>16),J=(l=(V>>>16)+(w>>>16)+(o>>>16))<<16|65535&o,Y=s<<16|65535&a,a=(65535&S)+(65535&_),o=(65535&A)+(65535&w)+((s=(S>>>16)+(_>>>16)+(a>>>16))>>>16),V=(l=(A>>>16)+(w>>>16)+(o>>>16))<<16|65535&o,H=s<<16|65535&a;a=(65535&I)+(65535&H),o=(65535&T)+(65535&V)+((s=(I>>>16)+(H>>>16)+(a>>>16))>>>16),l=(T>>>16)+(V>>>16)+(o>>>16),this.h0h=l<<16|65535&o,this.h0l=s<<16|65535&a,a=(65535&O)+(65535&W),o=(65535&k)+(65535&q)+((s=(O>>>16)+(W>>>16)+(a>>>16))>>>16),l=(k>>>16)+(q>>>16)+(o>>>16),this.h1h=l<<16|65535&o,this.h1l=s<<16|65535&a,a=(65535&N)+(65535&G),o=(65535&C)+(65535&K)+((s=(N>>>16)+(G>>>16)+(a>>>16))>>>16),l=(C>>>16)+(K>>>16)+(o>>>16),this.h2h=l<<16|65535&o,this.h2l=s<<16|65535&a,a=(65535&D)+(65535&X),o=(65535&P)+(65535&Z)+((s=(D>>>16)+(X>>>16)+(a>>>16))>>>16),l=(P>>>16)+(Z>>>16)+(o>>>16),this.h3h=l<<16|65535&o,this.h3l=s<<16|65535&a,a=(65535&$)+(65535&Y),o=(65535&R)+(65535&J)+((s=($>>>16)+(Y>>>16)+(a>>>16))>>>16),l=(R>>>16)+(J>>>16)+(o>>>16),this.h4h=l<<16|65535&o,this.h4l=s<<16|65535&a,a=(65535&L)+(65535&ee),o=(65535&B)+(65535&Q)+((s=(L>>>16)+(ee>>>16)+(a>>>16))>>>16),l=(B>>>16)+(Q>>>16)+(o>>>16),this.h5h=l<<16|65535&o,this.h5l=s<<16|65535&a,a=(65535&F)+(65535&er),o=(65535&U)+(65535&et)+((s=(F>>>16)+(er>>>16)+(a>>>16))>>>16),l=(U>>>16)+(et>>>16)+(o>>>16),this.h6h=l<<16|65535&o,this.h6l=s<<16|65535&a,a=(65535&j)+(65535&en),o=(65535&M)+(65535&ei)+((s=(j>>>16)+(en>>>16)+(a>>>16))>>>16),l=(M>>>16)+(ei>>>16)+(o>>>16),this.h7h=l<<16|65535&o,this.h7l=s<<16|65535&a},w.prototype.hex=function(){this.finalize();var e=this.h0h,t=this.h0l,r=this.h1h,i=this.h1l,n=this.h2h,a=this.h2l,s=this.h3h,o=this.h3l,l=this.h4h,u=this.h4l,d=this.h5h,f=this.h5l,h=this.h6h,p=this.h6l,g=this.h7h,m=this.h7l,y=this.bits,v=c[e>>28&15]+c[e>>24&15]+c[e>>20&15]+c[e>>16&15]+c[e>>12&15]+c[e>>8&15]+c[e>>4&15]+c[15&e]+c[t>>28&15]+c[t>>24&15]+c[t>>20&15]+c[t>>16&15]+c[t>>12&15]+c[t>>8&15]+c[t>>4&15]+c[15&t]+c[r>>28&15]+c[r>>24&15]+c[r>>20&15]+c[r>>16&15]+c[r>>12&15]+c[r>>8&15]+c[r>>4&15]+c[15&r]+c[i>>28&15]+c[i>>24&15]+c[i>>20&15]+c[i>>16&15]+c[i>>12&15]+c[i>>8&15]+c[i>>4&15]+c[15&i]+c[n>>28&15]+c[n>>24&15]+c[n>>20&15]+c[n>>16&15]+c[n>>12&15]+c[n>>8&15]+c[n>>4&15]+c[15&n]+c[a>>28&15]+c[a>>24&15]+c[a>>20&15]+c[a>>16&15]+c[a>>12&15]+c[a>>8&15]+c[a>>4&15]+c[15&a]+c[s>>28&15]+c[s>>24&15]+c[s>>20&15]+c[s>>16&15]+c[s>>12&15]+c[s>>8&15]+c[s>>4&15]+c[15&s];return y>=256&&(v+=c[o>>28&15]+c[o>>24&15]+c[o>>20&15]+c[o>>16&15]+c[o>>12&15]+c[o>>8&15]+c[o>>4&15]+c[15&o]),y>=384&&(v+=c[l>>28&15]+c[l>>24&15]+c[l>>20&15]+c[l>>16&15]+c[l>>12&15]+c[l>>8&15]+c[l>>4&15]+c[15&l]+c[u>>28&15]+c[u>>24&15]+c[u>>20&15]+c[u>>16&15]+c[u>>12&15]+c[u>>8&15]+c[u>>4&15]+c[15&u]+c[d>>28&15]+c[d>>24&15]+c[d>>20&15]+c[d>>16&15]+c[d>>12&15]+c[d>>8&15]+c[d>>4&15]+c[15&d]+c[f>>28&15]+c[f>>24&15]+c[f>>20&15]+c[f>>16&15]+c[f>>12&15]+c[f>>8&15]+c[f>>4&15]+c[15&f]),512==y&&(v+=c[h>>28&15]+c[h>>24&15]+c[h>>20&15]+c[h>>16&15]+c[h>>12&15]+c[h>>8&15]+c[h>>4&15]+c[15&h]+c[p>>28&15]+c[p>>24&15]+c[p>>20&15]+c[p>>16&15]+c[p>>12&15]+c[p>>8&15]+c[p>>4&15]+c[15&p]+c[g>>28&15]+c[g>>24&15]+c[g>>20&15]+c[g>>16&15]+c[g>>12&15]+c[g>>8&15]+c[g>>4&15]+c[15&g]+c[m>>28&15]+c[m>>24&15]+c[m>>20&15]+c[m>>16&15]+c[m>>12&15]+c[m>>8&15]+c[m>>4&15]+c[15&m]),v},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var e=this.h0h,t=this.h0l,r=this.h1h,i=this.h1l,n=this.h2h,a=this.h2l,s=this.h3h,o=this.h3l,l=this.h4h,u=this.h4l,c=this.h5h,d=this.h5l,f=this.h6h,h=this.h6l,p=this.h7h,g=this.h7l,m=this.bits,y=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a,s>>24&255,s>>16&255,s>>8&255,255&s];return m>=256&&y.push(o>>24&255,o>>16&255,o>>8&255,255&o),m>=384&&y.push(l>>24&255,l>>16&255,l>>8&255,255&l,u>>24&255,u>>16&255,u>>8&255,255&u,c>>24&255,c>>16&255,c>>8&255,255&c,d>>24&255,d>>16&255,d>>8&255,255&d),512==m&&y.push(f>>24&255,f>>16&255,f>>8&255,255&f,h>>24&255,h>>16&255,h>>8&255,255&h,p>>24&255,p>>16&255,p>>8&255,255&p,g>>24&255,g>>16&255,g>>8&255,255&g),y},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var e=this.bits,t=new ArrayBuffer(e/8),r=new DataView(t);return r.setUint32(0,this.h0h),r.setUint32(4,this.h0l),r.setUint32(8,this.h1h),r.setUint32(12,this.h1l),r.setUint32(16,this.h2h),r.setUint32(20,this.h2l),r.setUint32(24,this.h3h),e>=256&&r.setUint32(28,this.h3l),e>=384&&(r.setUint32(32,this.h4h),r.setUint32(36,this.h4l),r.setUint32(40,this.h5h),r.setUint32(44,this.h5l)),512==e&&(r.setUint32(48,this.h6h),r.setUint32(52,this.h6l),r.setUint32(56,this.h7h),r.setUint32(60,this.h7l)),t},w.prototype.clone=function(){var e=new w(this.bits,!1);return this.copyTo(e),e},w.prototype.copyTo=function(e){var t=0,r=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(t=0;t<r.length;++t)e[r[t]]=this[r[t]];for(t=0;t<this.blocks.length;++t)e.blocks[t]=this.blocks[t]},_.prototype=new w,_.prototype.finalize=function(){if(w.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();w.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(e),w.prototype.finalize.call(this)}},_.prototype.clone=function(){var e=new _([],this.bits,!1);this.copyTo(e),e.inner=this.inner;for(var t=0;t<this.oKeyPad.length;++t)e.oKeyPad[t]=this.oKeyPad[t];return e};var A=y(512);if(A.sha512=A,A.sha384=y(384),A.sha512_256=y(256),A.sha512_224=y(224),A.sha512.hmac=b(512),A.sha384.hmac=b(384),A.sha512_256.hmac=b(256),A.sha512_224.hmac=b(224),o)t.exports=A;else a.sha512=A.sha512,a.sha384=A.sha384,a.sha512_256=A.sha512_256,a.sha512_224=A.sha512_224,l&&(e.r,void 0!==A&&e.v(A))}()},892623,(e,t,r)=>{!function(r){"use strict";var i,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,s=Math.floor,o="[BigNumber Error] ",l=o+"Number primitive has more than 15 significant digits: ",u=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13];function c(e){var t=0|e;return e>0||e===t?t:t-1}function d(e){for(var t,r,i=1,n=e.length,a=e[0]+"";i<n;){for(r=14-(t=e[i++]+"").length;r--;t="0"+t);a+=t}for(n=a.length;
248===a.charCodeAt(--n););return a.slice(0,n+1||1)}function f(e,t){var r,i,n=e.c,a=t.c,s=e.s,o=t.s,l=e.e,u=t.e;if(!s||!o)return null;if(r=n&&!n[0],i=a&&!a[0],r||i)return r?i?0:-o:s;if(s!=o)return s;if(r=s<0,i=l==u,!n||!a)return i?0:!n^r?1:-1;if(!i)return l>u^r?1:-1;for(s=0,o=(l=n.length)<(u=a.length)?l:u;s<o;s++)if(n[s]!=a[s])return n[s]>a[s]^r?1:-1;return l==u?0:l>u^r?1:-1}function h(e,t,r,i){if(e<t||e>r||e!==s(e))throw Error(o+(i||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function p(e){var t=e.c.length-1;return c(e.e/14)==t&&e.c[t]%2!=0}function g(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function m(e,t,r){var i,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(i=e.length,++t>i){for(n=r,t-=i;--t;n+=r);e+=n}else t<i&&(e=e.slice(0,t)+"."+e.slice(t));return e}if((i=function e(t){var r,i,y,v,b,w,_,A,S,E=U.prototype={constructor:U,toString:null,valueOf:null},x=new U(1),T=20,I=4,k=-7,O=21,C=-1e7,N=1e7,P=!1,D=1,R=0,$={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"Â ",suffix:""},B="0123456789abcdefghijklmnopqrstuvwxyz",L=!0;function U(e,t){var r,i,a,o,u,c,d,f,p=this;if(!(p instanceof U))return new U(e,t);if(null==t){if(e&&!0===e._isBigNumber){p.s=e.s,!e.c||e.e>N?p.c=p.e=null:e.e<C?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice());return}if((c="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(o=0,u=e;u>=10;u/=10,o++);o>N?p.c=p.e=null:(p.e=o,p.c=[e]);return}f=String(e)}else{if(!n.test(f=String(e)))return S(p,f,c);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(o=f.indexOf("."))>-1&&(f=f.replace(".","")),(u=f.search(/e/i))>0?(o<0&&(o=u),o+=+f.slice(u+1),f=f.substring(0,u)):o<0&&(o=f.length)}else{if(h(t,2,B.length,"Base"),10==t&&L)return z(p=new U(e),T+p.e+1,I);if(f=String(e),c="number"==typeof e){if(0*e!=0)return S(p,f,c,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,U.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(r=B.slice(0,t),o=u=0,d=f.length;u<d;u++)if(0>r.indexOf(i=f.charAt(u))){if("."==i){if(u>o){o=d;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!0,u=-1,o=0;continue}return S(p,String(e),c,t)}c=!1,(o=(f=A(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):o=f.length}for(u=0;48===f.charCodeAt(u);u++);for(d=f.length;48===f.charCodeAt(--d););if(f=f.slice(u,++d)){if(d-=u,c&&U.DEBUG&&d>15&&(e>0x1fffffffffffff||e!==s(e)))throw Error(l+p.s*e);if((o=o-u-1)>N)p.c=p.e=null;else if(o<C)p.c=[p.e=0];else{if(p.e=o,p.c=[],u=(o+1)%14,o<0&&(u+=14),u<d){for(u&&p.c.push(+f.slice(0,u)),d-=14;u<d;)p.c.push(+f.slice(u,u+=14));u=14-(f=f.slice(u)).length}else u-=d;for(;u--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function F(e,t,r,i){var n,a,s,o,l;if(null==r?r=I:h(r,0,8),!e.c)return e.toString();if(n=e.c[0],s=e.e,null==t)l=d(e.c),l=1==i||2==i&&(s<=k||s>=O)?g(l,s):m(l,s,"0");else if(a=(e=z(new U(e),t,r)).e,o=(l=d(e.c)).length,1==i||2==i&&(t<=a||a<=k)){for(;o<t;l+="0",o++);l=g(l,a)}else if(t-=s+(2===i&&a>s),l=m(l,a,"0"),a+1>o){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=a-o)>0)for(a+1==o&&(l+=".");t--;l+="0");return e.s<0&&n?"-"+l:l}function M(e,t){for(var r,i,n=1,a=new U(e[0]);n<e.length;n++)(i=new U(e[n])).s&&(r=f(a,i))!==t&&(0!==r||a.s!==t)||(a=i);return a}function j(e,t,r){for(var i=1,n=t.length;!t[--n];t.pop());for(n=t[0];n>=10;n/=10,i++);return(r=i+14*r-1)>N?e.c=e.e=null:r<C?e.c=[e.e=0]:(e.e=r,e.c=t),e}function z(e,t,r,i){var n,o,l,c,d,f,h,p=e.c;if(p){e:{for(n=1,c=p[0];c>=10;c/=10,n++);if((o=t-n)<0)o+=14,l=t,h=s((d=p[f=0])/u[n-l-1]%10);else if((f=a((o+1)/14))>=p.length)if(i){for(;p.length<=f;p.push(0));d=h=0,n=1,o%=14,l=o-14+1}else break e;else{for(n=1,d=c=p[f];c>=10;c/=10,n++);o%=14,h=(l=o-14+n)<0?0:s(d/u[n-l-1]%10)}if(i=i||t<0||null!=p[f+1]||(l<0?d:d%u[n-l-1]),i=r<4?(h||i)&&(0==r||r==(e.s<0?3:2)):h>5||5==h&&(4==r||i||6==r&&(o>0?l>0?d/u[n-l]:0:p[f-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,i?(t-=e.e+1,p[0]=u[(14-t%14)%14],e.e=-t||0):p[0]=e.e=0,e;if(0==o?(p.length=f,c=1,f--):(p.length=f+1,c=u[14-o],p[f]=l>0?s(d/u[n-l]%u[l])*c:0),i)for(;;)if(0==f){for(o=1,l=p[0];l>=10;l/=10,o++);for(l=p[0]+=c,c=1;l>=10;l/=10,c++);o!=c&&(e.e++,1e14==p[0]&&(p[0]=1));break}else{if(p[f]+=c,1e14!=p[f])break;p[f--]=0,c=1}for(o=p.length;0===p[--o];p.pop());}e.e>N?e.c=e.e=null:e.e<C&&(e.c=[e.e=0])}return e}function V(e){var t,r=e.e;return null===r?e.toString():(t=d(e.c),t=r<=k||r>=O?g(t,r):m(t,r,"0"),e.s<0?"-"+t:t)}return U.clone=e,U.ROUND_UP=0,U.ROUND_DOWN=1,U.ROUND_CEIL=2,U.ROUND_FLOOR=3,U.ROUND_HALF_UP=4,U.ROUND_HALF_DOWN=5,U.ROUND_HALF_EVEN=6,U.ROUND_HALF_CEIL=7,U.ROUND_HALF_FLOOR=8,U.EUCLID=9,U.config=U.set=function(e){var t,r;if(null!=e)if("object"==typeof e){if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(h(r=e[t],0,1e9,t),T=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(h(r=e[t],0,8,t),I=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(h(r[0],-1e9,0,t),h(r[1],0,1e9,t),k=r[0],O=r[1]):(h(r,-1e9,1e9,t),k=-(O=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)h(r[0],-1e9,-1,t),h(r[1],1,1e9,t),C=r[0],N=r[1];else if(h(r,-1e9,1e9,t),r)C=-(N=r<0?-r:r);else throw Error(o+t+" cannot be zero: "+r);if(e.hasOwnProperty(t="CRYPTO"))if(!!(r=e[t])===r)if(r)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))P=r;else throw P=!r,Error(o+"crypto unavailable");else P=r;else throw Error(o+t+" not true or false: "+r);if(e.hasOwnProperty(t="MODULO_MODE")&&(h(r=e[t],0,9,t),D=r),e.hasOwnProperty(t="POW_PRECISION")&&(h(r=e[t],0,1e9,t),R=r),e.hasOwnProperty(t="FORMAT"))if("object"==typeof(r=e[t]))$=r;else throw Error(o+t+" not an object: "+r);if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\
2s]|(.).*\1/.test(r))throw Error(o+t+" invalid: "+r);L="0123456789"==r.slice(0,10),B=r}}else throw Error(o+"Object expected: "+e);return{DECIMAL_PLACES:T,ROUNDING_MODE:I,EXPONENTIAL_AT:[k,O],RANGE:[C,N],CRYPTO:P,MODULO_MODE:D,POW_PRECISION:R,FORMAT:$,ALPHABET:B}},U.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!U.DEBUG)return!0;var t,r,i=e.c,n=e.e,a=e.s;e:if("[object Array]"==({}).toString.call(i)){if((1===a||-1===a)&&n>=-1e9&&n<=1e9&&n===s(n)){if(0===i[0]){if(0===n&&1===i.length)return!0;break e}if((t=(n+1)%14)<1&&(t+=14),String(i[0]).length==t){for(t=0;t<i.length;t++)if((r=i[t])<0||r>=1e14||r!==s(r))break e;if(0!==r)return!0}}}else if(null===i&&null===n&&(null===a||1===a||-1===a))return!0;throw Error(o+"Invalid BigNumber: "+e)},U.maximum=U.max=function(){return M(arguments,-1)},U.minimum=U.min=function(){return M(arguments,1)},r=0x20000000000000*Math.random()&2097151?function(){return s(0x20000000000000*Math.random())}:function(){return(0x40000000*Math.random()|0)*8388608+(8388608*Math.random()|0)},U.random=function(e){var t,i,n,l,c,d=0,f=[],p=new U(x);if(null==e?e=T:h(e,0,1e9),l=a(e/14),P)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(l*=2));d<l;)(c=131072*t[d]+(t[d+1]>>>11))>=9e15?(i=crypto.getRandomValues(new Uint32Array(2)),t[d]=i[0],t[d+1]=i[1]):(f.push(c%1e14),d+=2);d=l/2}else if(crypto.randomBytes){for(t=crypto.randomBytes(l*=7);d<l;)(c=(31&t[d])*0x1000000000000+0x10000000000*t[d+1]+0x100000000*t[d+2]+0x1000000*t[d+3]+(t[d+4]<<16)+(t[d+5]<<8)+t[d+6])>=9e15?crypto.randomBytes(7).copy(t,d):(f.push(c%1e14),d+=7);d=l/7}else throw P=!1,Error(o+"crypto unavailable");if(!P)for(;d<l;)(c=r())<9e15&&(f[d++]=c%1e14);for(l=f[--d],e%=14,l&&e&&(c=u[14-e],f[d]=s(l/c)*c);0===f[d];f.pop(),d--);if(d<0)f=[n=0];else{for(n=-1;0===f[0];f.splice(0,1),n-=14);for(d=1,c=f[0];c>=10;c/=10,d++);d<14&&(n-=14-d)}return p.e=n,p.c=f,p},U.sum=function(){for(var e=1,t=arguments,r=new U(t[0]);e<t.length;)r=r.plus(t[e++]);return r},A=function(){var e="0123456789";function t(e,t,r,i){for(var n,a,s=[0],o=0,l=e.length;o<l;){for(a=s.length;a--;s[a]*=t);for(s[0]+=i.indexOf(e.charAt(o++)),n=0;n<s.length;n++)s[n]>r-1&&(null==s[n+1]&&(s[n+1]=0),s[n+1]+=s[n]/r|0,s[n]%=r)}return s.reverse()}return function(r,i,n,a,s){var o,l,u,c,f,h,p,g,y=r.indexOf("."),v=T,b=I;for(y>=0&&(c=R,R=0,r=r.replace(".",""),h=(g=new U(i)).pow(r.length-y),R=c,g.c=t(m(d(h.c),h.e,"0"),10,n,e),g.e=g.c.length),u=c=(p=t(r,i,n,s?(o=B,e):(o=e,B))).length;0==p[--c];p.pop());if(!p[0])return o.charAt(0);if(y<0?--u:(h.c=p,h.e=u,h.s=a,p=(h=_(h,g,v,b,n)).c,f=h.r,u=h.e),y=p[l=u+v+1],c=n/2,f=f||l<0||null!=p[l+1],f=b<4?(null!=y||f)&&(0==b||b==(h.s<0?3:2)):y>c||y==c&&(4==b||f||6==b&&1&p[l-1]||b==(h.s<0?8:7)),l<1||!p[0])r=f?m(o.charAt(1),-v,o.charAt(0)):o.charAt(0);else{if(p.length=l,f)for(--n;++p[--l]>n;)p[l]=0,l||(++u,p=[1].concat(p));for(c=p.length;!p[--c];);for(y=0,r="";y<=c;r+=o.charAt(p[y++]));r=m(r,u,o.charAt(0))}return r}}(),_=function(){function e(e,t,r){var i,n,a,s,o=0,l=e.length,u=t%1e7,c=t/1e7|0;for(e=e.slice();l--;)i=c*(a=e[l]%1e7)+(s=e[l]/1e7|0)*u,o=((n=u*a+i%1e7*1e7+o)/r|0)+(i/1e7|0)+c*s,e[l]=n%r;return o&&(e=[o].concat(e)),e}function t(e,t,r,i){var n,a;if(r!=i)a=r>i?1:-1;else for(n=a=0;n<r;n++)if(e[n]!=t[n]){a=e[n]>t[n]?1:-1;break}return a}function r(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=+(e[r]<t[r]),e[r]=n*i+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(i,n,a,o,l){var u,d,f,h,p,g,m,y,v,b,w,_,A,S,E,x,T,I=i.s==n.s?1:-1,k=i.c,O=n.c;if(!k||!k[0]||!O||!O[0])return new U(!i.s||!n.s||(k?O&&k[0]==O[0]:!O)?NaN:k&&0==k[0]||!O?0*I:I/0);for(v=(y=new U(I)).c=[],I=a+(d=i.e-n.e)+1,l||(l=1e14,d=c(i.e/14)-c(n.e/14),I=I/14|0),f=0;O[f]==(k[f]||0);f++);if(O[f]>(k[f]||0)&&d--,I<0)v.push(1),h=!0;else{for(S=k.length,x=O.length,f=0,I+=2,(p=s(l/(O[0]+1)))>1&&(O=e(O,p,l),k=e(k,p,l),x=O.length,S=k.length),A=x,w=(b=k.slice(0,x)).length;w<x;b[w++]=0);T=[0].concat(T=O.slice()),E=O[0],O[1]>=l/2&&E++;do{if(p=0,(u=t(O,b,x,w))<0){if(_=b[0],x!=w&&(_=_*l+(b[1]||0)),(p=s(_/E))>1)for(p>=l&&(p=l-1),m=(g=e(O,p,l)).length,w=b.length;1==t(g,b,m,w);)p--,r(g,x<m?T:O,m,l),m=g.length,u=1;else 0==p&&(u=p=1),m=(g=O.slice()).length;if(m<w&&(g=[0].concat(g)),r(b,g,w,l),w=b.length,-1==u)for(;1>t(O,b,x,w);)p++,r(b,x<w?T:O,w,l),w=b.length}else 0===u&&(p++,b=[0]);v[f++]=p,b[0]?b[w++]=k[A]||0:(b=[k[A]],w=1)}while((A++<S||null!=b[0])&&I--)h=null!=b[0],v[0]||v.splice(0,1)}if(1e14==l){for(f=1,I=v[0];I>=10;I/=10,f++);z(y,a+(y.e=f+14*d-1)+1,o,h)}else y.e=d,y.r=+h;return y}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,y=/^([^.]+)\.$/,v=/^\.([^.]+)$/,b=/^-?(Infinity|NaN)$/,w=/^\s*\+(?=[\w.])|^\s+|\s+$/g,S=function(e,t,r,n){var a,s=r?t:t.replace(w,"");if(b.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(i,function(e,t,r){return a="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=a?e:t}),n&&(a=n,s=s.replace(y,"$1").replace(v,"0.$1")),t!=s))return new U(s,a);if(U.DEBUG)throw Error(o+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},E.absoluteValue=E.abs=function(){var e=new U(this);return e.s<0&&(e.s=1),e},E.comparedTo=function(e,t){return f(this,new U(e,t))},E.decimalPlaces=E.dp=function(e,t){var r,i,n;
2if(null!=e)return h(e,0,1e9),null==t?t=I:h(t,0,8),z(new U(this),e+this.e+1,t);if(!(r=this.c))return null;if(i=((n=r.length-1)-c(this.e/14))*14,n=r[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},E.dividedBy=E.div=function(e,t){return _(this,new U(e,t),T,I)},E.dividedToIntegerBy=E.idiv=function(e,t){return _(this,new U(e,t),0,1)},E.exponentiatedBy=E.pow=function(e,t){var r,i,n,l,u,c,d,f,h,g=this;if((e=new U(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+V(e));if(null!=t&&(t=new U(t)),c=e.e>14,!g.c||!g.c[0]||1==g.c[0]&&!g.e&&1==g.c.length||!e.c||!e.c[0])return h=new U(Math.pow(+V(g),c?e.s*(2-p(e)):+V(e))),t?h.mod(t):h;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new U(NaN);(i=!d&&g.isInteger()&&t.isInteger())&&(g=g.mod(t))}else{if(e.e>9&&(g.e>0||g.e<-1||(0==g.e?g.c[0]>1||c&&g.c[1]>=24e7:g.c[0]<8e13||c&&g.c[0]<=9999975e7)))return l=g.s<0&&p(e)?-0:0,g.e>-1&&(l=1/l),new U(d?1/l:l);R&&(l=a(R/14+2))}for(c?(r=new U(.5),d&&(e.s=1),f=p(e)):f=(n=Math.abs(+V(e)))%2,h=new U(x);;){if(f){if(!(h=h.times(g)).c)break;l?h.c.length>l&&(h.c.length=l):i&&(h=h.mod(t))}if(n){if(0===(n=s(n/2)))break;f=n%2}else if(z(e=e.times(r),e.e+1,1),e.e>14)f=p(e);else{if(0==(n=+V(e)))break;f=n%2}g=g.times(g),l?g.c&&g.c.length>l&&(g.c.length=l):i&&(g=g.mod(t))}return i?h:(d&&(h=x.div(h)),t?h.mod(t):l?z(h,R,I,u):h)},E.integerValue=function(e){var t=new U(this);return null==e?e=I:h(e,0,8),z(t,t.e+1,e)},E.isEqualTo=E.eq=function(e,t){return 0===f(this,new U(e,t))},E.isFinite=function(){return!!this.c},E.isGreaterThan=E.gt=function(e,t){return f(this,new U(e,t))>0},E.isGreaterThanOrEqualTo=E.gte=function(e,t){return 1===(t=f(this,new U(e,t)))||0===t},E.isInteger=function(){return!!this.c&&c(this.e/14)>this.c.length-2},E.isLessThan=E.lt=function(e,t){return 0>f(this,new U(e,t))},E.isLessThanOrEqualTo=E.lte=function(e,t){return -1===(t=f(this,new U(e,t)))||0===t},E.isNaN=function(){return!this.s},E.isNegative=function(){return this.s<0},E.isPositive=function(){return this.s>0},E.isZero=function(){return!!this.c&&0==this.c[0]},E.minus=function(e,t){var r,i,n,a,s=this.s;if(t=(e=new U(e,t)).s,!s||!t)return new U(NaN);if(s!=t)return e.s=-t,this.plus(e);var o=this.e/14,l=e.e/14,u=this.c,d=e.c;if(!o||!l){if(!u||!d)return u?(e.s=-t,e):new U(d?this:NaN);if(!u[0]||!d[0])return d[0]?(e.s=-t,e):new U(u[0]?this:3==I?-0:0)}if(o=c(o),l=c(l),u=u.slice(),s=o-l){for((a=s<0)?(s=-s,n=u):(l=o,n=d),n.reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=u.length)<(t=d.length))?s:t,s=t=0;t<i;t++)if(u[t]!=d[t]){a=u[t]<d[t];break}if(a&&(n=u,u=d,d=n,e.s=-e.s),(t=(i=d.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=1e14-1;i>s;){if(u[--i]<d[i]){for(r=i;r&&!u[--r];u[r]=t);--u[r],u[i]+=1e14}u[i]-=d[i]}for(;0==u[0];u.splice(0,1),--l);return u[0]?j(e,u,l):(e.s=3==I?-1:1,e.c=[e.e=0],e)},E.modulo=E.mod=function(e,t){var r,i;return(e=new U(e,t),this.c&&e.s&&(!e.c||e.c[0]))?e.c&&(!this.c||this.c[0])?(9==D?(i=e.s,e.s=1,r=_(this,e,0,3),e.s=i,r.s*=i):r=_(this,e,0,D),(e=this.minus(r.times(e))).c[0]||1!=D||(e.s=this.s),e):new U(this):new U(NaN)},E.multipliedBy=E.times=function(e,t){var r,i,n,a,s,o,l,u,d,f,h,p,g,m=this.c,y=(e=new U(e,t)).c;if(!m||!y||!m[0]||!y[0])return this.s&&e.s&&(!m||m[0]||y)&&(!y||y[0]||m)?(e.s*=this.s,m&&y?(e.c=[0],e.e=0):e.c=e.e=null):e.c=e.e=e.s=null,e;for(i=c(this.e/14)+c(e.e/14),e.s*=this.s,(l=m.length)<(f=y.length)&&(g=m,m=y,y=g,n=l,l=f,f=n),n=l+f,g=[];n--;g.push(0));for(n=f;--n>=0;){for(r=0,h=y[n]%1e7,p=y[n]/1e7|0,a=n+(s=l);a>n;)o=p*(u=m[--s]%1e7)+(d=m[s]/1e7|0)*h,r=((u=h*u+o%1e7*1e7+g[a]+r)/1e14|0)+(o/1e7|0)+p*d,g[a--]=u%1e14;g[a]=r}return r?++i:g.splice(0,1),j(e,g,i)},E.negated=function(){var e=new U(this);return e.s=-e.s||null,e},E.plus=function(e,t){var r,i=this.s;if(t=(e=new U(e,t)).s,!i||!t)return new U(NaN);if(i!=t)return e.s=-t,this.minus(e);var n=this.e/14,a=e.e/14,s=this.c,o=e.c;if(!n||!a){if(!s||!o)return new U(i/0);if(!s[0]||!o[0])return o[0]?e:new U(s[0]?this:0*i)}if(n=c(n),a=c(a),s=s.slice(),i=n-a){for(i>0?(a=n,r=o):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=o.length)<0&&(r=o,o=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+o[t]+i)/1e14|0,s[t]=1e14===s[t]?0:s[t]%1e14;return i&&(s=[i].concat(s),++a),j(e,s,a)},E.precision=E.sd=function(e,t){var r,i,n;
2if(null!=e&&!!e!==e)return h(e,1,1e9),null==t?t=I:h(t,0,8),z(new U(this),e,t);if(!(r=this.c))return null;if(i=14*(n=r.length-1)+1,n=r[n]){for(;n%10==0;n/=10,i--);for(n=r[0];n>=10;n/=10,i++);}return e&&this.e+1>i&&(i=this.e+1),i},E.shiftedBy=function(e){return h(e,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+e)},E.squareRoot=E.sqrt=function(){var e,t,r,i,n,a=this.c,s=this.s,o=this.e,l=T+4,u=new U("0.5");if(1!==s||!a||!a[0])return new U(!s||s<0&&(!a||a[0])?NaN:a?this:1/0);if(0==(s=Math.sqrt(+V(this)))||s==1/0?(((t=d(a)).length+o)%2==0&&(t+="0"),s=Math.sqrt(+t),o=c((o+1)/2)-(o<0||o%2),r=new U(t=s==1/0?"5e"+o:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+o)):r=new U(s+""),r.c[0]){for((s=(o=r.e)+l)<3&&(s=0);;)if(n=r,r=u.times(n.plus(_(this,n,l,1))),d(n.c).slice(0,s)===(t=d(r.c)).slice(0,s)){if(r.e<o&&--s,"9999"!=(t=t.slice(s-3,s+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(z(r,r.e+T+2,1),e=!r.times(r).eq(this));break}if(!i&&(z(n,n.e+T+2,0),n.times(n).eq(this))){r=n;break}l+=4,s+=4,i=1}}return z(r,r.e+T+1,I,e)},E.toExponential=function(e,t){return null!=e&&(h(e,0,1e9),e++),F(this,e,t,1)},E.toFixed=function(e,t){return null!=e&&(h(e,0,1e9),e=e+this.e+1),F(this,e,t)},E.toFormat=function(e,t,r){var i;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=$;else if("object"!=typeof r)throw Error(o+"Argument not an object: "+r);if(i=this.toFixed(e,t),this.c){var n,a=i.split("."),s=+r.groupSize,l=+r.secondaryGroupSize,u=r.groupSeparator||"",c=a[0],d=a[1],f=this.s<0,h=f?c.slice(1):c,p=h.length;if(l&&(n=s,s=l,l=n,p-=n),s>0&&p>0){for(n=p%s||s,c=h.substr(0,n);n<p;n+=s)c+=u+h.substr(n,s);l>0&&(c+=u+h.slice(n)),f&&(c="-"+c)}i=d?c+(r.decimalSeparator||"")+((l=+r.fractionGroupSize)?d.replace(RegExp("\\d{"+l+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):c}return(r.prefix||"")+i+(r.suffix||"")},E.toFraction=function(e){var t,r,i,n,a,s,l,c,f,h,p,g,m=this.c;if(null!=e&&(!(l=new U(e)).isInteger()&&(l.c||1!==l.s)||l.lt(x)))throw Error(o+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+V(l));if(!m)return new U(this);for(t=new U(x),f=r=new U(x),i=c=new U(x),g=d(m),a=t.e=g.length-this.e-1,t.c[0]=u[(s=a%14)<0?14+s:s],e=!e||l.comparedTo(t)>0?a>0?t:f:l,s=N,N=1/0,l=new U(g),c.c[0]=0;h=_(l,t,0,1),1!=(n=r.plus(h.times(i))).comparedTo(e);)r=i,i=n,f=c.plus(h.times(n=f)),c=n,t=l.minus(h.times(n=t)),l=n;return n=_(e.minus(r),i,0,1),c=c.plus(n.times(f)),r=r.plus(n.times(i)),c.s=f.s=this.s,a*=2,p=1>_(f,i,a,I).minus(this).abs().comparedTo(_(c,r,a,I).minus(this).abs())?[f,i]:[c,r],N=s,p},E.toNumber=function(){return+V(this)},E.toPrecision=function(e,t){return null!=e&&h(e,1,1e9),F(this,e,t,2)},E.toString=function(e){var t,r=this,i=r.s,n=r.e;return null===n?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=n<=k||n>=O?g(d(r.c),n):m(d(r.c),n,"0"):10===e&&L?t=m(d((r=z(new U(r),T+n+1,I)).c),r.e,"0"):(h(e,2,B.length,"Base"),t=A(m(d(r.c),n,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},E.valueOf=E.toJSON=function(){return V(this)},E._isBigNumber=!0,null!=t&&U.set(t),U}()).default=i.BigNumber=i,"function"==typeof define&&define.amd)e.r,void 0!==i&&e.v(i);else t.exports?t.exports=i:(r||(r="u">typeof self&&self?self:window),r.BigNumber=i)}(e.e)},811274,(e,t,r)=>{var i=e.r(892623),n=t.exports;!function(){"use strict";var e,t,r,a=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function o(e){return a.lastIndex=0,a.test(e)?'"'+e.replace(a,function(e){var t=s[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}"function"!=typeof n.stringify&&(n.stringify=function(n,a,s){var l;if(e="",t="","number"==typeof s)for(l=0;l<s;l+=1)t+=" ";else"string"==typeof s&&(t=s);if(r=a,a&&"function"!=typeof a&&("object"!=typeof a||"number"!=typeof a.length))throw Error("JSON.stringify");return function n(a,s){var l,u,c,d,f,h=e,p=s[a],g=null!=p&&(p instanceof i||i.isBigNumber(p));switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(a)),"function"==typeof r&&(p=r.call(s,a,p)),typeof p){case"string":if(g)return p;return o(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":case"bigint":return String(p);case"object":if(!p)return"null";if(e+=t,f=[],"[object Array]"===Object.prototype.toString.apply(p)){for(l=0,d=p.length;l<d;l+=1)f[l]=n(l,p)||"null";return c=0===f.length?"[]":e?"[\n"+e+f.join(",\n"+e)+"\n"+h+"]":"["+f.join(",")+"]",e=h,c}if(r&&"object"==typeof r)for(l=0,d=r.length;l<d;l+=1)"string"==typeof r[l]&&(c=n(u=r[l],p))&&f.push(o(u)+(e?": ":":")+c);
2else Object.keys(p).forEach(function(t){var r=n(t,p);r&&f.push(o(t)+(e?": ":":")+r)});return c=0===f.length?"{}":e?"{\n"+e+f.join(",\n"+e)+"\n"+h+"}":"{"+f.join(",")+"}",e=h,c}}("",{"":n})})}()},773846,(e,t,r)=>{var i=null;let n=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,a=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;t.exports=function(t){"use strict";var r={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=t){if(!0===t.strict&&(r.strict=!0),!0===t.storeAsString&&(r.storeAsString=!0),r.alwaysParseAsBig=!0===t.alwaysParseAsBig&&t.alwaysParseAsBig,r.useNativeBigInt=!0===t.useNativeBigInt&&t.useNativeBigInt,void 0!==t.constructorAction)if("error"===t.constructorAction||"ignore"===t.constructorAction||"preserve"===t.constructorAction)r.constructorAction=t.constructorAction;else throw Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);if(void 0!==t.protoAction)if("error"===t.protoAction||"ignore"===t.protoAction||"preserve"===t.protoAction)r.protoAction=t.protoAction;else throw Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`)}var s,o,l,u,c={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:" "},d=function(e){throw{name:"SyntaxError",message:e,at:s,text:l}},f=function(e){return e&&e!==o&&d("Expected '"+e+"' instead of '"+o+"'"),o=l.charAt(s),s+=1,o},h=function(){var t,n="";for("-"===o&&(n="-",f("-"));o>="0"&&o<="9";)n+=o,f();if("."===o)for(n+=".";f()&&o>="0"&&o<="9";)n+=o;if("e"===o||"E"===o)for(n+=o,f(),("-"===o||"+"===o)&&(n+=o,f());o>="0"&&o<="9";)n+=o,f();if(isFinite(t=+n))return(null==i&&(i=e.r(892623)),n.length>15)?r.storeAsString?n:r.useNativeBigInt?BigInt(n):new i(n):r.alwaysParseAsBig?r.useNativeBigInt?BigInt(t):new i(t):t;d("Bad number")},p=function(){var e,t,r,i="";if('"'===o)for(var n=s;f();){if('"'===o)return s-1>n&&(i+=l.substring(n,s-1)),f(),i;if("\\"===o){if(s-1>n&&(i+=l.substring(n,s-1)),f(),"u"===o){for(t=0,r=0;t<4&&isFinite(e=parseInt(f(),16));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else if("string"==typeof c[o])i+=c[o];else break;n=s}}d("Bad string")},g=function(){for(;o&&o<=" ";)f()},m=function(){switch(o){case"t":return f("t"),f("r"),f("u"),f("e"),!0;case"f":return f("f"),f("a"),f("l"),f("s"),f("e"),!1;case"n":return f("n"),f("u"),f("l"),f("l"),null}d("Unexpected '"+o+"'")},y=function(){var e=[];if("["===o){if(f("["),g(),"]"===o)return f("]"),e;for(;o;){if(e.push(u()),g(),"]"===o)return f("]"),e;f(","),g()}}d("Bad array")},v=function(){var e,t=Object.create(null);if("{"===o){if(f("{"),g(),"}"===o)return f("}"),t;for(;o;){if(e=p(),g(),f(":"),!0===r.strict&&Object.hasOwnProperty.call(t,e)&&d('Duplicate key "'+e+'"'),!0===n.test(e)?"error"===r.protoAction?d("Object contains forbidden prototype property"):"ignore"===r.protoAction?u():t[e]=u():!0===a.test(e)?"error"===r.constructorAction?d("Object contains forbidden constructor property"):"ignore"===r.constructorAction?u():t[e]=u():t[e]=u(),g(),"}"===o)return f("}"),t;f(","),g()}}d("Bad object")};return u=function(){switch(g(),o){case"{":return v();case"[":return y();case'"':return p();case"-":return h();default:return o>="0"&&o<="9"?h():m()}},function(e,t){var r;return l=e+"",s=0,o=" ",r=u(),g(),o&&d("Syntax error"),"function"==typeof t?function e(r,i){var n,a=r[i];return a&&"object"==typeof a&&Object.keys(a).forEach(function(t){void 0!==(n=e(a,t))?a[t]=n:delete a[t]}),t.call(r,i,a)}({"":r},""):r}}},885641,(e,t,r)=>{var i=e.r(811274).stringify,n=e.r(773846);t.exports=function(e){return{parse:n(e),stringify:i}},t.exports.parse=n(),t.exports.stringify=i},798651,(e,t,r)=>{var i=e.i(335292);!function(){"use strict";var r="object"==typeof window?window:{};!r.HI_BASE32_NO_NODE_JS&&"object"==typeof i.default&&i.default.versions&&i.default.versions.node&&(r=e.g);var n=!r.HI_BASE32_NO_COMMON_JS&&t.exports,a="function"==typeof define&&define.amd,s="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),o={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},l=[0,0,0,0,0,0,0,0],u=function(e,t){t.length>10&&(t="..."+t.substr(-10));
2var r=Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+e+" bytes: "+t+" <-");throw r.position=e,r},c=function(e){for(var t,r,i="",n=e.length,a=0,s=0;a<n;){if((t=e[a++])<=127){i+=String.fromCharCode(t);continue}t>191&&t<=223?(r=31&t,s=1):t<=239?(r=15&t,s=2):t<=247?(r=7&t,s=3):u(a,i);for(var o=0;o<s;++o)((t=e[a++])<128||t>191)&&u(a,i),r<<=6,r+=63&t;r>=55296&&r<=57343&&u(a,i),r>1114111&&u(a,i),r<=65535?i+=String.fromCharCode(r):(r-=65536,i+=String.fromCharCode((r>>10)+55296),i+=String.fromCharCode((1023&r)+56320))}return i},d=function(e){if(""===e)return[];if(!/^[A-Z2-7=]+$/.test(e))throw Error("Invalid base32 characters");e=e.replace(/=/g,"");for(var t,r,i,n,a,s,l,u,c=[],d=0,f=e.length,h=0,p=f>>3<<3;h<p;)t=o[e.charAt(h++)],r=o[e.charAt(h++)],i=o[e.charAt(h++)],n=o[e.charAt(h++)],a=o[e.charAt(h++)],s=o[e.charAt(h++)],l=o[e.charAt(h++)],u=o[e.charAt(h++)],c[d++]=(t<<3|r>>>2)&255,c[d++]=(r<<6|i<<1|n>>>4)&255,c[d++]=(n<<4|a>>>1)&255,c[d++]=(a<<7|s<<2|l>>>3)&255,c[d++]=(l<<5|u)&255;var g=f-p;return 2===g?(t=o[e.charAt(h++)],r=o[e.charAt(h++)],c[d++]=(t<<3|r>>>2)&255):4===g?(t=o[e.charAt(h++)],r=o[e.charAt(h++)],i=o[e.charAt(h++)],n=o[e.charAt(h++)],c[d++]=(t<<3|r>>>2)&255,c[d++]=(r<<6|i<<1|n>>>4)&255):5===g?(t=o[e.charAt(h++)],r=o[e.charAt(h++)],i=o[e.charAt(h++)],n=o[e.charAt(h++)],a=o[e.charAt(h++)],c[d++]=(t<<3|r>>>2)&255,c[d++]=(r<<6|i<<1|n>>>4)&255,c[d++]=(n<<4|a>>>1)&255):7===g&&(t=o[e.charAt(h++)],r=o[e.charAt(h++)],i=o[e.charAt(h++)],n=o[e.charAt(h++)],a=o[e.charAt(h++)],s=o[e.charAt(h++)],l=o[e.charAt(h++)],c[d++]=(t<<3|r>>>2)&255,c[d++]=(r<<6|i<<1|n>>>4)&255,c[d++]=(n<<4|a>>>1)&255,c[d++]=(a<<7|s<<2|l>>>3)&255),c},f=function(e){for(var t,r,i,n,a,o="",l=e.length,u=0,c=5*parseInt(l/5);u<c;)t=e.charCodeAt(u++),r=e.charCodeAt(u++),i=e.charCodeAt(u++),n=e.charCodeAt(u++),a=e.charCodeAt(u++),o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|i>>>4)&31]+s[(i<<1|n>>>7)&31]+s[n>>>2&31]+s[(n<<3|a>>>5)&31]+s[31&a];var d=l-c;return 1===d?o+=s[(t=e.charCodeAt(u))>>>3]+s[t<<2&31]+"======":2===d?(t=e.charCodeAt(u++),r=e.charCodeAt(u),o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[r<<4&31]+"===="):3===d?(t=e.charCodeAt(u++),r=e.charCodeAt(u++),i=e.charCodeAt(u),o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|i>>>4)&31]+s[i<<1&31]+"==="):4===d&&(t=e.charCodeAt(u++),r=e.charCodeAt(u++),i=e.charCodeAt(u++),n=e.charCodeAt(u),o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|i>>>4)&31]+s[(i<<1|n>>>7)&31]+s[n>>>2&31]+s[n<<3&31]+"="),o},h=function(e){var t,r,i,n,a,o,u,c=!1,d="",f=0,h=0,p=e.length;if(""===e)return d;do{for(l[0]=l[5],l[1]=l[6],l[2]=l[7],u=h;f<p&&u<5;++f)(o=e.charCodeAt(f))<128?l[u++]=o:(o<2048?l[u++]=192|o>>6:(o<55296||o>=57344?l[u++]=224|o>>12:(o=65536+((1023&o)<<10|1023&e.charCodeAt(++f)),l[u++]=240|o>>18,l[u++]=128|o>>12&63),l[u++]=128|o>>6&63),l[u++]=128|63&o);h=u-5,f===p&&++f,f>p&&u<6&&(c=!0),t=l[0],u>4?(r=l[1],i=l[2],n=l[3],a=l[4],d+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|i>>>4)&31]+s[(i<<1|n>>>7)&31]+s[n>>>2&31]+s[(n<<3|a>>>5)&31]+s[31&a]):1===u?d+=s[t>>>3]+s[t<<2&31]+"======":2===u?(r=l[1],d+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[r<<4&31]+"===="):3===u?(r=l[1],i=l[2],d+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|i>>>4)&31]+s[i<<1&31]+"==="):(r=l[1],i=l[2],n=l[3],d+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|i>>>4)&31]+s[(i<<1|n>>>7)&31]+s[n>>>2&31]+s[n<<3&31]+"=")}while(!c)return d},p=function(e){for(var t,r,i,n,a,o="",l=e.length,u=0,c=5*parseInt(l/5);u<c;)t=e[u++],r=e[u++],i=e[u++],n=e[u++],a=e[u++],o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|i>>>4)&31]+s[(i<<1|n>>>7)&31]+s[n>>>2&31]+s[(n<<3|a>>>5)&31]+s[31&a];var d=l-c;return 1===d?o+=s[(t=e[u])>>>3]+s[t<<2&31]+"======":2===d?(t=e[u++],r=e[u],o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[r<<4&31]+"===="):3===d?(t=e[u++],r=e[u++],i=e[u],o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|i>>>4)&31]+s[i<<1&31]+"==="):4===d&&(t=e[u++],r=e[u++],i=e[u++],n=e[u],o+=s[t>>>3]+s[(t<<2|r>>>6)&31]+s[r>>>1&31]+s[(r<<4|i>>>4)&31]+s[(i<<1|n>>>7)&31]+s[n>>>2&31]+s[n<<3&31]+"="),o},g=function(e,t){if(!t)return c(d(e));if(""===e)return"";if(!/^[A-Z2-7=]+$/.test(e))throw Error("Invalid base32 characters");var r,i,n,a,s,l,u,f,h="",p=e.indexOf("=");-1===p&&(p=e.length);for(var g=0,m=p>>3<<3;g<m;)r=o[e.charAt(g++)],i=o[e.charAt(g++)],n=o[e.charAt(g++)],a=o[e.charAt(g++)],s=o[e.charAt(g++)],l=o[e.charAt(g++)],u=o[e.charAt(g++)],f=o[e.charAt(g++)],h+=String.fromCharCode((r<<3|i>>>2)&255)+String.fromCharCode((i<<6|n<<1|a>>>4)&255)+String.fromCharCode((a<<4|s>>>1)&255)+String.fromCharCode((s<<7|l<<2|u>>>3)&255)+String.fromCharCode((u<<5|f)&255);var y=p-m;return 2===y?h+=String.fromCharCode(((r=o[e.charAt(g++)])<<3|(i=o[e.charAt(g++)])>>>2)&255):4===y?(r=o[e.charAt(g++)],i=o[e.charAt(g++)],n=o[e.charAt(g++)],a=o[e.charAt(g++)],h+=String.fromCharCode((r<<3|i>>>2)&255)+String.fromCharCode((i<<6|n<<1|a>>>4)&255)):5===y?(r=o[e.charAt(g++)],i=o[e.charAt(g++)],n=o[e.charAt(g++)],a=o[e.charAt(g++)],s=o[e.charAt(g++)],h+=String.fromCharCode((r<<3|i>>>2)&255)+String.fromCharCode((i<<6|n<<1|a>>>4)&255)+String.fromCharCode((a<<4|s>>>1)&255)):7===y&&(r=o[e.charAt(g++)],i=o[e.charAt(g++)],n=o[e.charAt(g++)],a=o[e.charAt(g++)],s=o[e.charAt(g++)],l=o[e.charAt(g++)],u=o[e.charAt(g++)],h+=String.fromCharCode((r<<3|i>>>2)&255)+String.fromCharCode((i<<6|n<<1|a>>>4)&255)+String.fromCharCode((a<<4|s>>>1)&255)+String.fromCharCode((s<<7|l<<2|u>>>3)&255)),h},m={encode:function(e,t){var r="string"!=typeof e;return(r&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),r)?p(e):t?f(e):h(e)},decode:g};if(g.asBytes=d,n)t.exports=m;else r.base32=m,a&&(e.r,void 0!==m&&e.v(m))}()},42570,(e,t,r)=>{var i=e.i(335292);e.e,t.exports=function(){var e=[function(e,t,r){"use strict";r.r(t),r.d(t,"encode",function(){return O}),r.d(t,"decode",function(){return V}),r.d(t,"decodeAsync",function(){return Z}),r.d(t,"decodeArrayStream",function(){return X}),r.d(t,"decodeStream",function(){return J}),r.d(t,"Decoder",function(){return j}),r.d(t,"Encoder",function(){return I}),r.d(t,"ExtensionCodec",function(){return E}),r.d(t,"ExtData",function(){return p}),r.d(t,"EXT_TIMESTAMP",function(){return y}),r.d(t,"encodeDateToTimeSpec",function(){return b}),r.d(t,"encodeTimeSpecToTimestamp",function(){return v}),r.d(t,"decodeTimestampToTimeSpec",function(){return _}),r.d(t,"encodeTimestampExtension",function(){return w}),r.d(t,"decodeTimestampExtension",function(){return A});var n=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,a=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)s.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return s},a=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e},s=void 0!==i.default&&"u">typeof TextEncoder&&"u">typeof TextDecoder;function o(e){for(var t=e.length,r=0,i=0;i<t;){var n=e.charCodeAt(i++);if(0!=(0xffffff80&n))if(0==(0xfffff800&n))r+=2;else{if(n>=55296&&n<=56319&&i<t){var a=e.charCodeAt(i);56320==(64512&a)&&(++i,n=((1023&n)<<10)+(1023&a)+65536)}r+=0==(0xffff0000&n)?3:4}else r++}return r}var l=s?new TextEncoder:void 0,u=200*(void 0!==i.default),c=(null==l?void 0:l.encodeInto)?function(e,t,r){l.encodeInto(e,t.subarray(r))}:function(e,t,r){t.set(l.encode(e),r)};function d(e,t,r){for(var i=t,n=i+r,s=[],o="";i<n;){var l=e[i++];if(0==(128&l))s.push(l);else if(192==(224&l)){var u=63&e[i++];s.push((31&l)<<6|u)}else if(224==(240&l)){u=63&e[i++];var c=63&e[i++];s.push((31&l)<<12|u<<6|c)}else if(240==(248&l)){var d=(7&l)<<18|(u=63&e[i++])<<12|(c=63&e[i++])<<6|63&e[i++];d>65535&&(d-=65536,s.push(d>>>10&1023|55296),d=56320|1023&d),s.push(d)}else s.push(l);s.length>=4096&&(o+=String.fromCharCode.apply(String,a(s)),s.length=0)}return s.length>0&&(o+=String.fromCharCode.apply(String,a(s))),o}var f=s?new TextDecoder:null,h=200*(void 0!==i.default),p=function(e,t){this.type=e,this.data=t};function g(e,t,r){var i=Math.floor(r/0x100000000);e.setUint32(t,i),e.setUint32(t+4,r)}function m(e,t){var r=e.getInt32(t),i=e.getUint32(t+4),n=r<Math.floor(Number.MIN_SAFE_INTEGER/0x100000000)||r===Math.floor(Number.MIN_SAFE_INTEGER/0x100000000)&&0===i,a=r>Math.floor(Number.MAX_SAFE_INTEGER/0x100000000);return n||a?BigInt(r)*BigInt(0x100000000)+BigInt(i):0x100000000*r+i}var y=-1;function v(e){var t,r=e.sec,i=e.nsec;if(r>=0&&i>=0&&r<=0x3ffffffff){if(0===i&&r<=0xffffffff){var n=new Uint8Array(4);return(t=new DataView(n.buffer)).setUint32(0,r),n}var a=r/0x100000000,s=0|r;return(t=new DataView((n=new Uint8Array(8)).buffer)).setUint32(0,i<<2|3&a),t.setUint32(4,s),n}return(t=new DataView((n=new Uint8Array(12)).buffer)).setUint32(0,i),g(t,4,r),n}function b(e){var t=e.getTime(),r=Math.floor(t/1e3),i=1e6*(t-1e3*r),n=Math.floor(i/1e9);return{sec:r+n,nsec:i-1e9*n}}function w(e){return e instanceof Date?v(b(e)):null}function _(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var r=t.getUint32(0);return{sec:0x100000000*(3&r)+t.getUint32(4),nsec:r>>>2};case 12:return{sec:m(t,4),nsec:t.getUint32(0)};default:throw Error("Unrecognized data size for timestamp: "+e.length)}}function A(e){var t=_(e);return new Date(1e3*t.sec+t.nsec/1e6)}var S={type:-1,encode:w,decode:A},E=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(S)}return e.prototype.register=function(e){var t=e.type,r=e.encode,i=e.decode;if(t>=0)this.encoders[t]=r,this.decoders[t]=i;else{var n=1+t;this.builtInEncoders[n]=r,this.builtInDecoders[n]=i}},e.prototype.tryToEncode=function(e,t){for(var r,i,n=0;n<this.builtInEncoders.length;n++)if(null!=(r=this.builtInEncoders[n])&&null!=(i=r(e,t)))return new p(-1-n,i);for(n=0;n<this.encoders.length;n++)if(null!=(r=this.encoders[n])&&null!=(i=r(e,t)))return new p(n,i);return e instanceof p?e:null},e.prototype.decode=function(e,t,r){var i=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return i?i(e,t,r):new p(t,e)},e.defaultCodec=new e,e}();function x(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}var T=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);
2if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},I=function(){function e(e,t,r,i,n,a,s,o){void 0===e&&(e=E.defaultCodec),void 0===t&&(t=void 0),void 0===r&&(r=100),void 0===i&&(i=2048),void 0===n&&(n=!1),void 0===a&&(a=!1),void 0===s&&(s=!1),void 0===o&&(o=!1),this.extensionCodec=e,this.context=t,this.maxDepth=r,this.initialBufferSize=i,this.sortKeys=n,this.forceFloat32=a,this.ignoreUndefined=s,this.forceIntegerToFloat=o,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return e.prototype.getUint8Array=function(){return this.bytes.subarray(0,this.pos)},e.prototype.reinitializeState=function(){this.pos=0},e.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.getUint8Array()},e.prototype.doEncode=function(e,t){if(t>this.maxDepth)throw Error("Too deep objects in depth "+t);null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):"bigint"==typeof e?this.encodebigint(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)},e.prototype.resizeBuffer=function(e){var t=new ArrayBuffer(e),r=new Uint8Array(t),i=new DataView(t);r.set(this.bytes),this.view=i,this.bytes=r},e.prototype.encodeNil=function(){this.writeU8(192)},e.prototype.encodeBoolean=function(e){!1===e?this.writeU8(194):this.writeU8(195)},e.prototype.encodeNumber=function(e){Number.isSafeInteger(e)&&!this.forceIntegerToFloat?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<0x100000000?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-0x80000000?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.encodebigint=function(e){e>=BigInt(0)?e<BigInt(128)?this.writeU8(Number(e)):e<BigInt(256)?(this.writeU8(204),this.writeU8(Number(e))):e<BigInt(65536)?(this.writeU8(205),this.writeU16(Number(e))):e<BigInt(0x100000000)?(this.writeU8(206),this.writeU32(Number(e))):(this.writeU8(207),this.writeBig64(e)):e>=BigInt(-32)?this.writeU8(224|Number(e)+32):e>=BigInt(-128)?(this.writeU8(208),this.writeI8(Number(e))):e>=BigInt(-32768)?(this.writeU8(209),this.writeI16(Number(e))):e>=BigInt(-0x80000000)?(this.writeU8(210),this.writeI32(Number(e))):(this.writeU8(211),this.writeBig64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<0x100000000))throw Error("Too long string: "+e+" bytes in UTF-8");this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){var t=e.length;if(s&&t>u){var r=o(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),c(e,this.bytes,this.pos),this.pos+=r}else r=o(e),this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),function(e,t,r){for(var i=e.length,n=r,a=0;a<i;){var s=e.charCodeAt(a++);if(0!=(0xffffff80&s)){if(0==(0xfffff800&s))t[n++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&a<i){var o=e.charCodeAt(a);56320==(64512&o)&&(++a,s=((1023&s)<<10)+(1023&o)+65536)}0==(0xffff0000&s)?t[n++]=s>>12&15|224:(t[n++]=s>>18&7|240,t[n++]=s>>12&63|128),t[n++]=s>>6&63|128}t[n++]=63&s|128}else t[n++]=s}}(e,this.bytes,this.pos),this.pos+=r},e.prototype.encodeObject=function(e,t){var r=this.extensionCodec.tryToEncode(e,this.context);if(null!=r)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!=typeof e)throw Error("Unrecognized object: "+Object.prototype.toString.apply(e));this.encodeMap(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<0x100000000))throw Error("Too large binary: "+t);this.writeU8(198),this.writeU32(t)}var r=x(e);this.writeU8a(r)},e.prototype.encodeArray=function(e,t){var r,i,n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<0x100000000))throw Error("Too large array: "+n);this.writeU8(221),this.writeU32(n)}try{for(var a=T(e),s=a.next();!s.done;s=a.next()){var o=s.value;this.doEncode(o,t+1)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},e.prototype.countWithoutUndefined=function(e,t){var r,i,n=0;try{for(var a=T(t),s=a.next();!s.done;s=a.next())void 0!==e[s.value]&&n++}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n},e.prototype.encodeMap=function(e,t){var r,i,n=Object.keys(e);this.sortKeys&&n.sort();var a=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(a<16)this.writeU8(128+a);
2else if(a<65536)this.writeU8(222),this.writeU16(a);else{if(!(a<0x100000000))throw Error("Too large map object: "+a);this.writeU8(223),this.writeU32(a)}try{for(var s=T(n),o=s.next();!o.done;o=s.next()){var l=o.value,u=e[l];this.ignoreUndefined&&void 0===u||(this.encodeString(l),this.doEncode(u,t+1))}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}},e.prototype.encodeExtension=function(e){var t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else{if(!(t<0x100000000))throw Error("Too large extension object: "+t);this.writeU8(201),this.writeU32(t)}this.writeI8(e.type),this.writeU8a(e.data)},e.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},e.prototype.writeU8a=function(e){var t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t},e.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},e.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},e.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},e.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},e.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},e.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},e.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},e.prototype.writeU64=function(e){var t,r;this.ensureBufferSizeToWrite(8),t=this.view,r=this.pos,t.setUint32(r,e/0x100000000),t.setUint32(r+4,e),this.pos+=8},e.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),g(this.view,this.pos,e),this.pos+=8},e.prototype.writeBig64=function(e){var t,r,i,n;this.ensureBufferSizeToWrite(8),t=this.view,r=this.pos,i=Number(e/BigInt(0x100000000)),n=Number(e%BigInt(0x100000000)),i<0&&0!==n&&(i-=1),t.setUint32(r,i),t.setUint32(r+4,n),this.pos+=8},e}(),k={};function O(e,t){return void 0===t&&(t=k),new I(t.extensionCodec,t.context,t.maxDepth,t.initialBufferSize,t.sortKeys,t.forceFloat32,t.ignoreUndefined,t.forceIntegerToFloat).encode(e)}function C(e){return(e<0?"-":"")+"0x"+Math.abs(e).toString(16).padStart(2,"0")}var N=function(){function e(e,t){void 0===e&&(e=16),void 0===t&&(t=16),this.maxKeyLength=e,this.maxLengthPerKey=t,this.hit=0,this.miss=0,this.caches=[];for(var r=0;r<this.maxKeyLength;r++)this.caches.push([])}return e.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},e.prototype.get=function(e,t,r){var i=this.caches[r-1],n=i.length;t:for(var a=0;a<n;a++){for(var s=i[a],o=s.bytes,l=0;l<r;l++)if(o[l]!==e[t+l])continue t;return s.value}return null},e.prototype.store=function(e,t){var r=this.caches[e.length-1],i={bytes:e,value:t};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=i:r.push(i)},e.prototype.decode=function(e,t,r){var i=this.get(e,t,r);if(null!=i)return this.hit++,i;this.miss++;var n=d(e,t,r),a=Uint8Array.prototype.slice.call(e,t,t+r);return this.store(a,n),n},e}(),P=function(e,t){var r,i,n,a,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){var l=[a,o];if(r)throw TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&l[0]?i.return:l[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,l[1])).done)return n;switch(i=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return s.label++,{value:l[1],done:!1};case 5:s.label++,i=l[1],l=[0];continue;case 7:l=s.ops.pop(),s.trys.pop();continue;default:if(!(n=(n=s.trys).length>0&&n[n.length-1])&&(6===l[0]||2===l[0])){s=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){s.label=l[1];break}if(6===l[0]&&s.label<n[1]){s.label=n[1],n=l;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(l);break}n[2]&&s.ops.pop(),s.trys.pop();continue}l=t.call(e,s)}catch(e){l=[6,e],i=0}finally{r=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},D=function(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=e[r]&&function(t){return new Promise(function(i,n){var a;a=(t=e[r](t)).done,Promise.resolve(t.value).then(function(e){i({value:e,done:a})},n)})}}},R=function(e){return this instanceof R?(this.v=e,this):new R(e)},$=function(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,n=r.apply(e,t||[]),a=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(e){n[e]&&(i[e]=function(t){return new Promise(function(r,i){a.push([e,t,r,i])>1||o(e,t)})})}function o(e,t){var r;try{(r=n[e](t)).value instanceof R?Promise.resolve(r.value.v).then(l,u):c(a[0][2],r)}catch(e){c(a[0][3],e)}}function l(e){o("next",e)}function u(e){o("throw",e)}function c(e,t){e(t),a.shift(),a.length&&o(a[0][0],a[0][1])}},B=new DataView(new ArrayBuffer(0)),L=new Uint8Array(B.buffer),U=function(){try{B.getInt8(0)}catch(e){return e.constructor}throw Error("never reached")}(),F=new U("Insufficient data"),M=new N,j=function(){function e(e,t,r,i,n,a,s,o){void 0===e&&(e=E.defaultCodec),void 0===t&&(t=void 0),void 0===r&&(r=0xffffffff),void 0===i&&(i=0xffffffff),void 0===n&&(n=0xffffffff),void 0===a&&(a=0xffffffff),void 0===s&&(s=0xffffffff),void 0===o&&(o=M),this.extensionCodec=e,this.context=t,this.maxStrLength=r,this.maxBinLength=i,this.maxArrayLength=n,this.maxMapLength=a,this.maxExtLength=s,this.keyDecoder=o,this.totalPos=0,this.pos=0,this.view=B,this.bytes=L,this.headByte=-1,this.stack=[]}return e.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1},e.prototype.setBuffer=function(e){this.bytes=x(e),this.view=function(e){if(e instanceof ArrayBuffer)return new DataView(e);var t=x(e);return new DataView(t.buffer,t.byteOffset,t.byteLength)}(this.bytes),this.pos=0},e.prototype.appendBuffer=function(e){if(-1!==this.headByte||this.hasRemaining()){var t=this.bytes.subarray(this.pos),r=x(e),i=new Uint8Array(t.length+r.length);i.set(t),i.set(r,t.length),this.setBuffer(i)}else this.setBuffer(e)},e.prototype.hasRemaining=function(e){return void 0===e&&(e=1),this.view.byteLength-this.pos>=e},e.prototype.createNoExtraBytesError=function(e){var t=this.view,r=this.pos;return RangeError("Extra "+(t.byteLength-r)+" of "+t.byteLength+" b
2yte(s) found at buffer["+e+"]")},e.prototype.decode=function(e){return this.reinitializeState(),this.setBuffer(e),this.doDecodeSingleSync()},e.prototype.doDecodeSingleSync=function(){var e=this.doDecodeSync();if(this.hasRemaining())throw this.createNoExtraBytesError(this.pos);return e},e.prototype.decodeAsync=function(e){var t,r,i,n,a,s,o,l;return a=this,s=void 0,o=void 0,l=function(){var a,s,o,l,u,c,d;return P(this,function(f){switch(f.label){case 0:a=!1,f.label=1;case 1:f.trys.push([1,6,7,12]),t=D(e),f.label=2;case 2:return[4,t.next()];case 3:if((r=f.sent()).done)return[3,5];if(o=r.value,a)throw this.createNoExtraBytesError(this.totalPos);this.appendBuffer(o);try{s=this.doDecodeSync(),a=!0}catch(e){if(!(e instanceof U))throw e}this.totalPos+=this.pos,f.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return i={error:f.sent()},[3,12];case 7:return f.trys.push([7,,10,11]),r&&!r.done&&(n=t.return)?[4,n.call(t)]:[3,9];case 8:f.sent(),f.label=9;case 9:return[3,11];case 10:if(i)throw i.error;return[7];case 11:return[7];case 12:if(a){if(this.hasRemaining())throw this.createNoExtraBytesError(this.totalPos);return[2,s]}throw u=(l=this).headByte,c=l.pos,d=l.totalPos,RangeError("Insufficient data in parcing "+C(u)+" at "+d+" ("+c+" in the current buffer)")}})},new(o||(o=Promise))(function(e,t){function r(e){try{n(l.next(e))}catch(e){t(e)}}function i(e){try{n(l.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):((n=t.value)instanceof o?n:new o(function(e){e(n)})).then(r,i)}n((l=l.apply(a,s||[])).next())})},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return $(this,arguments,function(){var r,i,n,a,s,o,l,u;return P(this,function(c){switch(c.label){case 0:r=t,i=-1,c.label=1;case 1:c.trys.push([1,13,14,19]),n=D(e),c.label=2;case 2:return[4,R(n.next())];case 3:if((a=c.sent()).done)return[3,12];if(s=a.value,t&&0===i)throw this.createNoExtraBytesError(this.totalPos);this.appendBuffer(s),r&&(i=this.readArraySize(),r=!1,this.complete()),c.label=4;case 4:c.trys.push([4,9,,10]),c.label=5;case 5:return[4,R(this.doDecodeSync())];case 6:return[4,c.sent()];case 7:return c.sent(),0==--i?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((o=c.sent())instanceof U))throw o;return[3,10];case 10:this.totalPos+=this.pos,c.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return l={error:c.sent()},[3,19];case 14:return c.trys.push([14,,17,18]),a&&!a.done&&(u=n.return)?[4,R(u.call(n))]:[3,16];case 15:c.sent(),c.label=16;case 16:return[3,18];case 17:if(l)throw l.error;return[7];case 18:return[7];case 19:return[2]}})})},e.prototype.doDecodeSync=function(){t:for(;;){var e,t=this.readHeadByte(),r=void 0;if(t>=224)r=t-256;else if(t<192)if(t<128)r=t;else if(t<144){if(0!=(n=t-128)){this.pushMapState(n),this.complete();continue}r={}}else if(t<160){if(0!=(n=t-144)){this.pushArrayState(n),this.complete();continue}r=[]}else{var i=t-160;r=this.decodeUtf8String(i,0)}else if(192===t)r=null;else if(194===t)r=!1;else if(195===t)r=!0;else if(202===t)r=this.readF32();else if(203===t)r=this.readF64();else if(204===t)r=this.readU8();else if(205===t)r=this.readU16();else if(206===t)r=this.readU32();else if(207===t)r=this.readU64();else if(208===t)r=this.readI8();else if(209===t)r=this.readI16();else if(210===t)r=this.readI32();else if(211===t)r=this.readI64();else if(217===t)i=this.lookU8(),r=this.decodeUtf8String(i,1);else if(218===t)i=this.lookU16(),r=this.decodeUtf8String(i,2);else if(219===t)i=this.lookU32(),r=this.decodeUtf8String(i,4);else if(220===t){if(0!==(n=this.readU16())){this.pushArrayState(n),this.complete();continue}r=[]}else if(221===t){if(0!==(n=this.readU32())){this.pushArrayState(n),this.complete();continue}r=[]}else if(222===t){if(0!==(n=this.readU16())){this.pushMapState(n),this.complete();continue}r={}}else if(223===t){if(0!==(n=this.readU32())){this.pushMapState(n),this.complete();continue}r={}}else if(196===t){var n=this.lookU8();r=this.decodeBinary(n,1)}else if(197===t)n=this.lookU16(),r=this.decodeBinary(n,2);else if(198===t)n=this.lookU32(),r=this.decodeBinary(n,4);else if(212===t)r=this.decodeExtension(1,0);else if(213===t)r=this.decodeExtension(2,0);else if(214===t)r=this.decodeExtension(4,0);else if(215===t)r=this.decodeExtension(8,0);else if(216===t)r=this.decodeExtension(16,0);else if(199===t)n=this.lookU8(),r=this.decodeExtension(n,1);else if(200===t)n=this.lookU16(),r=this.decodeExtension(n,2);else{if(201!==t)throw Error("Unrecognized type byte: "+C(t));n=this.lookU32(),r=this.decodeExtension(n,4)}this.complete();for(var a=this.stack;a.length>0;){var s=a[a.length-1];
2if(0===s.type){if(s.array[s.position]=r,s.position++,s.position!==s.size)continue t;a.pop(),r=s.array}else{if(1===s.type){if(e=void 0,"string"!=(e=typeof r)&&"number"!==e)throw Error("The type of key must be string or number but "+typeof r);s.key=r,s.type=2;continue t}if(s.map[s.key]=r,s.readCount++,s.readCount!==s.size){s.key=null,s.type=1;continue t}a.pop(),r=s.map}}return r}},e.prototype.readHeadByte=function(){return -1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw Error("Unrecognized array type byte: "+C(e))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw Error("Max length exceeded: map length ("+e+") > maxMapLengthLength ("+this.maxMapLength+")");this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw Error("Max length exceeded: array length ("+e+") > maxArrayLength ("+this.maxArrayLength+")");this.stack.push({type:0,size:e,array:Array(e),position:0})},e.prototype.decodeUtf8String=function(e,t){if(e>this.maxStrLength)throw Error("Max length exceeded: UTF-8 byte length ("+e+") > maxStrLength ("+this.maxStrLength+")");if(this.bytes.byteLength<this.pos+t+e)throw F;var r,i,n,a,o=this.pos+t;return a=this.stateIsMapKey()&&(null==(n=this.keyDecoder)?void 0:n.canBeCached(e))?this.keyDecoder.decode(this.bytes,o,e):s&&e>h?(r=this.bytes,i=r.subarray(o,o+e),f.decode(i)):d(this.bytes,o,e),this.pos+=t+e,a},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw Error("Max length exceeded: bin length ("+e+") > maxBinLength ("+this.maxBinLength+")");if(!this.hasRemaining(e+t))throw F;var r=this.pos+t,i=this.bytes.subarray(r,r+e);return this.pos+=t+e,i},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw Error("Max length exceeded: ext length ("+e+") > maxExtLength ("+this.maxExtLength+")");var r=this.view.getInt8(this.pos+t),i=this.decodeBinary(e,t+1);return this.extensionCodec.decode(i,r,this.context)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e,t,r,i,n=(e=this.view,t=this.pos,r=e.getUint32(t),i=e.getUint32(t+4),r>Math.floor(Number.MAX_SAFE_INTEGER/0x100000000)?BigInt(r)*BigInt(0x100000000)+BigInt(i):0x100000000*r+i);return this.pos+=8,n},e.prototype.readI64=function(){var e=m(this.view,this.pos);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}(),z={};function V(e,t){return void 0===t&&(t=z),new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decode(e)}var H=function(e,t){var r,i,n,a,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){var l=[a,o];if(r)throw TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&l[0]?i.return:l[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,l[1])).done)return n;switch(i=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return s.label++,{value:l[1],done:!1};case 5:s.label++,i=l[1],l=[0];continue;case 7:l=s.ops.pop(),s.trys.pop();continue;default:if(!(n=(n=s.trys).length>0&&n[n.length-1])&&(6===l[0]||2===l[0])){s=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){s.label=l[1];break}if(6===l[0]&&s.label<n[1]){s.label=n[1],n=l;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(l);break}n[2]&&s.ops.pop(),s.trys.pop();continue}l=t.call(e,s)}catch(e){l=[6,e],i=0}finally{r=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},q=function(e){return this instanceof q?(this.v=e,this):new q(e)},W=function(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,n=r.apply(e,t||[]),a=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(e){n[e]&&(i[e]=function(t){return new Promise(function(r,i){a.push([e,t,r,i])>1||o(e,t)})})}function o(e,t){var r;try{(r=n[e](t)).value instanceof q?Promise.resolve(r.value.v).then(l,u):c(a[0][2],r)}catch(e){c(a[0][3],e)}}function l(e){o("next",e)}function u(e){o("throw",e)}function c(e,t){e(t),a.shift(),a.length&&o(a[0][0],a[0][1])}};function K(e){return null!=e[Symbol.asyncIterator]?e:function(e){return W(this,arguments,function(){var t,r,i,n;return H(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,q(t.read())];case 3:return i=(r=a.sent()).done,n=r.value,i?[4,q(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return function(e){if(null==e)throw Error("Assertion Failure: value must not be null nor undefined")}(n),[4,q(n)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}(e)}var G=function(e,t){var r,i,n,a,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){var l=[a,o];if(r)throw TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&l[0]?i.return:l[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,l[1])).done)return n;switch(i=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return s.label++,{value:l[1],done:!1};case 5:s.label++,i=l[1],l=[0];continue;case 7:l=s.ops.pop(),s.trys.pop();continue;default:if(!(n=(n=s.trys).length>0&&n[n.length-1])&&(6===l[0]||2===l[0])){s=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){s.label=l[1];break}if(6===l[0]&&s.label<n[1]){s.label=n[1],n=l;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(l);break}n[2]&&s.ops.pop(),s.trys.pop();continue}l=t.call(e,s)}catch(e){l=[6,e],i=0}finally{r=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}};function Z(e,t){var r,i,n,a;return void 0===t&&(t=z),r=this,i=void 0,n=void 0,a=function(){var r;return G(this,function(i){return r=K(e),[2,new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeAsync(r)]})}
2,new(n||(n=Promise))(function(e,t){function s(e){try{l(a.next(e))}catch(e){t(e)}}function o(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof n?r:new n(function(e){e(r)})).then(s,o)}l((a=a.apply(r,i||[])).next())})}function X(e,t){void 0===t&&(t=z);var r=K(e);return new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeArrayStream(r)}function J(e,t){void 0===t&&(t=z);var r=K(e);return new j(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeStream(r)}}],t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,(function(t){return e[t]}).bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}()},434748,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.c32decode=r.c32normalize=r.c32encode=r.c32=void 0;let i=e.r(781887);r.c32="0123456789ABCDEFGHJKMNPQRSTVWXYZ";let n="0123456789abcdef";function a(e){return e.toUpperCase().replace(/O/g,"0").replace(/L|I/g,"1")}r.c32encode=function(e,t){if(!e.match(/^[0-9a-fA-F]*$/))throw Error("Not a hex-encoded string");e.length%2!=0&&(e=`0${e}`),e=e.toLowerCase();let a=[],s=0;for(let t=e.length-1;t>=0;t--)if(s<4){let i=n.indexOf(e[t])>>s,o=0;0!==t&&(o=n.indexOf(e[t-1]));let l=1+s,u=o%(1<<l)<<5-l,c=r.c32[i+u];s=l,a.unshift(c)}else s=0;let o=0;for(let e=0;e<a.length;e++)if("0"!==a[e])break;else o++;a=a.slice(o);let l=new TextDecoder().decode((0,i.hexToBytes)(e)).match(/^\u0000*/),u=l?l[0].length:0;for(let e=0;e<u;e++)a.unshift(r.c32[0]);if(t){let e=t-a.length;for(let t=0;t<e;t++)a.unshift(r.c32[0])}return a.join("")},r.c32normalize=a,r.c32decode=function(e,t){if(!(e=a(e)).match(`^[${r.c32}]*$`))throw Error("Not a c32-encoded string");let i=e.match(`^${r.c32[0]}*`),s=i?i[0].length:0,o=[],l=0,u=0;for(let t=e.length-1;t>=0;t--){4===u&&(o.unshift(n[l]),u=0,l=0);let i=(r.c32.indexOf(e[t])<<u)+l,a=n[i%16];if(u+=1,(l=i>>4)>1<<u)throw Error("Panic error in decoding.");o.unshift(a)}o.unshift(n[l]),o.length%2==1&&o.unshift("0");let c=0;for(let e=0;e<o.length;e++)if("0"!==o[e])break;else c++;let d=(o=o.slice(c-c%2)).join("");for(let e=0;e<s;e++)d=`00${d}`;if(t){let e=2*t-d.length;for(let t=0;t<e;t+=2)d=`00${d}`}return d}},97595,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.sha224=r.SHA224=r.sha256=r.SHA256=void 0;let i=e.r(775631);r.SHA256=i.SHA256,r.sha256=i.sha256,r.SHA224=i.SHA224,r.sha224=i.sha224},997925,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.c32checkDecode=r.c32checkEncode=void 0;let i=e.r(97595),n=e.r(781887),a=e.r(434748);function s(e){let t=(0,i.sha256)((0,i.sha256)((0,n.hexToBytes)(e)));return(0,n.bytesToHex)(t.slice(0,4))}r.c32checkEncode=function(e,t){if(e<0||e>=32)throw Error("Invalid version (must be between 0 and 31)");if(!t.match(/^[0-9a-fA-F]*$/))throw Error("Invalid data (not a hex string)");(t=t.toLowerCase()).length%2!=0&&(t=`0${t}`);let r=e.toString(16);1===r.length&&(r=`0${r}`);let i=s(`${r}${t}`),n=(0,a.c32encode)(`${t}${i}`);return`${a.c32[e]}${n}`},r.c32checkDecode=function(e){e=(0,a.c32normalize)(e);let t=(0,a.c32decode)(e.slice(1)),r=e[0],i=a.c32.indexOf(r),n=t.slice(-8),o=i.toString(16);if(1===o.length&&(o=`0${o}`),s(`${o}${t.substring(0,t.length-8)}
2`)!==n)throw Error("Invalid c32check string: checksum mismatch");return[i,t.substring(0,t.length-8)]}},231839,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.decode=r.encode=void 0;let i=e.r(97595),n=e.r(781887),a=e.r(894361),s="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";r.encode=function(e,t="00"){let r="string"==typeof e?(0,n.hexToBytes)(e):e,o="string"==typeof t?(0,n.hexToBytes)(t):e;if(!(r instanceof Uint8Array)||!(o instanceof Uint8Array))throw TypeError("Argument must be of type Uint8Array or string");let l=(0,i.sha256)((0,i.sha256)(new Uint8Array([...o,...r])));return a(s).encode([...o,...r,...l.slice(0,4)])},r.decode=function(e){let t=a(s).decode(e),r=t.slice(0,1),n=t.slice(1,-4),o=(0,i.sha256)((0,i.sha256)(new Uint8Array([...r,...n])));return t.slice(-4).forEach((e,t)=>{if(e!==o[t])throw Error("Invalid checksum")}),{prefix:r,data:n}}},27555,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.c32ToB58=r.b58ToC32=r.c32addressDecode=r.c32address=r.versions=void 0;let i=e.r(997925),n=e.r(231839),a=e.r(781887);r.versions={mainnet:{p2pkh:22,p2sh:20},testnet:{p2pkh:26,p2sh:21}};let s={};s[0]=r.versions.mainnet.p2pkh,s[5]=r.versions.mainnet.p2sh,s[111]=r.versions.testnet.p2pkh,s[196]=r.versions.testnet.p2sh;let o={};function l(e,t){if(!t.match(/^[0-9a-fA-F]{40}$/))throw Error("Invalid argument: not a hash160 hex string");let r=(0,i.c32checkEncode)(e,t);return`S${r}`}function u(e){if(e.length<=5)throw Error("Invalid c32 address: invalid length");if("S"!=e[0])throw Error('Invalid c32 address: must start with "S"');return(0,i.c32checkDecode)(e.slice(1))}o[r.versions.mainnet.p2pkh]=0,o[r.versions.mainnet.p2sh]=5,o[r.versions.testnet.p2pkh]=111,o[r.versions.testnet.p2sh]=196,r.c32address=l,r.c32addressDecode=u,r.b58ToC32=function(e,t=-1){let r,i=n.decode(e),o=(0,a.bytesToHex)(i.data),u=parseInt((0,a.bytesToHex)(i.prefix),16);return t<0?(r=u,void 0!==s[u]&&(r=s[u])):r=t,l(r,o)},r.c32ToB58=function(e,t=-1){let r,i=u(e),a=i[0],s=i[1];t<0?(r=a,void 0!==o[a]&&(r=o[a])):r=t;let l=r.toString(16);return 1===l.length&&(l=`0${l}`),n.encode(s,l)}},949574,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.b58ToC32=r.c32ToB58=r.versions=r.c32normalize=r.c32addressDecode=r.c32address=r.c32checkDecode=r.c32checkEncode=r.c32decode=r.c32encode=void 0;let i=e.r(434748);Object.defineProperty(r,"c32encode",{enumerable:!0,get:function(){return i.c32encode}}),Object.defineProperty(r,"c32decode",{enumerable:!0,get:function(){return i.c32decode}}),Object.defineProperty(r,"c32normalize",{enumerable:!0,get:function(){return i.c32normalize}});let n=e.r(997925);Object.defineProperty(r,"c32checkEncode",{enumerable:!0,get:function(){return n.c32checkEncode}}),Object.defineProperty(r,"c32checkDecode",{enumerable:!0,get:function(){return n.c32checkDecode}});let a=e.r(27555);Object.defineProperty(r,"c32address",{enumerable:!0,get:function(){return a.c32address}}),Object.defineProperty(r,"c32addressDecode",{enumerable:!0,get:function(){return a.c32addressDecode}}),Object.defineProperty(r,"c32ToB58",{enumerable:!0,get:function(){return a.c32ToB58}}),Object.defineProperty(r,"b58ToC32",{enumerable:!0,get:function(){return a.b58ToC32}}),Object.defineProperty(r,"versions",{enumerable:!0,get:function(){return a.versions}})},894230,(e,t,r)=>{var i,n="__lodash_hash_undefined__",a="[object Arguments]",s="[object Boolean]",o="[object Date]",l="[object Function]",u="[object GeneratorFunction]",c="[object Map]",d="[object Number]",f="[object Object]",h="[object Promise]",p="[object RegExp]",g="[object Set]",m="[object String]",y="[object Symbol]",v="[object WeakMap]",b="[object ArrayBuffer]",w="[object DataView]",_="[object Float32Array]",A="[object Float64Array]",S="[object Int8Array]",E="[object Int16Array]",x="[object Int32Array]",T="[object Uint8Array]",I="[object Uint8ClampedArray]",k="[object Uint16Array]",O="[object Uint32Array]",C=/\w*$/,N=/^\[object .+?Constructor\]$/,P=/^(?:0|[1-9]\d*)$/,D={};D[a]=D["[object Array]"]=D[b]=D[w]=D[s]=D[o]=D[_]=D[A]=D[S]=D[E]=D[x]=D[c]=D[d]=D[f]=D[p]=D[g]=D[m]=D[y]=D[T]=D[I]=D[k]=D[O]=!0,D["[object Error]"]=D[l]=D[v]=!1;var R=e.g&&e.g.Object===Object&&e.g,$="object"==typeof self&&self&&self.Object===Object&&self,B=R||$||Function("return this")(),L=r&&!r.nodeType&&r,U=L&&t&&!t.nodeType&&t,F=U&&U.exports===L;function M(e,t){return e.set(t[0],t[1]),e}function j(e,t){return e.add(t),e}
vendor: 4,091 bytes, line 2
2function z(e,t,r,i){var n=-1,a=e?e.length:0;for(i&&a&&(r=e[++n]);++n<a;)r=t(r,e[n],n,e);return r}function V(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function H(e){var t=-1,r=Array(e.size);return e.forEach(function(e,i){r[++t]=[i,e]}),r}function q(e,t){return function(r){return e(t(r))}}function W(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var K=Array.prototype,G=Function.prototype,Z=Object.prototype,X=B["__core-js_shared__"],J=(i=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"",Y=G.toString,Q=Z.hasOwnProperty,ee=Z.toString,et=RegExp("^"+Y.call(Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),er=F?B.Buffer:void 0,ei=B.Symbol,en=B.Uint8Array,ea=q(Object.getPrototypeOf,Object),es=Object.create,eo=Z.propertyIsEnumerable,el=K.splice,eu=Object.getOwnPropertySymbols,ec=er?er.isBuffer:void 0,ed=q(Object.keys,Object),ef=eR(B,"DataView"),eh=eR(B,"Map"),ep=eR(B,"Promise"),eg=eR(B,"Set"),em=eR(B,"WeakMap"),ey=eR(Object,"create"),ev=eU(ef),eb=eU(eh),ew=eU(ep),e_=eU(eg),eA=eU(em),eS=ei?ei.prototype:void 0,eE=eS?eS.valueOf:void 0;function ex(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function eT(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function eI(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function ek(e){this.__data__=new eT(e)}function eO(e,t,r){var i=e[t];Q.call(e,t)&&eF(i,r)&&(void 0!==r||t in e)||(e[t]=r)}function eC(e,t){for(var r=e.length;r--;)if(eF(e[r][0],t))return r;return -1}function eN(e){var t=new e.constructor(e.byteLength);return new en(t).set(new en(e)),t}function eP(e,t,r,i){r||(r={});for(var n=-1,a=t.length;++n<a;){var s=t[n],o=i?i(r[s],e[s],s,r,e):void 0;eO(r,s,void 0===o?e[s]:o)}return r}function eD(e,t){var r,i,n=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?n["string"==typeof t?"string":"hash"]:n.map}function eR(e,t){var r,i=null==e?void 0:e[t];return!(!eH(i)||(r=i,J&&J in r))&&(eV(i)||V(i)?et:N).test(eU(i))?i:void 0}ex.prototype.clear=function(){this.__data__=ey?ey(null):{}},ex.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},ex.prototype.get=function(e){var t=this.__data__;if(ey){var r=t[e];return r===n?void 0:r}return Q.call(t,e)?t[e]:void 0},ex.prototype.has=function(e){var t=this.__data__;return ey?void 0!==t[e]:Q.call(t,e)},ex.prototype.set=function(e,t){return this.__data__[e]=ey&&void 0===t?n:t,this},eT.prototype.clear=function(){this.__data__=[]},eT.prototype.delete=function(e){var t=this.__data__,r=eC(t,e);return!(r<0)&&(r==t.length-1?t.pop():el.call(t,r,1),!0)},eT.prototype.get=function(e){var t=this.__data__,r=eC(t,e);return r<0?void 0:t[r][1]},eT.prototype.has=function(e){return eC(this.__data__,e)>-1},eT.prototype.set=function(e,t){var r=this.__data__,i=eC(r,e);return i<0?r.push([e,t]):r[i][1]=t,this},eI.prototype.clear=function(){this.__data__={hash:new ex,map:new(eh||eT),string:new ex}},eI.prototype.delete=function(e){return eD(this,e).delete(e)},eI.prototype.get=function(e){return eD(this,e).get(e)},eI.prototype.has=function(e){return eD(this,e).has(e)},eI.prototype.set=function(e,t){return eD(this,e).set(e,t),this},ek.prototype.clear=function(){this.__data__=new eT},ek.prototype.delete=function(e){return this.__data__.delete(e)},ek.prototype.get=function(e){return this.__data__.get(e)},ek.prototype.has=function(e){return this.__data__.has(e)},ek.prototype.set=function(e,t){var r=this.__data__;if(r instanceof eT){var i=r.__data__;if(!eh||i.length<199)return i.push([e,t]),this;r=this.__data__=new eI(i)}return r.set(e,t),this};var e$=eu?q(eu,Object):function(){return[]},eB=function(e){return ee.call(e)};function eL(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Z)}function eU(e){if(null!=e){try{return Y.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function eF(e,t){return e===t||e!=e&&t!=t}
2(ef&&eB(new ef(new ArrayBuffer(1)))!=w||eh&&eB(new eh)!=c||ep&&eB(ep.resolve())!=h||eg&&eB(new eg)!=g||em&&eB(new em)!=v)&&(eB=function(e){var t=ee.call(e),r=t==f?e.constructor:void 0,i=r?eU(r):void 0;if(i)switch(i){case ev:return w;case eb:return c;case ew:return h;case e_:return g;case eA:return v}return t});var eM=Array.isArray;function ej(e){var t;return null!=e&&"number"==typeof(t=e.length)&&t>-1&&t%1==0&&t<=0x1fffffffffffff&&!eV(e)}var ez=ec||function(){return!1};function eV(e){var t=eH(e)?ee.call(e):"";return t==l||t==u}function eH(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eq(e){return ej(e)?function(e){var t,r,i,n,s,o=eM(e)||(i=r=t=e)&&"object"==typeof i&&ej(r)&&Q.call(t,"callee")&&(!eo.call(t,"callee")||ee.call(t)==a)?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],l=o.length,u=!!l;for(var c in e){Q.call(e,c)&&!(u&&("length"==c||(n=c,(s=null==(s=l)?0x1fffffffffffff:s)&&("number"==typeof n||P.test(n))&&n>-1&&n%1==0&&n<s)))&&o.push(c)}return o}(e):function(e){if(!eL(e))return ed(e);var t=[];for(var r in Object(e))Q.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}t.exports=function(e){return function e(t,r,i,n,h,v,N){if(n&&(P=v?n(t,h,v,N):n(t)),void 0!==P)return P;if(!eH(t))return t;var P,R=eM(t);if(R){if(B=($=t).length,L=$.constructor(B),B&&"string"==typeof $[0]&&Q.call($,"index")&&(L.index=$.index,L.input=$.input),P=L,!r){var $,B,L,U=t,F=P,q=-1,K=U.length;for(F||(F=Array(K));++q<K;)F[q]=U[q];return F}}else{var G,Z,X,J,Y,ee=eB(t),et=ee==l||ee==u;if(ez(t)){var er=t,ei=r;if(ei)return er.slice();var en=new er.constructor(er.length);return er.copy(en),en}if(ee==f||ee==a||et&&!v){if(V(t))return v?t:{};if(P="function"!=typeof(G=et?{}:t).constructor||eL(G)?{}:eH(Z=ea(G))?es(Z):{},!r){return X=t,J=(Y=P)&&eP(t,eq(t),Y),eP(X,e$(X),J)}}else{if(!D[ee])return v?t:{};P=function(e,t,r,i){var n,a,l,u=e.constructor;switch(t){case b:return eN(e);case s:case o:return new u(+e);case w:return n=i?eN(e.buffer):e.buffer,new e.constructor(n,e.byteOffset,e.byteLength);case _:case A:case S:case E:case x:case T:case I:case k:case O:return a=i?eN(e.buffer):e.buffer,new e.constructor(a,e.byteOffset,e.length);case c:return z(i?r(H(e),!0):H(e),M,new e.constructor);case d:case m:return new u(e);case p:return(l=new e.constructor(e.source,C.exec(e))).lastIndex=e.lastIndex,l;case g:return z(i?r(W(e),!0):W(e),j,new e.constructor);case y:return eE?Object(eE.call(e)):{}}}(t,ee,e,r)}}N||(N=new ek);var eo=N.get(t);if(eo)return eo;if(N.set(t,P),!R)var el=i?function(e){var t;return t=eq(e),eM(e)?t:function(e,t){for(var r=-1,i=t.length,n=e.length;++r<i;)e[n+r]=t[r];return e}(t,e$(e))}(t):eq(t);return!function(e,t){for(var r=-1,i=e?e.length:0;++r<i&&!1!==t(e[r],r,e););}(el||t,function(a,s){el&&(a=t[s=a]),eO(P,s,e(a,r,i,n,s,t,N))}),P}(e,!0,!0)}},227730,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.XRPLFaucetError=r.NotFoundError=r.ValidationError=r.ResponseFormatError=r.TimeoutError=r.RippledNotInitializedError=r.DisconnectedError=r.NotConnectedError=r.RippledError=r.ConnectionError=r.UnexpectedError=r.XrplError=void 0;class i extends Error{constructor(e="",t){super(e),this.name=this.constructor.name,this.message=e,this.data=t,null!=Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(){let e=`[${this.name}(${this.message}`;return this.data&&(e+=`, ${JSON.stringify(this.data)}`),e+=")]"}inspect(){return this.toString()}}r.XrplError=i,r.RippledError=class extends i{},r.UnexpectedError=class extends i{};class n extends i{}r.ConnectionError=n,r.NotConnectedError=class extends n{},r.DisconnectedError=class extends n{},r.RippledNotInitializedError=class extends n{},r.TimeoutError=class extends n{},r.ResponseFormatError=class extends n{},r.ValidationError=class extends i{},r.XRPLFaucetError=class extends i{},r.NotFoundError=class extends i{constructor(e="Not found"){super(e)}}},654501,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_API_VERSION=r.RIPPLED_API_V2=r.RIPPLED_API_V1=void 0,r.RIPPLED_API_V1=1,r.RIPPLED_API_V2=2,r.DEFAULT_API_VERSION=r.RIPPLED_API_V2},832575,(e,t,r)=>{"use strict";var i,n;
2Object.defineProperty(r,"__esModule",{value:!0}),r.AccountRootFlags=void 0,(n=i||(r.AccountRootFlags=i={}))[n.lsfPasswordSpent=65536]="lsfPasswordSpent",n[n.lsfRequireDestTag=131072]="lsfRequireDestTag",n[n.lsfRequireAuth=262144]="lsfRequireAuth",n[n.lsfDisallowXRP=524288]="lsfDisallowXRP",n[n.lsfDisableMaster=1048576]="lsfDisableMaster",n[n.lsfNoFreeze=2097152]="lsfNoFreeze",n[n.lsfGlobalFreeze=4194304]="lsfGlobalFreeze",n[n.lsfDefaultRipple=8388608]="lsfDefaultRipple",n[n.lsfDepositAuth=0x1000000]="lsfDepositAuth",n[n.lsfAMM=0x2000000]="lsfAMM",n[n.lsfDisallowIncomingNFTokenOffer=0x4000000]="lsfDisallowIncomingNFTokenOffer",n[n.lsfDisallowIncomingCheck=0x8000000]="lsfDisallowIncomingCheck",n[n.lsfDisallowIncomingPayChan=0x10000000]="lsfDisallowIncomingPayChan",n[n.lsfDisallowIncomingTrustline=0x20000000]="lsfDisallowIncomingTrustline",n[n.lsfAllowTrustLineClawback=0x80000000]="lsfAllowTrustLineClawback",n[n.lsfAllowTrustLineLocking=0x40000000]="lsfAllowTrustLineLocking"},381037,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.concatArgs=r.arrayEqual=void 0,r.arrayEqual=function(e,t){return e.length===t.length&&e.every((e,r)=>e===t[r])},r.concatArgs=function(...e){return e.flatMap(e=>"number"==typeof e?[e]:Array.from(e))}},790526,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isValidClassicAddress=r.decodeAccountPublic=r.encodeAccountPublic=r.encodeNodePublic=r.decodeNodePublic=r.decodeAddress=r.decodeAccountID=r.encodeAddress=r.encodeAccountID=r.decodeSeed=r.encodeSeed=r.codec=void 0;let i=e.r(701902),n=e.r(555263),a=e.r(381037),s=[1,225,75],o={sha256:n.sha256},l=new class{constructor(e){this._sha256=e.sha256,this._codec=i.base58xrp}encode(e,t){let r=t.versions;return this._encodeVersioned(e,r,t.expectedLength)}decode(e,t){var r;let i=t.versions,n=t.versionTypes,s=this.decodeChecked(e);if(i.length>1&&!t.expectedLength)throw Error("expectedLength is required because there are >= 2 possible versions");let o="number"==typeof i[0]?1:i[0].length,l=null!=(r=t.expectedLength)?r:s.length-o,u=s.slice(0,-l),c=s.slice(-l);for(let e=0;e<i.length;e++){let t=Array.isArray(i[e])?i[e]:[i[e]];if((0,a.arrayEqual)(u,t))return{version:t,bytes:c,type:n?n[e]:null}}throw Error("version_invalid: version bytes do not match any of the provided version(s)")}encodeChecked(e){let t=this._sha256(this._sha256(e)).slice(0,4);return this._encodeRaw(Uint8Array.from((0,a.concatArgs)(e,t)))}decodeChecked(e){let t=this._decodeRaw(e);if(t.byteLength<5)throw Error("invalid_input_size: decoded data must have length >= 5");if(!this._verifyCheckSum(t))throw Error("checksum_invalid");return t.slice(0,-4)}_encodeVersioned(e,t,r){if(!d(e,r))throw Error("unexpected_payload_length: bytes.length does not match expectedLength. Ensure that the bytes are a Uint8Array.");return this.encodeChecked((0,a.concatArgs)(t,e))}_encodeRaw(e){return this._codec.encode(Uint8Array.from(e))}_decodeRaw(e){return this._codec.decode(e)}_verifyCheckSum(e){let t=this._sha256(this._sha256(e.slice(0,-4))).slice(0,4),r=e.slice(-4);return(0,a.arrayEqual)(t,r)}}(o);function u(e){return l.encode(e,{versions:[0],expectedLength:20})}function c(e){return l.decode(e,{versions:[0],expectedLength:20}).bytes}function d(e,t){return"byteLength"in e?e.byteLength===t:e.length===t}r.codec=l,r.encodeSeed=function(e,t){if(!d(e,16))throw Error("entropy must have length 16");return l.encode(e,{expectedLength:16,versions:"ed25519"===t?s:[33]})},r.decodeSeed=function(e,t={versionTypes:["ed25519","secp256k1"],versions:[s,33],expectedLength:16}){return l.decode(e,t)},r.encodeAccountID=u,r.encodeAddress=u,r.decodeAccountID=c,r.decodeAddress=c,r.decodeNodePublic=function(e){return l.decode(e,{versions:[28],expectedLength:33}).bytes},r.encodeNodePublic=function(e){return l.encode(e,{versions:[28],expectedLength:33})},r.encodeAccountPublic=function(e){return l.encode(e,{versions:[35],expectedLength:33})},r.decodeAccountPublic=function(e){return l.decode(e,{versions:[35],expectedLength:33}).bytes},r.isValidClassicAddress=function(e){try{c(e)}catch(e){return!1}return!0}},550294,(e,t,r)=>{"use strict";
2Object.defineProperty(r,"__esModule",{value:!0}),r.isValidXAddress=r.decodeXAddress=r.xAddressToClassicAddress=r.encodeXAddress=r.classicAddressToXAddress=r.isValidClassicAddress=r.decodeAccountPublic=r.encodeAccountPublic=r.decodeNodePublic=r.encodeNodePublic=r.decodeAccountID=r.encodeAccountID=r.decodeSeed=r.encodeSeed=r.codec=void 0;let i=e.r(575280),n=e.r(790526);Object.defineProperty(r,"codec",{enumerable:!0,get:function(){return n.codec}}),Object.defineProperty(r,"encodeSeed",{enumerable:!0,get:function(){return n.encodeSeed}}),Object.defineProperty(r,"decodeSeed",{enumerable:!0,get:function(){return n.decodeSeed}}),Object.defineProperty(r,"encodeAccountID",{enumerable:!0,get:function(){return n.encodeAccountID}}),Object.defineProperty(r,"decodeAccountID",{enumerable:!0,get:function(){return n.decodeAccountID}}),Object.defineProperty(r,"encodeNodePublic",{enumerable:!0,get:function(){return n.encodeNodePublic}}),Object.defineProperty(r,"decodeNodePublic",{enumerable:!0,get:function(){return n.decodeNodePublic}}),Object.defineProperty(r,"encodeAccountPublic",{enumerable:!0,get:function(){return n.encodeAccountPublic}}),Object.defineProperty(r,"decodeAccountPublic",{enumerable:!0,get:function(){return n.decodeAccountPublic}}),Object.defineProperty(r,"isValidClassicAddress",{enumerable:!0,get:function(){return n.isValidClassicAddress}});let a={main:Uint8Array.from([5,68]),test:Uint8Array.from([4,147])};function s(e,t,r){if(20!==e.length)throw Error("Account ID must be 20 bytes");if(!1!==t&&t>0xffffffff)throw Error("Invalid tag");let s=t||0,o=(0,i.concat)([r?a.test:a.main,e,Uint8Array.from([+(!1!==t&&null!=t),255&s,s>>8&255,s>>16&255,s>>24&255,0,0,0,0])]);return n.codec.encodeChecked(o)}function o(e){let t=n.codec.decodeChecked(e),r=function(e){let t=e.slice(0,2);if((0,i.equal)(a.main,t))return!1;if((0,i.equal)(a.test,t))return!0;throw Error("Invalid X-address: bad prefix")}(t);return{accountId:t.slice(2,22),tag:function(e){let t=e[22];if(t>=2)throw Error("Unsupported X-address");if(1===t)return e[23]+256*e[24]+65536*e[25]+0x1000000*e[26];if(0!==t)throw Error("flag must be zero to indicate no tag");if(!(0,i.equal)((0,i.hexToBytes)("0000000000000000"),e.slice(23,31)))throw Error("remaining bytes must be zero");return!1}(t),test:r}}r.classicAddressToXAddress=function(e,t,r){return s((0,n.decodeAccountID)(e),t,r)},r.encodeXAddress=s,r.xAddressToClassicAddress=function(e){let{accountId:t,tag:r,test:i}=o(e);return{classicAddress:(0,n.encodeAccountID)(t),tag:r,test:i}},r.decodeXAddress=o,r.isValidXAddress=function(e){try{o(e)}catch(e){return!1}return!0}},342129,(e,t,r)=>{t.exports=JSON.parse('{"ACCOUNT_SET_FLAGS":{"asfAccountTxnID":5,"asfAllowTrustLineClawback":16,"asfAllowTrustLineLocking":17,"asfAuthorizedNFTokenMinter":10,"asfDefaultRipple":8,"asfDepositAuth":9,"asfDisableMaster":4,"asfDisallowIncomingCheck":13,"asfDisallowIncomingNFTokenOffer":12,"asfDisallowIncomingPayChan":14,"asfDisallowIncomingTrustline":15,"asfDisallowXRP":3,"asfGlobalFreeze":7,"asfNoFreeze":6,"asfRequireAuth":2,"asfRequireDest":1},"FIELDS":[["Invalid",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":-1,"type":"Unknown"}],["ObjectEndMarker",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"STObject"}],["ArrayEndMarker",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"STArray"}],["taker_gets_funded",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":258,"type":"Amount"}],["taker_pays_funded",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":259,"type":"Amount"}],["Generic",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":0,"type":"Unknown"}],["LedgerEntryType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt16"}],["TransactionType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt16"}],["SignerWeight",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt16"}],["TransferFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt16"}],["TradingFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt16"}],["DiscountedFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt16"}],["Version",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt16"}],["HookStateChangeCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt16"}],["HookEmitCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt16"}],["HookExecutionIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt16"}],["HookApiVersion",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt16"}],["LedgerFixType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt16"}],["ManagementFeeRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt16"}],["NetworkID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt32"}],["Flags",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt32"}],["SourceTag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt32"}],["Sequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt32"}],["PreviousTxnLgrSeq",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt32"}],["LedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt32"}],["CloseTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"UInt32"}],["ParentCloseTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"UInt32"}],["SigningTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"UInt32"}],["Expiration",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"UInt32"}],["TransferRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"UInt32"}],["WalletSize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"UInt32"}],["OwnerCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"UInt32"}],["DestinationTag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"UInt32"}],["LastUpdateTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"UInt32"}],["HighQualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt32"}],["HighQualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt32"}],["LowQualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt32"}],["LowQualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt32"}],["QualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt32"}],["QualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt32"}],["StampEscrow",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt32"}],["BondAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"UInt32"}],["LoadFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"UInt32"}],["OfferSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"UInt32"}],["FirstLedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"UInt32"}],["LastLedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"UInt32"}],["TransactionIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"UInt32"}],["OperationLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"UInt32"}],["ReferenceFeeUnits",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"UInt32"}],["ReserveBase",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"UInt32"}],["ReserveIncrement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"UInt32"}],["SetFlag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"UInt32"}],["ClearFlag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"UInt32"}],["SignerQuorum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"UInt32"}],["CancelAfter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"UInt32"}],["FinishAfter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":37,"type":"UInt32"}],["SignerListID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":38,"type":"UInt32"}],["SettleDelay",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":39,"type":"UInt32"}],["TicketCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":40,"type":"UInt32"}],["TicketSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":41,"type":"UInt32"}],["NFTokenTaxon",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":42,"type":"UInt32"}],["MintedNFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":43,"type":"UInt32"}],["BurnedNFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":44,"type":"UInt32"}],["HookStateCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":45,"type":"UInt32"}],["EmitGeneration",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":46,"type":"UInt32"}],["VoteWeight",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":48,"type":"UInt32"}],["FirstNFTokenSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":50,"type":"UInt32"}],["OracleDocumentID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":51,"type":"UInt32"}],["PermissionValue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":52,"type":"UInt32"}],["MutableFlags",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":53,"type":"UInt32"}],["StartDate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":54,"type":"UInt32"}],["PaymentInterval",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":55,"type":"UInt32"}],["GracePeriod",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":56,"type":"UInt32"}],["PreviousPaymentDueDate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":57,"type":"UInt32"}],["NextPaymentDueDate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":58,"type":"UInt32"}],["PaymentRemaining",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":59,"type":"UInt32"}],["PaymentTotal",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":60,"type":"UInt32"}],["LoanSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":61,"type":"UInt32"}],["CoverRateMinimum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":62,"type":"UInt32"}],["CoverRateLiquidation",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":63,"type":"UInt32"}],["OverpaymentFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":64,"type":"UInt32"}],["InterestRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":65,"type":"UInt32"}],["LateInterestRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":66,"type":"UInt32"}],["CloseInterestRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":67,"type":"UInt32"}],["OverpaymentInterestRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":68,"type":"UInt32"}],["IndexNext",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt64"}],["IndexPrevious",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt64"}],["BookNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt64"}],["OwnerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt64"}],["BaseFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt64"}],["ExchangeRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt64"}],["LowNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"UInt64"}],["HighNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"UInt64"}],["DestinationNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"UInt64"}],["Cookie",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"UInt64"}],["ServerVersion",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"UInt64"}],["NFTokenOfferNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"UInt64"}],["EmitBurden",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"UInt64"}],["HookOn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt64"}],["HookInstructionCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt64"}],["HookReturnCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt64"}],["ReferenceCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt64"}],["XChainClaimID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt64"}],["XChainAccountCreateCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt64"}],["XChainAccountClaimCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt64"}],["AssetPrice",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"UInt64"}],["MaximumAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"UInt64"}],["OutstandingAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"UInt64"}],["MPTAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"UInt64"}],["IssuerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"UInt64"}],["SubjectNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"UInt64"}],["LockedAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"UInt64"}],["VaultNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"UInt64"}],["LoanBrokerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"UInt64"}],["EmailHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash128"}],["LedgerHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash256"}],["ParentHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash256"}],["TransactionHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Hash256"}],["AccountHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Hash256"}],["PreviousTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Hash256"}],["LedgerIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Hash256"}],["WalletLocator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Hash256"}],["RootIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Hash256"}],["AccountTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Hash256"}],["NFTokenID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type"
2:"Hash256"}],["EmitParentTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Hash256"}],["EmitNonce",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Hash256"}],["EmitHookHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Hash256"}],["AMMID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"Hash256"}],["BookDirectory",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Hash256"}],["InvoiceID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Hash256"}],["Nickname",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"Hash256"}],["Amendment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"Hash256"}],["Digest",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"Hash256"}],["Channel",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"Hash256"}],["ConsensusHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"Hash256"}],["CheckID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"Hash256"}],["ValidatedHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"Hash256"}],["PreviousPageMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"Hash256"}],["NextPageMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"Hash256"}],["NFTokenBuyOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"Hash256"}],["NFTokenSellOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"Hash256"}],["HookStateKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"Hash256"}],["HookHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"Hash256"}],["HookNamespace",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"Hash256"}],["HookSetTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"Hash256"}],["DomainID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"Hash256"}],["VaultID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"Hash256"}],["ParentBatchID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"Hash256"}],["LoanBrokerID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":37,"type":"Hash256"}],["LoanID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":38,"type":"Hash256"}],["ReferenceHolding",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":39,"type":"Hash256"}],["hash",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Hash256"}],["index",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":258,"type":"Hash256"}],["Amount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Amount"}],["Balance",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Amount"}],["LimitAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Amount"}],["TakerPays",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Amount"}],["TakerGets",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Amount"}],["LowLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Amount"}],["HighLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Amount"}],["Fee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Amount"}],["SendMax",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Amount"}],["DeliverMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"Amount"}],["Amount2",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Amount"}],["BidMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Amount"}],["BidMax",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Amount"}],["MinimumOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Amount"}],["RippleEscrow",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Amount"}],["DeliveredAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"Amount"}],["NFTokenBrokerFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"Amount"}],["BaseFeeDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"Amount"}],["ReserveBaseDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"Amount"}],["ReserveIncrementDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"Amount"}],["LPTokenOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"Amount"}],["LPTokenIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"Amount"}
2],["EPrice",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"Amount"}],["Price",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"Amount"}],["SignatureReward",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"Amount"}],["MinAccountCreateAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"Amount"}],["LPTokenBalance",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"Amount"}],["PublicKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"Blob"}],["MessageKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"Blob"}],["SigningPubKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"Blob"}],["TxnSignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":4,"type":"Blob"}],["URI",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"Blob"}],["Signature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":6,"type":"Blob"}],["Domain",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":7,"type":"Blob"}],["FundCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":8,"type":"Blob"}],["RemoveCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":9,"type":"Blob"}],["ExpireCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":10,"type":"Blob"}],["CreateCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":11,"type":"Blob"}],["MemoType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":12,"type":"Blob"}],["MemoData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":13,"type":"Blob"}],["MemoFormat",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":14,"type":"Blob"}],["Fulfillment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":16,"type":"Blob"}],["Condition",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":17,"type":"Blob"}],["MasterSignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":18,"type":"Blob"}],["UNLModifyValidator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":19,"type":"Blob"}],["ValidatorToDisable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":20,"type":"Blob"}],["ValidatorToReEnable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":21,"type":"Blob"}],["HookStateData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":22,"type":"Blob"}],["HookReturnString",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":23,"type":"Blob"}],["HookParameterName",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":24,"type":"Blob"}],["HookParameterValue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":25,"type":"Blob"}],["DIDDocument",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":26,"type":"Blob"}],["Data",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":27,"type":"Blob"}],["AssetClass",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":28,"type":"Blob"}],["Provider",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":29,"type":"Blob"}],["MPTokenMetadata",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":30,"type":"Blob"}],["CredentialType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":31,"type":"Blob"}],["Account",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"AccountID"}],["Owner",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"AccountID"}],["Destination",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"AccountID"}],["Issuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":4,"type":"AccountID"}],["Authorize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"AccountID"}],["Unauthorize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":6,"type":"AccountID"}],["RegularKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":8,"type":"AccountID"}],["NFTokenMinter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":9,"type":"AccountID"}],["EmitCallback",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":10,"type":"AccountID"}],["Holder",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":11,"type":"AccountID"}],["Delegate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":12,"type":"AccountID"}],["HookAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":16,"type":"AccountID"}],["OtherChainSource",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":18,"type":"AccountID"}],["OtherChainDestination",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":19,"type":"AccountID"}],["AttestationSignerAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":20,"type":"AccountID"}],["AttestationRewardAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":21,"type":"AccountID"}],["LockingChainDoor",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":22,"type":"AccountID"}],["IssuingChainDoor",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":23,"type":"AccountID"}],["Subject",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":24,"type":"AccountID"}],["Borrower",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":25,"type":"AccountID"}],["Counterparty",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":26,"type":"AccountID"}],["Number",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Number"}],["AssetsAvailable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Number"}],["AssetsMaximum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Number"}],["AssetsTotal",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Number"}],["LossUnrealized",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Number"}],["DebtTotal",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Number"}],["DebtMaximum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Number"}],["CoverAvailable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Number"}],["LoanOriginationFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Number"}],["LoanServiceFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"Number"}],["LatePaymentFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Number"}],["ClosePaymentFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Number"}],["PrincipalOutstanding",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Number"}],["PrincipalRequested",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"Number"}],["TotalValueOutstanding",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"Number"}],["PeriodicPayment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Number"}],["ManagementFeeOutstanding",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Number"}],["LoanScale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Int32"}],["TransactionMetaData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"STObject"}],["CreatedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"STObject"}],["DeletedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"STObject"}],["ModifiedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"STObject"}],["PreviousFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"STObject"}],["FinalFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"STObject"}],["NewFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"STObject"}],["TemplateEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"STObject"}],["Memo",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"STObject"}],["SignerEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"STObject"}],["NFToken",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"STObject"}
2],["EmitDetails",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"STObject"}],["Hook",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"STObject"}],["Permission",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"STObject"}],["Signer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"STObject"}],["Majority",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"STObject"}],["DisabledValidator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"STObject"}],["EmittedTxn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"STObject"}],["HookExecution",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"STObject"}],["HookDefinition",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"STObject"}],["HookParameter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"STObject"}],["HookGrant",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"STObject"}],["VoteEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"STObject"}],["AuctionSlot",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"STObject"}],["AuthAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"STObject"}],["XChainClaimProofSig",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"STObject"}],["XChainCreateAccountProofSig",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"STObject"}],["XChainClaimAttestationCollectionElement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"STObject"}],["XChainCreateAccountAttestationCollectionElement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"STObject"}],["PriceData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"STObject"}],["Credential",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"STObject"}],["RawTransaction",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"STObject"}],["BatchSigner",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"STObject"}],["Book",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"STObject"}],["CounterpartySignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":37,"type":"STObject"}],["Signers",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":3,"type":"STArray"}],["SignerEntries",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"STArray"}],["Template",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"STArray"}],["Necessary",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"STArray"}],["Sufficient",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"STArray"}],["AffectedNodes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"STArray"}],["Memos",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"STArray"}],["NFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"STArray"}],["Hooks",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"STArray"}],["VoteSlots",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"STArray"}],["AdditionalBooks",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"STArray"}],["Majorities",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"STArray"}],["DisabledValidators",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"STArray"}],["HookExecutions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"STArray"}],["HookParameters",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"STArray"}],["HookGrants",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"STArray"}],["XChainClaimAttestations",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"STArray"}],["XChainCreateAccountAttestations",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"STArray"}],["PriceDataSeries",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"STArray"}],["AuthAccounts",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"STArray"}],["AuthorizeCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"STArray"}],["UnauthorizeCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"STArray"}],["AcceptedCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"STArray"}],["Permissions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"STArray"}],["RawTransactions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"STArray"}],["BatchSigners",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":31,"type":"STArray"}],["CloseResolution",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt8"}],["Method",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt8"}],["TransactionResult",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt8"}],["Scale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt8"}],["AssetScale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt8"}],["TickSize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt8"}],["UNLModifyDisabling",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt8"}],["HookResult",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt8"}],["WasLockingChainSend",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt8"}],["WithdrawalPolicy",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt8"}],["TakerPaysCurrency",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash160"}],["TakerPaysIssuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash160"}],["TakerGetsCurrency",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Hash160"}],["TakerGetsIssuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Hash160"}],["Paths",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"PathSet"}
2],["Indexes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"Vector256"}],["Hashes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"Vector256"}],["Amendments",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"Vector256"}],["NFTokenOffers",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":4,"type":"Vector256"}],["CredentialIDs",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"Vector256"}],["MPTokenIssuanceID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash192"}],["ShareMPTID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash192"}],["TakerPaysMPT",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Hash192"}],["TakerGetsMPT",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Hash192"}],["LockingChainIssue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Issue"}],["IssuingChainIssue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Issue"}],["Asset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Issue"}],["Asset2",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Issue"}],["XChainBridge",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"XChainBridge"}],["BaseAsset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Currency"}],["QuoteAsset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Currency"}],["Transaction",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Transaction"}],["LedgerEntry",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"LedgerEntry"}],["Validation",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Validation"}],["Metadata",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Metadata"}]],"LEDGER_ENTRY_FLAGS":{"AccountRoot":{"lsfAllowTrustLineClawback":2147483648,"lsfAllowTrustLineLocking":1073741824,"lsfDefaultRipple":8388608,"lsfDepositAuth":16777216,"lsfDisableMaster":1048576,"lsfDisallowIncomingCheck":134217728,"lsfDisallowIncomingNFTokenOffer":67108864,"lsfDisallowIncomingPayChan":268435456,"lsfDisallowIncomingTrustline":536870912,"lsfDisallowXRP":524288,"lsfGlobalFreeze":4194304,"lsfNoFreeze":2097152,"lsfPasswordSpent":65536,"lsfRequireAuth":262144,"lsfRequireDestTag":131072},"Credential":{"lsfAccepted":65536},"DirNode":{"lsfNFTokenBuyOffers":1,"lsfNFTokenSellOffers":2},"Loan":{"lsfLoanDefault":65536,"lsfLoanImpaired":131072,"lsfLoanOverpayment":262144},"MPToken":{"lsfMPTAMM":4,"lsfMPTAuthorized":2,"lsfMPTLocked":1},"MPTokenIssuance":{"lsfMPTCanClawback":64,"lsfMPTCanEscrow":8,"lsfMPTCanLock":2,"lsfMPTCanTrade":16,"lsfMPTCanTransfer":32,"lsfMPTLocked":1,"lsfMPTRequireAuth":4},"MPTokenIssuanceMutable":{"lsmfMPTCanMutateCanClawback":64,"lsmfMPTCanMutateCanEscrow":8,"lsmfMPTCanMutateCanLock":2,"lsmfMPTCanMutateCanTrade":16,"lsmfMPTCanMutateCanTransfer":32,"lsmfMPTCanMutateMetadata":65536,"lsmfMPTCanMutateRequireAuth":4,"lsmfMPTCanMutateTransferFee":131072},"NFTokenOffer":{"lsfSellNFToken":1},"Offer":{"lsfHybrid":262144,"lsfPassive":65536,"lsfSell":131072},"RippleState":{"lsfAMMNode":16777216,"lsfHighAuth":524288,"lsfHighDeepFreeze":67108864,"lsfHighFreeze":8388608,"lsfHighNoRipple":2097152,"lsfHighReserve":131072,"lsfLowAuth":262144,"lsfLowDeepFreeze":33554432,"lsfLowFreeze":4194304,"lsfLowNoRipple":1048576,"lsfLowReserve":65536},"SignerList":{"lsfOneOwnerCount":65536},"Vault":{"lsfVaultPrivate":65536}},"LEDGER_ENTRY_FORMATS":{"AMM":[{"name":"Account","optionality":0},{"name":"TradingFee","optionality":2},{"name":"VoteSlots","optionality":1},{"name":"AuctionSlot","optionality":1},{"name":"LPTokenBalance","optionality":0},{"name":"Asset","optionality":0},{"name":"Asset2","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"PreviousTxnID","optionality":1},{"name":"PreviousTxnLgrSeq","optionality":1}],"AccountRoot":[{"name":"Account","optionality":0},{"name":"Sequence","optionality":0},{"name":"Balance","optionality":0},{"name":"OwnerCount","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0},{"name":"AccountTxnID","optionality":1},{"name":"RegularKey","optionality":1},{"name":"EmailHash","optionality":1},{"name":"WalletLocator","optionality":1},{"name":"WalletSize","optionality":1},{"name":"MessageKey","optionality":1},{"name":"TransferRate","optionality":1},{"name":"Domain","optionality":1},{"name":"TickSize","optionality":1},{"name":"TicketCount","optionality":1},{"name":"NFTokenMinter","optionality":1},{"name":"MintedNFTokens","optionality":2},{"name":"BurnedNFTokens","optionality":2},{"name":"FirstNFTokenSequence","optionality":1},{"name":"AMMID","optionality":1},{"name":"VaultID","optionality":1},{"name":"LoanBrokerID","optionality":1}],"Amendments":[{"name":"Amendments","optionality":1},{"name":"Majorities","optionality":1},{"name":"PreviousTxnID","optionality":1},{"name":"PreviousTxnLgrSeq","optionality":1}],"Bridge":[{"name":"Account","optionality":0},{"name":"SignatureReward","optionality":0}
2,{"name":"MinAccountCreateAmount","optionality":1},{"name":"XChainBridge","optionality":0},{"name":"XChainClaimID","optionality":0},{"name":"XChainAccountCreateCount","optionality":0},{"name":"XChainAccountClaimCount","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"Check":[{"name":"Account","optionality":0},{"name":"Destination","optionality":0},{"name":"SendMax","optionality":0},{"name":"Sequence","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"DestinationNode","optionality":0},{"name":"Expiration","optionality":1},{"name":"InvoiceID","optionality":1},{"name":"SourceTag","optionality":1},{"name":"DestinationTag","optionality":1},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"Credential":[{"name":"Subject","optionality":0},{"name":"Issuer","optionality":0},{"name":"CredentialType","optionality":0},{"name":"Expiration","optionality":1},{"name":"URI","optionality":1},{"name":"IssuerNode","optionality":0},{"name":"SubjectNode","optionality":1},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"DID":[{"name":"Account","optionality":0},{"name":"DIDDocument","optionality":1},{"name":"URI","optionality":1},{"name":"Data","optionality":1},{"name":"OwnerNode","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"Delegate":[{"name":"Account","optionality":0},{"name":"Authorize","optionality":0},{"name":"Permissions","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"DestinationNode","optionality":1},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"DepositPreauth":[{"name":"Account","optionality":0},{"name":"Authorize","optionality":1},{"name":"OwnerNode","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0},{"name":"AuthorizeCredentials","optionality":1}],"DirectoryNode":[{"name":"Owner","optionality":1},{"name":"TakerPaysCurrency","optionality":1},{"name":"TakerPaysIssuer","optionality":1},{"name":"TakerPaysMPT","optionality":1},{"name":"TakerGetsCurrency","optionality":1},{"name":"TakerGetsIssuer","optionality":1},{"name":"TakerGetsMPT","optionality":1},{"name":"ExchangeRate","optionality":1},{"name":"Indexes","optionality":0},{"name":"RootIndex","optionality":0},{"name":"IndexNext","optionality":1},{"name":"IndexPrevious","optionality":1},{"name":"NFTokenID","optionality":1},{"name":"PreviousTxnID","optionality":1},{"name":"PreviousTxnLgrSeq","optionality":1},{"name":"DomainID","optionality":1}],"Escrow":[{"name":"Account","optionality":0},{"name":"Sequence","optionality":1},{"name":"Destination","optionality":0},{"name":"Amount","optionality":0},{"name":"Condition","optionality":1},{"name":"CancelAfter","optionality":1},{"name":"FinishAfter","optionality":1},{"name":"SourceTag","optionality":1},{"name":"DestinationTag","optionality":1},{"name":"OwnerNode","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0},{"name":"DestinationNode","optionality":1},{"name":"TransferRate","optionality":1},{"name":"IssuerNode","optionality":1}],"FeeSettings":[{"name":"BaseFee","optionality":1},{"name":"ReferenceFeeUnits","optionality":1},{"name":"ReserveBase","optionality":1},{"name":"ReserveIncrement","optionality":1},{"name":"BaseFeeDrops","optionality":1},{"name":"ReserveBaseDrops","optionality":1},{"name":"ReserveIncrementDrops","optionality":1},{"name":"PreviousTxnID","optionality":1},{"name":"PreviousTxnLgrSeq","optionality":1}],"LedgerHashes":[{"name":"FirstLedgerSequence","optionality":1},{"name":"LastLedgerSequence","optionality":1},{"name":"Hashes","optionality":0}],"Loan":[{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"LoanBrokerNode","optionality":0},{"name":"LoanBrokerID","optionality":0},{"name":"LoanSequence","optionality":0},{"name":"Borrower","optionality":0},{"name":"LoanOriginationFee","optionality":2},{"name":"LoanServiceFee","optionality":2},{"name":"LatePaymentFee","optionality":2},{"name":"ClosePaymentFee","optionality":2},{"name":"OverpaymentFee","optionality":2},{"name":"InterestRate","optionality":2},{"name":"LateInterestRate","optionality":2},{"name":"CloseInterestRate","optionality":2},{"name":"OverpaymentInterestRate","optionality":2},{"name":"StartDate","optionality":0},{"name":"PaymentInterval","optionality":0},{"name":"GracePeriod","optionality":2},{"name":"PreviousPaymentDueDate","optionality":2},{"name":"NextPaymentDueDate","optionality":2},{"name":"PaymentRemaining","optionality":2},{"name":"PeriodicPayment","optionality":0},{"name":"PrincipalOutstanding","optionality":2},{"name":"TotalValueOutstanding","optionality":2},{"name":"ManagementFeeOutstanding","optionality":2},{"name":"LoanScale","optionality":2}],"LoanBroker":[{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0},{"name":"Sequence","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"VaultNode","optionality":0},{"name":"VaultID","optionality":0},{"name":"Account","optionality":0},{"name":"Owner","optionality":0},{"name":"LoanSequence","optionality":0},{"name":"Data","optionality":2},{"name":"ManagementFeeRate","optionality":2},{"name":"OwnerCount","optionality":2},{"name":"DebtTotal","optionality":2},{"name":"DebtMaximum","optionality":2},{"name":"CoverAvailable","optionality":2},{"name":"CoverRateMinimum","optionality":2},{"name":"CoverRateLiquidation","optionality":2}],"MPToken":[{"name":"Account","optionality":0},{"name":"MPTokenIssuanceID","optionality":0},{"name":"MPTAmount","optionality":2},{"name":"LockedAmount","optionality":1},{"name":"OwnerNode","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"MPTokenIssuance":[{"name":"Issuer","optionality":0},{"name":"Sequence","optionality":0},{"name":"TransferFee","optionality":2},{"name":"OwnerNode","optionality":0},{"name":"AssetScale","optionality":2},{"name":"MaximumAmount","optionality":1},{"name":"OutstandingAmount","optionality":0},{"name":"LockedAmount","optionality":1},{"name":"MPTokenMetadata","optionality":1},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0},{"name":"DomainID","optionality":1},{"name":"MutableFlags","optionality":2},{"name":"ReferenceHolding","optionality":1}],"NFTokenOffer":[{"name":"Owner","optionality":0},{"name":"NFTokenID","optionality":0},{"name":"Amount","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"NFTokenOfferNode","optionality":0},{"name":"Destination","optionality":1},{"name":"Expiration","optionality":1},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"NFTokenPage":[{"name":"PreviousPageMin","optionality":1},{"name":"NextPageMin","optionality":1},{"name":"NFTokens","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"NegativeUNL":[{"name":"DisabledValidators","optionality":1},{"name":"ValidatorToDisable","optionality":1},{"name":"ValidatorToReEnable","optionality":1},{"name":"PreviousTxnID","optionality":1},{"name":"PreviousTxnLgrSeq","optionality":1}],"Offer":[{"name":"Account","optionality":0},{"name":"Sequence","optionality":0},{"name":"TakerPays","optionality":0},{"name":"TakerGets","optionality":0},{"name":"BookDirectory","optionality":0},{"name":"BookNode","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0},{"name":"Expiration","optionality":1},{"name":"DomainID","optionality":1},{"name":"AdditionalBooks","optionality":1}],"Oracle":[{"name":"Owner","optionality":0},{"name":"OracleDocumentID","optionality":1},{"name":"Provider","optionality":0},{"name":"PriceDataSeries","optionality":0},{"name":"AssetClass","optionality":0},{"name":"LastUpdateTime","optionality":0},{"name":"URI","optionality":1},{"name":"OwnerNode","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"PayChannel":[{"name":"Account","optionality":0},{"name":"Destination","optionality":0},{"name":"Sequence","optionality":1},{"name":"Amount","optionality":0},{"name":"Balance","optionality":0},{"name":"PublicKey","optionality":0},{"name":"SettleDelay","optionality":0},{"name":"Expiration","optionality":1},{"name":"CancelAfter","optionality":1},{"name":"SourceTag","optionality":1},{"name":"DestinationTag","optionality":1},{"name":"OwnerNode","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0},{"name":"DestinationNode","optionality":1}],"PermissionedDomain":[{"name":"Owner","optionality":0},{"name":"Sequence","optionality":0},{"name":"AcceptedCredentials","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"RippleState":[{"name":"Balance","optionality":0},{"name":"LowLimit","optionality":0}
2,{"name":"HighLimit","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0},{"name":"LowNode","optionality":1},{"name":"LowQualityIn","optionality":1},{"name":"LowQualityOut","optionality":1},{"name":"HighNode","optionality":1},{"name":"HighQualityIn","optionality":1},{"name":"HighQualityOut","optionality":1}],"SignerList":[{"name":"Owner","optionality":1},{"name":"OwnerNode","optionality":0},{"name":"SignerQuorum","optionality":0},{"name":"SignerEntries","optionality":0},{"name":"SignerListID","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"Ticket":[{"name":"Account","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"TicketSequence","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"Vault":[{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0},{"name":"Sequence","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"Owner","optionality":0},{"name":"Account","optionality":0},{"name":"Data","optionality":1},{"name":"Asset","optionality":0},{"name":"AssetsTotal","optionality":2},{"name":"AssetsAvailable","optionality":2},{"name":"AssetsMaximum","optionality":2},{"name":"LossUnrealized","optionality":2},{"name":"ShareMPTID","optionality":0},{"name":"WithdrawalPolicy","optionality":0},{"name":"Scale","optionality":2}],"XChainOwnedClaimID":[{"name":"Account","optionality":0},{"name":"XChainBridge","optionality":0},{"name":"XChainClaimID","optionality":0},{"name":"OtherChainSource","optionality":0},{"name":"XChainClaimAttestations","optionality":0},{"name":"SignatureReward","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"XChainOwnedCreateAccountClaimID":[{"name":"Account","optionality":0},{"name":"XChainBridge","optionality":0},{"name":"XChainAccountCreateCount","optionality":0},{"name":"XChainCreateAccountAttestations","optionality":0},{"name":"OwnerNode","optionality":0},{"name":"PreviousTxnID","optionality":0},{"name":"PreviousTxnLgrSeq","optionality":0}],"common":[{"name":"LedgerIndex","optionality":1},{"name":"LedgerEntryType","optionality":0},{"name":"Flags","optionality":0}]},"LEDGER_ENTRY_TYPES":{"AMM":121,"AccountRoot":97,"Amendments":102,"Bridge":105,"Check":67,"Credential":129,"DID":73,"Delegate":131,"DepositPreauth":112,"DirectoryNode":100,"Escrow":117,"FeeSettings":115,"Invalid":-1,"LedgerHashes":104,"Loan":137,"LoanBroker":136,"MPToken":127,"MPTokenIssuance":126,"NFTokenOffer":55,"NFTokenPage":80,"NegativeUNL":78,"Offer":111,"Oracle":128,"PayChannel":120,"PermissionedDomain":130,"RippleState":114,"SignerList":83,"Ticket":84,"Vault":132,"XChainOwnedClaimID":113,"XChainOwnedCreateAccountClaimID":116},"TRANSACTION_FLAGS":{"AMMClawback":{"tfClawTwoAssets":1},"AMMDeposit":{"tfLPToken":65536,"tfLimitLPToken":4194304,"tfOneAssetLPToken":2097152,"tfSingleAsset":524288,"tfTwoAsset":1048576,"tfTwoAssetIfEmpty":8388608},"AMMWithdraw":{"tfLPToken":65536,"tfLimitLPToken":4194304,"tfOneAssetLPToken":2097152,"tfOneAssetWithdrawAll":262144,"tfSingleAsset":524288,"tfTwoAsset":1048576,"tfWithdrawAll":131072},"AccountSet":{"tfAllowXRP":2097152,"tfDisallowXRP":1048576,"tfOptionalAuth":524288,"tfOptionalDestTag":131072,"tfRequireAuth":262144,"tfRequireDestTag":65536},"Batch":{"tfAllOrNothing":65536,"tfIndependent":524288,"tfOnlyOne":131072,"tfUntilFailure":262144},"EnableAmendment":{"tfGotMajority":65536,"tfLostMajority":131072},"LoanManage":{"tfLoanDefault":65536,"tfLoanImpair":131072,"tfLoanUnimpair":262144},"LoanPay":{"tfLoanFullPayment":131072,"tfLoanLatePayment":262144,"tfLoanOverpayment":65536},"LoanSet":{"tfLoanOverpayment":65536},"MPTokenAuthorize":{"tfMPTUnauthorize":1},"MPTokenIssuanceCreate":{"tfMPTCanClawback":64,"tfMPTCanEscrow":8,"tfMPTCanLock":2,"tfMPTCanTrade":16,"tfMPTCanTransfer":32,"tfMPTRequireAuth":4},"MPTokenIssuanceSet":{"tfMPTLock":1,"tfMPTUnlock":2},"NFTokenCreateOffer":{"tfSellNFToken":1},"NFTokenMint":{"tfBurnable":1,"tfMutable":16,"tfOnlyXRP":2,"tfTransferable":8},"OfferCreate":{"tfFillOrKill":262144,"tfHybrid":1048576,"tfImmediateOrCancel":131072,"tfPassive":65536,"tfSell":524288},"Payment":{"tfLimitQuality":262144,"tfNoRippleDirect":65536,"tfPartialPayment":131072},"PaymentChannelClaim":{"tfClose":131072,"tfRenew":65536},"TrustSet":{"tfClearDeepFreeze":8388608,"tfClearFreeze":2097152,"tfClearNoRipple":262144,"tfSetDeepFreeze":4194304,"tfSetFreeze":1048576,"tfSetNoRipple":131072,"tfSetfAuth":65536},"VaultCreate":{"tfVaultPrivate":65536,"tfVaultShareNonTransferable":131072}
2,"XChainModifyBridge":{"tfClearAccountCreateAmount":65536},"universal":{"tfFullyCanonicalSig":2147483648,"tfInnerBatchTxn":1073741824}},"TRANSACTION_FORMATS":{"AMMBid":[{"name":"Asset","optionality":0},{"name":"Asset2","optionality":0},{"name":"BidMin","optionality":1},{"name":"BidMax","optionality":1},{"name":"AuthAccounts","optionality":1}],"AMMClawback":[{"name":"Holder","optionality":0},{"name":"Asset","optionality":0},{"name":"Asset2","optionality":0},{"name":"Amount","optionality":1}],"AMMCreate":[{"name":"Amount","optionality":0},{"name":"Amount2","optionality":0},{"name":"TradingFee","optionality":0}],"AMMDelete":[{"name":"Asset","optionality":0},{"name":"Asset2","optionality":0}],"AMMDeposit":[{"name":"Asset","optionality":0},{"name":"Asset2","optionality":0},{"name":"Amount","optionality":1},{"name":"Amount2","optionality":1},{"name":"EPrice","optionality":1},{"name":"LPTokenOut","optionality":1},{"name":"TradingFee","optionality":1}],"AMMVote":[{"name":"Asset","optionality":0},{"name":"Asset2","optionality":0},{"name":"TradingFee","optionality":0}],"AMMWithdraw":[{"name":"Asset","optionality":0},{"name":"Asset2","optionality":0},{"name":"Amount","optionality":1},{"name":"Amount2","optionality":1},{"name":"EPrice","optionality":1},{"name":"LPTokenIn","optionality":1}],"AccountDelete":[{"name":"Destination","optionality":0},{"name":"DestinationTag","optionality":1},{"name":"CredentialIDs","optionality":1}],"AccountSet":[{"name":"EmailHash","optionality":1},{"name":"WalletLocator","optionality":1},{"name":"WalletSize","optionality":1},{"name":"MessageKey","optionality":1},{"name":"Domain","optionality":1},{"name":"TransferRate","optionality":1},{"name":"SetFlag","optionality":1},{"name":"ClearFlag","optionality":1},{"name":"TickSize","optionality":1},{"name":"NFTokenMinter","optionality":1}],"Batch":[{"name":"RawTransactions","optionality":0},{"name":"BatchSigners","optionality":1}],"CheckCancel":[{"name":"CheckID","optionality":0}],"CheckCash":[{"name":"CheckID","optionality":0},{"name":"Amount","optionality":1},{"name":"DeliverMin","optionality":1}],"CheckCreate":[{"name":"Destination","optionality":0},{"name":"SendMax","optionality":0},{"name":"Expiration","optionality":1},{"name":"DestinationTag","optionality":1},{"name":"InvoiceID","optionality":1}],"Clawback":[{"name":"Amount","optionality":0},{"name":"Holder","optionality":1}],"CredentialAccept":[{"name":"Issuer","optionality":0},{"name":"CredentialType","optionality":0}],"CredentialCreate":[{"name":"Subject","optionality":0},{"name":"CredentialType","optionality":0},{"name":"Expiration","optionality":1},{"name":"URI","optionality":1}],"CredentialDelete":[{"name":"Subject","optionality":1},{"name":"Issuer","optionality":1},{"name":"CredentialType","optionality":0}],"DIDDelete":[],"DIDSet":[{"name":"DIDDocument","optionality":1},{"name":"URI","optionality":1},{"name":"Data","optionality":1}],"DelegateSet":[{"name":"Authorize","optionality":0},{"name":"Permissions","optionality":0}],"DepositPreauth":[{"name":"Authorize","optionality":1}
2,{"name":"Unauthorize","optionality":1},{"name":"AuthorizeCredentials","optionality":1},{"name":"UnauthorizeCredentials","optionality":1}],"EnableAmendment":[{"name":"LedgerSequence","optionality":0},{"name":"Amendment","optionality":0}],"EscrowCancel":[{"name":"Owner","optionality":0},{"name":"OfferSequence","optionality":0}],"EscrowCreate":[{"name":"Destination","optionality":0},{"name":"Amount","optionality":0},{"name":"Condition","optionality":1},{"name":"CancelAfter","optionality":1},{"name":"FinishAfter","optionality":1},{"name":"DestinationTag","optionality":1}],"EscrowFinish":[{"name":"Owner","optionality":0},{"name":"OfferSequence","optionality":0},{"name":"Fulfillment","optionality":1},{"name":"Condition","optionality":1},{"name":"CredentialIDs","optionality":1}],"LedgerStateFix":[{"name":"LedgerFixType","optionality":0},{"name":"Owner","optionality":1},{"name":"BookDirectory","optionality":1}],"LoanBrokerCoverClawback":[{"name":"LoanBrokerID","optionality":1},{"name":"Amount","optionality":1}],"LoanBrokerCoverDeposit":[{"name":"LoanBrokerID","optionality":0},{"name":"Amount","optionality":0}],"LoanBrokerCoverWithdraw":[{"name":"LoanBrokerID","optionality":0},{"name":"Amount","optionality":0},{"name":"Destination","optionality":1},{"name":"DestinationTag","optionality":1}],"LoanBrokerDelete":[{"name":"LoanBrokerID","optionality":0}],"LoanBrokerSet":[{"name":"VaultID","optionality":0},{"name":"LoanBrokerID","optionality":1},{"name":"Data","optionality":1},{"name":"ManagementFeeRate","optionality":1},{"name":"DebtMaximum","optionality":1},{"name":"CoverRateMinimum","optionality":1},{"name":"CoverRateLiquidation","optionality":1}],"LoanDelete":[{"name":"LoanID","optionality":0}],"LoanManage":[{"name":"LoanID","optionality":0}],"LoanPay":[{"name":"LoanID","optionality":0},{"name":"Amount","optionality":0}],"LoanSet":[{"name":"LoanBrokerID","optionality":0},{"name":"Data","optionality":1},{"name":"Counterparty","optionality":1},{"name":"CounterpartySignature","optionality":1},{"name":"LoanOriginationFee","optionality":1},{"name":"LoanServiceFee","optionality":1},{"name":"LatePaymentFee","optionality":1},{"name":"ClosePaymentFee","optionality":1},{"name":"OverpaymentFee","optionality":1},{"name":"InterestRate","optionality":1},{"name":"LateInterestRate","optionality":1},{"name":"CloseInterestRate","optionality":1},{"name":"OverpaymentInterestRate","optionality":1},{"name":"PrincipalRequested","optionality":0},{"name":"PaymentTotal","optionality":1},{"name":"PaymentInterval","optionality":1},{"name":"GracePeriod","optionality":1}],"MPTokenAuthorize":[{"name":"MPTokenIssuanceID","optionality":0},{"name":"Holder","optionality":1}],"MPTokenIssuanceCreate":[{"name":"AssetScale","optionality":1},{"name":"TransferFee","optionality":1},{"name":"MaximumAmount","optionality":1},{"name":"MPTokenMetadata","optionality":1},{"name":"DomainID","optionality":1},{"name":"MutableFlags","optionality":1}],"MPTokenIssuanceDestroy":[{"name":"MPTokenIssuanceID","optionality":0}],"MPTokenIssuanceSet":[{"name":"MPTokenIssuanceID","optionality":0},{"name":"Holder","optionality":1},{"name":"DomainID","optionality":1},{"name":"MPTokenMetadata","optionality":1},{"name":"TransferFee","optionality":1},{"name":"MutableFlags","optionality":1}],"NFTokenAcceptOffer":[{"name":"NFTokenBuyOffer","optionality":1},{"name":"NFTokenSellOffer","optionality":1},{"name":"NFTokenBrokerFee","optionality":1}],"NFTokenBurn":[{"name":"NFTokenID","optionality":0},{"name":"Owner","optionality":1}],"NFTokenCancelOffer":[{"name":"NFTokenOffers","optionality":0}],"NFTokenCreateOffer":[{"name":"NFTokenID","optionality":0},{"name":"Amount","optionality":0},{"name":"Destination","optionality":1},{"name":"Owner","optionality":1},{"name":"Expiration","optionality":1}],"NFTokenMint":[{"name":"NFTokenTaxon","optionality":0},{"name":"TransferFee","optionality":1},{"name":"Issuer","optionality":1},{"name":"URI","optionality":1},{"name":"Amount","optionality":1},{"name":"Destination","optionality":1},{"name":"Expiration","optionality":1}],"NFTokenModify":[{"name":"NFTokenID","optionality":0},{"name":"Owner","optionality":1},{"name":"URI","optionality":1}],"OfferCancel":[{"name":"OfferSequence","optionality":0}],"OfferCreate":[{"name":"TakerPays","optionality":0},{"name":"TakerGets","optionality":0},{"name":"Expiration","optionality":1},{"name":"OfferSequence","optionality":1},{"name":"DomainID","optionality":1}],"OracleDelete":[{"name":"OracleDocumentID","optionality":0}],"OracleSet":[{"name":"OracleDocumentID","optionality":0},{"name":"Provider","optionality":1},{"name":"URI","optionality":1},{"name":"AssetClass","optionality":1},{"name":"LastUpdateTime","optionality":0},{"name":"PriceDataSeries","optionality":0}],"Payment":[{"name":"Destination","optionality":0},{"name":"Amount","optionality":0},{"name":"SendMax","optionality":1},{"name":"Paths","optionality":2},{"name":"InvoiceID","optionality":1},{"name":"DestinationTag","optionality":1},{"name":"DeliverMin","optionality":1},{"name":"CredentialIDs","optionality":1},{"name":"DomainID","optionality":1}],"PaymentChannelClaim":[{"name":"Channel","optionality":0},{"name":"Amount","optionality":1},{"name":"Balance","optionality":1},{"name":"Signature","optionality":1},{"name":"PublicKey","optionality":1},{"name":"CredentialIDs","optionality":1}],"PaymentChannelCreate":[{"name":"Destination","optionality":0},{"name":"Amount","optionality":0},{"name":"SettleDelay","optionality":0},{"name":"PublicKey","optionality":0},{"name":"CancelAfter","optionality":1},{"name":"DestinationTag","optionality":1}],"PaymentChannelFund":[{"name":"Channel","optionality":0},{"name":"Amount","optionality":0},{"name":"Expiration","optionality":1}],"PermissionedDomainDelete":[{"name":"DomainID","optionality":0}],"PermissionedDomainSet":[{"name":"DomainID","optionality":1},{"name":"AcceptedCredentials","optionality":0}],"SetFee":[{"name":"LedgerSequence","optionality":1},{"name":"BaseFee","optionality":1},{"name":"ReferenceFeeUnits","optionality":1},{"name":"ReserveBase","optionality":1},{"name":"ReserveIncrement","optionality":1},{"name":"BaseFeeDrops","optionality":1},{"name":"ReserveBaseDrops","optionality":1},{"name":"ReserveIncrementDrops","optionality":1}],"SetRegularKey":[{"name":"RegularKey","optionality":1}
2],"SignerListSet":[{"name":"SignerQuorum","optionality":0},{"name":"SignerEntries","optionality":1}],"TicketCreate":[{"name":"TicketCount","optionality":0}],"TrustSet":[{"name":"LimitAmount","optionality":1},{"name":"QualityIn","optionality":1},{"name":"QualityOut","optionality":1}],"UNLModify":[{"name":"UNLModifyDisabling","optionality":0},{"name":"LedgerSequence","optionality":0},{"name":"UNLModifyValidator","optionality":0}],"VaultClawback":[{"name":"VaultID","optionality":0},{"name":"Holder","optionality":0},{"name":"Amount","optionality":1}],"VaultCreate":[{"name":"Asset","optionality":0},{"name":"AssetsMaximum","optionality":1},{"name":"MPTokenMetadata","optionality":1},{"name":"DomainID","optionality":1},{"name":"WithdrawalPolicy","optionality":1},{"name":"Data","optionality":1},{"name":"Scale","optionality":1}],"VaultDelete":[{"name":"VaultID","optionality":0}],"VaultDeposit":[{"name":"VaultID","optionality":0},{"name":"Amount","optionality":0}],"VaultSet":[{"name":"VaultID","optionality":0},{"name":"AssetsMaximum","optionality":1},{"name":"DomainID","optionality":1},{"name":"Data","optionality":1}],"VaultWithdraw":[{"name":"VaultID","optionality":0},{"name":"Amount","optionality":0},{"name":"Destination","optionality":1},{"name":"DestinationTag","optionality":1}],"XChainAccountCreateCommit":[{"name":"XChainBridge","optionality":0},{"name":"Destination","optionality":0},{"name":"Amount","optionality":0},{"name":"SignatureReward","optionality":0}],"XChainAddAccountCreateAttestation":[{"name":"XChainBridge","optionality":0},{"name":"AttestationSignerAccount","optionality":0},{"name":"PublicKey","optionality":0},{"name":"Signature","optionality":0},{"name":"OtherChainSource","optionality":0},{"name":"Amount","optionality":0},{"name":"AttestationRewardAccount","optionality":0},{"name":"WasLockingChainSend","optionality":0},{"name":"XChainAccountCreateCount","optionality":0},{"name":"Destination","optionality":0},{"name":"SignatureReward","optionality":0}],"XChainAddClaimAttestation":[{"name":"XChainBridge","optionality":0},{"name":"AttestationSignerAccount","optionality":0},{"name":"PublicKey","optionality":0},{"name":"Signature","optionality":0},{"name":"OtherChainSource","optionality":0},{"name":"Amount","optionality":0},{"name":"AttestationRewardAccount","optionality":0},{"name":"WasLockingChainSend","optionality":0},{"name":"XChainClaimID","optionality":0},{"name":"Destination","optionality":1}],"XChainClaim":[{"name":"XChainBridge","optionality":0},{"name":"XChainClaimID","optionality":0},{"name":"Destination","optionality":0},{"name":"DestinationTag","optionality":1},{"name":"Amount","optionality":0}],"XChainCommit":[{"name":"XChainBridge","optionality":0},{"name":"XChainClaimID","optionality":0},{"name":"Amount","optionality":0},{"name":"OtherChainDestination","optionality":1}],"XChainCreateBridge":[{"name":"XChainBridge","optionality":0},{"name":"SignatureReward","optionality":0},{"name":"MinAccountCreateAmount","optionality":1}],"XChainCreateClaimID":[{"name":"XChainBridge","optionality":0},{"name":"SignatureReward","optionality":0},{"name":"OtherChainSource","optionality":0}],"XChainModifyBridge":[{"name":"XChainBridge","optionality":0},{"name":"SignatureReward","optionality":1},{"name":"MinAccountCreateAmount","optionality":1}],"common":[{"name":"TransactionType","optionality":0},{"name":"Flags","optionality":1},{"name":"SourceTag","optionality":1},{"name":"Account","optionality":0},{"name":"Sequence","optionality":0},{"name":"PreviousTxnID","optionality":1},{"name":"LastLedgerSequence","optionality":1},{"name":"AccountTxnID","optionality":1},{"name":"Fee","optionality":0},{"name":"OperationLimit","optionality":1},{"name":"Memos","optionality":1},{"name":"SigningPubKey","optionality":0},{"name":"TicketSequence","optionality":1},{"name":"TxnSignature","optionality":1},{"name":"Signers","optionality":1},{"name":"NetworkID","optionality":1},{"name":"Delegate","optionality":1}]},"TRANSACTION_RESULTS":{"tecAMM_ACCOUNT":168,"tecAMM_BALANCE":163,"tecAMM_EMPTY":166,"tecAMM_FAILED":164,"tecAMM_INVALID_TOKENS":165,"tecAMM_NOT_E
2MPTY":167,"tecARRAY_EMPTY":190,"tecARRAY_TOO_LARGE":191,"tecBAD_CREDENTIALS":193,"tecCANT_ACCEPT_OWN_NFTOKEN_OFFER":158,"tecCLAIM":100,"tecCRYPTOCONDITION_ERROR":146,"tecDIR_FULL":121,"tecDST_TAG_NEEDED":143,"tecDUPLICATE":149,"tecEMPTY_DID":187,"tecEXPIRED":148,"tecFAILED_PROCESSING":105,"tecFROZEN":137,"tecHAS_OBLIGATIONS":151,"tecINCOMPLETE":169,"tecINSUFFICIENT_FUNDS":159,"tecINSUFFICIENT_PAYMENT":161,"tecINSUFFICIENT_RESERVE":141,"tecINSUFF_FEE":136,"tecINSUF_RESERVE_LINE":122,"tecINSUF_RESERVE_OFFER":123,"tecINTERNAL":144,"tecINVALID_UPDATE_TIME":188,"tecINVARIANT_FAILED":147,"tecKILLED":150,"tecLIMIT_EXCEEDED":195,"tecLOCKED":192,"tecMAX_SEQUENCE_REACHED":154,"tecNEED_MASTER_KEY":142,"tecNFTOKEN_BUY_SELL_MISMATCH":156,"tecNFTOKEN_OFFER_TYPE_MISMATCH":157,"tecNO_ALTERNATIVE_KEY":130,"tecNO_AUTH":134,"tecNO_DST":124,"tecNO_DST_INSUF_XRP":125,"tecNO_ENTRY":140,"tecNO_ISSUER":133,"tecNO_LINE":135,"tecNO_LINE_INSUF_RESERVE":126,"tecNO_LINE_REDUNDANT":127,"tecNO_PERMISSION":139,"tecNO_REGULAR_KEY":131,"tecNO_SUITABLE_NFTOKEN_PAGE":155,"tecNO_TARGET":138,"tecOBJECT_NOT_FOUND":160,"tecOVERSIZE":145,"tecOWNERS":132,"tecPATH_DRY":128,"tecPATH_PARTIAL":101,"tecPRECISION_LOSS":197,"tecPSEUDO_ACCOUNT":196,"tecTOKEN_PAIR_NOT_FOUND":189,"tecTOO_SOON":152,"tecUNFUNDED":129,"tecUNFUNDED_ADD":102,"tecUNFUNDED_AMM":162,"tecUNFUNDED_OFFER":103,"tecUNFUNDED_PAYMENT":104,"tecWRONG_ASSET":194,"tecXCHAIN_ACCOUNT_CREATE_PAST":181,"tecXCHAIN_ACCOUNT_CREATE_TOO_MANY":182,"tecXCHAIN_BAD_CLAIM_ID":172,"tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR":185,"tecXCHAIN_BAD_TRANSFER_ISSUE":170,"tecXCHAIN_CLAIM_NO_QUORUM":173,"tecXCHAIN_CREATE_ACCOUNT_DISABLED":186,"tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE":175,"tecXCHAIN_INSUFF_CREATE_AMOUNT":180,"tecXCHAIN_NO_CLAIM_ID":171,"tecXCHAIN_NO_SIGNERS_LIST":178,"tecXCHAIN_PAYMENT_FAILED":183,"tecXCHAIN_PROOF_UNKNOWN_KEY":174,"tecXCHAIN_REWARD_MISMATCH":177,"tecXCHAIN_SELF_COMMIT":184,"tecXCHAIN_SENDING_ACCOUNT_MISMATCH":179,"tecXCHAIN_WRONG_CHAIN":176,"tefALREADY":-198,"tefBAD_ADD_AUTH":-197,"tefBAD_AUTH":-196,"tefBAD_AUTH_MASTER":-183,"tefBAD_LEDGER":-195,"tefBAD_QUORUM":-185,"tefBAD_SIGNATURE":-186,"tefCREATED":-194,"tefEXCEPTION":-193,"tefFAILURE":-199,"tefINTERNAL":-192,"tefINVALID_LEDGER_FIX_TYPE":-178,"tefINVARIANT_FAILED":-182,"tefMASTER_DISABLED":-188,"tefMAX_LEDGER":-187,"tefNFTOKEN_IS_NOT_TRANSFERABLE":-179,"tefNOT_MULTI_SIGNING":-184,"tefNO_AUTH_REQUIRED":-191,"tefNO_TICKET":-180,"tefPAST_SEQ":-190,"tefTOO_BIG":-181,"tefWRONG_PRIOR":-189,"telBAD_DOMAIN":-398,"telBAD_PATH_COUNT":-397,"telBAD_PUBLIC_KEY":-396,"telCAN_NOT_QUEUE":-392,"telCAN_NOT_QUEUE_BALANCE":-391,"telCAN_NOT_QUEUE_BLOCKED":-389,"telCAN_NOT_QUEUE_BLOCKS":-390,"telCAN_NOT_QUEUE_FEE":-388,"telCAN_NOT_QUEUE_FULL":-387,"telENV_RPC_FAILED":-383,"telFAILED_PROCESSING":-395,"telINSUF_FEE_P":-394,"telLOCAL_ERROR":-399,"telNETWORK_ID_MAKES_TX_NON_CANONICAL":-384,"telNO_DST_PARTIAL":-393,"telREQUIRES_NETWORK_ID":-385,"telWRONG_NETWORK":-386,"temARRAY_EMPTY":-253,"temARRAY_TOO_LARGE":-252,"temBAD_AMM_TOKENS":-261,"temBAD_AMOUNT":-298,"temBAD_CURRENCY":-297,"temBAD_EXPIRATION":-296,"temBAD_FEE":-295,"temBAD_ISSUER":-294,"temBAD_LIMIT":-293,"temBAD_MPT":-249,"temBAD_NFTOKEN_TRANSFER_FEE":-262,"temBAD_OFFER":-292,"temBAD_PATH":-291,"temBAD_PATH_LOOP":-290,"temBAD_QUORUM":-271,"temBAD_REGKEY":-289,"temBAD_SEND_XRP_LIMIT":-288,"temBAD_SEND_XRP_MAX":-287,"temBAD_SEND_XRP_NO_DIRECT":-286,"temBAD_SEND_XRP_PARTIAL":-285,"temBAD_SEND_XRP_PATHS":-284,"temBAD_SEQUENCE":-283,"temBAD_SIGNATURE":-282,"temBAD_SIGNER":-272,"temBAD_SRC_ACCOUNT":-281,"temBAD_TICK_SIZE":-269,"temBAD_TRANSFER_FEE":-251,"temBAD_TRANSFER_RATE":-280,"temBAD_WEIGHT":-270,"temCANNOT_PREAUTH_SELF":-267,"temDISABLED":-273,"temDST_IS_SRC":-279,"temDST_NEEDED":-278,"temEMPTY_DID":-254,"temINVALID":-277,"temINVALID_ACCOUNT_ID":-268,"temINVALID_COUNT":-266,"temINVALID_FLAG":-276,"temINVALID_INNER_BATCH":-250,"temMALFORMED":-299,"temREDUNDANT":-275,"temRIPPLE_EMPTY":-274,"temSEQ_AND_TICKET":-263,"temUNCERTAIN":-265,"temUNKNOWN":-264,"temXCHAIN_BAD_PROOF":-259,"temXCHAIN_BRIDGE_BAD_ISSUES":-258,"temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT":-256,"temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT":-255,"temXCHAIN_BRIDGE_NONDOOR_OWNER":-257,"temXCHAIN_EQUAL_DOOR_ACCOUNTS":-260,"terADDRESS_COLLISION":-86,"terFUNDS_SPENT":-98,"terINSUF_FEE_B":-97,"terLAST":-91,"terLOCKED":-84,"terNO_ACCOUNT":-96,"terNO_AMM":-87,"terNO_AUTH":-95,"terNO_DELEGATE_PERMISSION":-85,"terNO_LINE":-94,"terNO_RIPPLE":-90,"terOWNERS":-93,"terPRE_SEQ":-92,"terPRE_TICKET":-88,"terQUEUED":-89,"terRETRY":-99,"tesSUCCESS":0},"TRANSACTION_TYPES":{"AMMBid":39,"AMMClawback":31,"AMMCreate":35,"AMMDelete":40,"AMMDeposit":36,"AMMVote":38,"AMMWithdraw":37,"AccountDelete":21,"AccountSet":3,"Batch":71,"CheckCancel":18,"CheckCash":17,"CheckCreate":16,"Clawback":30,"CredentialAccept":59,"CredentialCreate":58,"CredentialDelete":60,"DIDDelete":50,"DIDSet":49,"DelegateSet":64,"DepositPreauth":19,"EnableAmendment":100,"EscrowCancel":4,"EscrowCreate":1,"EscrowFinish":2,"Invalid":-1,"LedgerStateFix":53,"LoanBrokerCoverClawback":78,"LoanBrokerCoverDeposit":76,"LoanBrokerCoverWithdraw":77,"LoanBrokerDelete":75,"LoanBrokerSet":74,"LoanDelete":81,"LoanManage":82,"LoanPay":84,"LoanSet":80,"MPTokenAuthorize":57,"MPTokenIssuanceCreate":54,"MPTokenIssuanceDestroy":55,"MPTokenIssuanceSet":56,"NFTokenAcceptOffer":29,"NFTokenBurn":26,"NFTokenCancelOffer":28,"NFTokenCreateOffer":27,"NFTokenMint":25,"NFTokenModify":61,"OfferCancel":8,"OfferCreate":7,"OracleDelete":52,"OracleSet":51,"Payment":0,"PaymentChannelClaim":15,"PaymentChannelCreate":13,"PaymentChannelFund":14,"PermissionedDomainDelete":63,"PermissionedDomainSet":62,"SetFee":101,"SetRegularKey":5,"SignerListSet":12,"TicketCreate":10,"TrustSet":20,"UNLModify":102,"VaultClawback":70,"VaultCreate":65,"VaultDelete":67,"VaultDeposit":68,"VaultSet":66,"VaultWithdraw":69,"XChainAccountCreateCommit":44,"XChainAddAccountCreateAttestation":46,"XChainAddClaimAttestation":45,"XChainClaim":43,"XChainCommit":42,"XChainCreateBridge":48,"XChainCreateClaimID":41,"XChainModifyBridge":47},"TYPES":{"AccountID":8,"Amount":6,"Blob":7,"Currency":26,"Done":-1,"Hash128":4,"Hash160":17,"Hash192":21,"Hash256":5,"Hash384":22,"Hash512":23,"Int32":10,"Int64":11,"Issue":24,"LedgerEntry":10002,"Metadata":10004,"NotPresent":0,"Number":9,"PathSet":18,"STArray":15,"STObject":14,"Transaction":10001,"UInt16":1,"UInt32":2,"UInt64":3,"UInt8":16,"UInt96":20,"Unknown":-2,"Validation":10003,"Vector256":19,"XChainBridge":25},"hash":"C685734F5FEB756693B4BB978BBB3A158A65652E71EEB2977068B0D680689213"}')},516681,(e,t,r)=>{"use strict";
2Object.defineProperty(r,"__esModule",{value:!0}),r.BytesLookup=r.Bytes=void 0;class i{constructor(e,t,r){this.name=e,this.ordinal=t,this.ordinalWidth=r,this.bytes=new Uint8Array(r);for(let e=0;e<r;e++)this.bytes[r-e-1]=t>>>8*e&255}toJSON(){return this.name}toBytesSink(e){e.put(this.bytes)}toBytes(){return this.bytes}}r.Bytes=i,r.BytesLookup=class{constructor(e,t){this.ordinalWidth=t,Object.entries(e).forEach(([e,t])=>{this.add(e,t)})}add(e,t){if(this[e])throw SyntaxError(`Attempted to add a value with a duplicate name "${e}". This is not allowed because it is unclear how to decode.`);if(this[t.toString()])throw SyntaxError(`Attempted to add a duplicate value under a different name (Given name: "${e}" and previous name: "${this[t.toString()]}. This is not allowed because it is unclear how to decode. 3Given value: ${t.toString()}`);this[e]=new i(e,t,this.ordinalWidth),this[t.toString()]=this[e]}from(e){return e instanceof i?e:this[e]}fromParser(e){return this.from(e.readUIntN(this.ordinalWidth).toString())}}},540908,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BinarySerializer=r.BytesList=void 0;let i=e.r(575280);class n{constructor(){this.bytesArray=[]}getLength(){return(0,i.concat)(this.bytesArray).byteLength}put(e){let t=Uint8Array.from(e);return this.bytesArray.push(t),this}toBytesSink(e){e.put(this.toBytes())}toBytes(){return(0,i.concat)(this.bytesArray)}toHex(){return(0,i.bytesToHex)(this.toBytes())}}r.BytesList=n,r.BinarySerializer=class{constructor(e){this.sink=new n,this.sink=e}write(e){e.toBytesSink(this.sink)}put(e){this.sink.put(e)}writeType(e,t){this.write(e.from(t))}writeBytesList(e){e.toBytesSink(this.sink)}encodeVariableLength(e){let t=new Uint8Array(3);if(e<=192)return t[0]=e,t.slice(0,1);if(e<=12480)return e-=193,t[0]=193+(e>>>8),t[1]=255&e,t.slice(0,2);if(e<=918744)return e-=12481,t[0]=241+(e>>>16),t[1]=e>>8&255,t[2]=255&e,t.slice(0,3);throw Error("Overflow error")}writeFieldAndValue(e,t,r=!1){let i=e.associatedType.from(t);if(void 0===i.toBytesSink||void 0===e.name)throw Error();this.sink.put(e.header),e.isVariableLengthEncoded?this.writeLengthEncoded(i,r):i.toBytesSink(this.sink)}writeLengthEncoded(e,t=!1){let r=new n;t||e.toBytesSink(r),this.put(this.encodeVariableLength(r.getLength())),this.writeBytesList(r)}}},808995,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Comparable=r.SerializedType=void 0;let i=e.r(540908),n=e.r(575280);class a{constructor(e){this.bytes=new Uint8Array(0),this.bytes=null!=e?e:new Uint8Array(0)}static fromParser(e,t){throw Error("fromParser not implemented")}static from(e){throw Error("from not implemented")}toBytesSink(e){e.put(this.bytes)}toHex(){return(0,n.bytesToHex)(this.toBytes())}toBytes(){if(this.bytes)return this.bytes;let e=new i.BytesList;return this.toBytesSink(e),e.toBytes()}toJSON(e,t){return this.toHex()}toString(){return this.toHex()}}r.SerializedType=a,r.Comparable=class extends a{lt(e){return 0>this.compareTo(e)}eq(e){return 0===this.compareTo(e)}gt(e){return this.compareTo(e)>0}gte(e){return this.compareTo(e)>-1}lte(e){return 1>this.compareTo(e)}compareTo(e){throw Error(`cannot compare ${this.toString()} and ${e.toString()}`)}}},993516,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.DELEGATABLE_PERMISSIONS_WIDTH=r.TRANSACTION_RESULT_WIDTH=r.TRANSACTION_TYPE_WIDTH=r.LEDGER_ENTRY_WIDTH=r.TYPE_WIDTH=void 0,r.TYPE_WIDTH=2,r.LEDGER_ENTRY_WIDTH=2,r.TRANSACTION_TYPE_WIDTH=2,r.TRANSACTION_RESULT_WIDTH=1,r.DELEGATABLE_PERMISSIONS_WIDTH=4},840770,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.FieldLookup=void 0;let i=e.r(516681),n=e.r(808995),a=e.r(993516);r.FieldLookup=class{constructor(e,t){e.forEach(([e,r])=>{let s=t[r.type];this[e]=function([e,t],r){var s;let o,l=(s=t.nth,o=[],r<16?s<16?o.push(r<<4|s):o.push(r<<4,s):s<16?o.push(s,r):o.push(0,r,s),Uint8Array.from(o));return{name:e,nth:t.nth,isVariableLengthEncoded:t.isVLEncoded,isSerialized:t.isSerialized,isSigningField:t.isSigningField,ordinal:r<<16|t.nth,type:new i.Bytes(t.type,r,a.TYPE_WIDTH),header:l,associatedType:n.SerializedType}}([e,r],s),this[this[e].ordinal.toString()]=this[e]})}fromString(e){return this[e]}}},11538,(e,t,r)=>{"use strict";
3Object.defineProperty(r,"__esModule",{value:!0}),r.BytesLookup=r.Bytes=r.FieldLookup=r.XrplDefinitionsBase=void 0;let i=e.r(516681);Object.defineProperty(r,"Bytes",{enumerable:!0,get:function(){return i.Bytes}}),Object.defineProperty(r,"BytesLookup",{enumerable:!0,get:function(){return i.BytesLookup}});let n=e.r(840770);Object.defineProperty(r,"FieldLookup",{enumerable:!0,get:function(){return n.FieldLookup}});let a=e.r(993516);r.XrplDefinitionsBase=class{constructor(e,t){this.type=new i.BytesLookup(e.TYPES,a.TYPE_WIDTH),this.ledgerEntryType=new i.BytesLookup(e.LEDGER_ENTRY_TYPES,a.LEDGER_ENTRY_WIDTH),this.transactionType=new i.BytesLookup(e.TRANSACTION_TYPES,a.TRANSACTION_TYPE_WIDTH),this.transactionResult=new i.BytesLookup(e.TRANSACTION_RESULTS,a.TRANSACTION_RESULT_WIDTH),this.field=new n.FieldLookup(e.FIELDS,e.TYPES),this.transactionNames=Object.entries(e.TRANSACTION_TYPES).filter(([e,t])=>t>=0).map(([e,t])=>e),this.dataTypes={},this.associateTypes(t),this.granularPermissions={TrustlineAuthorize:65537,TrustlineFreeze:65538,TrustlineUnfreeze:65539,AccountDomainSet:65540,AccountEmailHashSet:65541,AccountMessageKeySet:65542,AccountTransferRateSet:65543,AccountTickSizeSet:65544,PaymentMint:65545,PaymentBurn:65546,MPTokenIssuanceLock:65547,MPTokenIssuanceUnlock:65548};const r=Object.fromEntries(Object.entries(e.TRANSACTION_TYPES).map(([e,t])=>[e,t+1])),s=Object.assign(Object.assign({},this.granularPermissions),r);this.delegatablePermissions=new i.BytesLookup(s,a.DELEGATABLE_PERMISSIONS_WIDTH)}associateTypes(e){this.dataTypes=Object.assign({},this.dataTypes,e),Object.values(this.field).forEach(e=>{e.associatedType=this.dataTypes[e.type.name]}),this.field.TransactionType.associatedType=this.transactionType,this.field.TransactionResult.associatedType=this.transactionResult,this.field.LedgerEntryType.associatedType=this.ledgerEntryType,this.field.PermissionValue&&(this.field.PermissionValue.associatedType=this.delegatablePermissions)}getAssociatedTypes(){return this.dataTypes}}},88108,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.TRANSACTION_TYPES=r.TransactionType=r.TransactionResult=r.LedgerEntryType=r.Type=r.Field=r.DEFAULT_DEFINITIONS=r.XrplDefinitionsBase=r.Bytes=void 0;let n=i(e.r(342129)),a=e.r(11538);Object.defineProperty(r,"XrplDefinitionsBase",{enumerable:!0,get:function(){return a.XrplDefinitionsBase}}),Object.defineProperty(r,"Bytes",{enumerable:!0,get:function(){return a.Bytes}});let s=new a.XrplDefinitionsBase(n.default,{});r.DEFAULT_DEFINITIONS=s,r.Type=s.type,r.LedgerEntryType=s.ledgerEntryType,r.TransactionType=s.transactionType,r.TransactionResult=s.transactionResult,r.Field=s.field,r.TRANSACTION_TYPES=s.transactionNames},260927,(e,t,r)=>{"use strict";function i(e,t){if(e.byteLength!==t.byteLength)throw Error("Cannot compare arrays of different length");for(let r=0;r<e.length;r+=1){if(e[r]>t[r])return 1;if(e[r]<t[r])return -1}return 0}function n(e){return e.byteOffset%2==0&&e.byteLength%2==0}function a(e){return e.byteOffset%4==0&&e.byteLength%4==0}Object.defineProperty(r,"__esModule",{value:!0}),r.compare=r.equal=r.readInt64BE=r.readInt32BE=r.readUInt32BE=r.readUInt16BE=r.writeInt64BE=r.writeInt32BE=r.writeUInt32BE=r.writeUInt16BE=r.writeUInt8=void 0,r.writeUInt8=function(e,t,r){t=Number(t),e[r]=t},r.writeUInt16BE=function(e,t,r){t=Number(t),e[r]=t>>>8,e[r+1]=t},r.writeUInt32BE=function(e,t,r){e[r]=t>>>24&255,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=255&t},r.writeInt32BE=function(e,t,r){new DataView(e.buffer,e.byteOffset,e.byteLength).setInt32(r,t,!1)},r.writeInt64BE=function(e,t,r){new DataView(e.buffer,e.byteOffset,e.byteLength).setBigInt64(r,t,!1)},r.readUInt16BE=function(e,t){return new DataView(e.buffer).getUint16(t,!1).toString(10)},r.readUInt32BE=function(e,t){return new DataView(e.buffer).getUint32(t,!1).toString(10)},r.readInt32BE=function(e,t){return new DataView(e.buffer,e.byteOffset,e.byteLength).getInt32(t,!1)},r.readInt64BE=function(e,t){return new DataView(e.buffer,e.byteOffset,e.byteLength).getBigInt64(t,!1)},r.equal=function(e,t){var r,s,o,l,u,c;let d=e instanceof ArrayBuffer?new Uint8Array(e,0):e,f=t instanceof ArrayBuffer?new Uint8Array(t,0):t;return d.byteLength==f.byteLength&&(a(d)&&a(f)?0===(r=d,s=f,i(new Uint32Array(r.buffer,r.byteOffset,r.byteLength/4),new Uint32Array(s.buffer,s.byteOffset,s.byteLength/4))):n(d)&&n(f)?0===(o=d,l=f,i(new Uint16Array(o.buffer,o.byteOffset,o.byteLength/2),new Uint16Array(l.buffer,l.byteOffset,l.byteLength/2))):0===(u=d,c=f,i(new Uint8Array(u.buffer,u.byteOffset,u.byteLength),new Uint8Array(c.buffer,c.byteOffset,c.byteLength))))},r.compare=i},396410,(e,t,r)=>{"use strict";
3Object.defineProperty(r,"__esModule",{value:!0}),r.Hash=void 0;let i=e.r(808995),n=e.r(575280),a=e.r(260927);class s extends i.Comparable{constructor(e){if(super(e),this.bytes.length!==this.constructor.width)throw Error(`Invalid Hash length ${this.bytes.byteLength}`)}static from(e){if(e instanceof this)return e;if("string"==typeof e){if(!n.HEX_REGEX.test(e))throw Error(`Invalid hash string ${e}`);return new this((0,n.hexToBytes)(e))}throw Error("Cannot construct Hash from given value")}static fromParser(e,t){return new this(e.read(null!=t?t:this.width))}compareTo(e){return(0,a.compare)(this.bytes,this.constructor.from(e).bytes)}toString(){return this.toHex()}nibblet(e){let t=this.bytes[e>0?e/2|0:0];return e%2==0?t=(240&t)>>>4:t&=15,t}}r.Hash=s},481253,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Hash160=void 0;let i=e.r(396410);class n extends i.Hash{constructor(e){(null==e?void 0:e.byteLength)===0&&(e=n.ZERO_160.bytes),super(null!=e?e:n.ZERO_160.bytes)}}r.Hash160=n,n.width=20,n.ZERO_160=new n(new Uint8Array(n.width))},490133,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AccountID=void 0;let i=e.r(848924),n=e.r(481253),a=e.r(575280),s=/^[A-F0-9]{40}$/;class o extends n.Hash160{constructor(e){super(null!=e?e:o.defaultAccountID.bytes)}static from(e){if(e instanceof o)return e;if("string"==typeof e)return""===e?new o:s.test(e)?new o((0,a.hexToBytes)(e)):this.fromBase58(e);throw Error("Cannot construct AccountID from value given")}static fromBase58(e){if((0,i.isValidXAddress)(e)){let t=(0,i.xAddressToClassicAddress)(e);if(!1!==t.tag)throw Error("Only allowed to have tag on Account or Destination");e=t.classicAddress}return new o(Uint8Array.from((0,i.decodeAccountID)(e)))}toJSON(){return this.toBase58()}toBase58(){return(0,i.encodeAccountID)(this.bytes)}}r.AccountID=o,o.defaultAccountID=new o(new Uint8Array(20))},775620,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BinaryParser=void 0;let i=e.r(88108),n=e.r(575280);r.BinaryParser=class{constructor(e,t=i.DEFAULT_DEFINITIONS){this.bytes=(0,n.hexToBytes)(e),this.definitions=t}peek(){if(0===this.bytes.byteLength)throw Error();return this.bytes[0]}skip(e){if(e<0)throw Error(`skip: negative length ${e}`);if(e>this.bytes.byteLength)throw Error(`skip: requested ${e} bytes but only ${this.bytes.byteLength} available`);this.bytes=this.bytes.slice(e)}read(e){if(e<0)throw Error(`read: negative length ${e}`);if(e>this.bytes.byteLength)throw Error(`read: requested ${e} bytes but only ${this.bytes.byteLength} available`);let t=this.bytes.slice(0,e);return this.skip(e),t}readUIntN(e){if(0>=e||e>4)throw Error("invalid n");return this.read(e).reduce((e,t)=>e<<8|t)>>>0}readUInt8(){return this.readUIntN(1)}readUInt16(){return this.readUIntN(2)}readUInt32(){return this.readUIntN(4)}size(){return this.bytes.byteLength}end(e){let t=this.bytes.byteLength;return 0===t||void 0!==e&&t<=e}readVariableLength(){return this.read(this.readVariableLengthLength())}readVariableLengthLength(){let e=this.readUInt8();if(e<=192)return e;if(e<=240)return 193+(e-193)*256+this.readUInt8();if(e<=254)return 12481+(e-241)*65536+256*this.readUInt8()+this.readUInt8();throw Error("Invalid variable length indicator")}readFieldOrdinal(){let e=this.readUInt8(),t=15&e;if(0==(e>>=4)&&(0===(e=this.readUInt8())||e<16))throw Error(`Cannot read FieldOrdinal, type_code ${e} out of range`);if(0===t&&(0===(t=this.readUInt8())||t<16))throw Error(`Cannot read FieldOrdinal, field_code ${t} out of range`);return e<<16|t}readField(){return this.definitions.field.fromString(this.readFieldOrdinal().toString())}readType(e){return e.fromParser(this)}typeForField(e){return e.associatedType}readFieldValue(e){let t=this.typeForField(e);if(!t)throw Error(`unsupported: (${e.name}, ${e.type.name})`);let r=e.isVariableLengthEncoded?this.readVariableLengthLength():void 0,i=t.fromParser(this,r);if(void 0===i)throw Error(`fromParser for (${e.name}, ${e.type.name}) -> undefined `);return i}readFieldAndValue(){let e=this.readField();return[e,this.readFieldValue(e)]}}},761882,(e,t,r)=>{"use strict";
3Object.defineProperty(r,"__esModule",{value:!0}),r.Currency=void 0;let i=e.r(481253),n=e.r(575280),a=/^0{40}$/,s=/^[A-Z0-9a-z?!@#$%^&*(){}[\]|]{3}$/,o=/^[A-F0-9]{40}$/,l=/^0{24}[\x00-\x7F]{6}0{10}$/;class u extends i.Hash160{constructor(e){super(null!=e?e:u.XRP.bytes);const t=(0,n.bytesToHex)(this.bytes);a.test(t)?this._iso="XRP":l.test(t)?this._iso=function(e){let t=(0,n.hexToString)((0,n.bytesToHex)(e));return"XRP"===t?null:s.test(t)?t:null}(this.bytes.slice(12,15)):this._iso=null}iso(){return this._iso}static from(e){if(e instanceof u)return e;if("string"==typeof e)return new u(function(e){if(!function(e){return e instanceof Uint8Array?20===e.byteLength:3===e.length||o.test(e)}(e))throw Error(`Unsupported Currency representation: ${e}`);return 3===e.length?function(e){let t=new Uint8Array(20);if("XRP"!==e){let r=e.split("").map(e=>e.charCodeAt(0));t.set(r,12)}return t}(e):(0,n.hexToBytes)(e)}(e));throw Error("Cannot construct Currency from value given")}toJSON(){let e=this.iso();return null!==e?e:(0,n.bytesToHex)(this.bytes)}}
3r.Currency=u,u.XRP=new u(new Uint8Array(20))},966027,(e,t,r)=>{var i=function e(t){var r,i,m,y,v,b,w,_,A,S=B.prototype={constructor:B,toString:null,valueOf:null},E=new B(1),x=20,T=4,I=-7,k=21,O=-1e7,C=1e7,N=!1,P=1,D=0,R={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"Â ",suffix:""},$="0123456789abcdefghijklmnopqrstuvwxyz";function B(e,t){var r,i,a,s,l,u,c,d;if(!(this instanceof B))return new B(e,t);if(d=typeof e,null==t){if(U(e)){this.s=e.s,!e.c||e.e>C?this.c=this.e=null:e.e<O?this.c=[this.e=0]:(this.e=e.e,this.c=e.c.slice());return}if("number"==d){if(0*e!=0){this.s=isNaN(e)?null:e<0?-1:1,this.c=this.e=null;return}if(this.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,l=e;l>=10;l/=10,s++);s>C?this.c=this.e=null:(this.e=s,this.c=[e]);return}c=String(e)}else{if("string"==d){if(!n.test(c=e))return A(this,c)}else if("bigint"==d)c=String(e);else throw Error(o+"Invalid argument: "+e);this.s=45==c.charCodeAt(0)?(c=c.slice(1),-1):1}(s=c.indexOf("."))>-1&&(c=c.replace(".","")),(l=c.search(/e/i))>0?(s<0&&(s=l),s+=+c.slice(l+1),c=c.substring(0,l)):s<0&&(s=c.length)}else{if("string"!=d)throw Error(o+"String expected: "+e);for(f(t,2,$.length,"Base"),c=e,this.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1,r=$.slice(0,t),s=l=0,u=c.length;l<u;l++)if(0>r.indexOf(i=c.charAt(l))){if("."==i){if(l>s){s=u;continue}}else if(!a&&(c==c.toUpperCase()&&(c=c.toLowerCase())||c==c.toLowerCase()&&(c=c.toUpperCase()))){a=!0,l=-1,s=0;continue}return A(this,e,t)}(s=(c=_(c,t,10,this.s)).indexOf("."))>-1?c=c.replace(".",""):s=c.length}for(l=0;48===c.charCodeAt(l);l++);for(u=c.length;48===c.charCodeAt(--u););if(c=c.slice(l,++u))if(u-=l,(s=s-l-1)>C)this.c=this.e=null;else if(s<O)this.c=[this.e=0];else{if(this.e=s,this.c=[],l=(s+1)%14,s<0&&(l+=14),l<u){for(l&&this.c.push(+c.slice(0,l)),u-=14;l<u;)this.c.push(+c.slice(l,l+=14));l=14-(c=c.slice(l)).length}else l-=u;for(;l--;c+="0");this.c.push(+c)}else this.c=[this.e=0]}function L(e,t,r,i){var n,a,s,o,l;if(null==r?r=T:f(r,0,8),!e.c)return e.toString();if(n=e.c[0],s=e.e,null==t)l=c(e.c),l=1==i||2==i&&(s<=I||s>=k)?p(l,s):g(l,s,"0");else if(a=(e=j(new B(e),t,r)).e,o=(l=c(e.c)).length,1==i||2==i&&(t<=a||a<=I)){for(;o<t;l+="0",o++);l=p(l,a)}else if(t-=s+(2===i&&a>s),l=g(l,a,"0"),a+1>o){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=a-o)>0)for(a+1==o&&(l+=".");t--;l+="0");return e.s<0&&n?"-"+l:l}function U(e){return e instanceof B||!!e&&!0===e._isBigNumber}function F(e,t){for(var r,i,n=1,a=new B(e[0]);n<e.length;n++)(i=new B(e[n])).s&&(r=d(a,i))!==t&&(0!==r||a.s!==t)||(a=i);return a}function M(e,t,r){for(var i=1,n=t.length;!t[--n];t.pop());for(n=t[0];n>=10;n/=10,i++);return(r=i+14*r-1)>C?e.c=e.e=null:r<O?e.c=[e.e=0]:(e.e=r,e.c=t),e}function j(e,t,r,i){var n,o,u,c,d,f,h,p=e.c;if(p){e:{for(n=1,c=p[0];c>=10;c/=10,n++);if((o=t-n)<0)o+=14,u=t,h=s((d=p[f=0])/l[n-u-1]%10);else if((f=a((o+1)/14))>=p.length)if(i){for(;p.length<=f;p.push(0));d=h=0,n=1,o%=14,u=o-14+1}else break e;else{for(n=1,d=c=p[f];c>=10;c/=10,n++);o%=14,h=(u=o-14+n)<0?0:s(d/l[n-u-1]%10)}if(i=i||t<0||null!=p[f+1]||(u<0?d:d%l[n-u-1]),i=r<4?(h||i)&&(0==r||r==(e.s<0?3:2)):h>5||5==h&&(4==r||i||6==r&&(o>0?u>0?d/l[n-u]:0:p[f-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,i?(t-=e.e+1,p[0]=l[(14-t%14)%14],e.e=-t||0):p[0]=e.e=0,e;if(0==o?(p.length=f,c=1,f--):(p.length=f+1,c=l[14-o],p[f]=u>0?s(d/l[n-u]%l[u])*c:0),i)for(;;)if(0==f){for(o=1,u=p[0];u>=10;u/=10,o++);for(u=p[0]+=c,c=1;u>=10;u/=10,c++);o!=c&&(e.e++,1e14==p[0]&&(p[0]=1));break}else{if(p[f]+=c,1e14!=p[f])break;p[f--]=0,c=1}for(o=p.length;0===p[--o];p.pop());}e.e>C?e.c=e.e=null:e.e<O&&(e.c=[e.e=0])}return e}function z(e){var t,r=e.e;return null===r?e.toString():(t=c(e.c),t=r<=I||r>=k?p(t,r):g(t,r,"0"),e.s<0?"-"+t:t)}return B.clone=e,B.ROUND_UP=0,B.ROUND_DOWN=1,B.ROUND_CEIL=2,B.ROUND_FLOOR=3,B.ROUND_HALF_UP=4,B.ROUND_HALF_DOWN=5,B.ROUND_HALF_EVEN=6,B.ROUND_HALF_CEIL=7,B.ROUND_HALF_FLOOR=8,B.EUCLID=9,B.config=B.set=function(e){var t,r;if(null!=e)if("object"==typeof e){if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(f(r=e[t],0,1e9,t),x=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(f(r=e[t],0,8,t),T=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(f(r[0],-1e9,0,t),f(r[1],0,1e9,t),I=r[0],k=r[1]):(f(r,-1e9,1e9,t),I=-(k=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)f(r[0],-1e9,-1,t),f(r[1],1,1e9,t),O=r[0],C=r[1];else if(f(r,-1e9,1e9,t),r)O=-(C=r<0?-r:r);else throw Error(o+t+" cannot be zero: "+r);if(e.hasOwnProperty(t="CRYPTO"))if(!!(r=e[t])===r)if(r)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))N=r;else throw N=!r,Error(o+"crypto unavailable");else N=r;else throw Error(o+t+" not true or false: "+r);if(e.hasOwnProperty(t="MODULO_MODE")&&(f(r=e[t],0,9,t),P=r),e.hasOwnProperty(t="POW_PRECISION")&&(f(r=e[t],0,1e9,t),D=r),e.hasOwnProperty(t="FORMAT"))if("object"==typeof(r=e[t]))R=r;else throw Error(o+t+" not an object: "+r);if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\
3s]|(.).*\1/.test(r))throw Error(o+t+" invalid: "+r);$=r}}else throw Error(o+"Object expected: "+e);return{DECIMAL_PLACES:x,ROUNDING_MODE:T,EXPONENTIAL_AT:[I,k],RANGE:[O,C],CRYPTO:N,MODULO_MODE:P,POW_PRECISION:D,FORMAT:R,ALPHABET:$}},B.isBigNumber=function(e){if(!U(e))return!1;var t,r,i=e.c,n=e.e,a=e.s;if("[object Array]"!=({}).toString.call(i))return null===i&&null===n&&(null===a||1===a||-1===a);if(1!==a&&-1!==a||n<-1e9||n>1e9||n!==s(n))return!1;if(0===i[0])return 0===n&&1===i.length;if((t=(n+1)%14)<1&&(t+=14),String(i[0]).length!==t)return!1;for(t=0;t<i.length;t++)if((r=i[t])<0||r>=1e14||r!==s(r))return!1;return 0!==r},B.maximum=B.max=function(){return F(arguments,-1)},B.minimum=B.min=function(){return F(arguments,1)},r=0x20000000000000*Math.random()&2097151?function(){return s(0x20000000000000*Math.random())}:function(){return(0x40000000*Math.random()|0)*8388608+(8388608*Math.random()|0)},B.random=function(e){var t,i,n,u,c,d=0,h=[],p=new B(E);if(null==e?e=x:f(e,0,1e9),u=a(e/14),N)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(u*=2));d<u;)(c=131072*t[d]+(t[d+1]>>>11))>=9e15?(i=crypto.getRandomValues(new Uint32Array(2)),t[d]=i[0],t[d+1]=i[1]):(h.push(c%1e14),d+=2);d=u/2}else if(crypto.randomBytes){for(t=crypto.randomBytes(u*=7);d<u;)(c=(31&t[d])*0x1000000000000+0x10000000000*t[d+1]+0x100000000*t[d+2]+0x1000000*t[d+3]+(t[d+4]<<16)+(t[d+5]<<8)+t[d+6])>=9e15?crypto.randomBytes(7).copy(t,d):(h.push(c%1e14),d+=7);d=u/7}else throw N=!1,Error(o+"crypto unavailable");if(!N)for(;d<u;)(c=r())<9e15&&(h[d++]=c%1e14);for(u=h[--d],e%=14,u&&e&&(c=l[14-e],h[d]=s(u/c)*c);0===h[d];h.pop(),d--);if(d<0)h=[n=0];else{for(n=-1;0===h[0];h.splice(0,1),n-=14);for(d=1,c=h[0];c>=10;c/=10,d++);d<14&&(n-=14-d)}return p.e=n,p.c=h,p},B.sum=function(){for(var e=1,t=arguments,r=new B(t[0]);e<t.length;)r=r.plus(t[e++]);return r},_=function(){var e="0123456789";function t(e,t,r,i){for(var n,a,s=[0],o=0,l=e.length;o<l;){for(a=s.length;a--;s[a]*=t);for(s[0]+=i.indexOf(e.charAt(o++)),n=0;n<s.length;n++)s[n]>r-1&&(null==s[n+1]&&(s[n+1]=0),s[n+1]+=s[n]/r|0,s[n]%=r)}return s.reverse()}return function(r,i,n,a,s){var o,l,u,d,f,h,p,m,y=r.indexOf("."),v=x,b=T;for(y>=0&&(d=D,D=0,r=r.replace(".",""),h=(m=new B(i)).pow(r.length-y),D=d,m.c=t(g(c(h.c),h.e,"0"),10,n,e),m.e=m.c.length),u=d=(p=t(r,i,n,s?(o=$,e):(o=e,$))).length;0==p[--d];p.pop());if(!p[0])return o.charAt(0);if(y<0?--u:(h.c=p,h.e=u,h.s=a,p=(h=w(h,m,v,b,n)).c,f=h.r,u=h.e),y=p[l=u+v+1],d=n/2,f=f||l<0||null!=p[l+1],f=b<4?(null!=y||f)&&(0==b||b==(h.s<0?3:2)):y>d||y==d&&(4==b||f||6==b&&1&p[l-1]||b==(h.s<0?8:7)),l<1||!p[0])r=f?g(o.charAt(1),-v,o.charAt(0)):o.charAt(0);else{if(p.length=l,f)for(--n;++p[--l]>n;)p[l]=0,l||(++u,p=[1].concat(p));for(d=p.length;!p[--d];);for(y=0,r="";y<=d;r+=o.charAt(p[y++]));r=g(r,u,o.charAt(0))}return r}}(),w=function(){function e(e,t,r){var i,n,a,s,o=0,l=e.length,u=t%1e7,c=t/1e7|0;for(e=e.slice();l--;)i=c*(a=e[l]%1e7)+(s=e[l]/1e7|0)*u,o=((n=u*a+i%1e7*1e7+o)/r|0)+(i/1e7|0)+c*s,e[l]=n%r;return o&&(e=[o].concat(e)),e}function t(e,t,r,i){var n,a;if(r!=i)a=r>i?1:-1;else for(n=a=0;n<r;n++)if(e[n]!=t[n]){a=e[n]>t[n]?1:-1;break}return a}function r(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=+(e[r]<t[r]),e[r]=n*i+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(i,n,a,o,l){var c,d,f,h,p,g,m,y,v,b,w,_,A,S,E,x,T,I=i.s==n.s?1:-1,k=i.c,O=n.c;if(!k||!k[0]||!O||!O[0])return new B(!i.s||!n.s||(k?O&&k[0]==O[0]:!O)?NaN:k&&0==k[0]||!O?0*I:I/0);for(v=(y=new B(I)).c=[],I=a+(d=i.e-n.e)+1,l||(l=1e14,d=u(i.e/14)-u(n.e/14),I=I/14|0),f=0;O[f]==(k[f]||0);f++);if(O[f]>(k[f]||0)&&d--,I<0)v.push(1),h=!0;else{for(S=k.length,x=O.length,f=0,I+=2,(p=s(l/(O[0]+1)))>1&&(O=e(O,p,l),k=e(k,p,l),x=O.length,S=k.length),A=x,w=(b=k.slice(0,x)).length;w<x;b[w++]=0);T=[0].concat(T=O.slice()),E=O[0],O[1]>=l/2&&E++;do{if(p=0,(c=t(O,b,x,w))<0){if(_=b[0],x!=w&&(_=_*l+(b[1]||0)),(p=s(_/E))>1)for(p>=l&&(p=l-1),m=(g=e(O,p,l)).length,w=b.length;1==t(g,b,m,w);)p--,r(g,x<m?T:O,m,l),m=g.length,c=1;else 0==p&&(c=p=1),m=(g=O.slice()).length;if(m<w&&(g=[0].concat(g)),r(b,g,w,l),w=b.length,-1==c)for(;1>t(O,b,x,w);)p++,r(b,x<w?T:O,w,l),w=b.length}else 0===c&&(p++,b=[0]);v[f++]=p,b[0]?b[w++]=k[A]||0:(b=[k[A]],w=1)}while((A++<S||null!=b[0])&&I--)h=null!=b[0],v[0]||v.splice(0,1)}if(1e14==l){for(f=1,I=v[0];I>=10;I/=10,f++);j(y,a+(y.e=f+14*d-1)+1,o,h)}else y.e=d,y.r=+h;return y}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,m=/^([^.]+)\.$/,y=/^\.([^.]+)$/,v=/^-?(Infinity|NaN)$/,b=/^\s*\+(?=[\w.])|^\s+|\s+$/g,A=function(e,t,r){var n,a=t.replace(b,"");if(v.test(a)){e.s=isNaN(a)?null:a<0?-1:1,e.c=e.e=null;return}if(a=a.replace(i,function(e,t,i){return n="x"==(i=i.toLowerCase())?16:"b"==i?2:8,r&&r!=n?e:t}),r&&(n=r,a=a.replace(m,"$1").replace(y,"0.$1")),t!=a)return new B(a,n);throw Error(o+"Not a"+(r?" base "+r:"")+" number: "+t)},S.absoluteValue=S.abs=function(){var e=new B(this);return e.s<0&&(e.s=1),e},S.comparedTo=function(e,t){return d(this,new B(e,t))},S.decimalPlaces=S.dp=function(e,t){var r,i,n;if(null!=e)return f(e,0,1e9),null==t?t=T:f(t,0,8),j(new B(this),e+this.e+1,t);if(!(r=this.c))return null;if(i=((n=r.length-1)-u(this.e/14))*14,n=r[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},S.dividedBy=S.div=function(e,t){return w(this,new B(e,t),x,T)},S.dividedToIntegerBy=S.idiv=function(e,t){return w(this,new B(e,t),0,1)},S.exponentiatedBy=S.pow=function(e,t){var r,i,n,l,u,c,d,f,p,g=this;
3if((e=new B(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+z(e));if(null!=t&&(t=new B(t)),c=e.e>14,!g.c||!g.c[0]||1==g.c[0]&&!g.e&&1==g.c.length||!e.c||!e.c[0])return p=new B(Math.pow(+z(g),c?e.s*(2-h(e)):+z(e))),t?p.mod(t):p;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new B(NaN);(i=!d&&g.isInteger()&&t.isInteger())&&(g=g.mod(t))}else{if(e.e>9&&(g.e>0||g.e<-1||(0==g.e?g.c[0]>1||c&&g.c[1]>=24e7:g.c[0]<8e13||c&&g.c[0]<=9999975e7)))return l=g.s<0&&h(e)?-0:0,g.e>-1&&(l=1/l),new B(d?1/l:l);D&&(l=a(D/14+2))}for(c?(r=new B(.5),d&&(e.s=1),f=h(e)):f=(n=Math.abs(+z(e)))%2,p=new B(E);;){if(f){if(!(p=p.times(g)).c)break;l?p.c.length>l&&(p.c.length=l):i&&(p=p.mod(t))}if(n){if(0===(n=s(n/2)))break;f=n%2}else if(j(e=e.times(r),e.e+1,1),e.e>14)f=h(e);else{if(0==(n=+z(e)))break;f=n%2}g=g.times(g),l?g.c&&g.c.length>l&&(g.c.length=l):i&&(g=g.mod(t))}return i?p:(d&&(p=E.div(p)),t?p.mod(t):l?j(p,D,T,u):p)},S.integerValue=function(e){var t=new B(this);return null==e?e=T:f(e,0,8),j(t,t.e+1,e)},S.isEqualTo=S.eq=function(e,t){return 0===d(this,new B(e,t))},S.isFinite=function(){return!!this.c},S.isGreaterThan=S.gt=function(e,t){return d(this,new B(e,t))>0},S.isGreaterThanOrEqualTo=S.gte=function(e,t){return 1===(t=d(this,new B(e,t)))||0===t},S.isInteger=function(){return!!this.c&&u(this.e/14)>this.c.length-2},S.isLessThan=S.lt=function(e,t){return 0>d(this,new B(e,t))},S.isLessThanOrEqualTo=S.lte=function(e,t){return -1===(t=d(this,new B(e,t)))||0===t},S.isNaN=function(){return!this.s},S.isNegative=function(){return this.s<0},S.isPositive=function(){return this.s>0},S.isZero=function(){return!!this.c&&0==this.c[0]},S.minus=function(e,t){var r,i,n,a,s=this.s;if(t=(e=new B(e,t)).s,!s||!t)return new B(NaN);if(s!=t)return e.s=-t,this.plus(e);var o=this.e/14,l=e.e/14,c=this.c,d=e.c;if(!o||!l){if(!c||!d)return c?(e.s=-t,e):new B(d?this:NaN);if(!c[0]||!d[0])return d[0]?(e.s=-t,e):new B(c[0]?this:3==T?-0:0)}if(o=u(o),l=u(l),c=c.slice(),s=o-l){for((a=s<0)?(s=-s,n=c):(l=o,n=d),n.reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=c.length)<(t=d.length))?s:t,s=t=0;t<i;t++)if(c[t]!=d[t]){a=c[t]<d[t];break}if(a&&(n=c,c=d,d=n,e.s=-e.s),(t=(i=d.length)-(r=c.length))>0)for(;t--;c[r++]=0);for(t=1e14-1;i>s;){if(c[--i]<d[i]){for(r=i;r&&!c[--r];c[r]=t);--c[r],c[i]+=1e14}c[i]-=d[i]}for(;0==c[0];c.splice(0,1),--l);return c[0]?M(e,c,l):(e.s=3==T?-1:1,e.c=[e.e=0],e)},S.modulo=S.mod=function(e,t){var r,i;return(e=new B(e,t),this.c&&e.s&&(!e.c||e.c[0]))?e.c&&(!this.c||this.c[0])?(9==P?(i=e.s,e.s=1,r=w(this,e,0,3),e.s=i,r.s*=i):r=w(this,e,0,P),(e=this.minus(r.times(e))).c[0]||1!=P||(e.s=this.s),e):new B(this):new B(NaN)},S.multipliedBy=S.times=function(e,t){var r,i,n,a,s,o,l,c,d,f,h,p,g,m=this.c,y=(e=new B(e,t)).c;if(!m||!y||!m[0]||!y[0])return this.s&&e.s&&(!m||m[0]||y)&&(!y||y[0]||m)?(e.s*=this.s,m&&y?(e.c=[0],e.e=0):e.c=e.e=null):e.c=e.e=e.s=null,e;for(i=u(this.e/14)+u(e.e/14),e.s*=this.s,(l=m.length)<(f=y.length)&&(g=m,m=y,y=g,n=l,l=f,f=n),n=l+f,g=[];n--;g.push(0));for(n=f;--n>=0;){for(r=0,h=y[n]%1e7,p=y[n]/1e7|0,a=n+(s=l);a>n;)o=p*(c=m[--s]%1e7)+(d=m[s]/1e7|0)*h,r=((c=h*c+o%1e7*1e7+g[a]+r)/1e14|0)+(o/1e7|0)+p*d,g[a--]=c%1e14;g[a]=r}return r?++i:g.splice(0,1),M(e,g,i)},S.negated=function(){var e=new B(this);return e.s=-e.s||null,e},S.plus=function(e,t){var r,i=this.s;if(t=(e=new B(e,t)).s,!i||!t)return new B(NaN);if(i!=t)return e.s=-t,this.minus(e);var n=this.e/14,a=e.e/14,s=this.c,o=e.c;if(!n||!a){if(!s||!o)return new B(i/0);if(!s[0]||!o[0])return o[0]?e:new B(s[0]?this:0*i)}if(n=u(n),a=u(a),s=s.slice(),i=n-a){for(i>0?(a=n,r=o):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=o.length)<0&&(r=o,o=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+o[t]+i)/1e14|0,s[t]=1e14===s[t]?0:s[t]%1e14;return i&&(s=[i].concat(s),++a),M(e,s,a)},S.precision=S.sd=function(e,t){var r,i,n;if(null!=e&&!!e!==e)return f(e,1,1e9),null==t?t=T:f(t,0,8),j(new B(this),e,t);if(!(r=this.c))return null;if(i=14*(n=r.length-1)+1,n=r[n]){for(;n%10==0;n/=10,i--);for(n=r[0];n>=10;n/=10,i++);}return e&&this.e+1>i&&(i=this.e+1),i},S.shiftedBy=function(e){return f(e,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+e)},S.squareRoot=S.sqrt=function(){var e,t,r,i,n,a=this.c,s=this.s,o=this.e,l=x+4,d=new B("0.5");
3if(1!==s||!a||!a[0])return new B(!s||s<0&&(!a||a[0])?NaN:a?this:1/0);if(0==(s=Math.sqrt(+z(this)))||s==1/0?(((t=c(a)).length+o)%2==0&&(t+="0"),s=Math.sqrt(+t),o=u((o+1)/2)-(o<0||o%2),r=new B(t=s==1/0?"5e"+o:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+o)):r=new B(s+""),r.c[0]){for((s=(o=r.e)+l)<3&&(s=0);;)if(n=r,r=d.times(n.plus(w(this,n,l,1))),c(n.c).slice(0,s)===(t=c(r.c)).slice(0,s)){if(r.e<o&&--s,"9999"!=(t=t.slice(s-3,s+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(j(r,r.e+x+2,1),e=!r.times(r).eq(this));break}if(!i&&(j(n,n.e+x+2,0),n.times(n).eq(this))){r=n;break}l+=4,s+=4,i=1}}return j(r,r.e+x+1,T,e)},S.toExponential=function(e,t){return null!=e&&(f(e,0,1e9),e++),L(this,e,t,1)},S.toFixed=function(e,t){return null!=e&&(f(e,0,1e9),e=e+this.e+1),L(this,e,t)},S.toFormat=function(e,t,r){var i;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=R;else if("object"!=typeof r)throw Error(o+"Argument not an object: "+r);if(i=this.toFixed(e,t),this.c){var n,a=i.split("."),s=+r.groupSize,l=+r.secondaryGroupSize,u=r.groupSeparator||"",c=a[0],d=a[1],f=this.s<0,h=f?c.slice(1):c,p=h.length;if(l&&(n=s,s=l,l=n,p-=n),s>0&&p>0){for(n=p%s||s,c=h.substr(0,n);n<p;n+=s)c+=u+h.substr(n,s);l>0&&(c+=u+h.slice(n)),f&&(c="-"+c)}i=d?c+(r.decimalSeparator||"")+((l=+r.fractionGroupSize)?d.replace(RegExp("\\d{"+l+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):c}return(r.prefix||"")+i+(r.suffix||"")},S.toFraction=function(e){var t,r,i,n,a,s,u,d,f,h,p,g,m=this.c;if(null!=e&&(!(u=new B(e)).isInteger()&&(u.c||1!==u.s)||u.lt(E)))throw Error(o+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+z(u));if(!m)return new B(this);for(t=new B(E),f=r=new B(E),i=d=new B(E),g=c(m),a=t.e=g.length-this.e-1,t.c[0]=l[(s=a%14)<0?14+s:s],e=!e||u.comparedTo(t)>0?a>0?t:f:u,s=C,C=1/0,u=new B(g),d.c[0]=0;h=w(u,t,0,1),1!=(n=r.plus(h.times(i))).comparedTo(e);)r=i,i=n,f=d.plus(h.times(n=f)),d=n,t=u.minus(h.times(n=t)),u=n;return n=w(e.minus(r),i,0,1),d=d.plus(n.times(f)),r=r.plus(n.times(i)),d.s=f.s=this.s,a*=2,p=1>w(f,i,a,T).minus(this).abs().comparedTo(w(d,r,a,T).minus(this).abs())?[f,i]:[d,r],C=s,p},S.toNumber=function(){return+z(this)},S.toObject=function(){return{c:this.c?this.c.slice():null,e:this.e,s:this.s}},S.toPrecision=function(e,t){return null!=e&&f(e,1,1e9),L(this,e,t,2)},S.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=i<=I||i>=k?p(c(this.c),i):g(c(this.c),i,"0"):(f(e,2,$.length,"Base"),t=_(g(c(this.c),i,"0"),10,e,r,!0)),r<0&&this.c[0]&&(t="-"+t)),t},S.valueOf=S.toJSON=function(){return z(this)},S._isBigNumber=!0,null!=t&&B.set(t),B}(),n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,s=Math.floor,o="[BigNumber Error] ",l=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13];function u(e){var t=0|e;return e>0||e===t?t:t-1}function c(e){for(var t,r,i=1,n=e.length,a=e[0]+"";i<n;){for(r=14-(t=e[i++]+"").length;r--;t="0"+t);a+=t}for(n=a.length;48===a.charCodeAt(--n););return a.slice(0,n+1||1)}function d(e,t){var r,i,n=e.c,a=t.c,s=e.s,o=t.s,l=e.e,u=t.e;if(!s||!o)return null;if(r=n&&!n[0],i=a&&!a[0],r||i)return r?i?0:-o:s;
3if(s!=o)return s;if(r=s<0,i=l==u,!n||!a)return i?0:!n^r?1:-1;if(!i)return l>u^r?1:-1;for(s=0,o=(l=n.length)<(u=a.length)?l:u;s<o;s++)if(n[s]!=a[s])return n[s]>a[s]^r?1:-1;return l==u?0:l>u^r?1:-1}function f(e,t,r,i){if(e<t||e>r||e!==s(e))throw Error(o+(i||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function h(e){var t=e.c.length-1;return u(e.e/14)==t&&e.c[t]%2!=0}function p(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function g(e,t,r){var i,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(i=e.length,++t>i){for(n=r,t-=i;--t;n+=r);e+=n}else t<i&&(e=e.slice(0,t)+"."+e.slice(t));return e}i.default=i.BigNumber=i,t.exports=i},84908,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Hash192=void 0;let i=e.r(396410);class n extends i.Hash{constructor(e){(null==e?void 0:e.byteLength)===0&&(e=n.ZERO_192.bytes),super(null!=e?e:n.ZERO_192.bytes)}}r.Hash192=n,n.width=24,n.ZERO_192=new n(new Uint8Array(n.width))},424293,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.Amount=void 0;let n=e.r(775620),a=e.r(490133),s=e.r(761882),o=e.r(808995),l=i(e.r(966027)),u=e.r(575280),c=e.r(260927),d=e.r(84908),f=new l.default("1e17"),h=new l.default("1e-6"),p=BigInt(0xffffffff),g=BigInt(0x8000000000000000);l.default.config({EXPONENTIAL_AT:[-112,96]});class m extends o.SerializedType{constructor(e){super(null!=e?e:m.defaultAmount.bytes)}static from(e){let t,r;if(e instanceof m)return e;let i=new Uint8Array(8);if("string"==typeof e){m.assertXrpIsValid(e);let t=BigInt(e),r=[new Uint8Array(4),new Uint8Array(4)];return(0,c.writeUInt32BE)(r[0],Number(t>>BigInt(32)),0),(0,c.writeUInt32BE)(r[1],Number(t&BigInt(p)),0),i=(0,u.concat)(r),i[0]|=64,new m(i)}if(3===(t=Object.keys(e).sort()).length&&"currency"===t[0]&&"issuer"===t[1]&&"value"===t[2]){let t;try{t=new l.default(e.value)}catch(t){throw Error(`${e.value} is an illegal amount`)}if(m.assertIouIsValid(t),t.isZero())i[0]|=128;else{let e=BigInt(t.times(`1e${-((t.e||0)-15)}`).abs().toString()),r=[new Uint8Array(4),new Uint8Array(4)];(0,c.writeUInt32BE)(r[0],Number(e>>BigInt(32)),0),(0,c.writeUInt32BE)(r[1],Number(e&BigInt(p)),0),i=(0,u.concat)(r),i[0]|=128,t.gt(new l.default(0))&&(i[0]|=64);let n=97+((t.e||0)-15);i[0]|=n>>>2,i[1]|=(3&n)<<6}let r=s.Currency.from(e.currency).toBytes(),n=a.AccountID.from(e.issuer).toBytes();return new m((0,u.concat)([i,r,n]))}if(2===(r=Object.keys(e).sort()).length&&"mpt_issuance_id"===r[0]&&"value"===r[1]){m.assertMptIsValid(e.value);let t=new Uint8Array(1);t[0]|=96;let r=BigInt(e.value),n=[new Uint8Array(4),new Uint8Array(4)];(0,c.writeUInt32BE)(n[0],Number(r>>BigInt(32)),0),(0,c.writeUInt32BE)(n[1],Number(r&BigInt(p)),0),i=(0,u.concat)(n);let a=d.Hash192.from(e.mpt_issuance_id).toBytes();return new m((0,u.concat)([t,i,a]))}throw Error("Invalid type to construct an Amount")}static fromParser(e){if(128&e.peek())return new m(e.read(48));let t=32&e.peek();return new m(e.read(t?33:8))}toJSON(){if(this.isNative()){let e=this.bytes.slice(),t=64&e[0];e[0]&=63;let r=BigInt((0,c.readUInt32BE)(e.slice(0,4),0)),i=BigInt((0,c.readUInt32BE)(e.slice(4),0)),n=r<<BigInt(32)|i;return`${t?"":"-"}${n.toString()}`}if(this.isIOU()){let e=new n.BinaryParser(this.toString()),t=e.read(8),r=s.Currency.fromParser(e),i=a.AccountID.fromParser(e),o=t[0],c=t[1];t[0]=0,t[1]&=63;let d=new l.default(`${64&o?"":"-"}0x${(0,u.bytesToHex)(t)}`).times(`1e${((63&o)<<2)+((255&c)>>6)-97}`);return m.assertIouIsValid(d),{value:d.toString(),currency:r.toJSON(),issuer:i.toJSON()}}if(this.isMPT()){let e=new n.BinaryParser(this.toString()),t=e.read(1),r=e.read(8),i=d.Hash192.fromParser(e),a=64&t[0],s=BigInt((0,c.readUInt32BE)(r.slice(0,4),0)),o=BigInt((0,c.readUInt32BE)(r.slice(4),0)),l=s<<BigInt(32)|o;return{value:`${a?"":"-"}${l.toString()}`,mpt_issuance_id:i.toString()}}throw Error("Invalid amount to construct JSON")}static assertXrpIsValid(e){let t;if(-1!==e.indexOf("."))throw Error(`${e.toString()} is an illegal amount`);try{t=new l.default(e)}catch(t){throw Error(`${e.toString()} is an illegal amount`)}if(!t.isZero()&&(t.lt(h)||t.gt(f)))throw Error(`${e.toString()} is an illegal amount`)}static assertIouIsValid(e){if(!e.isZero()){let t=e.precision(),r=(e.e||0)-15;if(t>16||r>80||r<-96)throw Error("Decimal precision out of range");this.verifyNoDecimal(e)}}static assertMptIsValid(e){let t;if(-1!==e.indexOf("."))throw Error(`${e.toString()} is an illegal amount`);try{t=new l.default(e)}catch(t){throw Error(`${e.toString()} is an illegal amount`)}if(!t.isZero()&&(t<(0,l.default)(0)||0!=Number(BigInt(e)&BigInt(g))))throw Error(`${e.toString()} is an illegal amount`)}static verifyNoDecimal(e){if(-1!==e.times(`1e${-((e.e||0)-15)}`).abs().toString().indexOf("."))throw Error("Decimal place found in integerNumberString")}isNative(){return(128&this.bytes[0])==0&&(32&this.bytes[0])==0}isMPT(){return(128&this.bytes[0])==0&&(32&this.bytes[0])!=0}isIOU(){return(128&this.bytes[0])!=0}}r.Amount=m,m.defaultAmount=new m((0,u.hexToBytes)("4000000000000000"))},890874,(e,t,r)=>{"use strict";
3Object.defineProperty(r,"__esModule",{value:!0}),r.Blob=void 0;let i=e.r(808995),n=e.r(575280);class a extends i.SerializedType{constructor(e){super(e)}static fromParser(e,t){return new a(e.read(t))}static from(e){if(e instanceof a)return e;if("string"==typeof e){if(!/^[A-F0-9]*$/iu.test(e))throw Error("Cannot construct Blob from a non-hex string");return new a((0,n.hexToBytes)(e))}throw Error("Cannot construct Blob from value given")}}r.Blob=a},208393,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Hash128=void 0;let i=e.r(396410),n=e.r(575280);class a extends i.Hash{constructor(e){(null==e?void 0:e.byteLength)===0&&(e=a.ZERO_128.bytes),super(null!=e?e:a.ZERO_128.bytes)}toHex(){let e=(0,n.bytesToHex)(this.toBytes());return/^0+$/.exec(e)?"":e}}r.Hash128=a,a.width=16,a.ZERO_128=new a(new Uint8Array(a.width))},475099,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Hash256=void 0;let i=e.r(396410);class n extends i.Hash{constructor(e){super(null!=e?e:n.ZERO_256.bytes)}}r.Hash256=n,n.width=32,n.ZERO_256=new n(new Uint8Array(n.width))},112219,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Int=void 0;let i=e.r(808995);class n extends i.Comparable{constructor(e){super(e)}compareTo(e){var t,r;return(t=this.valueOf())<(r=e.valueOf())?-1:+(t!=r)}toJSON(){let e=this.valueOf();return"number"==typeof e?e:e.toString()}static checkIntRange(e,t,r,i){if(t<r||t>i)throw Error(`Invalid ${e}: ${t} must be >= ${r} and <= ${i}`)}}r.Int=n},474323,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Int32=void 0;let i=e.r(112219),n=e.r(260927);class a extends i.Int{constructor(e){super(null!=e?e:a.defaultInt32.bytes)}static fromParser(e){return new a(e.read(a.width))}static from(e){if(e instanceof a)return e;let t=new Uint8Array(a.width);if("string"==typeof e){let r=Number(e);if(!Number.isFinite(r)||!Number.isInteger(r))throw Error(`Cannot construct Int32 from string: ${e}`);return a.checkIntRange("Int32",r,a.MIN_VALUE,a.MAX_VALUE),(0,n.writeInt32BE)(t,r,0),new a(t)}if("number"==typeof e&&Number.isInteger(e))return a.checkIntRange("Int32",e,a.MIN_VALUE,a.MAX_VALUE),(0,n.writeInt32BE)(t,e,0),new a(t);throw Error("Cannot construct Int32 from given value")}valueOf(){return(0,n.readInt32BE)(this.bytes,0)}}r.Int32=a,a.width=4,a.defaultInt32=new a(new Uint8Array(a.width)),a.MIN_VALUE=-0x80000000,a.MAX_VALUE=0x7fffffff},222417,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Issue=void 0;let i=e.r(575280),n=e.r(775620),a=e.r(490133),s=e.r(761882),o=e.r(808995),l=e.r(84908),u=e.r(260927),c=a.AccountID.from("0000000000000000000000000000000000000001");class d extends o.SerializedType{constructor(e){super(null!=e?e:d.XRP_ISSUE.bytes)}static from(e){let t,r,n,o;if(e instanceof d)return e;if(r=1===(t=Object.keys(e).sort()).length&&"currency"===t[0],n=2===t.length&&"currency"===t[0]&&"issuer"===t[1],o=1===t.length&&"mpt_issuance_id"===t[0],r||n||o){if(e.currency){let t=s.Currency.from(e.currency.toString()).toBytes();if(e.issuer){let r=a.AccountID.from(e.issuer.toString()).toBytes();return new d((0,i.concat)([t,r]))}return new d(t)}if(e.mpt_issuance_id){let t=l.Hash192.from(e.mpt_issuance_id.toString()).toBytes(),r=t.slice(4),n=Number((0,u.readUInt32BE)(t.slice(0,4),0)),a=new Uint8Array(4);return new DataView(a.buffer).setUint32(0,n,!0),new d((0,i.concat)([r,c.toBytes(),a]))}}throw Error("Invalid type to construct an Issue")}static fromParser(e){let t=e.read(20);if("XRP"===new s.Currency(t).toJSON())return new d(t);let r=new a.AccountID(e.read(20));if(c.toHex()===r.toHex()){let r=e.read(4);return new d((0,i.concat)([t,c.toBytes(),r]))}return new d((0,i.concat)([t,r.toBytes()]))}toJSON(){if(44===this.toBytes().length){let e=this.toBytes().slice(0,20),t=new DataView(this.toBytes().slice(40).buffer).getUint32(0,!0),r=new Uint8Array(4);return(0,u.writeUInt32BE)(r,t,0),{mpt_issuance_id:(0,i.bytesToHex)((0,i.concat)([r,e]))}}let e=new n.BinaryParser(this.toString()),t=s.Currency.fromParser(e);if("XRP"===t.toJSON())return{currency:t.toJSON()};let r=a.AccountID.fromParser(e);return{currency:t.toJSON(),issuer:r.toJSON()}}}r.Issue=d,d.XRP_ISSUE=new d(new Uint8Array(20))},632602,(e,t,r)=>{"use strict";
3Object.defineProperty(r,"__esModule",{value:!0}),r.STNumber=void 0;let i=e.r(808995),n=e.r(260927),a=BigInt("1000000000000000000"),s=BigInt("9999999999999999999"),o=BigInt("9223372036854775807");class l extends i.SerializedType{constructor(e){const t=null!=e?e:l.defaultBytes;if(!(t instanceof Uint8Array)||12!==t.length)throw Error(`STNumber must be constructed from a 12-byte Uint8Array, got ${null==t?void 0:t.length}`);super(t)}static from(e){if(e instanceof l)return e;if("string"==typeof e)return l.fromValue(e);throw Error("STNumber.from: Only string or STNumber instance is supported")}static fromValue(e){let{mantissa:t,exponent:r}=function(e){let t=/^([-+]?)([0-9]+)(?:\.([0-9]+))?(?:[eE]([+-]?[0-9]+))?$/.exec(e);if(!t)throw Error(`Unable to parse number from string: ${e}`);let[,r,i,n,a]=t,s=i.replace(/^0+(?=\d)/,"")||"0",o=0;for(n&&(s+=n,o-=n.length),a&&(o+=parseInt(a,10));s.length>1&&s.endsWith("0");)s=s.slice(0,-1),o+=1;let l=BigInt(s);"-"===r&&(l=-l);let u=l<BigInt(0);return{mantissa:l,exponent:o,isNegative:u}}(e),{mantissa:i,exponent:u}=function(e,t){let r=e<BigInt(0)?-e:e,i=e<BigInt(0);if(r===BigInt(0))return{mantissa:BigInt(0),exponent:-0x80000000};for(;r<a&&t>-32768;)t-=1,r*=BigInt(10);let n=null;for(;r>s;){if(t>=32768)throw Error("Mantissa and exponent are too large");t+=1,n=r%BigInt(10),r/=BigInt(10)}if(t<-32768||r<a)throw Error("Underflow: value too small to represent");if(t>32768)throw Error("Exponent overflow: value too large to represent");if(r>o){if(t>=32768)throw Error("Exponent overflow: value too large to represent");t+=1,n=r%BigInt(10),r/=BigInt(10)}if(null!=n&&n>=BigInt(5)&&(r+=BigInt(1))>o){if(t>=32768)throw Error("Exponent overflow: value too large to represent");n=r%BigInt(10),t+=1,r/=BigInt(10),n>=BigInt(5)&&(r+=BigInt(1))}return i&&(r=-r),{mantissa:r,exponent:t}}(t,r),c=new Uint8Array(12);return(0,n.writeInt64BE)(c,i,0),(0,n.writeInt32BE)(c,u,8),new l(c)}static fromParser(e){return new l(e.read(12))}toJSON(){let e=this.bytes;if(!e||(null==e?void 0:e.length)!==12)throw Error("STNumber internal bytes not set or wrong length");let t=(0,n.readInt64BE)(e,0),r=(0,n.readInt32BE)(e,8);if(t===BigInt(0)&&-0x80000000===r)return"0";let i=t<BigInt(0),s=i?-t:t;if(s!==BigInt(0)&&s<a&&(s*=BigInt(10),r-=1),0!==r&&(r<-28||r>-8)){let e=r;for(;s!==BigInt(0)&&s%BigInt(10)===BigInt(0)&&e<32768;)s/=BigInt(10),e+=1;return`${i?"-":""}${s}e${e}`}let o=s.toString(),l="0".repeat(30)+o+"0".repeat(26),u=r+30+18+1,c=l.slice(0,u).replace(/^0+/,"")||"0",d=l.slice(u).replace(/0+$/,"");return`${i?"-":""}${c}${d?"."+d:""}`}}r.STNumber=l,l.defaultBytes=new Uint8Array(12)},944175,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.PathSet=void 0;let i=e.r(490133),n=e.r(761882),a=e.r(775620),s=e.r(808995),o=e.r(575280);class l extends s.SerializedType{static from(e){if(e instanceof l)return e;let t=[Uint8Array.from([0])];return e.account&&(t.push(i.AccountID.from(e.account).toBytes()),t[0][0]|=1),e.currency&&(t.push(n.Currency.from(e.currency).toBytes()),t[0][0]|=16),e.issuer&&(t.push(i.AccountID.from(e.issuer).toBytes()),t[0][0]|=32),new l((0,o.concat)(t))}static fromParser(e){let t=e.readUInt8(),r=[Uint8Array.from([t])];return 1&t&&r.push(e.read(i.AccountID.width)),16&t&&r.push(e.read(n.Currency.width)),32&t&&r.push(e.read(i.AccountID.width)),new l((0,o.concat)(r))}toJSON(){let e,t,r,s=new a.BinaryParser((0,o.bytesToHex)(this.bytes)),l=s.readUInt8();1&l&&(e=i.AccountID.fromParser(s).toJSON()),16&l&&(t=n.Currency.fromParser(s).toJSON()),32&l&&(r=i.AccountID.fromParser(s).toJSON());let u={};return e&&(u.account=e),r&&(u.issuer=r),t&&(u.currency=t),u}type(){return this.bytes[0]}}class u extends s.SerializedType{static from(e){if(e instanceof u)return e;let t=[];return e.forEach(e=>{t.push(l.from(e).toBytes())}),new u((0,o.concat)(t))}static fromParser(e){let t=[];for(;!e.end()&&(t.push(l.fromParser(e).toBytes()),0!==e.peek()&&255!==e.peek()););return new u((0,o.concat)(t))}toJSON(){let e=[],t=new a.BinaryParser(this.toString());for(;!t.end();)e.push(l.fromParser(t).toJSON());return e}}class c extends s.SerializedType{static from(e){var t;if(e instanceof c)return e;if(Array.isArray(e)&&0===e.length||Array.isArray(e)&&Array.isArray(e[0])&&0===e[0].length||Array.isArray(e)&&Array.isArray(e[0])&&(void 0!==(t=e[0][0]).issuer||void 0!==t.account||void 0!==t.currency)){let t=[];
3return e.forEach(e=>{t.push(u.from(e).toBytes()),t.push(Uint8Array.from([255]))}),t[t.length-1]=Uint8Array.from([0]),new c((0,o.concat)(t))}throw Error("Cannot construct PathSet from given value")}static fromParser(e){let t=[];for(;!e.end()&&(t.push(u.fromParser(e).toBytes()),t.push(e.read(1)),0!=t[t.length-1][0]););return new c((0,o.concat)(t))}toJSON(){let e=[],t=new a.BinaryParser(this.toString());for(;!t.end();)e.push(u.fromParser(t).toJSON()),t.skip(1);return e}}r.PathSet=c},306771,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.UInt=void 0;let i=e.r(808995);class n extends i.Comparable{constructor(e){super(e)}compareTo(e){var t,r;return(t=this.valueOf())<(r=e.valueOf())?-1:+(t!=r)}toJSON(){let e=this.valueOf();return"number"==typeof e?e:e.toString()}static checkUintRange(e,t,r){if(e<t||e>r)throw Error(`Invalid ${this.constructor.name}: ${e} must be >= ${t} and <= ${r}`)}}r.UInt=n},996957,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.UInt64=void 0;let i=e.r(306771),n=e.r(575280),a=e.r(260927),s=e.r(88108),o=/^[a-fA-F0-9]{1,16}$/,l=/^[0-9]{1,20}$/,u=BigInt(0xffffffff),c=new Set(["MaximumAmount","OutstandingAmount","MPTAmount","LockedAmount"]);class d extends i.UInt{constructor(e){super(null!=e?e:d.defaultUInt64.bytes)}static fromParser(e){return new d(e.read(d.width))}static from(e,t=""){if(e instanceof d)return e;new Uint8Array(d.width);if("number"==typeof e&&Number.isInteger(e)){if(e<0)throw Error("value must be an unsigned integer");let t=BigInt(e),r=[new Uint8Array(4),new Uint8Array(4)];return(0,a.writeUInt32BE)(r[0],Number(t>>BigInt(32)),0),(0,a.writeUInt32BE)(r[1],Number(t&BigInt(u)),0),new d((0,n.concat)(r))}if("string"==typeof e){if(c.has(t)){if(!l.test(e))throw Error(`${t} ${e}
3 is not a valid base 10 string`);e=BigInt(e).toString(16)}if("string"==typeof e&&!o.test(e))throw Error(`${e} is not a valid hex-string`);let r=e.padStart(16,"0");return new d((0,n.hexToBytes)(r))}if("bigint"==typeof e){let t=[new Uint8Array(4),new Uint8Array(4)];return(0,a.writeUInt32BE)(t[0],Number(Number(e>>BigInt(32))),0),(0,a.writeUInt32BE)(t[1],Number(e&BigInt(u)),0),new d((0,n.concat)(t))}throw Error("Cannot construct UInt64 from given value")}toJSON(e=s.DEFAULT_DEFINITIONS,t=""){let r=(0,n.bytesToHex)(this.bytes);return c.has(t)?BigInt("0x"+r).toString(10):r}valueOf(){let e=BigInt((0,a.readUInt32BE)(this.bytes.slice(0,4),0)),t=BigInt((0,a.readUInt32BE)(this.bytes.slice(4),0));return e<<BigInt(32)|t}toBytes(){return this.bytes}}r.UInt64=d,d.width=8,d.defaultUInt64=new d(new Uint8Array(d.width))},842484,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.STObject=void 0;let i=e.r(88108),n=e.r(808995),a=e.r(848924),s=e.r(775620),o=e.r(540908),l=e.r(808042),u=e.r(996957),c=Uint8Array.from([225]),d="ObjectEndMarker",f="STObject",h="SourceTag",p="DestinationTag";class g extends n.SerializedType{static fromParser(e){let t=new o.BytesList,r=new o.BinarySerializer(t);for(;!e.end();){let t=e.readField();if(t.name===d)break;let i=e.readFieldValue(t);r.writeFieldAndValue(t,i),t.type.name===f&&r.put(c)}return new g(t.toBytes())}static from(e,t,r=i.DEFAULT_DEFINITIONS){if(e instanceof g)return e;let n=new o.BytesList,s=new o.BinarySerializer(n),d=!1,m=Object.entries(e).reduce((t,[r,i])=>{let n;if(i&&(0,a.isValidXAddress)(i.toString())){var s=n=function(e,t){let r,i=(0,a.xAddressToClassicAddress)(t);if("Destination"===e)r=p;else if("Account"===e)r=h;else if(!1!==i.tag)throw Error(`${e} cannot have an associated tag`);return!1!==i.tag?{[e]:i.classicAddress,[r]:i.tag}:{[e]:i.classicAddress}}(r,i.toString());if(void 0!==s[h]&&void 0!==e[h])throw Error("Cannot have Account X-Address and SourceTag");if(void 0!==s[p]&&void 0!==e[p])throw Error("Cannot have Destination X-Address and DestinationTag")}return Object.assign(t,null!=n?n:{[r]:i})},{}),y=Object.keys(m).map(e=>{if(!(e in r.field)){if(e[0]===e[0].toLowerCase())return;throw Error(`Field ${e} is not defined in the definitions`)}return r.field[e]}).filter(function(e){return void 0!==e&&void 0!==m[e.name]&&e.isSerialized}).sort((e,t)=>e.ordinal-t.ordinal);return void 0!==t&&(y=y.filter(t)),y.forEach(e=>{let t=e.type.name===f?this.from(m[e.name],void 0,r):"STArray"===e.type.name?l.STArray.from(m[e.name],r):"UInt64"===e.type.name?u.UInt64.from(m[e.name],e.name):e.associatedType.from(m[e.name]);if(void 0==t)throw TypeError(`Unable to interpret "${e.name}: ${m[e.name]}".`);"UNLModify"===t.name&&(d=!0);let i="Account"==e.name&&d;s.writeFieldAndValue(e,t,i),e.type.name===f&&s.put(c)}),new g(n.toBytes())}toJSON(e){let t=new s.BinaryParser(this.toString(),e),r={};for(;!t.end();){let i=t.readField();if(i.name===d)break;r[i.name]=t.readFieldValue(i).toJSON(e,i.name)}return r}}r.STObject=g},808042,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.STArray=void 0;let i=e.r(88108),n=e.r(808995),a=e.r(842484),s=e.r(775620),o=e.r(575280),l=Uint8Array.from([241]),u="ArrayEndMarker",c=Uint8Array.from([225]);class d extends n.SerializedType{static fromParser(e){let t=[];for(;!e.end();){let r=e.readField();if(r.name===u)break;t.push(r.header,e.readFieldValue(r).toBytes(),c)}return t.push(l),new d((0,o.concat)(t))}static from(e,t=i.DEFAULT_DEFINITIONS){if(e instanceof d)return e;if(Array.isArray(e)&&e.every(e=>"object"==typeof e&&1===Object.keys(e).length&&"object"==typeof Object.values(e)[0])){let r=[];return e.forEach(e=>{r.push(a.STObject.from(e,void 0,t).toBytes())}),r.push(l),new d((0,o.concat)(r))}throw Error("Cannot construct STArray from value given")}toJSON(e=i.DEFAULT_DEFINITIONS){let t=[],r=new s.BinaryParser(this.toString(),e);for(;!r.end();){let i=r.readField();if(i.name===u)break;let n={};n[i.name]=a.STObject.fromParser(r).toJSON(e),t.push(n)}return t}}r.STArray=d},146963,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.UInt16=void 0;let i=e.r(306771),n=e.r(260927);class a extends i.UInt{constructor(e){super(null!=e?e:a.defaultUInt16.bytes)}static fromParser(e){return new a(e.read(a.width))}static from(e){if(e instanceof a)return e;if("number"==typeof e&&Number.isInteger(e)){a.checkUintRange(e,0,65535);let t=new Uint8Array(a.width);return(0,n.writeUInt16BE)(t,e,0),new a(t)}throw Error("Cannot construct UInt16 from given value")}
3valueOf(){return parseInt((0,n.readUInt16BE)(this.bytes,0))}}r.UInt16=a,a.width=2,a.defaultUInt16=new a(new Uint8Array(a.width))},512941,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.UInt32=void 0;let i=e.r(306771),n=e.r(260927);class a extends i.UInt{constructor(e){super(null!=e?e:a.defaultUInt32.bytes)}static fromParser(e){return new a(e.read(a.width))}static from(e){if(e instanceof a)return e;let t=new Uint8Array(a.width);if("string"==typeof e){let r=Number.parseInt(e);return(0,n.writeUInt32BE)(t,r,0),new a(t)}if("number"==typeof e&&Number.isInteger(e))return a.checkUintRange(e,0,0xffffffff),(0,n.writeUInt32BE)(t,e,0),new a(t);throw Error("Cannot construct UInt32 from given value")}valueOf(){return parseInt((0,n.readUInt32BE)(this.bytes,0),10)}}r.UInt32=a,a.width=4,a.defaultUInt32=new a(new Uint8Array(a.width))},512606,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.UInt8=void 0;let i=e.r(306771),n=e.r(575280),a=e.r(260927);class s extends i.UInt{constructor(e){super(null!=e?e:s.defaultUInt8.bytes)}static fromParser(e){return new s(e.read(s.width))}static from(e){if(e instanceof s)return e;if("number"==typeof e&&Number.isInteger(e)){s.checkUintRange(e,0,255);let t=new Uint8Array(s.width);return(0,a.writeUInt8)(t,e,0),new s(t)}throw Error("Cannot construct UInt8 from given value")}valueOf(){return parseInt((0,n.bytesToHex)(this.bytes),16)}}r.UInt8=s,s.width=1,s.defaultUInt8=new s(new Uint8Array(s.width))},24853,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Vector256=void 0;let i=e.r(808995),n=e.r(475099),a=e.r(540908),s=e.r(575280);class o extends i.SerializedType{constructor(e){super(e)}static fromParser(e,t){let r=new a.BytesList,i=(null!=t?t:e.size())/32;for(let t=0;t<i;t++)n.Hash256.fromParser(e).toBytesSink(r);return new o(r.toBytes())}static from(e){if(e instanceof o)return e;if(Array.isArray(e)&&(0===e.length||"string"==typeof e[0])){let t=new a.BytesList;return e.forEach(e=>{n.Hash256.from(e).toBytesSink(t)}),new o(t.toBytes())}throw Error("Cannot construct Vector256 from given value")}toJSON(){if(this.bytes.byteLength%32!=0)throw Error("Invalid bytes for Vector256");let e=[];for(let t=0;t<this.bytes.byteLength;t+=32)e.push((0,s.bytesToHex)(this.bytes.slice(t,t+32)));return e}}r.Vector256=o},540921,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.XChainBridge=void 0;let i=e.r(775620),n=e.r(490133),a=e.r(808995),s=e.r(222417),o=e.r(575280);class l extends a.SerializedType{constructor(e){super(null!=e?e:l.ZERO_XCHAIN_BRIDGE.bytes)}static from(e){let t;if(e instanceof l)return e;if(4!==(t=Object.keys(e).sort()).length||"IssuingChainDoor"!==t[0]||"IssuingChainIssue"!==t[1]||"LockingChainDoor"!==t[2]||"LockingChainIssue"!==t[3])throw Error("Invalid type to construct an XChainBridge");let r=[];return this.TYPE_ORDER.forEach(t=>{let{name:i,type:a}=t;a===n.AccountID&&r.push(Uint8Array.from([20]));let s=a.from(e[i]);r.push(s.toBytes())}),new l((0,o.concat)(r))}static fromParser(e){let t=[];return this.TYPE_ORDER.forEach(r=>{let{type:i}=r;i===n.AccountID&&(e.skip(1),t.push(Uint8Array.from([20])));let a=i.fromParser(e);t.push(a.toBytes())}),new l((0,o.concat)(t))}toJSON(){let e=new i.BinaryParser(this.toString()),t={};return l.TYPE_ORDER.forEach(r=>{let{name:i,type:a}=r;a===n.AccountID&&e.skip(1);let s=a.fromParser(e).toJSON();t[i]=s}),t}}r.XChainBridge=l,l.ZERO_XCHAIN_BRIDGE=new l((0,o.concat)([Uint8Array.from([20]),new Uint8Array(40),Uint8Array.from([20]),new Uint8Array(40)])),l.TYPE_ORDER=[{name:"LockingChainDoor",type:n.AccountID},{name:"LockingChainIssue",type:s.Issue},{name:"IssuingChainDoor",type:n.AccountID},{name:"IssuingChainIssue",type:s.Issue}]},213022,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Vector256=r.UInt64=r.UInt32=r.UInt16=r.UInt8=r.STObject=r.STArray=r.PathSet=r.Int32=r.Hash256=r.Hash192=r.Hash160=r.Hash128=r.Currency=r.Blob=r.Amount=r.AccountID=r.coreTypes=void 0;let i=e.r(490133);Object.defineProperty(r,"AccountID",{enumerable:!0,get:function(){return i.AccountID}});let n=e.r(424293);Object.defineProperty(r,"Amount",{enumerable:!0,get:function(){return n.Amount}});let a=e.r(890874);Object.defineProperty(r,"Blob",{enumerable:!0,get:function(){return a.Blob}});let s=e.r(761882);Object.defineProperty(r,"Currency",{enumerable:!0,get:function(){return s.Currency}});let o=e.r(208393);Object.defineProperty(r,"Hash128",{enumerable:!0,get:function(){return o.Hash128}});let l=e.r(481253);Object.defineProperty(r,"Hash160",{enumerable:!0,get:function(){return l.Hash160}});let u=e.r(84908);Object.defineProperty(r,"Hash192",{enumerable:!0,get:function(){return u.Hash192}});let c=e.r(475099);Object.defineProperty(r,"Hash256",{enumerable:!0,get:function(){return c.Hash256}});let d=e.r(474323);Object.defineProperty(r,"Int32",{enumerable:!0,get:function(){return d.Int32}});let f=e.r(222417),h=e.r(632602),p=e.r(944175);Object.defineProperty(r,"PathSet",{enumerable:!0,get:function(){return p.PathSet}});let g=e.r(808042);Object.defineProperty(r,"STArray",{enumerable:!0,get:function(){return g.STArray}});let m=e.r(842484);Object.defineProperty(r,"STObject",{enumerable:!0,get:function(){return m.STObject}});let y=e.r(146963);Object.defineProperty(r,"UInt16",{enumerable:!0,get:function(){return y.UInt16}});let v=e.r(512941);Object.defineProperty(r,"UInt32",{enumerable:!0,get:function(){return v.UInt32}});let b=e.r(996957);Object.defineProperty(r,"UInt64",{enumerable:!0,get:function(){return b.UInt64}});let w=e.r(512606);Object.defineProperty(r,"UInt8",{enumerable:!0,get:function(){return w.UInt8}});let _=e.r(24853);Object.defineProperty(r,"Vector256",{enumerable:!0,get:function(){return _.Vector256}
3});let A=e.r(540921),S=e.r(88108),E={AccountID:i.AccountID,Amount:n.Amount,Blob:a.Blob,Currency:s.Currency,Hash128:o.Hash128,Hash160:l.Hash160,Hash192:u.Hash192,Hash256:c.Hash256,Int32:d.Int32,Issue:f.Issue,Number:h.STNumber,PathSet:p.PathSet,STArray:g.STArray,STObject:m.STObject,UInt8:w.UInt8,UInt16:y.UInt16,UInt32:v.UInt32,UInt64:b.UInt64,Vector256:_.Vector256,XChainBridge:A.XChainBridge};r.coreTypes=E,S.DEFAULT_DEFINITIONS.associateTypes(E)},545312,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.HashPrefix=void 0;let i=e.r(260927);function n(e){let t=new Uint8Array(4);return(0,i.writeUInt32BE)(t,e,0),t}r.HashPrefix={transactionID:n(0x54584e00),transaction:n(0x534e4400),accountStateEntry:n(0x4d4c4e00),innerNode:n(0x4d494e00),ledgerHeader:n(0x4c575200),transactionSig:n(0x53545800),transactionMultiSig:n(0x534d5400),validation:n(0x56414c00),proposal:n(0x50525000),paymentChannelClaim:n(0x434c4d00),batch:n(0x42434800)}},51668,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.sha512=void 0;let n=e.r(993882);r.sha512=(0,i(e.r(677580)).default)(n.sha512)},842691,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.transactionID=r.sha512Half=r.Sha512Half=void 0;let i=e.r(545312),n=e.r(213022),a=e.r(540908),s=e.r(51668);class o extends a.BytesList{constructor(){super(...arguments),this.hash=s.sha512.create()}static put(e){return new o().put(e)}put(e){return this.hash.update(e),this}finish256(){return Uint8Array.from(this.hash.digest().slice(0,32))}finish(){return new n.Hash256(this.finish256())}}function l(...e){let t=new o;return e.forEach(e=>t.put(e)),t.finish256()}r.Sha512Half=o,r.sha512Half=l,r.transactionID=function(e){return new n.Hash256(l(i.HashPrefix.transactionID,e))}},191750,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.signingBatchData=r.transactionID=r.sha512Half=r.binaryToJSON=r.signingClaimData=r.signingData=r.multiSigningData=r.readJSON=r.serializeObject=r.makeParser=r.BytesList=r.BinarySerializer=r.BinaryParser=void 0;let i=e.r(575280),n=e.r(213022),a=e.r(775620);Object.defineProperty(r,"BinaryParser",{enumerable:!0,get:function(){return a.BinaryParser}});let s=e.r(545312),o=e.r(540908);Object.defineProperty(r,"BinarySerializer",{enumerable:!0,get:function(){return o.BinarySerializer}}),Object.defineProperty(r,"BytesList",{enumerable:!0,get:function(){return o.BytesList}});let l=e.r(842691);Object.defineProperty(r,"sha512Half",{enumerable:!0,get:function(){return l.sha512Half}}),Object.defineProperty(r,"transactionID",{enumerable:!0,get:function(){return l.transactionID}});let u=e.r(88108),c=(e,t)=>new a.BinaryParser(e instanceof Uint8Array?(0,i.bytesToHex)(e):e,t);r.makeParser=c;let d=(e,t=u.DEFAULT_DEFINITIONS)=>e.readType(n.coreTypes.STObject).toJSON(t);function f(e,t={}){let{prefix:r,suffix:i,signingFieldsOnly:a=!1,definitions:s}=t,l=new o.BytesList;r&&l.put(r);let u=a?e=>e.isSigningField:void 0;return n.coreTypes.STObject.from(e,u,s).toBytesSink(l),i&&l.put(i),l.toBytes()}r.readJSON=d,r.binaryToJSON=(e,t)=>d(c(e,t),t),r.serializeObject=f,r.signingData=function(e,t=s.HashPrefix.transactionSig,r={}){return f(e,{prefix:t,signingFieldsOnly:!0,definitions:r.definitions})},r.signingClaimData=function(e){let t=BigInt(String(e.amount)),r=s.HashPrefix.paymentChannelClaim,i=n.coreTypes.Hash256.from(e.channel).toBytes(),a=n.coreTypes.UInt64.from(t).toBytes(),l=new o.BytesList;return l.put(r),l.put(i),l.put(a),l.toBytes()},r.multiSigningData=function(e,t,r={definitions:u.DEFAULT_DEFINITIONS}){return f(e,{prefix:s.HashPrefix.transactionMultiSig,suffix:n.coreTypes.AccountID.from(t).toBytes(),signingFieldsOnly:!0,definitions:r.definitions})},r.signingBatchData=function(e){if(null==e.flags)throw Error("No field `flags'");if(null==e.txIDs)throw Error("No field `txIDs`");let t=s.HashPrefix.batch,r=n.coreTypes.UInt32.from(e.flags).toBytes(),i=n.coreTypes.UInt32.from(e.txIDs.length).toBytes(),a=new o.BytesList;
3return a.put(t),a.put(r),a.put(i),e.txIDs.forEach(e=>{a.put(n.coreTypes.Hash256.from(e).toBytes())}),a.toBytes()}},539441,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ShaMapLeaf=r.ShaMapNode=r.ShaMap=void 0;let i=e.r(213022),n=e.r(545312),a=e.r(842691);class s{}r.ShaMapNode=s;class o extends s{constructor(e,t){super(),this.index=e,this.item=t}isLeaf(){return!0}isInner(){return!1}hashPrefix(){return void 0===this.item?new Uint8Array(0):this.item.hashPrefix()}hash(){let e=a.Sha512Half.put(this.hashPrefix());return this.toBytesSink(e),e.finish()}toBytesSink(e){void 0!==this.item&&this.item.toBytesSink(e),this.index.toBytesSink(e)}}r.ShaMapLeaf=o;class l extends s{constructor(e=0){super(),this.depth=e,this.slotBits=0,this.branches=Array(16)}isInner(){return!0}isLeaf(){return!1}hashPrefix(){return n.HashPrefix.innerNode}setBranch(e,t){this.slotBits=this.slotBits|1<<e,this.branches[e]=t}empty(){return 0===this.slotBits}hash(){if(this.empty())return i.coreTypes.Hash256.ZERO_256;let e=a.Sha512Half.put(this.hashPrefix());return this.toBytesSink(e),e.finish()}toBytesSink(e){for(let t=0;t<this.branches.length;t++){let r=this.branches[t];(r?r.hash():i.coreTypes.Hash256.ZERO_256).toBytesSink(e)}}addItem(e,t,r){if(void 0===e)throw Error();if(void 0!==e){let i=e.nibblet(this.depth),n=this.branches[i];if(void 0===n)this.setBranch(i,r||new o(e,t));else if(n instanceof o){let a=new l(this.depth+1);a.addItem(n.index,void 0,n),a.addItem(e,t,r),this.setBranch(i,a)}else if(n instanceof l)n.addItem(e,t,r);else throw Error("invalid ShaMap.addItem call")}}}r.ShaMap=class extends l{}},227218,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.decodeLedgerData=r.ledgerHash=r.transactionTreeHash=r.accountStateHash=void 0;let i=e.r(539441),n=e.r(545312),a=e.r(842691),s=e.r(191750),o=e.r(475099),l=e.r(842484),u=e.r(996957),c=e.r(512941),d=e.r(512606),f=e.r(775620);function h(e,t){let r=new i.ShaMap;return t.forEach(t=>r.addItem(...e(t))),r.hash()}function p(e){if(!e.hash)throw Error();return[o.Hash256.from(e.hash),{hashPrefix:()=>n.HashPrefix.transaction,toBytesSink(t){let r=new s.BinarySerializer(t);r.writeLengthEncoded(l.STObject.from(e)),r.writeLengthEncoded(l.STObject.from(e.metaData))}},void 0]}function g(e){let t=o.Hash256.from(e.index),r=(0,s.serializeObject)(e);return[t,{hashPrefix:()=>n.HashPrefix.accountStateEntry,toBytesSink(e){e.put(r)}},void 0]}r.transactionTreeHash=function(e){return h(p,e)},r.accountStateHash=function(e){return h(g,e)},r.ledgerHash=function(e){let t=new a.Sha512Half;if(t.put(n.HashPrefix.ledgerHeader),void 0===e.parent_close_time||void 0===e.close_flags)throw Error();return c.UInt32.from(e.ledger_index).toBytesSink(t),u.UInt64.from(BigInt(String(e.total_coins))).toBytesSink(t),o.Hash256.from(e.parent_hash).toBytesSink(t),o.Hash256.from(e.transaction_hash).toBytesSink(t),o.Hash256.from(e.account_hash).toBytesSink(t),c.UInt32.from(e.parent_close_time).toBytesSink(t),c.UInt32.from(e.close_time).toBytesSink(t),d.UInt8.from(e.close_time_resolution).toBytesSink(t),d.UInt8.from(e.close_flags).toBytesSink(t),t.finish()},r.decodeLedgerData=function(e,t){if("string"!=typeof e)throw Error("binary must be a hex string");let r=new f.BinaryParser(e,t);return{ledger_index:r.readUInt32(),total_coins:r.readType(u.UInt64).valueOf().toString(),parent_hash:r.readType(o.Hash256).toHex(),transaction_hash:r.readType(o.Hash256).toHex(),account_hash:r.readType(o.Hash256).toHex(),parent_close_time:r.readUInt32(),close_time:r.readUInt32(),close_time_resolution:r.readUInt8(),close_flags:r.readUInt8()}}},312686,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.quality=void 0;let n=e.r(213022),a=i(e.r(966027)),s=e.r(575280);r.quality=class{static encode(e){let t;try{t=new a.default(e)}catch(t){throw Error(`${e} is not a valid quality`)}let r=(t.e||0)-15,i=t.times(`1e${-r}`).abs().toString(),s=n.coreTypes.UInt64.from(BigInt(i)).toBytes();return s[0]=r+100,s}static decode(e){let t,r=(0,s.hexToBytes)(e).slice(-8),i=r[0]-100;try{t=new a.default(`0x${(0,s.bytesToHex)(r.slice(1))}`)}catch(t){throw Error(`${e} is not a valid quality`)}return t.times(`1e${i}`)}}},287660,(e,t,r)=>{"use strict";var i=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);
3(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=e.e&&e.e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=e.e&&e.e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.types=r.ShaMap=r.HashPrefix=r.quality=r.TransactionResult=r.Type=r.LedgerEntryType=r.TransactionType=r.Field=r.DEFAULT_DEFINITIONS=r.ledgerHashes=r.binary=r.hashes=void 0;let s=e.r(88108);Object.defineProperty(r,"DEFAULT_DEFINITIONS",{enumerable:!0,get:function(){return s.DEFAULT_DEFINITIONS}}),Object.defineProperty(r,"Field",{enumerable:!0,get:function(){return s.Field}}),Object.defineProperty(r,"TransactionType",{enumerable:!0,get:function(){return s.TransactionType}}),Object.defineProperty(r,"LedgerEntryType",{enumerable:!0,get:function(){return s.LedgerEntryType}}),Object.defineProperty(r,"Type",{enumerable:!0,get:function(){return s.Type}}),Object.defineProperty(r,"TransactionResult",{enumerable:!0,get:function(){return s.TransactionResult}}),r.types=a(e.r(213022)),r.binary=a(e.r(191750));let o=e.r(539441);Object.defineProperty(r,"ShaMap",{enumerable:!0,get:function(){return o.ShaMap}}),r.ledgerHashes=a(e.r(227218)),r.hashes=a(e.r(842691));let l=e.r(312686);Object.defineProperty(r,"quality",{enumerable:!0,get:function(){return l.quality}});let u=e.r(545312);Object.defineProperty(r,"HashPrefix",{enumerable:!0,get:function(){return u.HashPrefix}})},802451,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.XrplDefinitions=void 0;let i=e.r(11538),n=e.r(213022);class a extends i.XrplDefinitionsBase{constructor(e,t){super(e,Object.assign({},n.coreTypes,t))}}r.XrplDefinitions=a},522236,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.coreTypes=r.DEFAULT_DEFINITIONS=r.XrplDefinitionsBase=r.XrplDefinitions=r.TRANSACTION_TYPES=r.decodeLedgerData=r.decodeQuality=r.encodeQuality=r.encodeForSigningBatch=r.encodeForMultisigning=r.encodeForSigningClaim=r.encodeForSigning=r.encode=r.decode=void 0;let i=e.r(287660),n=e.r(227218);Object.defineProperty(r,"decodeLedgerData",{enumerable:!0,get:function(){return n.decodeLedgerData}});let a=e.r(88108);Object.defineProperty(r,"XrplDefinitionsBase",{enumerable:!0,get:function(){return a.XrplDefinitionsBase}}),Object.defineProperty(r,"TRANSACTION_TYPES",{enumerable:!0,get:function(){return a.TRANSACTION_TYPES}}),Object.defineProperty(r,"DEFAULT_DEFINITIONS",{enumerable:!0,get:function(){return a.DEFAULT_DEFINITIONS}});let s=e.r(802451);Object.defineProperty(r,"XrplDefinitions",{enumerable:!0,get:function(){return s.XrplDefinitions}});let o=e.r(213022);Object.defineProperty(r,"coreTypes",{enumerable:!0,get:function(){return o.coreTypes}});let l=e.r(575280),{signingData:u,signingClaimData:c,multiSigningData:d,signingBatchData:f,binaryToJSON:h,serializeObject:p}=i.binary;r.decode=function(e,t){if("string"!=typeof e)throw Error("binary must be a hex string");return h(e,t)},r.encode=function(e,t){if("object"!=typeof e)throw Error();return(0,l.bytesToHex)(p(e,{definitions:t}))},r.encodeForSigning=function(e,t){if("object"!=typeof e)throw Error();return(0,l.bytesToHex)(u(e,i.HashPrefix.transactionSig,{definitions:t}))},r.encodeForSigningClaim=function(e){if("object"!=typeof e)throw Error();return(0,l.bytesToHex)(c(e))},r.encodeForMultisigning=function(e,t,r){if("object"!=typeof e)throw Error();return(0,l.bytesToHex)(d(e,t,r?{definitions:r}:void 0))},r.encodeForSigningBatch=function(e){if("object"!=typeof e)throw Error("Need an object to encode a Batch transaction");return(0,l.bytesToHex)(f(e))},r.encodeQuality=function(e){if("string"!=typeof e)throw Error();return(0,l.bytesToHex)(i.quality.encode(e))},r.decodeQuality=function(e){if("string"!=typeof e)throw Error();return i.quality.decode(e).toString()}},932114,(e,t,r)=>{"use strict";
3Object.defineProperty(r,"__esModule",{value:!0}),r.isHex=r.hasFlag=r.isFlagEnabled=r.onlyHasFields=r.INTEGER_SANITY_CHECK=void 0;let i=/^[0-9A-Fa-f]+$/u;function n(e,t){return(BigInt(t)&BigInt(e))===BigInt(t)}r.INTEGER_SANITY_CHECK=/^[0-9]+$/u,r.onlyHasFields=function(e,t){return Object.keys(e).every(e=>t.includes(e))},r.isFlagEnabled=n,r.hasFlag=function(e,t,r){return null!=e.Flags&&("number"==typeof e.Flags?n(e.Flags,t):!0===e.Flags[r])},r.isHex=function(e){return i.test(e)}},798184,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.isDomainID=r.containsDuplicates=r.validateCredentialsList=r.validateCredentialType=r.parseAmountValue=r.validateBaseTransaction=r.GlobalFlags=r.validateOptionalField=r.validateRequiredField=r.validateHexMetadata=r.isLedgerEntryId=r.isArray=r.isXChainBridge=r.isTokenAmount=r.isAmount=r.isAccount=r.isClawbackAmount=r.isMPTAmount=r.isAuthorizeCredential=r.isIssuedCurrencyAmount=r.isIssuedCurrency=r.isCurrency=r.isXRPLNumber=r.isValue=r.isNull=r.isNumber=r.isString=r.isRecord=r.VAULT_DATA_MAX_BYTE_LENGTH=r.MAX_AUTHORIZED_CREDENTIALS=void 0;let a=e.r(575280),s=e.r(550294),o=e.r(522236),l=e.r(227730),u=e.r(932114);r.MAX_AUTHORIZED_CREDENTIALS=8;function c(e){if(!f(e))return!1;let t=e.Memo;if(!f(t))return!1;let r=Object.keys(t).length,i=null==t.MemoData||h(t.MemoData)&&(0,u.isHex)(t.MemoData),n=null==t.MemoFormat||h(t.MemoFormat)&&(0,u.isHex)(t.MemoFormat),a=null==t.MemoType||h(t.MemoType)&&(0,u.isHex)(t.MemoType);return r>=1&&r<=3&&i&&n&&a&&(0,u.onlyHasFields)(t,["MemoFormat","MemoData","MemoType"])}function d(e){if(!f(e))return!1;let t=e.Signer;return!!f(t)&&3===Object.keys(t).length&&h(t.Account)&&h(t.TxnSignature)&&h(t.SigningPubKey)}function f(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function h(e){return"string"==typeof e}function p(e){return"number"==typeof e}function g(e){return f(e)&&(2===Object.keys(e).length&&h(e.issuer)&&h(e.currency)||1===Object.keys(e).length&&"XRP"===e.currency)}function m(e){return f(e)&&3===Object.keys(e).length&&h(e.value)&&h(e.issuer)&&h(e.currency)}function y(e){return f(e)&&f(e.Credential)&&1===Object.keys(e).length&&"string"==typeof e.Credential.CredentialType&&"string"==typeof e.Credential.Issuer}function v(e){return f(e)&&2===Object.keys(e).length&&"string"==typeof e.value&&"string"==typeof e.mpt_issuance_id}function b(e){return"string"==typeof e&&((0,s.isValidClassicAddress)(e)||(0,s.isValidXAddress)(e))}function w(e){return"string"==typeof e||m(e)||v(e)}function _(e){return null!=e&&Array.isArray(e)}function A(e,t,r,i={}){var n,a;let s=null!=(n=i.paramName)?n:t,o=null!=(a=i.txType)?a:e.TransactionType;if(null==e[t])throw new l.ValidationError(`${o}: missing field ${String(s)}`);if(!r(e[t]))throw new l.ValidationError(`${o}: invalid field ${String(s)}`)}function S(e,t,r,i={}){var n,a;let s=null!=(n=i.paramName)?n:t,o=null!=(a=i.txType)?a:e.TransactionType;if(void 0!==e[t]&&!r(e[t]))throw new l.ValidationError(`${o}: invalid field ${String(s)}`)}function E(e){if("string"==typeof e[0])return new Set(e.map(e=>JSON.stringify(e))).size!==e.length;let t=new Set;if("string"!=typeof e[0])for(let r of e){let e=`${r.Credential.Issuer}-${r.Credential.CredentialType}`;if(t.has(e))return!0;t.add(e)}return!1}r.VAULT_DATA_MAX_BYTE_LENGTH=256,r.isRecord=f,r.isString=h,r.isNumber=p,r.isNull=function(e){return null==e},r.isValue=function(e){return t=>t===e},r.isXRPLNumber=function(e){return"string"==typeof e&&/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/u.test(e.trim())},r.isCurrency=function(e){return f(e)&&(2===Object.keys(e).length&&h(e.issuer)&&h(e.currency)||1===Object.keys(e).length&&"XRP"===e.currency||1===Object.keys(e).length&&h(e.mpt_issuance_id))},r.isIssuedCurrency=g,r.isIssuedCurrencyAmount=m,r.isAuthorizeCredential=y,r.isMPTAmount=v,r.isClawbackAmount=function(e){return m(e)||v(e)},r.isAccount=b,r.isAmount=w,r.isTokenAmount=function(e){return m(e)||v(e)},r.isXChainBridge=function(e){return f(e)&&4===Object.keys(e).length&&"string"==typeof e.LockingChainDoor&&g(e.LockingChainIssue)&&"string"==typeof e.IssuingChainDoor&&g(e.IssuingChainIssue)},r.isArray=_,r.isLedgerEntryId=function(e){return h(e)&&(0,u.isHex)(e)&&64===e.length},r.validateHexMetadata=function(e,t){return h(e)&&(0,u.isHex)(e)&&e.length>0&&e.length<=t},r.validateRequiredField=A,r.validateOptionalField=S,(n=i||(r.GlobalFlags=i={}))[n.tfInnerBatchTxn=0x40000000]="tfInnerBatchTxn",r.validateBaseTransaction=function(e){if(!f(e))throw new l.ValidationError("BaseTransaction: invali
3d, expected a valid object");if(void 0===e.TransactionType)throw new l.ValidationError("BaseTransaction: missing field TransactionType");if("string"!=typeof e.TransactionType)throw new l.ValidationError("BaseTransaction: TransactionType not string");if(!o.TRANSACTION_TYPES.includes(e.TransactionType))throw new l.ValidationError(`BaseTransaction: Unknown TransactionType ${e.TransactionType}`);A(e,"Account",h),S(e,"Fee",h),S(e,"Sequence",p),S(e,"AccountTxnID",h),S(e,"LastLedgerSequence",p);let t=e.Memos;if(null!=t&&(!_(t)||!t.every(c)))throw new l.ValidationError("BaseTransaction: invalid Memos");let r=e.Signers;if(null!=r&&(!_(r)||0===r.length||!r.every(d)))throw new l.ValidationError("BaseTransaction: invalid Signers");S(e,"SourceTag",p),S(e,"SigningPubKey",h),S(e,"TicketSequence",p),S(e,"TxnSignature",h),S(e,"NetworkID",p),S(e,"Delegate",b);let i=e.Delegate;if(null!=i&&i===e.Account)throw new l.ValidationError("BaseTransaction: Account and Delegate addresses cannot be the same")},r.parseAmountValue=function(e){return w(e)?"string"==typeof e?parseFloat(e):parseFloat(e.value):NaN},r.validateCredentialType=function(e){if("string"!=typeof e.TransactionType)throw new l.ValidationError("Invalid TransactionType");if(void 0===e.CredentialType)throw new l.ValidationError(`${e.TransactionType}: missing field CredentialType`);if(!h(e.CredentialType))throw new l.ValidationError(`${e.TransactionType}: CredentialType must be a string`);if(0===e.CredentialType.length)throw new l.ValidationError(`${e.TransactionType}: CredentialType cannot be an empty string`);if(e.CredentialType.length>128)throw new l.ValidationError(`${e.TransactionType}: CredentialType length cannot be > 128`);if(!a.HEX_REGEX.test(e.CredentialType))throw new l.ValidationError(`${e.TransactionType}: CredentialType must be encoded in hex`)},r.validateCredentialsList=function(e,t,r,i){if(null!=e){if(!_(e))throw new l.ValidationError(`${t}: Credentials must be an array`);if(e.length>i)throw new l.ValidationError(`${t}: Credentials length cannot exceed ${i} elements`);if(0===e.length)throw new l.ValidationError(`${t}: Credentials cannot be an empty array`);if(e.forEach(e=>{if(r){if(!h(e))throw new l.ValidationError(`${t}: Invalid Credentials ID list format`)}else if(!y(e))throw new l.ValidationError(`${t}: Invalid Credentials format`)}),E(e))throw new l.ValidationError(`${t}: Credentials cannot contain duplicate elements`)}},r.containsDuplicates=E,r.isDomainID=function(e){return h(e)&&64===e.length&&(0,u.isHex)(e)}},715204,(e,t,r)=>{"use strict";var i,n,a,s;Object.defineProperty(r,"__esModule",{value:!0}),r.validateAccountSet=r.AccountSetTfFlags=r.AccountSetAsfFlags=void 0;let o=e.r(227730),l=e.r(798184);(a=i||(r.AccountSetAsfFlags=i={}))[a.asfRequireDest=1]="asfRequireDest",a[a.asfRequireAuth=2]="asfRequireAuth",a[a.asfDisallowXRP=3]="asfDisallowXRP",a[a.asfDisableMaster=4]="asfDisableMaster",a[a.asfAccountTxnID=5]="asfAccountTxnID",a[a.asfNoFreeze=6]="asfNoFreeze",a[a.asfGlobalFreeze=7]="asfGlobalFreeze",a[a.asfDefaultRipple=8]="asfDefaultRipple",a[a.asfDepositAuth=9]="asfDepositAuth",a[a.asfAuthorizedNFTokenMinter=10]="asfAuthorizedNFTokenMinter",a[a.asfDisallowIncomingNFTokenOffer=12]="asfDisallowIncomingNFTokenOffer",a[a.asfDisallowIncomingCheck=13]="asfDisallowIncomingCheck",a[a.asfDisallowIncomingPayChan=14]="asfDisallowIncomingPayChan",a[a.asfDisallowIncomingTrustline=15]="asfDisallowIncomingTrustline",a[a.asfAllowTrustLineClawback=16]="asfAllowTrustLineClawback",a[a.asfAllowTrustLineLocking=17]="asfAllowTrustLineLocking",(s=n||(r.AccountSetTfFlags=n={}))[s.tfRequireDestTag=65536]="tfRequireDestTag",s[s.tfOptionalDestTag=131072]="tfOptionalDestTag",s[s.tfRequireAuth=262144]="tfRequireAuth",s[s.tfOptionalAuth=524288]="tfOptionalAuth",s[s.tfDisallowXRP=1048576]="tfDisallowXRP",s[s.tfAllowXRP=2097152]="tfAllowXRP",r.validateAccountSet=function(e){if((0,l.validateBaseTransaction)(e),(0,l.validateOptionalField)(e,"NFTokenMinter",l.isAccount),void 0!==e.ClearFlag&&("number"!=typeof e.ClearFlag||!Object.values(i).includes(e.ClearFlag)))throw new o.ValidationError("AccountSet: invalid ClearFlag");if(void 0!==e.Domain&&"string"!=typeof e.Domain)throw new o.ValidationError("AccountSet: invalid Domain");if(void 0!==e.EmailHash&&"string"!=typeof e.EmailHash)throw new o.ValidationError("AccountSet: invalid EmailHash");if(void 0!==e.MessageKey&&"string"!=typeof e.MessageKey)throw new o.ValidationError("AccountSet: invalid MessageKey");if(void 0!==e.SetFlag&&("number"!=typeof e.SetFlag||!Object.values(i).includes(e.SetFlag)))throw new o.ValidationError("AccountSet: invalid SetFlag");if(void 0!==e.TransferRate&&"number"!=typeof e.TransferRate)throw new o.ValidationError("AccountSet: invalid TransferRate");if(void 0!==e.TickSize&&("number"!=typeof e.TickSize||0!==e.TickSize&&(e.TickSize<3||e.TickSize>15)))throw new o.ValidationError("AccountSet: invalid TickSize")}},376204,(e,t,r)=>{"use strict";var i,n;
3Object.defineProperty(r,"__esModule",{value:!0}),r.validateAMMClawback=r.AMMClawbackFlags=void 0;let a=e.r(227730),s=e.r(798184);(n=i||(r.AMMClawbackFlags=i={}))[n.tfClawTwoAssets=1]="tfClawTwoAssets",r.validateAMMClawback=function(e){(0,s.validateBaseTransaction)(e),(0,s.validateRequiredField)(e,"Holder",s.isAccount),(0,s.validateRequiredField)(e,"Asset",s.isIssuedCurrency);let t=e.Asset;if(e.Holder===t.issuer)throw new a.ValidationError("AMMClawback: Holder and Asset.issuer must be distinct");if(e.Account!==t.issuer)throw new a.ValidationError("AMMClawback: Account must be the same as Asset.issuer");if((0,s.validateRequiredField)(e,"Asset2",s.isIssuedCurrency),(0,s.validateOptionalField)(e,"Amount",s.isIssuedCurrencyAmount),null!=e.Amount){if(e.Amount.currency!==t.currency)throw new a.ValidationError("AMMClawback: Amount.currency must match Asset.currency");if(e.Amount.issuer!==t.issuer)throw new a.ValidationError("AMMClawback: Amount.issuer must match Amount.issuer")}}},260390,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.validateAMMDeposit=r.AMMDepositFlags=void 0;let a=e.r(227730),s=e.r(798184);(n=i||(r.AMMDepositFlags=i={}))[n.tfLPToken=65536]="tfLPToken",n[n.tfSingleAsset=524288]="tfSingleAsset",n[n.tfTwoAsset=1048576]="tfTwoAsset",n[n.tfOneAssetLPToken=2097152]="tfOneAssetLPToken",n[n.tfLimitLPToken=4194304]="tfLimitLPToken",n[n.tfTwoAssetIfEmpty=8388608]="tfTwoAssetIfEmpty",r.validateAMMDeposit=function(e){if((0,s.validateBaseTransaction)(e),null==e.Asset)throw new a.ValidationError("AMMDeposit: missing field Asset");if(!(0,s.isIssuedCurrency)(e.Asset))throw new a.ValidationError("AMMDeposit: Asset must be a Currency");if(null==e.Asset2)throw new a.ValidationError("AMMDeposit: missing field Asset2");if(!(0,s.isIssuedCurrency)(e.Asset2))throw new a.ValidationError("AMMDeposit: Asset2 must be a Currency");if(null!=e.Amount2&&null==e.Amount)throw new a.ValidationError("AMMDeposit: must set Amount with Amount2");if(null!=e.EPrice&&null==e.Amount)throw new a.ValidationError("AMMDeposit: must set Amount with EPrice");if(null==e.LPTokenOut&&null==e.Amount)throw new a.ValidationError("AMMDeposit: must set at least LPTokenOut or Amount");if(null!=e.LPTokenOut&&!(0,s.isIssuedCurrencyAmount)(e.LPTokenOut))throw new a.ValidationError("AMMDeposit: LPTokenOut must be an IssuedCurrencyAmount");if(null!=e.Amount&&!(0,s.isAmount)(e.Amount))throw new a.ValidationError("AMMDeposit: Amount must be an Amount");if(null!=e.Amount2&&!(0,s.isAmount)(e.Amount2))throw new a.ValidationError("AMMDeposit: Amount2 must be an Amount");if(null!=e.EPrice&&!(0,s.isAmount)(e.EPrice))throw new a.ValidationError("AMMDeposit: EPrice must be an Amount")}},359256,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.validateAMMWithdraw=r.AMMWithdrawFlags=void 0;let a=e.r(227730),s=e.r(798184);(n=i||(r.AMMWithdrawFlags=i={}))[n.tfLPToken=65536]="tfLPToken",n[n.tfWithdrawAll=131072]="tfWithdrawAll",n[n.tfOneAssetWithdrawAll=262144]="tfOneAssetWithdrawAll",n[n.tfSingleAsset=524288]="tfSingleAsset",n[n.tfTwoAsset=1048576]="tfTwoAsset",n[n.tfOneAssetLPToken=2097152]="tfOneAssetLPToken",n[n.tfLimitLPToken=4194304]="tfLimitLPToken",r.validateAMMWithdraw=function(e){if((0,s.validateBaseTransaction)(e),null==e.Asset)throw new a.ValidationError("AMMWithdraw: missing field Asset");if(!(0,s.isIssuedCurrency)(e.Asset))throw new a.ValidationError("AMMWithdraw: Asset must be a Currency");if(null==e.Asset2)throw new a.ValidationError("AMMWithdraw: missing field Asset2");if(!(0,s.isIssuedCurrency)(e.Asset2))throw new a.ValidationError("AMMWithdraw: Asset2 must be a Currency");if(null!=e.Amount2&&null==e.Amount)throw new a.ValidationError("AMMWithdraw: must set Amount with Amount2");if(null!=e.EPrice&&null==e.Amount)throw new a.ValidationError("AMMWithdraw: must set Amount with EPrice");if(null!=e.LPTokenIn&&!(0,s.isIssuedCurrencyAmount)(e.LPTokenIn))throw new a.ValidationError("AMMWithdraw: LPTokenIn must be an IssuedCurrencyAmount");if(null!=e.Amount&&!(0,s.isAmount)(e.Amount))throw new a.ValidationError("AMMWithdraw: Amount must be an Amount");if(null!=e.Amount2&&!(0,s.isAmount)(e.Amount2))throw new a.ValidationError("AMMWithdraw: Amount2 must be an Amount");if(null!=e.EPrice&&!(0,s.isAmount)(e.EPrice))throw new a.ValidationError("AMMWithdraw: EPrice must be an Amount")}},783020,(e,t,r)=>{"use strict";var i,n;
3Object.defineProperty(r,"__esModule",{value:!0}),r.validateBatch=r.BatchFlags=void 0;let a=e.r(227730),s=e.r(932114),o=e.r(798184);(n=i||(r.BatchFlags=i={}))[n.tfAllOrNothing=65536]="tfAllOrNothing",n[n.tfOnlyOne=131072]="tfOnlyOne",n[n.tfUntilFailure=262144]="tfUntilFailure",n[n.tfIndependent=524288]="tfIndependent",r.validateBatch=function(e){var t;(0,o.validateBaseTransaction)(e),(0,o.validateRequiredField)(e,"RawTransactions",o.isArray),e.RawTransactions.forEach((e,t)=>{if(!(0,o.isRecord)(e))throw new a.ValidationError(`Batch: RawTransactions[${t}] is not object.`);(0,o.validateRequiredField)(e,"RawTransaction",o.isRecord,{paramName:`RawTransactions[${t}].RawTransaction`,txType:"Batch"});var r=e.RawTransaction;if("Batch"===r.TransactionType)throw new a.ValidationError(`Batch: RawTransactions[${t}] is a Batch transaction. Cannot nest Batch transactions.`);if(!(0,s.hasFlag)(r,o.GlobalFlags.tfInnerBatchTxn,"tfInnerBatchTxn"))throw new a.ValidationError(`Batch: RawTransactions[${t}] must contain the \`tfInnerBatchTxn\` flag.`);(0,o.validateOptionalField)(r,"Fee",(0,o.isValue)("0"),{paramName:`RawTransactions[${t}].RawTransaction.Fee`,txType:"Batch"}),(0,o.validateOptionalField)(r,"SigningPubKey",(0,o.isValue)(""),{paramName:`RawTransactions[${t}].RawTransaction.SigningPubKey`,txType:"Batch"}),(0,o.validateOptionalField)(r,"TxnSignature",o.isNull,{paramName:`RawTransactions[${t}].RawTransaction.TxnSignature`,txType:"Batch"}),(0,o.validateOptionalField)(r,"Signers",o.isNull,{paramName:`RawTransactions[${t}].RawTransaction.Signers`,txType:"Batch"}),(0,o.validateOptionalField)(r,"LastLedgerSequence",o.isNull,{paramName:`RawTransactions[${t}].RawTransaction.LastLedgerSequence`,txType:"Batch"})}),(0,o.validateOptionalField)(e,"BatchSigners",o.isArray),null==(t=e.BatchSigners)||t.forEach((e,t)=>{if(!(0,o.isRecord)(e))throw new a.ValidationError(`Batch: BatchSigners[${t}] is not object.`);(0,o.validateRequiredField)(e,"BatchSigner",o.isRecord,{paramName:`BatchSigners[${t}].BatchSigner`,txType:"Batch"});let r=e.BatchSigner;(0,o.validateRequiredField)(r,"Account",o.isString,{paramName:`BatchSigners[${t}].BatchSigner.Account`,txType:"Batch"}),(0,o.validateOptionalField)(r,"SigningPubKey",o.isString,{paramName:`BatchSigners[${t}].BatchSigner.SigningPubKey`,txType:"Batch"}),(0,o.validateOptionalField)(r,"TxnSignature",o.isString,{paramName:`BatchSigners[${t}].BatchSigner.TxnSignature`,txType:"Batch"}),(0,o.validateOptionalField)(r,"Signers",o.isArray,{paramName:`BatchSigners[${t}].BatchSigner.Signers`,txType:"Batch"})})}},529802,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.validateLoanManage=r.LoanManageFlags=void 0;let a=e.r(227730),s=e.r(798184);(n=i||(r.LoanManageFlags=i={}))[n.tfLoanDefault=65536]="tfLoanDefault",n[n.tfLoanImpair=131072]="tfLoanImpair",n[n.tfLoanUnimpair=262144]="tfLoanUnimpair",r.validateLoanManage=function(e){if((0,s.validateBaseTransaction)(e),(0,s.validateRequiredField)(e,"LoanID",s.isString),!(0,s.isLedgerEntryId)(e.LoanID))throw new a.ValidationError("LoanManage: LoanID must be 64 characters hexadecimal string");let t=e.Flags;if(null==t)return;let r=0;if("number"==typeof t?r=t:(t.tfLoanImpair&&(r|=i.tfLoanImpair),t.tfLoanUnimpair&&(r|=i.tfLoanUnimpair)),(r&i.tfLoanImpair)===i.tfLoanImpair&&(r&i.tfLoanUnimpair)===i.tfLoanUnimpair)throw new a.ValidationError("LoanManage: tfLoanImpair and tfLoanUnimpair cannot both be present")}},882843,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.validateLoanPay=r.LoanPayFlags=void 0;let a=e.r(227730),s=e.r(932114),o=e.r(798184);(n=i||(r.LoanPayFlags=i={}))[n.tfLoanOverpayment=65536]="tfLoanOverpayment",n[n.tfLoanFullPayment=131072]="tfLoanFullPayment",n[n.tfLoanLatePayment=262144]="tfLoanLatePayment",r.validateLoanPay=function(e){if((0,o.validateBaseTransaction)(e),(0,o.validateRequiredField)(e,"LoanID",o.isString),(0,o.validateRequiredField)(e,"Amount",o.isAmount),!(0,o.isLedgerEntryId)(e.LoanID))throw new a.ValidationError("LoanPay: LoanID must be 64 characters hexadecimal string");if("number"==typeof e.Flags){if([(0,s.isFlagEnabled)(e.Flags,i.tfLoanLatePayment),(0,s.isFlagEnabled)(e.Flags,i.tfLoanFullPayment),(0,s.isFlagEnabled)(e.Flags,i.tfLoanOverpayment)].filter(
3Boolean).length>1)throw new a.ValidationError("LoanPay: Only one of tfLoanLatePayment, tfLoanFullPayment, or tfLoanOverpayment flags can be set")}else if(null!=e.Flags&&"object"==typeof e.Flags){let t=e.Flags;if([t.tfLoanLatePayment,t.tfLoanFullPayment,t.tfLoanOverpayment].filter(Boolean).length>1)throw new a.ValidationError("LoanPay: Only one of tfLoanLatePayment, tfLoanFullPayment, or tfLoanOverpayment flags can be set")}}},457648,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.validateMPTokenAuthorize=r.MPTokenAuthorizeFlags=void 0;let a=e.r(798184);(n=i||(r.MPTokenAuthorizeFlags=i={}))[n.tfMPTUnauthorize=1]="tfMPTUnauthorize",r.validateMPTokenAuthorize=function(e){(0,a.validateBaseTransaction)(e),(0,a.validateRequiredField)(e,"MPTokenIssuanceID",a.isString),(0,a.validateOptionalField)(e,"Holder",a.isAccount)}},580381,(e,t,r)=>{"use strict";t.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,i="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&(r=t.cmp,function(e){return function(t,i){return r({key:t,value:e[t]},{key:i,value:e[i]})}}),a=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);if(Array.isArray(t)){for(r=0,s="[";r<t.length;r++)r&&(s+=","),s+=e(t[r])||"null";return s+"]"}if(null===t)return"null";if(-1!==a.indexOf(t)){if(i)return JSON.stringify("__cycle__");throw TypeError("Converting circular structure to JSON")}var r,s,o=a.push(t)-1,l=Object.keys(t).sort(n&&n(t));for(r=0,s="";r<l.length;r++){var u=l[r],c=e(t[u]);c&&(s&&(s+=","),s+=JSON.stringify(u)+":"+c)}return a.splice(o,1),"{"+s+"}"}}(e)}},976749,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.validateMPTokenMetadata=r.decodeMPTokenMetadata=r.encodeMPTokenMetadata=r.MPT_META_WARNING_HEADER=r.MAX_MPT_META_BYTE_LENGTH=void 0;let n=e.r(575280),a=i(e.r(580381)),s=e.r(798184),o=e.r(932114);r.MAX_MPT_META_BYTE_LENGTH=1024,r.MPT_META_WARNING_HEADER="MPTokenMetadata is not properly formatted as JSON as per the XLS-89 standard. While adherence to this standard is not mandatory, such non-compliant MPToken's might not be discoverable by Explorers and Indexers in the XRPL ecosystem.";let l=[{long:"uri",compact:"u"},{long:"category",compact:"c"},{long:"title",compact:"t"}],u=[{long:"ticker",compact:"t",validate(e){var t;if(null!=e[this.long]&&null!=e[this.compact])return[`${this.long}/${this.compact}: both long and compact forms present. expected only one.`];let r=null!=(t=e[this.long])?t:e[this.compact];return(0,s.isString)(r)&&/^[A-Z0-9]{1,6}$/u.test(r)?[]:[`${this.long}/${this.compact}: should have uppercase letters (A-Z) and digits (0-9) only. Max 6 characters recommended.`]}},{long:"name",compact:"n",validate(e){var t;if(null!=e[this.long]&&null!=e[this.compact])return[`${this.long}/${this.compact}: both long and compact forms present. expected only one.`];let r=null!=(t=e[this.long])?t:e[this.compact];return(0,s.isString)(r)&&0!==r.length?[]:[`${this.long}/${this.compact}: should be a non-empty string.`]}},{long:"icon",compact:"i",validate(e){var t;if(null!=e[this.long]&&null!=e[this.compact])return[`${this.long}/${this.compact}: both long and compact forms present. expected only one.`];let r=null!=(t=e[this.long])?t:e[this.compact];return(0,s.isString)(r)&&0!==r.length?[]:[`${this.long}/${this.compact}: should be a non-empty string.`]}},{long:"asset_class",compact:"ac",validate(e){var t;if(null!=e[this.long]&&null!=e[this.compact])return[`${this.long}/${this.compact}: both long and compact forms present. expected only one.`];let r=null!=(t=e[this.long])?t:e[this.compact],i=["rwa","memes","wrapped","gaming","defi","other"];return(0,s.isString)(r)&&i.includes(r)?[]:[`${this.long}/${this.compact}: should be one of ${i.join(", ")}.`]}},{long:"issuer_name",compact:"in",validate(e){var t;if(null!=e[this.long]&&null!=e[this.compact])return[`${this.long}/${this.compact}: both long and compact forms present. expected only one.`];let r=null!=(t=e[this.long])?t:e[this.compact];return(0,s.isString)(r)&&0!==r.length?[]:[`${this.long}/${this.compact}: should be a non-empty string.`]}},{long:"desc",compact:"d",validate(e){var t;if(null!=e[this.long]&&null!=e[this.compact])return[`${this.long}/${this.compact}: both long and compact forms present. expected only one.`];if(void 0===e[this.long]&&void 0===e[this.compact])return[];let r=null!=(t=e[this.long])?t:e[this.compact];return(0,s.isString)(r)&&0!==r.length?[]:[`${this.long}/${this.compact}: should be a non-empty string.`]}},{long:"asset_subclass",compact:"as",required:!1,validate(e){var t;if(null!=e[this.long]&&null!=e[this.compact])return[`${this.long}/${this.compact}: both long and compact forms present. expected only one.`];let r=null!=(t=e[this.long])?t:e[this.compact];if(("rwa"===e.asset_class||"rwa"===e.ac)&&void 0===r)return[`${this.long}/${this.compact}: required when asset_class is rwa.`];if(void 0===e[this.long]&&void 0===e[this.compact])return[];let i=["stablecoin","commodity","real_estate","private_credit","equity","treasury","other"];return(0,s.isString)(r)&&i.includes(r)?[]:[`${this.long}/${this.compact}: should be one of ${i.join(", ")}.`]}},{long:"uris",compact:"us",required:!1,validate(e){var t,r,i,n;if(null!=e[this.long]&&null!=e[this.compact])return[`${this.long}/${this.compact}: both long and compact forms present. expected only one.`];if(void 0===e[this.long]&&void 0===e[this.compact])return[];let a=null!=(t=e[this.long])?t:e[this.compact];if(!Array.isArray(a)||0===a.length)return[`${this.long}/${this.compact}: should be a non-empty array.`];let o=[];for(let e of a){if(!(0,s.isRecord)(e)||Object.keys(e).length!==l.length){o.push(`${this.long}/${this.compact}: should be an array of objects each with uri/u, category/c, and title/t properties.`);continue}for(let t of l)if(null!=e[t.long]&&null!=e[t.compact]){o.push(`${this.long}/${this.compact}: should not have both ${t.long} and ${t.compact} fields.`);break}let t=null!=(r=e.uri)?r:e.u,a=null!=(i=e.category)?i:e.c,u=null!=(n=e.title)?n:e.t;(0,s.isString)(t)&&(0,s.isString)(a)&&(0,s.isString)(u)||o.push(`${this.long}/${this.compact}: should be an array of objects each with uri/u, category/c, and title/t properties.`)}return o}},{long:"additional_info",compact:"ai",required:!1,validate(e){var t;if(null!=e[this.long]&&null!=e[this.compact])return[`${this.long}/${this.compact}: both long and compact forms present. expected only one.`];if(void 0===e[this.long]&&void 0===e[this.compact])return[];let r=null!=(t=e[this.long])?t:e[this.compact];return(0,s.isString)(r)||(0,s.isRecord)(r)?[]:[`${this.long}/${this.compact}: should be a string or JSON object.`]}}];function c(e,t){let r={};for(let[i,n]of Object.entries(e)){let a=t.find(({long:e,compact:t})=>e===i||t===i);if(void 0===a||void 0!==e[a.long]&&void 0!==e[a.compact]){r[i]=n;continue}r[a.compact]=n}return r}function d(e,t){let r={};for(let[i,n]of Object.entries(e)){let a=t.find(({long:e,compact:t})=>e===i||t===i);if(void 0===a||void 0!==e[a.long]&&void 0!==e[a.compact]){r[i]=n;continue}r[a.long]=n}return r}r.encodeMPTokenMetadata=function(e){let t=e;if(!(0,s.isRecord)(t))throw Error("MPTokenMetadata must be JSON object.");return Array.isArray((t=c(t,u)).uris)&&(t.uris=t.uris.map(e=>(0,s.isRecord)(e)?c(e,l):e)),Array.isArray(t.us)&&(t.us=t.us.map(e=>(0,s.isRecord)(e)?c(e,l):e)),(0,n.stringToHex)((0,a.default)(t)).toUpperCase()},r.decodeMPTokenMetadata=function(e){let t;if(!(0,o.isHex)(e))throw Error("MPTokenMetadata must be in hex format.");try{t=JSON.parse((0,n.hexToString)(e))}catch(e){throw Error(`MPTokenMetadata is not properly formatted as JSON - ${String(e)}`)}if(!(0,s.isRecord)(t))throw Error("MPTokenMetadata must be a JSON object.");let r=t;return Array.isArray((r=d(r,u)).uris)&&(r.uris=r.uris.map(e=>(0,s.isRecord)(e)?d(e,l):e)),Array.isArray(r.us)&&(r.us=r.us.map(e=>(0,s.isRecord)(e)?d(e,l):e)),r},r.validateMPTokenMetadata=function(e){let t,i=[];if(!(0,o.isHex)(e))return i.push("MPTokenMetadata must be in hex format."),i;if(e.length/2>r.MAX_MPT_META_BYTE_LENGTH)return i.push(`MPTokenMetadata must be max ${r.MAX_MPT_META_BYTE_LENGTH} bytes.`),i;try{t=JSON.parse((0,n.hexToString)(e))}catch(e){return i.push(`MPTokenMetadata is not properly formatted as JSON - ${String(e)}`),i}if(!(0,s.isRecord)(t))return i.push("MPTokenMetadata is not properly formatted JSON object as per XLS-89."),i;Object.keys(t).length>u.length&&i.push(`MPTokenMetadata must not contain more than ${u.length} top-level fields (found ${Object.keys(t).length}).`);let a=t;for(let e of u)i.push(...e.validate(a));return i}},889678,(e,t,r)=>{"use strict";var i,n;
3Object.defineProperty(r,"__esModule",{value:!0}),r.validateMPTokenIssuanceCreate=r.MPTokenIssuanceCreateFlags=void 0;let a=e.r(227730),s=e.r(932114),o=e.r(976749),l=e.r(798184);(n=i||(r.MPTokenIssuanceCreateFlags=i={}))[n.tfMPTCanLock=2]="tfMPTCanLock",n[n.tfMPTRequireAuth=4]="tfMPTRequireAuth",n[n.tfMPTCanEscrow=8]="tfMPTCanEscrow",n[n.tfMPTCanTrade=16]="tfMPTCanTrade",n[n.tfMPTCanTransfer=32]="tfMPTCanTransfer",n[n.tfMPTCanClawback=64]="tfMPTCanClawback",r.validateMPTokenIssuanceCreate=function(e){var t,r;if((0,l.validateBaseTransaction)(e),(0,l.validateOptionalField)(e,"MaximumAmount",l.isString),(0,l.validateOptionalField)(e,"MPTokenMetadata",l.isString),(0,l.validateOptionalField)(e,"TransferFee",l.isNumber),(0,l.validateOptionalField)(e,"AssetScale",l.isNumber),"string"==typeof e.MPTokenMetadata&&(!(0,s.isHex)(e.MPTokenMetadata)||e.MPTokenMetadata.length/2>o.MAX_MPT_META_BYTE_LENGTH))throw new a.ValidationError(`MPTokenIssuanceCreate: MPTokenMetadata (hex format) must be non-empty and no more than ${o.MAX_MPT_META_BYTE_LENGTH} bytes.`);if("string"==typeof e.MaximumAmount)if(s.INTEGER_SANITY_CHECK.exec(e.MaximumAmount)){if(BigInt(e.MaximumAmount)>BigInt("9223372036854775807")||BigInt(e.MaximumAmount)<BigInt("0"))throw new a.ValidationError("MPTokenIssuanceCreate: MaximumAmount out of range")}else throw new a.ValidationError("MPTokenIssuanceCreate: Invalid MaximumAmount");if("number"==typeof e.TransferFee){let n=null!=(t=e.Flags)?t:0,o="number"==typeof n?(0,s.isFlagEnabled)(n,i.tfMPTCanTransfer):null!=(r=n.tfMPTCanTransfer)&&r;if(e.TransferFee<0||e.TransferFee>5e4)throw new a.ValidationError("MPTokenIssuanceCreate: TransferFee must be between 0 and 50000");if(e.TransferFee&&!o)throw new a.ValidationError("MPTokenIssuanceCreate: TransferFee cannot be provided without enabling tfMPTCanTransfer flag")}if(null!=e.MPTokenMetadata){let t=(0,o.validateMPTokenMetadata)(e.MPTokenMetadata);t.length>0&&console.warn([o.MPT_META_WARNING_HEADER,...t.map(e=>`- ${e}`)].join("\n"))}}},922370,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.validateMPTokenIssuanceSet=r.MPTokenIssuanceSetFlags=void 0;let a=e.r(227730),s=e.r(932114),o=e.r(798184);(n=i||(r.MPTokenIssuanceSetFlags=i={}))[n.tfMPTLock=1]="tfMPTLock",n[n.tfMPTUnlock=2]="tfMPTUnlock",r.validateMPTokenIssuanceSet=function(e){var t,r,n;(0,o.validateBaseTransaction)(e),(0,o.validateRequiredField)(e,"MPTokenIssuanceID",o.isString),(0,o.validateOptionalField)(e,"Holder",o.isAccount);let l=null!=(t=e.Flags)?t:0,u="number"==typeof l?(0,s.isFlagEnabled)(l,i.tfMPTLock):null!=(r=l.tfMPTLock)&&r,c="number"==typeof l?(0,s.isFlagEnabled)(l,i.tfMPTUnlock):null!=(n=l.tfMPTUnlock)&&n;if(u&&c)throw new a.ValidationError("MPTokenIssuanceSet: flag conflict")}},145725,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.validateNFTokenCreateOffer=r.NFTokenCreateOfferFlags=void 0;let a=e.r(227730),s=e.r(932114),o=e.r(798184);(n=i||(r.NFTokenCreateOfferFlags=i={}))[n.tfSellNFToken=1]="tfSellNFToken",r.validateNFTokenCreateOffer=function(e){var t,r;if((0,o.validateBaseTransaction)(e),e.Account===e.Owner)throw new a.ValidationError("NFTokenCreateOffer: Owner and Account must not be equal");if(e.Account===e.Destination)throw new a.ValidationError("NFTokenCreateOffer: Destination and Account must not be equal");if((0,o.validateOptionalField)(e,"Destination",o.isAccount),(0,o.validateOptionalField)(e,"Owner",o.isAccount),null==e.NFTokenID)throw new a.ValidationError("NFTokenCreateOffer: missing field NFTokenID");if(!(0,o.isAmount)(e.Amount))throw new a.ValidationError("NFTokenCreateOffer: invalid Amount");let n=null!=(t=e.Flags)?t:0;if("number"==typeof n?(0,s.isFlagEnabled)(n,i.tfSellNFToken):null!=(r=n.tfSellNFToken)&&r){if(null!=e.Owner)throw new a.ValidationError("NFTokenCreateOffer: Owner must not be present for sell offers")}else{if(null==e.Owner)throw new a.ValidationError("NFTokenCreateOffer: Owner must be present for buy offers");if(0>=(0,o.parseAmountValue)(e.Amount))throw new a.ValidationError("NFTokenCreateOffer: Amount must be greater than 0 for buy offers")}}},905489,(e,t,r)=>{"use strict";var i,n;
3Object.defineProperty(r,"__esModule",{value:!0}),r.validateNFTokenMint=r.NFTokenMintFlags=void 0;let a=e.r(227730),s=e.r(932114),o=e.r(798184);(n=i||(r.NFTokenMintFlags=i={}))[n.tfBurnable=1]="tfBurnable",n[n.tfOnlyXRP=2]="tfOnlyXRP",n[n.tfTrustLine=4]="tfTrustLine",n[n.tfTransferable=8]="tfTransferable",n[n.tfMutable=16]="tfMutable",r.validateNFTokenMint=function(e){if((0,o.validateBaseTransaction)(e),e.Account===e.Issuer)throw new a.ValidationError("NFTokenMint: Issuer must not be equal to Account");if((0,o.validateOptionalField)(e,"Issuer",o.isAccount),"string"==typeof e.URI&&""===e.URI)throw new a.ValidationError("NFTokenMint: URI must not be empty string");if("string"==typeof e.URI&&!(0,s.isHex)(e.URI))throw new a.ValidationError("NFTokenMint: URI must be in hex format");if(null==e.NFTokenTaxon)throw new a.ValidationError("NFTokenMint: missing field NFTokenTaxon");if(null==e.Amount&&(null!=e.Expiration||null!=e.Destination))throw new a.ValidationError("NFTokenMint: Amount is required when Expiration or Destination is present");(0,o.validateOptionalField)(e,"Amount",o.isAmount),(0,o.validateOptionalField)(e,"Expiration",o.isNumber),(0,o.validateOptionalField)(e,"Destination",o.isAccount)}},163326,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.validateOfferCreate=r.OfferCreateFlags=void 0;let a=e.r(227730),s=e.r(932114),o=e.r(798184);(n=i||(r.OfferCreateFlags=i={}))[n.tfPassive=65536]="tfPassive",n[n.tfImmediateOrCancel=131072]="tfImmediateOrCancel",n[n.tfFillOrKill=262144]="tfFillOrKill",n[n.tfSell=524288]="tfSell",n[n.tfHybrid=1048576]="tfHybrid",r.validateOfferCreate=function(e){if((0,o.validateBaseTransaction)(e),void 0===e.TakerGets)throw new a.ValidationError("OfferCreate: missing field TakerGets");if(void 0===e.TakerPays)throw new a.ValidationError("OfferCreate: missing field TakerPays");if("string"!=typeof e.TakerGets&&!(0,o.isAmount)(e.TakerGets))throw new a.ValidationError("OfferCreate: invalid TakerGets");if("string"!=typeof e.TakerPays&&!(0,o.isAmount)(e.TakerPays))throw new a.ValidationError("OfferCreate: invalid TakerPays");if(void 0!==e.Expiration&&"number"!=typeof e.Expiration)throw new a.ValidationError("OfferCreate: invalid Expiration");if(void 0!==e.OfferSequence&&"number"!=typeof e.OfferSequence)throw new a.ValidationError("OfferCreate: invalid OfferSequence");if((0,o.validateOptionalField)(e,"DomainID",o.isDomainID,{txType:"OfferCreate",paramName:"DomainID"}),null==e.DomainID&&(0,s.hasFlag)(e,i.tfHybrid,"tfHybrid"))throw new a.ValidationError("OfferCreate: tfHybrid flag cannot be set if DomainID is not present")}},492805,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.validatePayment=r.PaymentFlags=void 0;let a=e.r(227730),s=e.r(932114),o=e.r(798184);(n=i||(r.PaymentFlags=i={}))[n.tfNoRippleDirect=65536]="tfNoRippleDirect",n[n.tfPartialPayment=131072]="tfPartialPayment",n[n.tfLimitQuality=262144]="tfLimitQuality",r.validatePayment=function(e){if((0,o.validateBaseTransaction)(e),void 0===e.Amount)throw new a.ValidationError("PaymentTransaction: missing field Amount");if(!(0,o.isAmount)(e.Amount))throw new a.ValidationError("PaymentTransaction: invalid Amount");if((0,o.validateRequiredField)(e,"Destination",o.isAccount),(0,o.validateOptionalField)(e,"DestinationTag",o.isNumber),(0,o.validateCredentialsList)(e.CredentialIDs,e.TransactionType,!0,o.MAX_AUTHORIZED_CREDENTIALS),void 0!==e.InvoiceID&&"string"!=typeof e.InvoiceID)throw new a.ValidationError("PaymentTransaction: InvoiceID must be a string");if((0,o.validateOptionalField)(e,"DomainID",o.isDomainID,{txType:"PaymentTransaction",paramName:"DomainID"}),void 0!==e.Paths&&!function(e){if(!(0,o.isArray)(e)||0===e.length)return!1;for(let t of e)if(!(0,o.isArray)(t)||0===t.length||!function(e){if(!Array.isArray(e)||0===e.length)return!1;for(let t of e)if(void 0!==t.account&&"string"!=typeof t.account||void 0!==t.currency&&"string"!=typeof t.currency||void 0!==t.issuer&&"string"!=typeof t.issuer||(void 0===t.account||void 0!==t.currency||void 0!==t.issuer)&&void 0===t.currency&&void 0===t.issuer&&1)return!1;return!0}(t))return!1;return!0}(e.Paths))throw new a.ValidationError("PaymentTransaction: invali
3d Paths");if(void 0!==e.SendMax&&!(0,o.isAmount)(e.SendMax))throw new a.ValidationError("PaymentTransaction: invalid SendMax");var t,r=e;if(null!=r.DeliverMin){if(null==r.Flags)throw new a.ValidationError("PaymentTransaction: tfPartialPayment flag required with DeliverMin");let e=r.Flags;if(!("number"==typeof e?(0,s.isFlagEnabled)(e,i.tfPartialPayment):null!=(t=e.tfPartialPayment)&&t))throw new a.ValidationError("PaymentTransaction: tfPartialPayment flag required with DeliverMin");if(!(0,o.isAmount)(r.DeliverMin))throw new a.ValidationError("PaymentTransaction: invalid DeliverMin")}}},99653,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.validatePaymentChannelClaim=r.PaymentChannelClaimFlags=void 0;let a=e.r(227730),s=e.r(798184);(n=i||(r.PaymentChannelClaimFlags=i={}))[n.tfRenew=65536]="tfRenew",n[n.tfClose=131072]="tfClose",r.validatePaymentChannelClaim=function(e){if((0,s.validateBaseTransaction)(e),(0,s.validateCredentialsList)(e.CredentialIDs,e.TransactionType,!0,s.MAX_AUTHORIZED_CREDENTIALS),void 0===e.Channel)throw new a.ValidationError("PaymentChannelClaim: missing Channel");if("string"!=typeof e.Channel)throw new a.ValidationError("PaymentChannelClaim: Channel must be a string");if(void 0!==e.Balance&&"string"!=typeof e.Balance)throw new a.ValidationError("PaymentChannelClaim: Balance must be a string");if(void 0!==e.Amount&&"string"!=typeof e.Amount)throw new a.ValidationError("PaymentChannelClaim: Amount must be a string");if(void 0!==e.Signature&&"string"!=typeof e.Signature)throw new a.ValidationError("PaymentChannelClaim: Signature must be a string");if(void 0!==e.PublicKey&&"string"!=typeof e.PublicKey)throw new a.ValidationError("PaymentChannelClaim: PublicKey must be a string")}},127984,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.validateTrustSet=r.TrustSetFlags=void 0;let a=e.r(227730),s=e.r(798184);(n=i||(r.TrustSetFlags=i={}))[n.tfSetfAuth=65536]="tfSetfAuth",n[n.tfSetNoRipple=131072]="tfSetNoRipple",n[n.tfClearNoRipple=262144]="tfClearNoRipple",n[n.tfSetFreeze=1048576]="tfSetFreeze",n[n.tfClearFreeze=2097152]="tfClearFreeze",n[n.tfSetDeepFreeze=4194304]="tfSetDeepFreeze",n[n.tfClearDeepFreeze=8388608]="tfClearDeepFreeze",r.validateTrustSet=function(e){(0,s.validateBaseTransaction)(e);let{LimitAmount:t,QualityIn:r,QualityOut:i}=e;if(void 0===t)throw new a.ValidationError("TrustSet: missing field LimitAmount");if(!(0,s.isAmount)(t))throw new a.ValidationError("TrustSet: invalid LimitAmount");if(void 0!==r&&"number"!=typeof r)throw new a.ValidationError("TrustSet: QualityIn must be a number");if(void 0!==i&&"number"!=typeof i)throw new a.ValidationError("TrustSet: QualityOut must be a number")}},453557,(e,t,r)=>{"use strict";var i,n,a,s;Object.defineProperty(r,"__esModule",{value:!0}),r.validateVaultCreate=r.VaultCreateFlags=r.VaultWithdrawalPolicy=void 0;let o=e.r(227730),l=e.r(932114),u=e.r(976749),c=e.r(798184);(a=i||(r.VaultWithdrawalPolicy=i={}))[a.vaultStrategyFirstComeFirstServe=1]="vaultStrategyFirstComeFirstServe",(s=n||(r.VaultCreateFlags=n={}))[s.tfVaultPrivate=65536]="tfVaultPrivate",s[s.tfVaultShareNonTransferable=131072]="tfVaultShareNonTransferable",r.validateVaultCreate=function(e){if((0,c.validateBaseTransaction)(e),(0,c.validateRequiredField)(e,"Asset",c.isCurrency),(0,c.validateOptionalField)(e,"Data",c.isString),(0,c.validateOptionalField)(e,"AssetsMaximum",c.isXRPLNumber),(0,c.validateOptionalField)(e,"MPTokenMetadata",c.isString),(0,c.validateOptionalField)(e,"WithdrawalPolicy",c.isNumber),(0,c.validateOptionalField)(e,"DomainID",c.isString),(0,c.validateOptionalField)(e,"Scale",c.isNumber),void 0!==e.Data){let t=e.Data;if(!(0,l.isHex)(t))throw new o.ValidationError("VaultCreate: Data must be a valid hex string");let r=t.length/2;if(r>c.VAULT_DATA_MAX_BYTE_LENGTH)throw new o.ValidationError(`VaultCreate: Data exceeds ${c.VAULT_DATA_MAX_BYTE_LENGTH} bytes (actual: ${r})`)}if(void 0!==e.MPTokenMetadata){let t=e.MPTokenMetadata;if(!(0,l.isHex)(t))throw new o.ValidationError("VaultCreate: MPTokenMetadata must be a valid non-empty hex string");let r=t.length/2;if(r>u.MAX_MPT_META_BYTE_LENGTH)throw new o.ValidationError(`VaultCreate: MPTokenMetadata exceeds ${u.MAX_MPT_META_BYTE_LENGTH} bytes (actual: ${r})`)}if(void 0!==e.DomainID&&!(0,l.hasFlag)(e,n.tfVaultPrivate,"tfVaultPrivate"))throw new o.ValidationError("VaultCreate: Cannot set DomainID unless tfVaultPrivate flag is set.");let t=e.Asset,r="XRP"===t.currency,i="mpt_issuance_id"in t;if(void 0!==e.Scale){if(r||i)throw new o.ValidationError("VaultCreate: Scale parameter must not be provided for XRP or MPT assets");if(!r&&!i&&(!Number.isInteger(e.Scale)||e.Scale<0||e.Scale>18))throw new o.ValidationError("VaultCreate: Scale must be a number between 0 and 18 inclusive for IOU assets")}if(null!=e.MPTokenMetadata){let t=(0,u.validateMPTokenMetadata)(e.MPTokenMetadata);t.length>0&&console.warn([u.MPT_META_WARNING_HEADER,...t.map(e=>`- ${e}`)].join("\n"))}}},872349,(e,t,r)=>{"use strict";var i,n;
3Object.defineProperty(r,"__esModule",{value:!0}),r.validateXChainModifyBridge=r.XChainModifyBridgeFlags=void 0;let a=e.r(798184);(n=i||(r.XChainModifyBridgeFlags=i={}))[n.tfClearAccountCreateAmount=65536]="tfClearAccountCreateAmount",r.validateXChainModifyBridge=function(e){(0,a.validateBaseTransaction)(e),(0,a.validateRequiredField)(e,"XChainBridge",a.isXChainBridge),(0,a.validateOptionalField)(e,"SignatureReward",a.isAmount),(0,a.validateOptionalField)(e,"MinAccountCreateAmount",a.isAmount)}},529155,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.parseTransactionFlags=r.convertTxFlagsToNumber=r.setTransactionFlagsToNumber=r.parseAccountRootFlags=void 0;let i=e.r(227730),n=e.r(832575),a=e.r(715204),s=e.r(376204),o=e.r(260390),l=e.r(359256),u=e.r(783020),c=e.r(798184),d=e.r(529802),f=e.r(882843),h=e.r(457648),p=e.r(889678),g=e.r(922370),m=e.r(145725),y=e.r(905489),v=e.r(163326),b=e.r(492805),w=e.r(99653),_=e.r(127984),A=e.r(453557),S=e.r(872349),E=e.r(932114);r.parseAccountRootFlags=function(e){let t={};return Object.values(n.AccountRootFlags).forEach(r=>{"string"==typeof r&&(0,E.isFlagEnabled)(e,n.AccountRootFlags[r])&&(t[r]=!0)}),t};let x={AccountSet:a.AccountSetTfFlags,AMMClawback:s.AMMClawbackFlags,AMMDeposit:o.AMMDepositFlags,AMMWithdraw:l.AMMWithdrawFlags,Batch:u.BatchFlags,LoanManage:d.LoanManageFlags,LoanPay:f.LoanPayFlags,MPTokenAuthorize:h.MPTokenAuthorizeFlags,MPTokenIssuanceCreate:p.MPTokenIssuanceCreateFlags,MPTokenIssuanceSet:g.MPTokenIssuanceSetFlags,NFTokenCreateOffer:m.NFTokenCreateOfferFlags,NFTokenMint:y.NFTokenMintFlags,OfferCreate:v.OfferCreateFlags,PaymentChannelClaim:w.PaymentChannelClaimFlags,Payment:b.PaymentFlags,TrustSet:_.TrustSetFlags,VaultCreate:A.VaultCreateFlags,XChainModifyBridge:S.XChainModifyBridgeFlags};function T(e){let t=e.Flags;if(null==t)return 0;if("number"==typeof t)return t;if(e.TransactionType in x){let r=x[e.TransactionType];return Object.keys(t).reduce((e,n)=>{var a;if(null==r[n]&&null==c.GlobalFlags[n])throw new i.ValidationError(`Invalid flag ${n}.`);return t[n]?e|(null!=(a=r[n])?a:c.GlobalFlags[n]):e},0)}return Object.keys(t).reduce((e,r)=>{if(null==c.GlobalFlags[r])throw new i.ValidationError(`Invalid flag ${r}. Valid flags are ${JSON.stringify(c.GlobalFlags)}`);return t[r]?e|c.GlobalFlags[r]:e},0)}r.setTransactionFlagsToNumber=function(e){console.warn("This function is deprecated. Use convertTxFlagsToNumber() instead and use the returned value to modify the Transaction.Flags from the caller."),e.Flags&&(e.Flags=T(e))},r.convertTxFlagsToNumber=T,r.parseTransactionFlags=function(e){let t=T(e);if(0===t)return{};let r={};if(e.TransactionType in x){let i=x[e.TransactionType];Object.values(i).forEach(e=>{"string"==typeof e&&(0,E.isFlagEnabled)(t,i[e])&&(r[e]=!0)})}return Object.values(c.GlobalFlags).forEach(e=>{"string"==typeof e&&(0,E.isFlagEnabled)(t,c.GlobalFlags[e])&&(r[e]=!0)}),r}},318267,e=>{"use strict";var t=e.i(940188),r=e.i(922543);let i=Uint32Array.from([0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0]),n=new Uint32Array(80);class a extends t.HashMD{A=0|i[0];B=0|i[1];C=0|i[2];D=0|i[3];E=0|i[4];constructor(){super(64,20,8,!1)}get(){let{A:e,B:t,C:r,D:i,E:n}=this;return[e,t,r,i,n]}set(e,t,r,i,n){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|n}process(e,i){for(let t=0;t<16;t++,i+=4)n[t]=e.getUint32(i,!1);for(let e=16;e<80;e++)n[e]=(0,r.rotl)(n[e-3]^n[e-8]^n[e-14]^n[e-16],1);let{A:a,B:s,C:o,D:l,E:u}=this;for(let e=0;e<80;e++){let i,c;e<20?(i=(0,t.Chi)(s,o,l),c=0x5a827999):e<40?(i=s^o^l,c=0x6ed9eba1):e<60?(i=(0,t.Maj)(s,o,l),c=0x8f1bbcdc):(i=s^o^l,c=0xca62c1d6);let d=(0,r.rotl)(a,5)+i+u+c+n[e]|0;u=l,l=o,o=(0,r.rotl)(s,30),s=a,a=d}a=a+this.A|0,s=s+this.B|0,o=o+this.C|0,l=l+this.D|0,u=u+this.E|0,this.set(a,s,o,l,u)}roundClean(){(0,r.clean)(n)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0),(0,r.clean)(this.buffer)}}let s=(0,r.createHasher)(()=>new a),o=Array.from({length:64},(e,t)=>Math.floor(0x100000000*Math.abs(Math.sin(t+1)))),l=i.slice(0,4),u=new Uint32Array(16);class c extends t.HashMD{A=0|l[0];B=0|l[1];C=0|l[2];D=0|l[3];constructor(){super(64,16,8,!0)}get(){let{A:e,B:t,C:r,D:i}=this;return[e,t,r,i]}
3set(e,t,r,i){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i}process(e,i){for(let t=0;t<16;t++,i+=4)u[t]=e.getUint32(i,!0);let{A:n,B:a,C:s,D:l}=this;for(let e=0;e<64;e++){let i,c,d;e<16?(i=(0,t.Chi)(a,s,l),c=e,d=[7,12,17,22]):e<32?(i=(0,t.Chi)(l,a,s),c=(5*e+1)%16,d=[5,9,14,20]):e<48?(i=a^s^l,c=(3*e+5)%16,d=[4,11,16,23]):(i=s^(a|~l),c=7*e%16,d=[6,10,15,21]),i=i+n+o[e]+u[c],n=l,l=s,s=a,a+=(0,r.rotl)(i,d[e%4])}n=n+this.A|0,a=a+this.B|0,s=s+this.C|0,l=l+this.D|0,this.set(n,a,s,l)}roundClean(){(0,r.clean)(u)}destroy(){this.destroyed=!0,this.set(0,0,0,0),(0,r.clean)(this.buffer)}}let d=(0,r.createHasher)(()=>new c),f=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),h=Uint8Array.from(Array(16).fill(0).map((e,t)=>t)),p=h.map(e=>(9*e+5)%16),g=(()=>{let e=[[h],[p]];for(let t=0;t<4;t++)for(let r of e)r.push(r[t].map(e=>f[e]));return e})(),m=g[0],y=g[1],v=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),b=m.map((e,t)=>e.map(e=>v[t][e])),w=y.map((e,t)=>e.map(e=>v[t][e])),_=Uint32Array.from([0,0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xa953fd4e]),A=Uint32Array.from([0x50a28be6,0x5c4dd124,0x6d703ef3,0x7a6d76e9,0]);function S(e,t,r,i){return 0===e?t^r^i:1===e?t&r|~t&i:2===e?(t|~r)^i:3===e?t&i|r&~i:t^(r|~i)}let E=new Uint32Array(16);class x extends t.HashMD{h0=0x67452301;h1=-0x10325477;h2=-0x67452302;h3=0x10325476;h4=-0x3c2d1e10;constructor(){super(64,20,8,!0)}get(){let{h0:e,h1:t,h2:r,h3:i,h4:n}=this;return[e,t,r,i,n]}set(e,t,r,i,n){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|i,this.h4=0|n}process(e,t){for(let r=0;r<16;r++,t+=4)E[r]=e.getUint32(t,!0);let i=0|this.h0,n=i,a=0|this.h1,s=a,o=0|this.h2,l=o,u=0|this.h3,c=u,d=0|this.h4,f=d;for(let e=0;e<5;e++){let t=4-e,h=_[e],p=A[e],g=m[e],v=y[e],x=b[e],T=w[e];for(let t=0;t<16;t++){let n=(0,r.rotl)(i+S(e,a,o,u)+E[g[t]]+h,x[t])+d|0;i=d,d=u,u=0|(0,r.rotl)(o,10),o=a,a=n}for(let e=0;e<16;e++){let i=(0,r.rotl)(n+S(t,s,l,c)+E[v[e]]+p,T[e])+f|0;n=f,f=c,c=0|(0,r.rotl)(l,10),l=s,s=i}}this.set(this.h1+o+c|0,this.h2+u+f|0,this.h3+d+n|0,this.h4+i+s|0,this.h0+a+l|0)}roundClean(){(0,r.clean)(E)}destroy(){this.destroyed=!0,(0,r.clean)(this.buffer),this.set(0,0,0,0,0)}}let T=(0,r.createHasher)(()=>new x);e.s(["_MD5",0,c,"_RIPEMD160",0,x,"_SHA1",0,a,"md5",0,d,"ripemd160",0,T,"sha1",0,s])},207650,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.ripemd160=void 0;let n=e.r(318267);r.ripemd160=(0,i(e.r(677580)).default)(n.ripemd160)},371340,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isHash=r.validateObject=r.memoized=r.notImplemented=r.createHmacDrbg=r.bitMask=r.bitSet=r.bitGet=r.bitLen=r.aInRange=r.inRange=r.asciiToBytes=r.copyBytes=r.equalBytes=r.ensureBytes=r.numberToVarBytesBE=r.numberToBytesLE=r.numberToBytesBE=r.bytesToNumberLE=r.bytesToNumberBE=r.hexToNumber=r.numberToHexUnpadded=r.abool=r.utf8ToBytes=r.randomBytes=r.isBytes=r.hexToBytes=r.concatBytes=r.bytesToUtf8=r.bytesToHex=r.anumber=r.abytes=void 0;let i=e.r(820376);r.abytes=i.abytes,r.anumber=i.anumber,r.bytesToHex=i.bytesToHex,r.bytesToUtf8=i.bytesToUtf8,r.concatBytes=i.concatBytes,r.hexToBytes=i.hexToBytes,r.isBytes=i.isBytes,r.randomBytes=i.randomBytes,r.utf8ToBytes=i.utf8ToBytes,r.abool=i.abool,r.numberToHexUnpadded=i.numberToHexUnpadded,r.hexToNumber=i.hexToNumber,r.bytesToNumberBE=i.bytesToNumberBE,r.bytesToNumberLE=i.bytesToNumberLE,r.numberToBytesBE=i.numberToBytesBE,r.numberToBytesLE=i.numberToBytesLE,r.numberToVarBytesBE=i.numberToVarBytesBE,r.ensureBytes=i.ensureBytes,r.equalBytes=i.equalBytes,r.copyBytes=i.copyBytes,r.asciiToBytes=i.asciiToBytes,r.inRange=i.inRange,r.aInRange=i.aInRange,r.bitLen=i.bitLen,r.bitGet=i.bitGet,r.bitSet=i.bitSet,r.bitMask=i.bitMask,r.createHmacDrbg=i.createHmacDrbg,r.notImplemented=i.notImplemented,r.memoized=i.memoized,r.validateObject=i.validateObject,r.isHash=i.isHash},126210,(e,t,r)=>{"use strict";
3Object.defineProperty(r,"__esModule",{value:!0});let i=e.r(51668),n=e.r(371340);class a{constructor(){this.hash=i.sha512.create()}static half(e){return new a().add(e).first256()}add(e){return this.hash.update(e),this}addU32(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),this.add(t)}finish(){return this.hash.digest()}first256(){return this.finish().slice(0,32)}first256BigInt(){return(0,n.bytesToNumberBE)(this.first256())}}r.default=a},40274,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.accountPublicFromPublicGenerator=r.derivePrivateKey=void 0;let n=e.r(124906),a=i(e.r(126210)),s=BigInt(0);function o(e,t){let r=n.secp256k1.CURVE.n;for(let i=0;i<=0xffffffff;i++){let n=new a.default().add(e);void 0!==t&&n.addU32(t),n.addU32(i);let o=n.first256BigInt();if(o>s&&o<r)return o}throw Error("impossible unicorn ;)")}r.derivePrivateKey=function(e,t={}){let r=t.validator,i=n.secp256k1.CURVE.n,a=o(e);return r?a:(o(n.secp256k1.ProjectivePoint.BASE.multiply(a).toRawBytes(!0),t.accountIndex||0)+a)%i},r.accountPublicFromPublicGenerator=function(e){let t=n.secp256k1.ProjectivePoint.fromHex(e),r=o(e,0),i=n.secp256k1.ProjectivePoint.BASE.multiply(r);return t.add(i).toRawBytes(!0)}},728498,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default={ok(e,t){if(!e)throw Error(t)}}},316934,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.getAlgorithmFromPrivateKey=r.getAlgorithmFromPublicKey=r.getAlgorithmFromKey=void 0,(n=i||(i={}))[n.NONE=-1]="NONE",n[n.ED25519=237]="ED25519",n[n.SECP256K1_PUB_X=2]="SECP256K1_PUB_X",n[n.SECP256K1_PUB_X_ODD_Y=3]="SECP256K1_PUB_X_ODD_Y",n[n.SECP256K1_PUB_XY=4]="SECP256K1_PUB_XY",n[n.SECP256K1_PRIVATE=0]="SECP256K1_PRIVATE";let a={[`private_${i.NONE}_32`]:"ecdsa-secp256k1",[`private_${i.SECP256K1_PRIVATE}_33`]:"ecdsa-secp256k1",[`private_${i.ED25519}_33`]:"ed25519",[`public_${i.ED25519}_33`]:"ed25519",[`public_${i.SECP256K1_PUB_X}_33`]:"ecdsa-secp256k1",[`public_${i.SECP256K1_PUB_X_ODD_Y}_33`]:"ecdsa-secp256k1",[`public_${i.SECP256K1_PUB_XY}_65`]:"ecdsa-secp256k1"};function s(e){return e===i.NONE?"None":`0x${e.toString(16).padStart(2,"0")}`}function o(e,t){let{prefix:r,len:n}={prefix:e.length<2?i.NONE:parseInt(e.slice(0,2),16),len:e.length/2},o="private"===t&&32===n?i.NONE:r,l=a[`${t}_${o}_${n}`];if(!l)throw Error(function({key:e,type:t,prefix:r,len:i}){let n,o=(n={algorithm:17,prefix:6},Object.entries(a).filter(([e])=>e.startsWith(t)).map(([e,t])=>{let[,r,i]=e.split("_"),a=t.padEnd(n.algorithm),o=s(Number(r)).padEnd(n.prefix);return`${a} - Prefix: ${o} Length: ${i} bytes`}).join("\n"));return`invalid_key: 4 5Type: ${t} 6Key: ${e} 7Prefix: ${s(r)} 8Length: ${i} bytes 9 10Acceptable ${t} formats are: 11${o} 12`}({key:e,type:t,len:n,prefix:o}));return l}r.getAlgorithmFromKey=o,r.getAlgorithmFromPublicKey=function(e){return o(e,"public")},r.getAlgorithmFromPrivateKey=function(e){return o(e,"private")}},124687,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(371340),a=e.r(124906),s=e.r(575280),o=e.r(40274),l=i(e.r(728498)),u=i(e.r(126210));r.default={deriveKeypair(e,t){let r=(0,o.derivePrivateKey)(e,t);return{privateKey:"00"+(0,s.bytesToHex)((0,n.numberToBytesBE)(r,32)),publicKey:(0,s.bytesToHex)(a.secp256k1.getPublicKey(r,!0))}},sign(e,t){l.default.ok(66===t.length&&t.startsWith("00")||64===t.length);let r=66===t.length?t.slice(2):t;return a.secp256k1.sign(u.default.half(e),r,{lowS:!0,extraEntropy:void 0}).toDERHex(!0).toUpperCase()},verify(e,t,r){let i=a.secp256k1.Signature.fromDER(t);return a.secp256k1.verify(i,u.default.half(e),r)}}},480011,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(955961),a=e.r(575280),s=i(e.r(728498)),o=i(e.r(126210));r.default={deriveKeypair(e){let t=o.default.half(e);return{privateKey:"ED"+(0,a.bytesToHex)(t),publicKey:"ED"+(0,a.bytesToHex)(n.ed25519.getPublicKey(t))}},sign:(e,t)=>(s.default.ok(e instanceof Uint8Array,"message must be array of octets"),s.default.ok(66===t.length,"private key must be 33 bytes including prefix"),(0,a.bytesToHex)(n.ed25519.sign(e,t.slice(2)))),verify:(e,t,r)=>(s.default.ok(66===r.length,"public key must be 33 bytes including prefix"),n.ed25519.verify(t,e,r.slice(2),{zip215:!1}))}},377702,(e,t,r)=>{"use strict";
12var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeSeed=r.deriveNodeAddress=r.deriveAddress=r.verify=r.sign=r.deriveKeypair=r.generateSeed=void 0;let n=e.r(550294);Object.defineProperty(r,"decodeSeed",{enumerable:!0,get:function(){return n.decodeSeed}});let a=e.r(207650),s=e.r(555263),o=e.r(575280),l=e.r(40274),u=i(e.r(126210)),c=i(e.r(728498)),d=e.r(316934),f=i(e.r(124687)),h=i(e.r(480011));function p(e){return({"ecdsa-secp256k1":f.default,ed25519:h.default})[e]}function g(e){return(0,n.encodeAccountID)((0,a.ripemd160)((0,s.sha256)(e)))}r.generateSeed=function(e={}){c.default.ok(!e.entropy||e.entropy.length>=16,"entropy too short");let t=e.entropy?e.entropy.slice(0,16):(0,o.randomBytes)(16),r="ed25519"===e.algorithm?"ed25519":"secp256k1";return(0,n.encodeSeed)(t,r)},r.deriveKeypair=function(e,t){var r;let i=(0,n.decodeSeed)(e),a=p("ed25519"===(null!=(r=null==t?void 0:t.algorithm)?r:i.type)?"ed25519":"ecdsa-secp256k1"),s=a.deriveKeypair(i.bytes,t),o=u.default.half("This test message should verify."),l=a.sign(o,s.privateKey);if(!a.verify(o,l,s.publicKey))throw Error("derived keypair did not generate verifiable signature");return s},r.sign=function(e,t){return p((0,d.getAlgorithmFromPrivateKey)(t)).sign((0,o.hexToBytes)(e),t)},r.verify=function(e,t,r){return p((0,d.getAlgorithmFromPublicKey)(r)).verify((0,o.hexToBytes)(e),t,r)},r.deriveAddress=function(e){return g((0,o.hexToBytes)(e))},r.deriveNodeAddress=function(e){let t=(0,n.decodeNodePublic)(e);return g((0,l.accountPublicFromPublicGenerator)(t))}},272148,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.deriveXAddress=r.deriveAddress=r.deriveKeypair=void 0;let i=e.r(550294),n=e.r(377702);Object.defineProperty(r,"deriveKeypair",{enumerable:!0,get:function(){return n.deriveKeypair}}),Object.defineProperty(r,"deriveAddress",{enumerable:!0,get:function(){return n.deriveAddress}}),r.deriveXAddress=function(e){let t=(0,n.deriveAddress)(e.publicKey);return(0,i.classicAddressToXAddress)(t,e.tag,e.test)}},78437,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.omitBy=r.groupBy=void 0,r.groupBy=function(e,t){return e.reduce(function(e,r,i,n){let a=t(r,i,n)||0,s=e[a]||[];return s.push(r),e[a]=s,e},{})},r.omitBy=function(e,t){return Object.keys(e).filter(r=>!t(e[r],r)).reduce((t,r)=>(t[r]=e[r],t),{})}},960972,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.xrpToDrops=r.dropsToXrp=void 0;let n=i(e.r(892623)),a=e.r(227730),s=/^-?[0-9.]+$/u;r.dropsToXrp=function(e){let t=new n.default(e).toString(10);if("string"==typeof e&&"NaN"===t)throw new a.ValidationError(`dropsToXrp: invalid value '${e}', should be a BigNumber or string-encoded number.`);if(t.includes("."))throw new a.ValidationError(`dropsToXrp: value '${t}' has too many decimal places.`);if(!s.exec(t))throw new a.ValidationError(`dropsToXrp: failed sanity check - value '${t}', does not match (^-?[0-9]+$).`);return new n.default(t).dividedBy(1e6).toNumber()},r.xrpToDrops=function(e){let t=new n.default(e).toString(10);if("string"==typeof e&&"NaN"===t)throw new a.ValidationError(`xrpToDrops: invalid value '${e}', should be a BigNumber or string-encoded number.`);if(!s.exec(t))throw new a.ValidationError(`xrpToDrops: failed sanity check - value '${t}', does not match (^-?[0-9.]+$).`);let r=t.split(".");if(r.length>2)throw new a.ValidationError(`xrpToDrops: failed sanity check - value '${t}' has too many decimal points.`);if((r[1]||"0").length>6)throw new a.ValidationError(`xrpToDrops: value '${t}' has too many decimal places.`);return new n.default(t).times(1e6).integerValue(n.default.ROUND_FLOOR).toString(10)}},232454,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});let n=i(e.r(892623)),a=e.r(78437),s=e.r(960972);function o(e){let t=Object.keys(e)[0],r=e[t];return Object.assign(Object.assign({},r),{NodeType:t,LedgerEntryType:r.LedgerEntryType,LedgerIndex:r.LedgerIndex,NewFields:r.NewFields,FinalFields:r.FinalFields,PreviousFields:r.PreviousFields})}function l(e){return new n.default("string"==typeof e?e:e.value)}function u(e){var t,r,i;let n=null;
12return((null==(t=e.NewFields)?void 0:t.Balance)?n=l(e.NewFields.Balance):(null==(r=e.PreviousFields)?void 0:r.Balance)&&(null==(i=e.FinalFields)?void 0:i.Balance)&&(n=l(e.FinalFields.Balance).minus(l(e.PreviousFields.Balance))),null===n||n.isZero())?null:n}r.default=function(e){var t;return t=(0===e.AffectedNodes.length?[]:e.AffectedNodes.map(o)).map(e=>{if("AccountRoot"===e.LedgerEntryType){var t,r,i;let n,a=null===(n=u(e))?null:{account:null!=(r=null==(t=e.FinalFields)?void 0:t.Account)?r:null==(i=e.NewFields)?void 0:i.Account,balance:{currency:"XRP",value:(0,s.dropsToXrp)(n).toString()}};return null==a?[]:[a]}if("RippleState"===e.LedgerEntryType){let t=function(e){var t,r,i;let a,s=u(e);if(null===s)return null;let o=null!=(t=e.NewFields)?t:e.FinalFields,l={account:null==(r=null==o?void 0:o.LowLimit)?void 0:r.issuer,balance:{issuer:null==(i=null==o?void 0:o.HighLimit)?void 0:i.issuer,currency:(null==o?void 0:o.Balance).currency,value:s.toString()}};return[l,(a=new n.default(l.balance.value).negated(),{account:l.balance.issuer,balance:{issuer:l.account,currency:l.balance.currency,value:a.toString()}})]}(e);return null==t?[]:t}return[]}).flat(),Object.entries((0,a.groupBy)(t,e=>e.account)).map(([e,t])=>({account:e,balances:t.map(e=>e.balance)}))}},858908,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isDeletedNode=r.isModifiedNode=r.isCreatedNode=void 0,r.isCreatedNode=function(e){return Object.prototype.hasOwnProperty.call(e,"CreatedNode")},r.isModifiedNode=function(e){return Object.prototype.hasOwnProperty.call(e,"ModifiedNode")},r.isDeletedNode=function(e){return Object.prototype.hasOwnProperty.call(e,"DeletedNode")}},28731,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let i=e.r(522236),n=e.r(858908);r.default=function(e){if("string"!=typeof e&&(null==e?void 0:e.AffectedNodes)===void 0)throw TypeError(`Unable to parse the parameter given to getNFTokenID. 13 'meta' must be the metadata from an NFTokenMint transaction. Received ${JSON.stringify(e)} instead.`);let t=("string"==typeof e?(0,i.decode)(e):e).AffectedNodes.filter(e=>{var t;return(0,n.isCreatedNode)(e)?"NFTokenPage"===e.CreatedNode.LedgerEntryType:!!(0,n.isModifiedNode)(e)&&"NFTokenPage"===e.ModifiedNode.LedgerEntryType&&!!(null==(t=e.ModifiedNode.PreviousFields)?void 0:t.NFTokens)}),r=new Set(t.flatMap(e=>{var t;return((0,n.isModifiedNode)(e)?null==(t=e.ModifiedNode.PreviousFields)?void 0:t.NFTokens:[]).map(e=>e.NFToken.NFTokenID)}).filter(e=>!!e));return t.flatMap(e=>{var t,r,i,n,a,s;return(null!=(s=null!=(i=null==(r=null==(t=e.ModifiedNode)?void 0:t.FinalFields)?void 0:r.NFTokens)?i:null==(a=null==(n=e.CreatedNode)?void 0:n.NewFields)?void 0:a.NFTokens)?s:[]).map(e=>e.NFToken.NFTokenID)}).filter(e=>!!e).find(e=>!r.has(e))}},256015,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let i=e.r(522236),n=e.r(858908);r.default=function(e){if("string"!=typeof e&&(null==e?void 0:e.AffectedNodes)===void 0)throw TypeError(`Unable to parse the parameter given to getXChainClaimID. 14 'meta' must be the metadata from an XChainCreateClaimID transaction. Received ${JSON.stringify(e)} instead.`);let t="string"==typeof e?(0,i.decode)(e):e;if(!t.TransactionResult)throw TypeError("Cannot get XChainClaimID from un-validated transaction");if("tesSUCCESS"===t.TransactionResult)return t.AffectedNodes.find(e=>(0,n.isCreatedNode)(e)&&"XChainOwnedClaimID"===e.CreatedNode.LedgerEntryType).CreatedNode.NewFields.XChainClaimID}},122001,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),(n=i||(i={}))[n.TRANSACTION_ID=0x54584e00]="TRANSACTION_ID",n[n.TRANSACTION_NODE=0x534e4400]="TRANSACTION_NODE",n[n.INNER_NODE=0x4d494e00]="INNER_NODE",n[n.LEAF_NODE=0x4d4c4e00]="LEAF_NODE",n[n.TRANSACTION_SIGN=0x53545800]="TRANSACTION_SIGN",n[n.TRANSACTION_SIGN_TESTNET=0x73747800]="TRANSACTION_SIGN_TESTNET",n[n.TRANSACTION_MULTISIGN=0x534d5400]="TRANSACTION_MULTISIGN",n[n.LEDGER=0x4c575200]="LEDGER",r.default=i},217540,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let i=e.r(51668),n=e.r(575280);r.default=function(e){return(0,n.bytesToHex)((0,i.sha512)((0,n.hexToBytes)(e)).slice(0,32))}},211333,(e,t,r)=>{"use strict";var i,n;
14Object.defineProperty(r,"__esModule",{value:!0}),r.Node=r.NodeType=void 0,(n=i||(r.NodeType=i={}))[n.INNER=1]="INNER",n[n.TRANSACTION_NO_METADATA=2]="TRANSACTION_NO_METADATA",n[n.TRANSACTION_METADATA=3]="TRANSACTION_METADATA",n[n.ACCOUNT_STATE=4]="ACCOUNT_STATE",r.Node=class{}},66261,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(227730),a=i(e.r(122001)),s=i(e.r(217540)),o=e.r(211333);class l extends o.Node{constructor(e,t,r){super(),this.tag=e,this.type=r,this.data=t}get hash(){switch(this.type){case o.NodeType.ACCOUNT_STATE:{let e=a.default.LEAF_NODE.toString(16);return(0,s.default)(e+this.data+this.tag)}case o.NodeType.TRANSACTION_NO_METADATA:{let e=a.default.TRANSACTION_ID.toString(16);return(0,s.default)(e+this.data)}case o.NodeType.TRANSACTION_METADATA:{let e=a.default.TRANSACTION_NODE.toString(16);return(0,s.default)(e+this.data+this.tag)}default:throw new n.XrplError("Tried to hash a SHAMap node of unknown type.")}}addItem(e,t){throw new n.XrplError("Cannot call addItem on a LeafNode")}}r.default=l},729234,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(227730),a=i(e.r(122001)),s=i(e.r(217540)),o=i(e.r(66261)),l=e.r(211333),u="0000000000000000000000000000000000000000000000000000000000000000";class c extends l.Node{constructor(e=0){super(),this.leaves={},this.type=l.NodeType.INNER,this.depth=e,this.empty=!0}get hash(){if(this.empty)return u;let e="";for(let t=0;t<=15;t++){let r=this.leaves[t];e+=null==r?u:r.hash}let t=a.default.INNER_NODE.toString(16);return(0,s.default)(t+e)}addItem(e,t){let r=this.getNode(parseInt(e[this.depth],16));if(void 0===r)return void this.setNode(parseInt(e[this.depth],16),t);if(r instanceof c)r.addItem(e,t);else if(r instanceof o.default)if(r.tag===e)throw new n.XrplError("Tried to add a node to a SHAMap that was already in there.");else{let i=new c(this.depth+1);i.addItem(r.tag,r),i.addItem(e,t),this.setNode(parseInt(e[this.depth],16),i)}}setNode(e,t){if(e<0||e>15)throw new n.XrplError("Invalid slot: slot must be between 0-15.");this.leaves[e]=t,this.empty=!1}getNode(e){if(e<0||e>15)throw new n.XrplError("Invalid slot: slot must be between 0-15.");return this.leaves[e]}}r.default=c},907572,(e,t,r)=>{"use strict";var i=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},a=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});let s=a(e.r(729234)),o=a(e.r(66261));n(e.r(211333),r),r.default=class{constructor(){this.root=new s.default(0)}get hash(){return this.root.hash}addItem(e,t,r){this.root.addItem(e,new o.default(e,t,r))}}},880432,(e,t,r)=>{"use strict";var i=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=e.e&&e.e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=e.e&&e.e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},s=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.hashStateTree=r.hashTxTree=r.hashLedgerHeader=r.hashSignedTx=void 0;let o=e.r(575280),l=s(e.r(892623)),u=e.r(522236),c=e.r(227730),d=e.r(798184),f=e.r(932114),h=s(e.r(122001)),p=s(e.r(217540)),g=a(e.r(907572));function m(e,t){return Number(e).toString(16).padStart(2*t,"0")}function y(e){let t=e.length/2;if(t<=192)return(0,o.bytesToHex)([t])+e;if(t<=12480){let r=t-193;return(0,o.bytesToHex)([193+(r>>>8),255&r])+e}if(t<=918744){let r=t-12481;return(0,o.bytesToHex)([241+(r>>>16),r>>>8&255,255&r])+e}throw new c.XrplError("Variable integer overflow.")}function v(e){let t,r;if("string"==typeof e?(t=e,r=(0,u.decode)(e)):(t=(0,u.encode)(e),r=e),void 0===r.TxnSignature&&void 0===r.Signers&&void 0===r.SigningPubKey&&!(0,f.hasFlag)(r,d.GlobalFlags.tfInnerBatchTxn,"tfInnerBatchTxn"))throw new c.ValidationError("The transaction must be signed to hash it.");let i=h.default.TRANSACTION_ID.toString(16).toUpperCase();return(0,p.default)(i.concat(t))}function b(e){var t;let r=h.default.LEDGER.toString(16).toUpperCase()+m(Number(e.ledger_index),4)+(t=e.total_coins,new l.default(t).toString(16).padStart(16,"0"))+e.parent_hash+e.transaction_hash+e.account_hash+m(e.parent_close_time,4)+m(e.close_time,4)+m(e.close_time_resolution,1)+m(e.close_flags,1);return(0,p.default)(r)}function w(e){var t;let r=new g.default;for(let i of e){let e=(0,u.encode)(i),n=(0,u.encode)(null!=(t=i.metaData)?t:{}),a=v(e),s=y(e)+y(n);r.addItem(a,s,g.NodeType.TRANSACTION_METADATA)}return r.hash}function _(e){let t=new g.default;
14return e.forEach(e=>{let r=(0,u.encode)(e);t.addItem(e.index,r,g.NodeType.ACCOUNT_STATE)}),t.hash}r.hashSignedTx=v,r.hashLedgerHeader=b,r.hashTxTree=w,r.hashStateTree=_,r.default=function(e,t={}){let r={transaction_hash:function(e,t){let{transaction_hash:r}=e;if(!t.computeTreeHashes)return r;if(null==e.transactions)throw new c.ValidationError("transactions is missing from the ledger");let i=w(e.transactions);if(r!==i)throw new c.ValidationError("transactionHash in header does not match computed hash of transactions",{transactionHashInHeader:r,computedHashOfTransactions:i});return i}(e,t),account_hash:function(e,t){let{account_hash:r}=e;if(!t.computeTreeHashes)return r;if(null==e.accountState)throw new c.ValidationError("accountState is missing from the ledger");let i=_(e.accountState);if(r!==i)throw new c.ValidationError("stateHash in header does not match computed hash of state");return i}(e,t)};return b(Object.assign(Object.assign({},e),r))}},389799,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default={account:"a",dirNode:"d",generatorMap:"g",rippleState:"r",offer:"o",ownerDir:"O",bookDir:"B",contract:"c",skipList:"s",escrow:"u",amendment:"f",feeSettings:"e",ticket:"T",signerList:"S",paychan:"x",check:"C",depositPreauth:"p",vault:"V",loanBroker:"l",loan:"L"}},254234,(e,t,r)=>{"use strict";var i=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=e.e&&e.e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=e.e&&e.e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},s=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.hashTxTree=r.hashStateTree=r.hashLedger=r.hashSignedTx=r.hashLedgerHeader=r.hashLoan=r.hashLoanBroker=r.hashVault=r.hashPaymentChannel=r.hashEscrow=r.hashTrustline=r.hashOfferId=r.hashSignerListId=r.hashAccountRoot=r.hashTx=void 0;let o=e.r(575280),l=s(e.r(892623)),u=e.r(550294),c=a(e.r(880432));r.hashLedger=c.default,Object.defineProperty(r,"hashLedgerHeader",{enumerable:!0,get:function(){return c.hashLedgerHeader}}),Object.defineProperty(r,"hashSignedTx",{enumerable:!0,get:function(){return c.hashSignedTx}}),Object.defineProperty(r,"hashTxTree",{enumerable:!0,get:function(){return c.hashTxTree}}),Object.defineProperty(r,"hashStateTree",{enumerable:!0,get:function(){return c.hashStateTree}});let d=s(e.r(122001)),f=s(e.r(389799)),h=s(e.r(217540));function p(e){return(0,o.bytesToHex)((0,u.decodeAccountID)(e))}function g(e){return f.default[e].charCodeAt(0).toString(16).padStart(4,"0")}r.hashTx=function(e){let t=d.default.TRANSACTION_SIGN.toString(16).toUpperCase();return(0,h.default)(t+e)},r.hashAccountRoot=function(e){return(0,h.default)(g("account")+p(e))},r.hashSignerListId=function(e){return(0,h.default)(`${g("signerList")+p(e)}00000000`)},r.hashOfferId=function(e,t){let r=f.default.offer.charCodeAt(0).toString(16).padStart(2,"0"),i=t.toString(16).padStart(8,"0"),n=`00${r}`;return(0,h.default)(n+p(e)+i)},r.hashTrustline=function(e,t,r){let i=p(e),n=p(t),a=new l.default(i,16).isGreaterThan(new l.default(n,16)),s=a?n:i,u=a?i:n,c=g("rippleState");return(0,h.default)(c+s+u+function(e){if(3!==e.length)return e;let t=Array(20).fill(0);return t[12]=255&e.charCodeAt(0),t[13]=255&e.charCodeAt(1),t[14]=255&e.charCodeAt(2),(0,o.bytesToHex)(Uint8Array.from(t))}(r))},r.hashEscrow=function(e,t){return(0,h.default)(g("escrow")+p(e)+t.toString(16).padStart(8,"0"))},r.hashPaymentChannel=function(e,t,r){return(0,h.default)(g("paychan")+p(e)+p(t)+r.toString(16).padStart(8,"0"))},r.hashVault=function(e,t){return(0,h.default)(g("vault")+p(e)+t.toString(16).padStart(8,"0"))},r.hashLoanBroker=function(e,t){return(0,h.default)(g("loanBroker")+p(e)+t.toString(16).padStart(8,"0"))},r.hashLoan=function(e,t){return(0,h.default)(g("loan")+e+t.toString(16).padStart(8,"0"))}},341416,(e,t,r)=>{"use strict";
14var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(575280),a=i(e.r(892623)),s=e.r(550294),o=e.r(227730);r.default=function(e){if(64!==e.length)throw new o.XrplError(`Attempting to parse a nftokenID with length ${e.length} 15 , but expected a token with length 64`);let t=new a.default(e.substring(48,56),16).toNumber(),r=new a.default(e.substring(56,64),16).toNumber();return{NFTokenID:e,Flags:new a.default(e.substring(0,4),16).toNumber(),TransferFee:new a.default(e.substring(4,8),16).toNumber(),Issuer:(0,s.encodeAccountID)((0,n.hexToBytes)(e.substring(8,48))),Taxon:(t^new a.default(0x16e5d101).multipliedBy(r).modulo(0x100000000).plus(2459).modulo(0x100000000).toNumber())>>>0,Sequence:r}}},638242,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.percentToQuality=r.transferRateToDecimal=r.qualityToDecimal=r.decimalToQuality=r.percentToTransferRate=r.decimalToTransferRate=void 0;let n=i(e.r(892623)),a=e.r(227730),s="1000000000";function o(e){if(!e.endsWith("%"))throw new a.ValidationError(`Value ${e} must end with %`);let t=e.split("%").filter(e=>""!==e);if(1!==t.length)throw new a.ValidationError(`Value ${e} contains too many % signs`);return new n.default(t[0]).dividedBy("100").toString(10)}function l(e){let t=new n.default(e).times(s).plus(s);if(t.isLessThan(s)||t.isGreaterThan("2000000000"))throw new a.ValidationError("Decimal value must be between 0 and 1.00.");let r=t.toString(10);if(r===s)return 0;if("NaN"===r)throw new a.ValidationError("Value is not a number");if(r.includes("."))throw new a.ValidationError("Decimal exceeds maximum precision.");return Number(r)}function u(e){let t=new n.default(e).times(s).toString(10);if("NaN"===t)throw new a.ValidationError("Value is not a number");if(t.includes("-"))throw new a.ValidationError("Cannot have negative Quality");if(t===s)return 0;if(t.includes("."))throw new a.ValidationError("Decimal exceeds maximum precision.");return Number(t)}r.decimalToTransferRate=l,r.percentToTransferRate=function(e){return l(o(e))},r.decimalToQuality=u,r.qualityToDecimal=function(e){if(!Number.isInteger(e))throw new a.ValidationError("Quality must be an integer");if(e<0)throw new a.ValidationError("Negative quality not allowed");return 0===e?"1":new n.default(e).dividedBy(s).toString(10)},r.transferRateToDecimal=function(e){if(!Number.isInteger(e))throw new a.ValidationError("Error decoding, transfer Rate must be an integer");if(0===e)return"0";let t=new n.default(e).minus(s).dividedBy(s);if(t.isLessThan(0))throw new a.ValidationError("Error decoding, negative transfer rate");return t.toString(10)},r.percentToQuality=function(e){return u(o(e))}},34704,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let i=e.r(522236),n=e.r(377702),a=e.r(960972);r.default=function(e,t,r){let s=(0,i.encodeForSigningClaim)({channel:e,amount:(0,a.xrpToDrops)(t)});return(0,n.sign)(s,r)}},535168,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.convertStringToHex=r.convertHexToString=void 0;let i=e.r(575280);r.convertStringToHex=function(e){return(0,i.stringToHex)(e)},r.convertHexToString=function(e,t="utf8"){return(0,i.hexToString)(e,t)}},834176,(e,t,r)=>{"use strict";function i(e){return(e+0x386d4380)*1e3}function n(e){return Math.round(e/1e3)-0x386d4380}Object.defineProperty(r,"__esModule",{value:!0}),r.isoTimeToRippleTime=r.rippleTimeToISOTime=r.unixTimeToRippleTime=r.rippleTimeToUnixTime=void 0,r.rippleTimeToUnixTime=i,r.unixTimeToRippleTime=n,r.rippleTimeToISOTime=function(e){return new Date(i(e)).toISOString()},r.isoTimeToRippleTime=function(e){return n(("string"==typeof e?new Date(e):e).getTime())}},394698,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let i=e.r(522236),n=e.r(377702),a=e.r(960972);r.default=function(e,t,r,s){let o=(0,i.encodeForSigningClaim)({channel:e,amount:(0,a.xrpToDrops)(t)});return(0,n.verify)(o,r,s)}},277871,(e,t,r)=>{"use strict";
15var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.getXChainClaimID=r.parseNFTokenID=r.getNFTokenID=r.encodeForSigningClaim=r.encodeForSigningBatch=r.encodeForSigning=r.encodeForMultiSigning=r.decode=r.encode=r.decodeXAddress=r.encodeXAddress=r.decodeAccountPublic=r.encodeAccountPublic=r.decodeNodePublic=r.encodeNodePublic=r.decodeAccountID=r.encodeAccountID=r.decodeSeed=r.encodeSeed=r.isValidClassicAddress=r.isValidXAddress=r.xAddressToClassicAddress=r.classicAddressToXAddress=r.convertHexToString=r.convertStringToHex=r.verifyPaymentChannelClaim=r.verifyKeypairSignature=r.signPaymentChannelClaim=r.deriveXAddress=r.deriveAddress=r.deriveKeypair=r.hashes=r.isValidAddress=r.isValidSecret=r.qualityToDecimal=r.transferRateToDecimal=r.decimalToTransferRate=r.percentToTransferRate=r.decimalToQuality=r.percentToQuality=r.unixTimeToRippleTime=r.rippleTimeToUnixTime=r.isoTimeToRippleTime=r.rippleTimeToISOTime=r.hasNextPage=r.xrpToDrops=r.dropsToXrp=r.getBalanceChanges=void 0;let n=e.r(550294);Object.defineProperty(r,"classicAddressToXAddress",{enumerable:!0,get:function(){return n.classicAddressToXAddress}}),Object.defineProperty(r,"decodeAccountID",{enumerable:!0,get:function(){return n.decodeAccountID}}),Object.defineProperty(r,"decodeAccountPublic",{enumerable:!0,get:function(){return n.decodeAccountPublic}}),Object.defineProperty(r,"decodeNodePublic",{enumerable:!0,get:function(){return n.decodeNodePublic}}),Object.defineProperty(r,"decodeSeed",{enumerable:!0,get:function(){return n.decodeSeed}}),Object.defineProperty(r,"decodeXAddress",{enumerable:!0,get:function(){return n.decodeXAddress}}),Object.defineProperty(r,"encodeAccountID",{enumerable:!0,get:function(){return n.encodeAccountID}}),Object.defineProperty(r,"encodeAccountPublic",{enumerable:!0,get:function(){return n.encodeAccountPublic}}),Object.defineProperty(r,"encodeNodePublic",{enumerable:!0,get:function(){return n.encodeNodePublic}}),Object.defineProperty(r,"encodeSeed",{enumerable:!0,get:function(){return n.encodeSeed}}),Object.defineProperty(r,"encodeXAddress",{enumerable:!0,get:function(){return n.encodeXAddress}}),Object.defineProperty(r,"isValidClassicAddress",{enumerable:!0,get:function(){return n.isValidClassicAddress}}),Object.defineProperty(r,"isValidXAddress",{enumerable:!0,get:function(){return n.isValidXAddress}}),Object.defineProperty(r,"xAddressToClassicAddress",{enumerable:!0,get:function(){return n.xAddressToClassicAddress}});let a=e.r(522236),s=e.r(377702);Object.defineProperty(r,"verifyKeypairSignature",{enumerable:!0,get:function(){return s.verify}});let o=e.r(272148);Object.defineProperty(r,"deriveKeypair",{enumerable:!0,get:function(){return o.deriveKeypair}}),Object.defineProperty(r,"deriveAddress",{enumerable:!0,get:function(){return o.deriveAddress}}),Object.defineProperty(r,"deriveXAddress",{enumerable:!0,get:function(){return o.deriveXAddress}}),r.getBalanceChanges=i(e.r(232454)).default,r.getNFTokenID=i(e.r(28731)).default,r.getXChainClaimID=i(e.r(256015)).default;let l=e.r(254234);r.parseNFTokenID=i(e.r(341416)).default;let u=e.r(638242);Object.defineProperty(r,"percentToTransferRate",{enumerable:!0,get:function(){return u.percentToTransferRate}}),Object.defineProperty(r,"decimalToTransferRate",{enumerable:!0,get:function(){return u.decimalToTransferRate}}),Object.defineProperty(r,"transferRateToDecimal",{enumerable:!0,get:function(){return u.transferRateToDecimal}}),Object.defineProperty(r,"percentToQuality",{enumerable:!0,get:function(){return u.percentToQuality}}),Object.defineProperty(r,"decimalToQuality",{enumerable:!0,get:function(){return u.decimalToQuality}}),Object.defineProperty(r,"qualityToDecimal",{enumerable:!0,get:function(){return u.qualityToDecimal}}),r.signPaymentChannelClaim=i(e.r(34704)).default;let c=e.r(535168);Object.defineProperty(r,"convertHexToString",{enumerable:!0,get:function(){return c.convertHexToString}}),Object.defineProperty(r,"convertStringToHex",{enumerable:!0,get:function(){return c.convertStringToHex}});let d=e.r(834176);Object.defineProperty(r,"rippleTimeToISOTime",{enumerable:!0,get:function(){return d.rippleTimeToISOTime}}),Object.defineProperty(r,"isoTimeToRippleTime",{enumerable:!0,get:function(){return d.isoTimeToRippleTime}}),Object.defineProperty(r,"rippleTimeToUnixTime",{enumerable:!0,get:function(){return d.rippleTimeToUnixTime}}),Object.defineProperty(r,"unixTimeToRippleTime",{enumerable:!0,get:function(){return d.unixTimeToRippleTime}}),r.verifyPaymentChannelClaim=i(e.r(394698)).default;let f=e.r(960972);Object.defineProperty(r,"xrpToDrops",{enumerable:!0,get:function(){return f.xrpToDrops}}),Object.defineProperty(r,"dropsToXrp",{enumerable:!0,get:function(){return f.dropsToXrp}}),r.isValidSecret=function(e){try{return(0,o.deriveKeypair)(e),!0}catch(e){return!1}},r.encode=function(e){return(0,a.encode)(e)},r.encodeForSigning=function(e){return(0,a.encodeForSigning)(e)},r.encodeForSigningClaim=function(e){return(0,a.encodeForSigningClaim)(e)},r.encodeForMultiSigning=function(e,t){return(0,a.encodeForMultisigning)(e,t)},r.encodeForSigningBatch=function(e){return(0,a.encodeForSigningBatch)(e)},r.decode=function(e){return(0,a.decode)(e)},r.isValidAddress=function(e){return(0,n.isValidXAddress)(e)||(0,n.isValidClassicAddress)(e)},r.hasNextPage=function(e){return!!e.result.marker},r.hashes={hashSignedTx:l.hashSignedTx,hashTx:l.hashTx,hashAccountRoot:l.hashAccountRoot,hashSignerListId:l.hashSignerListId,hashOfferId:l.hashOfferId,hashTrustline:l.hashTrustline,hashTxTree:l.hashTxTree,hashStateTree:l.hashStateTree,hashLedger:l.hashLedger,hashLedgerHeader:l.hashLedgerHeader,hashEscrow:l.hashEscrow,hashPaymentChannel:l.hashPaymentChannel,hashVault:l.hashVault,hashLoanBroker:l.hashLoanBroker,hashLoan:l.hashLoan}},655145,(e,t,r)=>{"use strict";var i=e.e&&e.e.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((i=i.apply(e,t||[])).next())})};
15Object.defineProperty(r,"__esModule",{value:!0}),r.getLastLedgerSequence=r.getSignedTx=r.waitForFinalTransactionOutcome=r.submitRequest=void 0;let n=e.r(227730),a=e.r(277871);function s(e){let t="string"==typeof e?(0,a.decode)(e):e;if("string"==typeof t)return!1;if(null!=t.Signers){for(let e of t.Signers)if(null==e.Signer.SigningPubKey||null==e.Signer.TxnSignature)return!1;return!0}return null!=t.SigningPubKey&&null!=t.TxnSignature}r.submitRequest=function(e,t,r=!1){return i(this,void 0,void 0,function*(){var i;if(!s(t))throw new n.ValidationError("Transaction must be signed.");let o={command:"submit",tx_blob:"string"==typeof t?t:(0,a.encode)(t),fail_hard:"AccountDelete"===("string"==typeof(i=t)?(0,a.decode)(i):i).TransactionType||r};return e.request(o)})},r.waitForFinalTransactionOutcome=function e(t,r,a,s){return i(this,void 0,void 0,function*(){yield function(){return i(this,void 0,void 0,function*(){return new Promise(e=>{setTimeout(e,1e3)})})}();let o=yield t.getLedgerIndex();if(a<o)throw new n.XrplError(`The latest ledger sequence ${o} is greater than the transaction's LastLedgerSequence (${a}). 16Preliminary result: ${s}`);let l=yield t.request({command:"tx",transaction:r}).catch(n=>i(this,void 0,void 0,function*(){var i;let o=null==(i=null==n?void 0:n.data)?void 0:i.error;if("txnNotFound"===o)return e(t,r,a,s);throw Error(`${o} 17 Preliminary result: ${s}. 18Full error details: ${String(n)}`)}));return l.result.validated?l:e(t,r,a,s)})},r.getSignedTx=function(e,t,{autofill:r=!0,wallet:o}={}){return i(this,void 0,void 0,function*(){if(s(t))return t;if(!o)throw new n.ValidationError("Wallet must be provided when submitting an unsigned transaction");let i="string"==typeof t?(0,a.decode)(t):t;return r&&(i=yield e.autofill(i)),o.sign(i).tx_blob})},r.getLastLedgerSequence=function(e){return("string"==typeof e?(0,a.decode)(e):e).LastLedgerSequence}},576781,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ensureClassicAddress=void 0;let i=e.r(550294);r.ensureClassicAddress=function(e){if((0,i.isValidXAddress)(e)){let{classicAddress:t,tag:r}=(0,i.xAddressToClassicAddress)(e);if(!1!==r)throw Error("This command does not support the use of a tag. Use an address without a tag.");return t}return e}},1738,(e,t,r)=>{"use strict";var i=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),n(e.r(655145),r),n(e.r(576781),r)},982951,(e,t,r)=>{"use strict";var i=e.e&&e.e.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((i=i.apply(e,t||[])).next())})},n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});let a=n(e.r(892623)),s=e.r(227730);r.default=function(e,t){var r;return i(this,void 0,void 0,function*(){let i=null!=t?t:e.feeCushion,n=(yield e.request({command:"server_info"})).result.info,o=null==(r=n.validated_ledger)?void 0:r.base_fee_xrp;if(null==o)throw new s.XrplError("getFeeXrp: Could not get base_fee_xrp from server_info");let l=new a.default(o);null!=n.load_factor||(n.load_factor=1);let u=l.times(n.load_factor).times(i);return u=a.default.min(u,e.maxFeeXRP),new a.default(u.toFixed(6)).toString(10)})}},320387,(e,t,r)=>{"use strict";var i=e.e&&e.e.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((i=i.apply(e,t||[])).next())})}
18,n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.autofillBatchTxn=r.handleDeliverMax=r.checkAccountDeleteBlockers=r.setLatestValidatedLedgerSequence=r.getTransactionFee=r.setNextValidSequenceNumber=r.setValidAddresses=r.txNeedsNetworkID=void 0;let a=n(e.r(892623)),s=e.r(550294),o=e.r(227730),l=e.r(277871),u=n(e.r(982951));function c(e){return!!(void 0!==e.networkID&&e.networkID>1024&&e.buildVersion&&function(e,t){if(e===t)return!0;let r=e.split("."),i=t.split("."),n=parseInt(r[0],10),a=parseInt(r[1],10),s=parseInt(i[0],10),o=parseInt(i[1],10);if(n!==s)return n<s;if(a!==o)return a<o;let l=r[2].split("-"),u=i[2].split("-"),c=parseInt(l[0],10),d=parseInt(u[0],10);return c!==d?c<d:l.length!==u.length?l.length>u.length:2===l.length&&(l[1][0].startsWith(u[1][0])?l[1].startsWith("b")?parseInt(l[1].slice(1),10)<parseInt(u[1].slice(1),10):parseInt(l[1].slice(2),10)<parseInt(u[1].slice(2),10):l[1]<u[1])}("1.11.0",e.buildVersion))}function d(e,t,r){let{classicAccount:i,tag:n}=f(e[t]);if(e[t]=i,null!=n&&!1!==n){if(e[r]&&e[r]!==n)throw new o.ValidationError(`The ${r}, if present, must match the tag of the ${t} X-address`);e[r]=n}}function f(e,t){if((0,s.isValidXAddress)(e)){let r=(0,s.xAddressToClassicAddress)(e);if(null!=t&&r.tag!==t)throw new o.ValidationError("address includes a tag that does not match the tag specified in the transaction");return{classicAccount:r.classicAddress,tag:r.tag}}return{classicAccount:e,tag:t}}function h(e,t){let r=e[t];if("string"==typeof r){let{classicAccount:i}=f(r);e[t]=i}}function p(e,t){return i(this,void 0,void 0,function*(){return(yield e.request({command:"account_info",account:t,ledger_index:"current"})).result.account_data.Sequence})}function g(e,t){return new a.default(e).times(t).toString()}r.txNeedsNetworkID=c,r.setValidAddresses=function(e){d(e,"Account","SourceTag"),null!=e.Destination&&d(e,"Destination","DestinationTag"),h(e,"Authorize"),h(e,"Unauthorize"),h(e,"Owner"),h(e,"RegularKey")},r.setNextValidSequenceNumber=function(e,t){return i(this,void 0,void 0,function*(){t.Sequence=yield p(e,t.Account)})},r.getTransactionFee=function(e,t,r=0){return i(this,void 0,void 0,function*(){let n=yield function e(t,r,n=0){return i(this,void 0,void 0,function*(){let s=yield(0,u.default)(t),c=(0,l.xrpToDrops)(s),d=new a.default(c),f=["AccountDelete","AMMCreate","VaultCreate"].includes(r.TransactionType);if("EscrowFinish"===r.TransactionType&&null!=r.Fulfillment){let e=Math.ceil(r.Fulfillment.length/2);d=new a.default(g(c,33+e/16))}else if(f)d=yield function(e){var t;return i(this,void 0,void 0,function*(){let r=null==(t=(yield e.request({command:"server_state"})).result.state.validated_ledger)?void 0:t.reserve_inc;return null==r?Promise.reject(Error("Could not fetch Owner Reserve.")):new a.default(r)})}(t);else if("Batch"===r.TransactionType){let n=yield r.RawTransactions.reduce((r,n)=>i(this,void 0,void 0,function*(){let i=yield r,s=yield e(t,n.RawTransaction);return a.default.sum(i,s)}),Promise.resolve(new a.default(0)));d=a.default.sum(d.times(2),n)}if(n>0&&(d=a.default.sum(d,g(c,n))),"LoanSet"===r.TransactionType){let e=yield function(e,t){var r,n;return i(this,void 0,void 0,function*(){let i=t.Counterparty;if(null==i){if(null==t.LoanBrokerID)throw new o.ValidationError("LoanBrokerID is required for LoanSet transaction");i=(yield e.request({command:"ledger_entry",index:t.LoanBrokerID,ledger_index:"validated"})).result.node.Owner}let a={command:"account_info",account:i,ledger_index:"validated",signer_lists:!0},s=null==(r=(yield e.request(a)).result.signer_lists)?void 0:r[0];return null!=(n=null==s?void 0:s.SignerEntries.length)?n:1})}(t,r);d=a.default.sum(d,g(c,e)),console.warn("For LoanSet transaction the auto calculated Fee accounts for total number of signers the counterparty has to avoid transaction failure.")}let h=(0,l.xrpToDrops)(t.maxFeeXRP);return(f?d:a.default.min(d,h)).dp(0,a.default.ROUND_CEIL)})}(e,t,r);t.Fee=n.toString(10)})},r.setLatestValidatedLedgerSequence=function(e,t){return i(this,void 0,void 0,function*(){t.LastLedgerSequence=(yield e.getLedgerIndex())+20})},r.checkAccountDeleteBlockers=function(e,t){return i(this,void 0,void 0,function*(){let r={command:"account_objects",account:t.Account,ledger_index:"validated",deletion_blockers_only:!0},i=yield e.request(r);return new Promise((e,r)=>{i.result.account_objects.length>0&&r(new o.XrplError(`Account ${t.Account} cannot be deleted; there are Escrows, PayChannels, RippleStates, or Checks associated with the account.`,i.result.account_objects)),e()})})},r.handleDeliverMax=function(e){if(null!=e.DeliverMax){if(null!=e.Amount||(e.Amount=e.DeliverMax),null!=e.Amount&&e.Amount!==e.DeliverMax)throw new o.ValidationError("PaymentTransaction: Amount and DeliverMax fields must be identical when both are provided");delete e.DeliverMax}},r.autofillBatchTxn=function(e,t){return i(this,void 0,void 0,function*(){let r={};for(let i of t.RawTransactions){let n=i.RawTransaction;if(null==n.Sequence&&null==n.TicketSequence)if(n.Account in r)n.Sequence=r[n.Account],r[n.Account]+=1;else{let i=yield p(e,n.Account),a=n.Account===t.Account?i+1:i;r[n.Account]=a+1,n.Sequence=a}if(null==n.Fee)n.Fee="0";else if("0"!==n.Fee)throw new o.XrplError('Must have `Fee of "0" in inner Batch transaction.');if(null==n.SigningPubKey)n.SigningPubKey="";else if(""!==n.SigningPubKey)throw new o.XrplError('Must have `SigningPubKey` of "" in inner Batch transaction.');
18if(null!=n.TxnSignature)throw new o.XrplError("Must not have `TxnSignature` in inner Batch transaction.");if(null!=n.Signers)throw new o.XrplError("Must not have `Signers` in inner Batch transaction.");null==n.NetworkID&&c(e)&&(n.NetworkID=e.networkID)}})}},188486,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.formatBalances=void 0,r.formatBalances=function(e){return e.map(e=>({value:e.balance,currency:e.currency,issuer:e.account}))}},150708,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.OfferFlags=void 0,(n=i||(r.OfferFlags=i={}))[n.lsfPassive=65536]="lsfPassive",n[n.lsfSell=131072]="lsfSell",n[n.lsfHybrid=262144]="lsfHybrid"},77625,(e,t,r)=>{"use strict";var i=e.e&&e.e.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((i=i.apply(e,t||[])).next())})},n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.sortAndLimitOffers=r.separateBuySellOrders=r.combineOrders=r.extractOffers=r.reverseRequest=r.requestAllOffers=r.createBookOffersRequest=r.validateOrderbookOptions=void 0;let a=n(e.r(892623)),s=e.r(227730),o=e.r(150708),l=new Set(["limit","ledger_index","ledger_hash","taker"]);r.validateOrderbookOptions=function(e){for(let t of Object.keys(e))if(!l.has(t))throw new s.ValidationError(`Unexpected option: ${t}`,e);if(e.limit&&"number"!=typeof e.limit)throw new s.ValidationError("limit must be a number",e.limit);if(e.ledger_index&&!("number"==typeof e.ledger_index||"string"==typeof e.ledger_index&&["validated","closed","current"].includes(e.ledger_index)))throw new s.ValidationError('ledger_index must be a number or a string of "validated", "closed", or "current"',e.ledger_index);if(void 0!==e.ledger_hash&&null!==e.ledger_hash&&"string"!=typeof e.ledger_hash)throw new s.ValidationError("ledger_hash must be a string",e.ledger_hash);if(void 0!==e.taker&&"string"!=typeof e.taker)throw new s.ValidationError("taker must be a string",e.taker)},r.createBookOffersRequest=function(e,t,r){var i,n,a;return{command:"book_offers",taker_pays:e,taker_gets:t,ledger_index:null!=(i=r.ledger_index)?i:"validated",ledger_hash:null===r.ledger_hash?void 0:r.ledger_hash,limit:null!=(n=r.limit)?n:20,taker:null!=(a=r.taker)?a:void 0}},r.requestAllOffers=function(e,t){return i(this,void 0,void 0,function*(){return(yield e.requestAll(t)).map(e=>e.result.offers)})},r.reverseRequest=function(e){return Object.assign(Object.assign({},e),{taker_pays:e.taker_gets,taker_gets:e.taker_pays})},r.extractOffers=function(e){return e.flatMap(e=>e)},r.combineOrders=function(e,t){return[...e,...t]},r.separateBuySellOrders=function(e){let t=[],r=[];return e.forEach(e=>{(e.Flags&o.OfferFlags.lsfSell)==0?t.push(e):r.push(e)}),{buy:t,sell:r}},r.sortAndLimitOffers=function(e,t){return e.sort((e,t)=>{var r,i,n;let s=null!=(r=e.quality)?r:0,o=null!=(i=t.quality)?i:0;return null!=(n=new a.default(s).comparedTo(o))?n:0}).slice(0,t)}},966885,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AMENDMENTS_ID=void 0,r.AMENDMENTS_ID="7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4"},664735,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.FEE_SETTINGS_ID=void 0,r.FEE_SETTINGS_ID="4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A651"},634019,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.LoanFlags=void 0,(n=i||(r.LoanFlags=i={}))[n.lsfLoanDefault=65536]="lsfLoanDefault",n[n.lsfLoanImpaired=131072]="lsfLoanImpaired",n[n.lsfLoanOverpayment=262144]="lsfLoanOverpayment"},55127,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.NEGATIVE_UNL_ID=void 0,r.NEGATIVE_UNL_ID="2E8A59AA9D3B5B186B0B9E0F62E6C02587CA74A4D778938E957B6357D364B244"},276697,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.RippleStateFlags=void 0,(n=i||(r.RippleStateFlags=i={}))[n.lsfLowReserve=65536]="lsfLowReserve",n[n.lsfHighReserve=131072]="lsfHighReserve",n[n.lsfLowAuth=262144]="lsfLowAuth",n[n.lsfHighAuth=524288]="lsfHighAuth",n[n.lsfLowNoRipple=1048576]="lsfLowNoRipple",n[n.lsfHighNoRipple=2097152]="lsfHighNoRipple",n[n.lsfLowFreeze=4194304]="lsfLowFreeze",n[n.lsfHighFreeze=8388608]="lsfHighFreeze",n[n.lsfAMMNode=0x1000000]="lsfAMMNode",n[n.lsfLowDeepFreeze=0x2000000]="lsfLowDeepFreeze",n[n.lsfHighDeepFreeze=0x4000000]="lsfHighDeepFreeze"},337826,(e,t,r)=>{"use strict";var i,n;
18Object.defineProperty(r,"__esModule",{value:!0}),r.SignerListFlags=void 0,(n=i||(r.SignerListFlags=i={}))[n.lsfOneOwnerCount=65536]="lsfOneOwnerCount"},469631,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.VaultFlags=void 0,(n=i||(r.VaultFlags=i={}))[n.lsfVaultPrivate=65536]="lsfVaultPrivate"},429839,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.VaultFlags=r.SignerListFlags=r.RippleStateFlags=r.OfferFlags=r.NEGATIVE_UNL_ID=r.LoanFlags=r.FEE_SETTINGS_ID=r.AMENDMENTS_ID=r.AccountRootFlags=void 0;let i=e.r(832575);Object.defineProperty(r,"AccountRootFlags",{enumerable:!0,get:function(){return i.AccountRootFlags}});let n=e.r(966885);Object.defineProperty(r,"AMENDMENTS_ID",{enumerable:!0,get:function(){return n.AMENDMENTS_ID}});let a=e.r(664735);Object.defineProperty(r,"FEE_SETTINGS_ID",{enumerable:!0,get:function(){return a.FEE_SETTINGS_ID}});let s=e.r(634019);Object.defineProperty(r,"LoanFlags",{enumerable:!0,get:function(){return s.LoanFlags}});let o=e.r(55127);Object.defineProperty(r,"NEGATIVE_UNL_ID",{enumerable:!0,get:function(){return o.NEGATIVE_UNL_ID}});
18let l=e.r(150708);Object.defineProperty(r,"OfferFlags",{enumerable:!0,get:function(){return l.OfferFlags}});let u=e.r(276697);Object.defineProperty(r,"RippleStateFlags",{enumerable:!0,get:function(){return u.RippleStateFlags}});let c=e.r(337826);Object.defineProperty(r,"SignerListFlags",{enumerable:!0,get:function(){return c.SignerListFlags}});let d=e.r(469631);Object.defineProperty(r,"VaultFlags",{enumerable:!0,get:function(){return d.VaultFlags}})},705861,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},309613,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateAccountDelete=void 0;let i=e.r(798184);r.validateAccountDelete=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"Destination",i.isAccount),(0,i.validateOptionalField)(e,"DestinationTag",i.isNumber),(0,i.validateCredentialsList)(e.CredentialIDs,e.TransactionType,!0,i.MAX_AUTHORIZED_CREDENTIALS)}},187541,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateAMMBid=void 0;let i=e.r(227730),n=e.r(798184);r.validateAMMBid=function(e){if((0,n.validateBaseTransaction)(e),null==e.Asset)throw new i.ValidationError("AMMBid: missing field Asset");if(!(0,n.isIssuedCurrency)(e.Asset))throw new i.ValidationError("AMMBid: Asset must be a Currency");if(null==e.Asset2)throw new i.ValidationError("AMMBid: missing field Asset2");if(!(0,n.isIssuedCurrency)(e.Asset2))throw new i.ValidationError("AMMBid: Asset2 must be a Currency");if(null!=e.BidMin&&!(0,n.isAmount)(e.BidMin))throw new i.ValidationError("AMMBid: BidMin must be an Amount");if(null!=e.BidMax&&!(0,n.isAmount)(e.BidMax))throw new i.ValidationError("AMMBid: BidMax must be an Amount");if(null!=e.AuthAccounts){if(!(0,n.isArray)(e.AuthAccounts))throw new i.ValidationError("AMMBid: AuthAccounts must be an AuthAccount array");if(e.AuthAccounts.length>4)throw new i.ValidationError("AMMBid: AuthAccounts length must not be greater than 4");var t=e.Account,r=e.AuthAccounts;for(let e of r){if(!(0,n.isRecord)(e)||!(0,n.isRecord)(e.AuthAccount)||null==e.AuthAccount.Account||"string"!=typeof e.AuthAccount.Account)throw new i.ValidationError("AMMBid: invalid AuthAccounts");if(e.AuthAccount.Account===t)throw new i.ValidationError("AMMBid: AuthAccounts must not include sender's address")}}}},377850,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateAMMCreate=r.AMM_MAX_TRADING_FEE=void 0;let i=e.r(227730),n=e.r(798184);r.AMM_MAX_TRADING_FEE=1e3,r.validateAMMCreate=function(e){if((0,n.validateBaseTransaction)(e),null==e.Amount)throw new i.ValidationError("AMMCreate: missing field Amount");if(!(0,n.isAmount)(e.Amount))throw new i.ValidationError("AMMCreate: Amount must be an Amount");if(null==e.Amount2)throw new i.ValidationError("AMMCreate: missing field Amount2");if(!(0,n.isAmount)(e.Amount2))throw new i.ValidationError("AMMCreate: Amount2 must be an Amount");if(null==e.TradingFee)throw new i.ValidationError("AMMCreate: missing field TradingFee");if("number"!=typeof e.TradingFee)throw new i.ValidationError("AMMCreate: TradingFee must be a number");if(e.TradingFee<0||e.TradingFee>r.AMM_MAX_TRADING_FEE)throw new i.ValidationError(`AMMCreate: TradingFee must be between 0 and ${r.AMM_MAX_TRADING_FEE}`)}},696034,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateAMMDelete=void 0;let i=e.r(227730),n=e.r(798184);r.validateAMMDelete=function(e){if((0,n.validateBaseTransaction)(e),null==e.Asset)throw new i.ValidationError("AMMDelete: missing field Asset");if(!(0,n.isIssuedCurrency)(e.Asset))throw new i.ValidationError("AMMDelete: Asset must be a Currency");if(null==e.Asset2)throw new i.ValidationError("AMMDelete: missing field Asset2");if(!(0,n.isIssuedCurrency)(e.Asset2))throw new i.ValidationError("AMMDelete: Asset2 must be a Currency")}},277820,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateAMMVote=void 0;let i=e.r(227730),n=e.r(377850),a=e.r(798184);r.validateAMMVote=function(e){if((0,a.validateBaseTransaction)(e),null==e.Asset)throw new i.ValidationError("AMMVote: missing field Asset");if(!(0,a.isIssuedCurrency)(e.Asset))throw new i.ValidationError("AMMVote: Asset must be a Currency");if(null==e.Asset2)throw new i.ValidationError("AMMVote: missing field Asset2");if(!(0,a.isIssuedCurrency)(e.Asset2))throw new i.ValidationError("AMMVote: Asset2 must be a Currency");if(null==e.TradingFee)throw new i.ValidationError("AMMVote: missing field TradingFee");
18if("number"!=typeof e.TradingFee)throw new i.ValidationError("AMMVote: TradingFee must be a number");if(e.TradingFee<0||e.TradingFee>n.AMM_MAX_TRADING_FEE)throw new i.ValidationError(`AMMVote: TradingFee must be between 0 and ${n.AMM_MAX_TRADING_FEE}`)}},445321,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateCheckCancel=void 0;let i=e.r(227730),n=e.r(798184);r.validateCheckCancel=function(e){if((0,n.validateBaseTransaction)(e),void 0!==e.CheckID&&"string"!=typeof e.CheckID)throw new i.ValidationError("CheckCancel: invalid CheckID")}},294185,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateCheckCash=void 0;let i=e.r(227730),n=e.r(798184);r.validateCheckCash=function(e){if((0,n.validateBaseTransaction)(e),null==e.Amount&&null==e.DeliverMin)throw new i.ValidationError("CheckCash: must have either Amount or DeliverMin");if(null!=e.Amount&&null!=e.DeliverMin)throw new i.ValidationError("CheckCash: cannot have both Amount and DeliverMin");if(null!=e.Amount&&void 0!==e.Amount&&!(0,n.isAmount)(e.Amount))throw new i.ValidationError("CheckCash: invalid Amount");if(null!=e.DeliverMin&&void 0!==e.DeliverMin&&!(0,n.isAmount)(e.DeliverMin))throw new i.ValidationError("CheckCash: invalid DeliverMin");if(void 0!==e.CheckID&&"string"!=typeof e.CheckID)throw new i.ValidationError("CheckCash: invalid CheckID")}},555011,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateCheckCreate=void 0;let i=e.r(227730),n=e.r(798184);r.validateCheckCreate=function(e){if((0,n.validateBaseTransaction)(e),void 0===e.SendMax)throw new i.ValidationError("CheckCreate: missing field SendMax");if((0,n.validateRequiredField)(e,"Destination",n.isAccount),(0,n.validateOptionalField)(e,"DestinationTag",n.isNumber),"string"!=typeof e.SendMax&&!(0,n.isIssuedCurrencyAmount)(e.SendMax))throw new i.ValidationError("CheckCreate: invalid SendMax");if(void 0!==e.Expiration&&"number"!=typeof e.Expiration)throw new i.ValidationError("CheckCreate: invalid Expiration");if(void 0!==e.InvoiceID&&"string"!=typeof e.InvoiceID)throw new i.ValidationError("CheckCreate: invalid InvoiceID")}},708095,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateClawback=void 0;let i=e.r(227730),n=e.r(798184);r.validateClawback=function(e){if((0,n.validateBaseTransaction)(e),(0,n.validateRequiredField)(e,"Amount",n.isClawbackAmount),(0,n.validateOptionalField)(e,"Holder",n.isAccount),!(0,n.isIssuedCurrencyAmount)(e.Amount)&&!(0,n.isMPTAmount)(e.Amount))throw new i.ValidationError("Clawback: invalid Amount");if((0,n.isIssuedCurrencyAmount)(e.Amount)&&e.Account===e.Amount.issuer||(0,n.isMPTAmount)(e.Amount)&&e.Account===e.Holder)throw new i.ValidationError("Clawback: invalid holder Account");if((0,n.isIssuedCurrencyAmount)(e.Amount)&&e.Holder)throw new i.ValidationError("Clawback: cannot have Holder for currency");if((0,n.isMPTAmount)(e.Amount)&&!e.Holder)throw new i.ValidationError("Clawback: missing Holder")}},966609,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateCredentialAccept=void 0;let i=e.r(798184);r.validateCredentialAccept=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"Account",i.isString),(0,i.validateRequiredField)(e,"Issuer",i.isString),(0,i.validateCredentialType)(e)}},854259,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateCredentialCreate=void 0;let i=e.r(575280),n=e.r(227730),a=e.r(798184);r.validateCredentialCreate=function(e){(0,a.validateBaseTransaction)(e),(0,a.validateRequiredField)(e,"Account",a.isString),(0,a.validateRequiredField)(e,"Subject",a.isString),(0,a.validateCredentialType)(e),(0,a.validateOptionalField)(e,"Expiration",a.isNumber),function(e){if(void 0!==e){if("string"!=typeof e)throw new n.ValidationError("CredentialCreate: invalid field URI");if(0===e.length)throw new n.ValidationError("CredentialCreate: URI cannot be an empty string");if(e.length>256)throw new n.ValidationError("CredentialCreate: URI length must be <= 256");if(!i.HEX_REGEX.test(e))throw new n.ValidationError("CredentialCreate: URI must be encoded in hex")}}(e.URI)}},749349,(e,t,r)=>{"use strict";
18Object.defineProperty(r,"__esModule",{value:!0}),r.validateCredentialDelete=void 0;let i=e.r(227730),n=e.r(798184);r.validateCredentialDelete=function(e){if((0,n.validateBaseTransaction)(e),!e.Subject&&!e.Issuer)throw new i.ValidationError("CredentialDelete: either `Issuer` or `Subject` must be provided");(0,n.validateRequiredField)(e,"Account",n.isString),(0,n.validateCredentialType)(e),(0,n.validateOptionalField)(e,"Subject",n.isString),(0,n.validateOptionalField)(e,"Issuer",n.isString)}},888978,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateDelegateSet=void 0;let i=e.r(227730),n=e.r(798184),a=new Set(["AccountSet","SetRegularKey","SignerListSet","DelegateSet","AccountDelete","Batch","EnableAmendment","SetFee","UNLModify"]);r.validateDelegateSet=function(e){if((0,n.validateBaseTransaction)(e),(0,n.validateRequiredField)(e,"Authorize",n.isAccount),e.Authorize===e.Account)throw new i.ValidationError("DelegateSet: Authorize and Account must be different.");(0,n.validateRequiredField)(e,"Permissions",Array.isArray);let t=e.Permissions;
18if(t.length>10)throw new i.ValidationError("DelegateSet: Permissions array length cannot be greater than 10.");let r=new Set;if(t.forEach(e=>{if(null==e||1!==Object.keys(e).length||null==e.Permission||1!==Object.keys(e.Permission).length)throw new i.ValidationError("DelegateSet: Permissions array element is malformed");let t=e.Permission.PermissionValue;if(null==t)throw new i.ValidationError("DelegateSet: PermissionValue must be defined");if("string"!=typeof t)throw new i.ValidationError("DelegateSet: PermissionValue must be a string");if(a.has(t))throw new i.ValidationError(`DelegateSet: PermissionValue contains a non-delegatable transaction ${t}`);r.add(t)}),t.length!==r.size)throw new i.ValidationError("DelegateSet: Permissions array cannot contain duplicate values")}},309614,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateDepositPreauth=void 0;let i=e.r(227730),n=e.r(798184);r.validateDepositPreauth=function(e){if((0,n.validateBaseTransaction)(e),function(e){if(1!==["Authorize","Unauthorize","AuthorizeCredentials","UnauthorizeCredentials"].filter(t=>void 0!==e[t]).length)throw new i.ValidationError("DepositPreauth: Requires exactly one field of the following: Authorize, Unauthorize, AuthorizeCredentials, UnauthorizeCredentials.")}(e),void 0!==e.Authorize){if("string"!=typeof e.Authorize)throw new i.ValidationError("DepositPreauth: Authorize must be a string");if(e.Account===e.Authorize)throw new i.ValidationError("DepositPreauth: Account can't preauthorize its own address")}else if(void 0!==e.Unauthorize){if("string"!=typeof e.Unauthorize)throw new i.ValidationError("DepositPreauth: Unauthorize must be a string");if(e.Account===e.Unauthorize)throw new i.ValidationError("DepositPreauth: Account can't unauthorize its own address")}else void 0!==e.AuthorizeCredentials?(0,n.validateCredentialsList)(e.AuthorizeCredentials,e.TransactionType,!1,n.MAX_AUTHORIZED_CREDENTIALS):void 0!==e.UnauthorizeCredentials&&(0,n.validateCredentialsList)(e.UnauthorizeCredentials,e.TransactionType,!1,n.MAX_AUTHORIZED_CREDENTIALS)}},113526,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateDIDDelete=void 0;let i=e.r(798184);r.validateDIDDelete=function(e){(0,i.validateBaseTransaction)(e)}},498674,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateDIDSet=void 0;let i=e.r(227730),n=e.r(798184);r.validateDIDSet=function(e){if((0,n.validateBaseTransaction)(e),(0,n.validateOptionalField)(e,"Data",n.isString),(0,n.validateOptionalField)(e,"DIDDocument",n.isString),(0,n.validateOptionalField)(e,"URI",n.isString),void 0===e.Data&&void 0===e.DIDDocument&&void 0===e.URI)throw new i.ValidationError("DIDSet: Must have at least one of `Data`, `DIDDocument`, and `URI`")}},387280,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateEscrowCancel=void 0;let i=e.r(227730),n=e.r(798184);r.validateEscrowCancel=function(e){if((0,n.validateBaseTransaction)(e),(0,n.validateRequiredField)(e,"Owner",n.isAccount),null==e.OfferSequence)throw new i.ValidationError("EscrowCancel: missing OfferSequence");if("number"!=typeof e.OfferSequence&&"string"!=typeof e.OfferSequence||Number.isNaN(Number(e.OfferSequence)))throw new i.ValidationError("EscrowCancel: OfferSequence must be a number")}},93383,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateEscrowCreate=void 0;let i=e.r(227730),n=e.r(798184);r.validateEscrowCreate=function(e){if((0,n.validateBaseTransaction)(e),(0,n.validateRequiredField)(e,"Amount",n.isAmount),(0,n.validateRequiredField)(e,"Destination",n.isAccount),(0,n.validateOptionalField)(e,"DestinationTag",n.isNumber),void 0===e.CancelAfter&&void 0===e.FinishAfter)throw new i.ValidationError("EscrowCreate: Either CancelAfter or FinishAfter must be specified");if(void 0===e.FinishAfter&&void 0===e.Condition)throw new i.ValidationError("EscrowCreate: Either Condition or FinishAfter must be specified");if(void 0!==e.CancelAfter&&"number"!=typeof e.CancelAfter)throw new i.ValidationError("EscrowCreate: CancelAfter must be a number");
18if(void 0!==e.FinishAfter&&"number"!=typeof e.FinishAfter)throw new i.ValidationError("EscrowCreate: FinishAfter must be a number");if(void 0!==e.Condition&&"string"!=typeof e.Condition)throw new i.ValidationError("EscrowCreate: Condition must be a string")}},947035,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateEscrowFinish=void 0;let i=e.r(227730),n=e.r(798184);r.validateEscrowFinish=function(e){if((0,n.validateBaseTransaction)(e),(0,n.validateRequiredField)(e,"Owner",n.isAccount),(0,n.validateCredentialsList)(e.CredentialIDs,e.TransactionType,!0,n.MAX_AUTHORIZED_CREDENTIALS),null==e.OfferSequence)throw new i.ValidationError("EscrowFinish: missing field OfferSequence");if("number"!=typeof e.OfferSequence&&"string"!=typeof e.OfferSequence||Number.isNaN(Number(e.OfferSequence)))throw new i.ValidationError("EscrowFinish: OfferSequence must be a number");if(void 0!==e.Condition&&"string"!=typeof e.Condition)throw new i.ValidationError("EscrowFinish: Condition must be a string");if(void 0!==e.Fulfillment&&"string"!=typeof e.Fulfillment)throw new i.ValidationError("EscrowFinish: Fulfillment must be a string")}},231182,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.validateLoanBrokerCoverClawback=void 0;let n=i(e.r(892623)),a=e.r(227730),s=e.r(798184);r.validateLoanBrokerCoverClawback=function(e){if((0,s.validateBaseTransaction)(e),(0,s.validateOptionalField)(e,"LoanBrokerID",s.isString),(0,s.validateOptionalField)(e,"Amount",s.isTokenAmount),null!=e.LoanBrokerID&&!(0,s.isLedgerEntryId)(e.LoanBrokerID))throw new a.ValidationError("LoanBrokerCoverClawback: LoanBrokerID must be 64 characters hexadecimal string");if(null!=e.Amount&&new n.default(e.Amount.value).isLessThan(0))throw new a.ValidationError("LoanBrokerCoverClawback: Amount must be >= 0");if(null==e.LoanBrokerID&&null==e.Amount)throw new a.ValidationError("LoanBrokerCoverClawback: Either LoanBrokerID or Amount is required")}},39,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateLoanBrokerCoverDeposit=void 0;let i=e.r(227730),n=e.r(798184);r.validateLoanBrokerCoverDeposit=function(e){if((0,n.validateBaseTransaction)(e),(0,n.validateRequiredField)(e,"LoanBrokerID",n.isString),(0,n.validateRequiredField)(e,"Amount",n.isAmount),!(0,n.isLedgerEntryId)(e.LoanBrokerID))throw new i.ValidationError("LoanBrokerCoverDeposit: LoanBrokerID must be 64 characters hexadecimal string")}},712332,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateLoanBrokerCoverWithdraw=void 0;let i=e.r(227730),n=e.r(798184);r.validateLoanBrokerCoverWithdraw=function(e){if((0,n.validateBaseTransaction)(e),(0,n.validateRequiredField)(e,"LoanBrokerID",n.isString),(0,n.validateRequiredField)(e,"Amount",n.isAmount),(0,n.validateOptionalField)(e,"Destination",n.isAccount),(0,n.validateOptionalField)(e,"DestinationTag",n.isNumber),!(0,n.isLedgerEntryId)(e.LoanBrokerID))throw new i.ValidationError("LoanBrokerCoverWithdraw: LoanBrokerID must be 64 characters hexadecimal string")}},537635,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateLoanBrokerDelete=void 0;let i=e.r(227730),n=e.r(798184);r.validateLoanBrokerDelete=function(e){if((0,n.validateBaseTransaction)(e),(0,n.validateRequiredField)(e,"LoanBrokerID",n.isString),!(0,n.isLedgerEntryId)(e.LoanBrokerID))throw new i.ValidationError("LoanBrokerDelete: LoanBrokerID must be 64 characters hexadecimal string")}},83115,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.validateLoanBrokerSet=void 0;let n=i(e.r(892623)),a=e.r(227730),s=e.r(798184);r.validateLoanBrokerSet=function(e){var t,r;if((0,s.validateBaseTransaction)(e),(0,s.validateRequiredField)(e,"VaultID",s.isString),(0,s.validateOptionalField)(e,"LoanBrokerID",s.isString),(0,s.validateOptionalField)(e,"Data",s.isString),(0,s.validateOptionalField)(e,"ManagementFeeRate",s.isNumber),(0,s.validateOptionalField)(e,"DebtMaximum",s.isXRPLNumber),(0,s.validateOptionalField)(e,"CoverRateMinimum",s.isNumber),(0,s.validateOptionalField)(e,"CoverRateLiquidation",s.isNumber),!(0,s.isLedgerEntryId)(e.VaultID))throw new a.ValidationError("LoanBrokerSet: VaultID must be 64 characters hexadecimal string");
18if(null!=e.LoanBrokerID&&!(0,s.isLedgerEntryId)(e.LoanBrokerID))throw new a.ValidationError("LoanBrokerSet: LoanBrokerID must be 64 characters hexadecimal string");if(null!=e.Data&&!(0,s.validateHexMetadata)(e.Data,512))throw new a.ValidationError("LoanBrokerSet: Data must be a valid non-empty hex string up to 512 characters");if(null!=e.ManagementFeeRate&&(e.ManagementFeeRate<0||e.ManagementFeeRate>1e4))throw new a.ValidationError("LoanBrokerSet: ManagementFeeRate must be between 0 and 10000 inclusive");if(null!=e.DebtMaximum&&new n.default(e.DebtMaximum).isLessThan(0))throw new a.ValidationError("LoanBrokerSet: DebtMaximum must be a non-negative value");if(null!=e.CoverRateMinimum&&(e.CoverRateMinimum<0||e.CoverRateMinimum>1e5))throw new a.ValidationError("LoanBrokerSet: CoverRateMinimum must be between 0 and 100000 inclusive");if(null!=e.CoverRateLiquidation&&(e.CoverRateLiquidation<0||e.CoverRateLiquidation>1e5))throw new a.ValidationError("LoanBrokerSet: CoverRateLiquidation must be between 0 and 100000 inclusive");let i=null!=(t=e.CoverRateMinimum)?t:0,o=null!=(r=e.CoverRateLiquidation)?r:0;if(0===i&&0!==o||0!==i&&0===o)throw new a.ValidationError("LoanBrokerSet: CoverRateMinimum and CoverRateLiquidation must both be zero or both be non-zero")}},812162,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateLoanDelete=void 0;let i=e.r(227730),n=e.r(798184);r.validateLoanDelete=function(e){if((0,n.validateBaseTransaction)(e),(0,n.validateRequiredField)(e,"LoanID",n.isString),!(0,n.isLedgerEntryId)(e.LoanID))throw new i.ValidationError("LoanDelete: LoanID must be 64 characters hexadecimal string")}},109172,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.validateLoanSet=r.LoanSetFlags=void 0;let a=e.r(227730),s=e.r(798184);(n=i||(r.LoanSetFlags=i={}))[n.tfLoanOverpayment=65536]="tfLoanOverpayment",r.validateLoanSet=function(e){if((0,s.validateBaseTransaction)(e),(0,s.validateRequiredField)(e,"LoanBrokerID",s.isString),(0,s.validateRequiredField)(e,"PrincipalRequested",s.isXRPLNumber),(0,s.validateOptionalField)(e,"CounterpartySignature",s.isRecord),(0,s.validateOptionalField)(e,"Data",s.isString),(0,s.validateOptionalField)(e,"Counterparty",s.isAccount),(0,s.validateOptionalField)(e,"LoanOriginationFee",s.isXRPLNumber),(0,s.validateOptionalField)(e,"LoanServiceFee",s.isXRPLNumber),(0,s.validateOptionalField)(e,"LatePaymentFee",s.isXRPLNumber),(0,s.validateOptionalField)(e,"ClosePaymentFee",s.isXRPLNumber),(0,s.validateOptionalField)(e,"OverpaymentFee",s.isNumber),(0,s.validateOptionalField)(e,"InterestRate",s.isNumber),(0,s.validateOptionalField)(e,"LateInterestRate",s.isNumber),(0,s.validateOptionalField)(e,"CloseInterestRate",s.isNumber),(0,s.validateOptionalField)(e,"OverpaymentInterestRate",s.isNumber),(0,s.validateOptionalField)(e,"PaymentTotal",s.isNumber),(0,s.validateOptionalField)(e,"PaymentInterval",s.isNumber),(0,s.validateOptionalField)(e,"GracePeriod",s.isNumber),!(0,s.isLedgerEntryId)(e.LoanBrokerID))throw new a.ValidationError("LoanSet: LoanBrokerID must be 64 characters hexadecimal string");if(null!=e.Data&&!(0,s.validateHexMetadata)(e.Data,512))throw new a.ValidationError("LoanSet: Data must be a valid non-empty hex string up to 512 characters");if(null!=e.OverpaymentFee&&(e.OverpaymentFee<0||e.OverpaymentFee>1e5))throw new a.ValidationError("LoanSet: OverpaymentFee must be between 0 and 100000 inclusive");if(null!=e.InterestRate&&(e.InterestRate<0||e.InterestRate>1e5))throw new a.ValidationError("LoanSet: InterestRate must be between 0 and 100000 inclusive");if(null!=e.LateInterestRate&&(e.LateInterestRate<0||e.LateInterestRate>1e5))throw new a.ValidationError("LoanSet: LateInterestRate must be between 0 and 100000 inclusive");if(null!=e.CloseInterestRate&&(e.CloseInterestRate<0||e.CloseInterestRate>1e5))throw new a.ValidationError("LoanSet: CloseInterestRate must be between 0 and 100000 inclusive");if(null!=e.OverpaymentInterestRate&&(e.OverpaymentInterestRate<0||e.OverpaymentInterestRate>1e5))throw new a.ValidationError("LoanSet: OverpaymentInterestRate must be between 0 and 100000 inclusive");
18if(null!=e.PaymentInterval&&e.PaymentInterval<60)throw new a.ValidationError("LoanSet: PaymentInterval must be greater than or equal to 60");if(null!=e.PaymentInterval&&null!=e.GracePeriod&&e.GracePeriod>e.PaymentInterval)throw new a.ValidationError("LoanSet: GracePeriod must not be greater than PaymentInterval")}},618798,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateMPTokenIssuanceDestroy=void 0;let i=e.r(798184);r.validateMPTokenIssuanceDestroy=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"MPTokenIssuanceID",i.isString)}},904741,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateNFTokenAcceptOffer=void 0;let i=e.r(227730),n=e.r(798184);r.validateNFTokenAcceptOffer=function(e){if((0,n.validateBaseTransaction)(e),null!=e.NFTokenBrokerFee&&function(e){let t=(0,n.parseAmountValue)(e.NFTokenBrokerFee);if(Number.isNaN(t))throw new i.ValidationError("NFTokenAcceptOffer: invalid NFTokenBrokerFee");if(t<=0)throw new i.ValidationError("NFTokenAcceptOffer: NFTokenBrokerFee must be greater than 0; omit if there is no fee");if(null==e.NFTokenSellOffer||null==e.NFTokenBuyOffer)throw new i.ValidationError("NFTokenAcceptOffer: both NFTokenSellOffer and NFTokenBuyOffer must be set if using brokered mode")}(e),null==e.NFTokenSellOffer&&null==e.NFTokenBuyOffer)throw new i.ValidationError("NFTokenAcceptOffer: must set either NFTokenSellOffer or NFTokenBuyOffer")}},741449,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateNFTokenBurn=void 0;let i=e.r(798184);r.validateNFTokenBurn=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"NFTokenID",i.isString),(0,i.validateOptionalField)(e,"Owner",i.isAccount)}},104159,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateNFTokenCancelOffer=void 0;let i=e.r(227730),n=e.r(798184);r.validateNFTokenCancelOffer=function(e){if((0,n.validateBaseTransaction)(e),!(0,n.isArray)(e.NFTokenOffers))throw new i.ValidationError("NFTokenCancelOffer: missing field NFTokenOffers");if(e.NFTokenOffers.length<1)throw new i.ValidationError("NFTokenCancelOffer: empty field NFTokenOffers")}},316577,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateNFTokenModify=void 0;let i=e.r(227730),n=e.r(932114),a=e.r(798184);r.validateNFTokenModify=function(e){if((0,a.validateBaseTransaction)(e),(0,a.validateRequiredField)(e,"NFTokenID",a.isString),(0,a.validateOptionalField)(e,"Owner",a.isAccount),(0,a.validateOptionalField)(e,"URI",a.isString),void 0!==e.URI&&"string"==typeof e.URI){if(""===e.URI)throw new i.ValidationError("NFTokenModify: URI must not be empty string");if(!(0,n.isHex)(e.URI))throw new i.ValidationError("NFTokenModify: URI must be in hex format")}}},760304,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateOfferCancel=void 0;let i=e.r(227730),n=e.r(798184);r.validateOfferCancel=function(e){if((0,n.validateBaseTransaction)(e),void 0===e.OfferSequence)throw new i.ValidationError("OfferCancel: missing field OfferSequence");if("number"!=typeof e.OfferSequence)throw new i.ValidationError("OfferCancel: OfferSequence must be a number")}},17562,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateOracleDelete=void 0;let i=e.r(798184);r.validateOracleDelete=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"OracleDocumentID",i.isNumber)}},824776,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateOracleSet=void 0;let i=e.r(227730),n=e.r(932114),a=e.r(798184);r.validateOracleSet=function(e){(0,a.validateBaseTransaction)(e),(0,a.validateRequiredField)(e,"OracleDocumentID",a.isNumber),(0,a.validateRequiredField)(e,"LastUpdateTime",a.isNumber),(0,a.validateOptionalField)(e,"Provider",a.isString),(0,a.validateOptionalField)(e,"URI",a.isString),(0,a.validateOptionalField)(e,"AssetClass",a.isString),(0,a.validateRequiredField)(e,"PriceDataSeries",e=>{if(!(0,a.isArray)(e))throw new i.ValidationError("OracleSet: PriceDataSeries must be an array");if(e.length>10)throw new i.ValidationError("OracleSet: PriceDataSeries must have at most 10 PriceData objects");for(let t of e){if(!(0,a.isRecord)(t))throw new i.ValidationError("OracleSet: PriceDataSeries must be an array of objects");let e=t.PriceData;if(!(0,a.isRecord)(e))throw new i.ValidationError("OracleSet: PriceDataSeries must have a `PriceData` object");
18if(1!==Object.keys(t).length)throw new i.ValidationError("OracleSet: PriceDataSeries must only have a single PriceData object");if(null==e.BaseAsset||"string"!=typeof e.BaseAsset)throw new i.ValidationError("OracleSet: PriceDataSeries must have a `BaseAsset` string");if("string"!=typeof e.QuoteAsset)throw new i.ValidationError("OracleSet: PriceDataSeries must have a `QuoteAsset` string");if(null==e.AssetPrice!=(null==e.Scale))throw new i.ValidationError("OracleSet: PriceDataSeries must have both `AssetPrice` and `Scale` if any are present");if("AssetPrice"in e&&!(0,a.isNumber)(e.AssetPrice)){if("string"!=typeof e.AssetPrice)throw new i.ValidationError("OracleSet: Field AssetPrice must be a string or a number");if(!(0,n.isHex)(e.AssetPrice))throw new i.ValidationError("OracleSet: Field AssetPrice must be a valid hex string");if(e.AssetPrice.length<1||e.AssetPrice.length>16)throw new i.ValidationError("OracleSet: Length of AssetPrice field must be between 1 and 16 characters long")}if("Scale"in e){if(!(0,a.isNumber)(e.Scale))throw new i.ValidationError("OracleSet: invalid field Scale");if(e.Scale<0||e.Scale>10)throw new i.ValidationError("OracleSet: Scale must be in range 0-10")}}return!0})}},878719,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validatePaymentChannelCreate=void 0;let i=e.r(227730),n=e.r(798184);r.validatePaymentChannelCreate=function(e){if((0,n.validateBaseTransaction)(e),void 0===e.Amount)throw new i.ValidationError("PaymentChannelCreate: missing Amount");if("string"!=typeof e.Amount)throw new i.ValidationError("PaymentChannelCreate: Amount must be a string");if((0,n.validateRequiredField)(e,"Destination",n.isAccount),(0,n.validateOptionalField)(e,"DestinationTag",n.isNumber),void 0===e.SettleDelay)throw new i.ValidationError("PaymentChannelCreate: missing SettleDelay");if("number"!=typeof e.SettleDelay)throw new i.ValidationError("PaymentChannelCreate: SettleDelay must be a number");if(void 0===e.PublicKey)throw new i.ValidationError("PaymentChannelCreate: missing PublicKey");if("string"!=typeof e.PublicKey)throw new i.ValidationError("PaymentChannelCreate: PublicKey must be a string");if(void 0!==e.CancelAfter&&"number"!=typeof e.CancelAfter)throw new i.ValidationError("PaymentChannelCreate: CancelAfter must be a number")}},302292,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validatePaymentChannelFund=void 0;let i=e.r(227730),n=e.r(798184);r.validatePaymentChannelFund=function(e){if((0,n.validateBaseTransaction)(e),void 0===e.Channel)throw new i.ValidationError("PaymentChannelFund: missing Channel");if("string"!=typeof e.Channel)throw new i.ValidationError("PaymentChannelFund: Channel must be a string");if(void 0===e.Amount)throw new i.ValidationError("PaymentChannelFund: missing Amount");if("string"!=typeof e.Amount)throw new i.ValidationError("PaymentChannelFund: Amount must be a string");if(void 0!==e.Expiration&&"number"!=typeof e.Expiration)throw new i.ValidationError("PaymentChannelFund: Expiration must be a number")}},740764,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validatePermissionedDomainDelete=void 0;let i=e.r(798184);r.validatePermissionedDomainDelete=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"DomainID",i.isString)}},247377,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validatePermissionedDomainSet=void 0;let i=e.r(798184);r.validatePermissionedDomainSet=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateOptionalField)(e,"DomainID",i.isString),(0,i.validateRequiredField)(e,"AcceptedCredentials",i.isArray),(0,i.validateCredentialsList)(e.AcceptedCredentials,e.TransactionType,!1,10)}},23613,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateSetRegularKey=void 0;let i=e.r(227730),n=e.r(798184);r.validateSetRegularKey=function(e){if((0,n.validateBaseTransaction)(e),void 0!==e.RegularKey&&"string"!=typeof e.RegularKey)throw new i.ValidationError("SetRegularKey: RegularKey must be a string")}},112364,(e,t,r)=>{"use strict";
18Object.defineProperty(r,"__esModule",{value:!0}),r.validateSignerListSet=void 0;let i=e.r(227730),n=e.r(798184),a=/^[0-9A-Fa-f]{64}$/u;r.validateSignerListSet=function(e){if((0,n.validateBaseTransaction)(e),(0,n.validateRequiredField)(e,"SignerQuorum",n.isNumber),0!==e.SignerQuorum){if((0,n.validateRequiredField)(e,"SignerEntries",n.isArray),0===e.SignerEntries.length)throw new i.ValidationError("SignerListSet: need at least 1 member in SignerEntries");if(e.SignerEntries.length>32)throw new i.ValidationError("SignerListSet: maximum of 32 members allowed in SignerEntries");for(let t of e.SignerEntries){if(!(0,n.isRecord)(t)||!(0,n.isRecord)(t.SignerEntry))throw new i.ValidationError("SignerListSet: SignerEntries must be an array of SignerEntry objects");let{WalletLocator:e}=t.SignerEntry;if(null!=e&&(!(0,n.isString)(e)||!a.test(e)))throw new i.ValidationError("SignerListSet: WalletLocator in SignerEntry must be a 256-bit (32-byte) hexadecimal value")}}}},562624,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateTicketCreate=void 0;let i=e.r(227730),n=e.r(798184);r.validateTicketCreate=function(e){(0,n.validateBaseTransaction)(e);let{TicketCount:t}=e;if(void 0===t)throw new i.ValidationError("TicketCreate: missing field TicketCount");if("number"!=typeof t)throw new i.ValidationError("TicketCreate: TicketCount must be a number");if(!Number.isInteger(t)||t<1||t>250)throw new i.ValidationError("TicketCreate: TicketCount must be an integer from 1 to 250")}},237061,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateVaultClawback=void 0;let i=e.r(798184);r.validateVaultClawback=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"VaultID",i.isString),(0,i.validateRequiredField)(e,"Holder",i.isAccount),(0,i.validateOptionalField)(e,"Amount",i.isClawbackAmount)}},492391,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateVaultDelete=void 0;let i=e.r(798184);r.validateVaultDelete=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"VaultID",i.isString)}},251133,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateVaultDeposit=void 0;let i=e.r(798184);r.validateVaultDeposit=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"VaultID",i.isString),(0,i.validateRequiredField)(e,"Amount",i.isAmount)}},262858,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateVaultSet=void 0;let i=e.r(227730),n=e.r(932114),a=e.r(798184);r.validateVaultSet=function(e){if((0,a.validateBaseTransaction)(e),(0,a.validateRequiredField)(e,"VaultID",a.isString),(0,a.validateOptionalField)(e,"Data",a.isString),(0,a.validateOptionalField)(e,"AssetsMaximum",a.isXRPLNumber),(0,a.validateOptionalField)(e,"DomainID",a.isString),void 0!==e.Data){let t=e.Data;if(!(0,n.isHex)(t))throw new i.ValidationError("VaultSet: Data must be a valid hex string");let r=t.length/2;if(r>a.VAULT_DATA_MAX_BYTE_LENGTH)throw new i.ValidationError(`VaultSet: Data exceeds ${a.VAULT_DATA_MAX_BYTE_LENGTH} bytes (actual: ${r})`)}}},332940,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateVaultWithdraw=void 0;let i=e.r(798184);r.validateVaultWithdraw=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"VaultID",i.isString),(0,i.validateRequiredField)(e,"Amount",i.isAmount),(0,i.validateOptionalField)(e,"Destination",i.isAccount),(0,i.validateOptionalField)(e,"DestinationTag",i.isNumber)}},77299,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateXChainAccountCreateCommit=void 0;let i=e.r(798184);r.validateXChainAccountCreateCommit=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"XChainBridge",i.isXChainBridge),(0,i.validateRequiredField)(e,"SignatureReward",i.isAmount),(0,i.validateRequiredField)(e,"Destination",i.isAccount),(0,i.validateRequiredField)(e,"Amount",i.isAmount)}},893550,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateXChainAddAccountCreateAttestation=void 0;let i=e.r(798184);r.validateXChainAddAccountCreateAttestation=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"Amount",i.isAmount),(0,i.validateRequiredField)(e,"AttestationRewardAccount",i.isAccount),(0,i.validateRequiredField)(e,"AttestationSignerAccount",i.isAccount),(0,i.validateRequiredField)(e,"Destination",i.isAccount),(0,i.validateRequiredField)(e,"OtherChainSource",i.isAccount),(0,i.validateRequiredField)(e,"PublicKey",i.isString),(0,i.validateRequiredField)(e,"Signature",i.isString),(0,i.validateRequiredField)(e,"SignatureReward",i.isAmount),(0,i.validateRequiredField)(e,"WasLockingChainSend",e=>0===e||1===e),(0,i.validateRequiredField)(e,"XChainAccountCreateCount",e=>(0,i.isNumber)(e)||(0,i.isString)(e)),(0,i.validateRequiredField)(e,"XChainBridge",i.isXChainBridge)}},404673,(e,t,r)=>{"use strict";
18Object.defineProperty(r,"__esModule",{value:!0}),r.validateXChainAddClaimAttestation=void 0;let i=e.r(798184);r.validateXChainAddClaimAttestation=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"Amount",i.isAmount),(0,i.validateRequiredField)(e,"AttestationRewardAccount",i.isAccount),(0,i.validateRequiredField)(e,"AttestationSignerAccount",i.isAccount),(0,i.validateOptionalField)(e,"Destination",i.isAccount),(0,i.validateRequiredField)(e,"OtherChainSource",i.isAccount),(0,i.validateRequiredField)(e,"PublicKey",i.isString),(0,i.validateRequiredField)(e,"Signature",i.isString),(0,i.validateRequiredField)(e,"WasLockingChainSend",e=>0===e||1===e),(0,i.validateRequiredField)(e,"XChainBridge",i.isXChainBridge),(0,i.validateRequiredField)(e,"XChainClaimID",e=>(0,i.isNumber)(e)||(0,i.isString)(e))}},51066,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateXChainClaim=void 0;let i=e.r(798184);r.validateXChainClaim=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"XChainBridge",i.isXChainBridge),(0,i.validateRequiredField)(e,"XChainClaimID",e=>(0,i.isNumber)(e)||(0,i.isString)(e)),(0,i.validateRequiredField)(e,"Destination",i.isAccount),(0,i.validateOptionalField)(e,"DestinationTag",i.isNumber),(0,i.validateRequiredField)(e,"Amount",i.isAmount)}},318336,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateXChainCommit=void 0;let i=e.r(798184);r.validateXChainCommit=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"XChainBridge",i.isXChainBridge),(0,i.validateRequiredField)(e,"XChainClaimID",e=>(0,i.isNumber)(e)||(0,i.isString)(e)),(0,i.validateOptionalField)(e,"OtherChainDestination",i.isAccount),(0,i.validateRequiredField)(e,"Amount",i.isAmount)}},140495,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateXChainCreateBridge=void 0;let i=e.r(798184);r.validateXChainCreateBridge=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"XChainBridge",i.isXChainBridge),(0,i.validateRequiredField)(e,"SignatureReward",i.isAmount),(0,i.validateOptionalField)(e,"MinAccountCreateAmount",i.isAmount)}},228820,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateXChainCreateClaimID=void 0;let i=e.r(798184);r.validateXChainCreateClaimID=function(e){(0,i.validateBaseTransaction)(e),(0,i.validateRequiredField)(e,"XChainBridge",i.isXChainBridge),(0,i.validateRequiredField)(e,"SignatureReward",i.isAmount),(0,i.validateRequiredField)(e,"OtherChainSource",i.isAccount)}},654914,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validate=void 0;let i=e.r(227730),n=e.r(529155),a=e.r(309613),s=e.r(715204),o=e.r(187541),l=e.r(376204),u=e.r(377850),c=e.r(696034),d=e.r(260390),f=e.r(277820),h=e.r(359256),p=e.r(783020),g=e.r(445321),m=e.r(294185),y=e.r(555011),v=e.r(708095),b=e.r(798184),w=e.r(966609),_=e.r(854259),A=e.r(749349),S=e.r(888978),E=e.r(309614),x=e.r(113526),T=e.r(498674),I=e.r(387280),k=e.r(93383),O=e.r(947035),C=e.r(231182),N=e.r(39),P=e.r(712332),D=e.r(537635),R=e.r(83115),$=e.r(812162),B=e.r(529802),L=e.r(882843),U=e.r(109172),F=e.r(457648),M=e.r(889678),j=e.r(618798),z=e.r(922370),V=e.r(904741),H=e.r(741449),q=e.r(104159),W=e.r(145725),K=e.r(905489),G=e.r(316577),Z=e.r(760304),X=e.r(163326),J=e.r(17562),Y=e.r(824776),Q=e.r(492805),ee=e.r(99653),et=e.r(878719),er=e.r(302292),ei=e.r(740764),en=e.r(247377),ea=e.r(23613),es=e.r(112364),eo=e.r(562624),el=e.r(127984),eu=e.r(237061),ec=e.r(453557),ed=e.r(492391),ef=e.r(251133),eh=e.r(262858),ep=e.r(332940),eg=e.r(77299),em=e.r(893550),ey=e.r(404673),ev=e.r(51066),eb=e.r(318336),ew=e.r(140495),e_=e.r(228820),eA=e.r(872349);r.validate=function e(t){let r=Object.assign({},t);switch((0,b.validateBaseTransaction)(r),Object.keys(r).forEach(e=>{let t=r[e];if(t&&(0,b.isIssuedCurrencyAmount)(t)){let e=t.currency;if(3===e.length&&"XRP"===e.toUpperCase())throw new i.ValidationError(`Cannot have an issued currency with a similar standard code to XRP (received '${e}'). XRP is not an issued currency.`)}}),r.Flags=(0,n.convertTxFlagsToNumber)(r),r.TransactionType){case"AMMBid":(0,o.validateAMMBid)(r);break;case"AMMClawback":(0,l.validateAMMClawback)(r);break;case"AMMCreate":(0,u.validateAMMCreate)(r);break;case"AMMDelete":(0,c.validateAMMDelete)(r);break;case"AMMDeposit":(0,d.validateAMMDeposit)(r);break;case"AMMVote":(0,f.validateAMMVote)(r);break;case"AMMWithdraw":(0,h.validateAMMWithdraw)(r);break;case"AccountDelete":(0,a.validateAccountDelete)(r);break;case"AccountSet":(0,s.validateAccountSet)(r);break;case"Batch":(0,p.validateBatch)(r),r.RawTransactions.forEach(t=>{e(t.RawTransaction)});break;case"CheckCancel":(0,g.validateCheckCancel)(r);break;case"CheckCash":(0,m.validateCheckCash)(r);break;case"CheckCreate":(0,y.validateCheckCreate)(r);break;case"Clawback":(0,v.validateClawback)(r);break;case"CredentialAccept":(0,w.validateCredentialAccept)(r);break;case"CredentialCreate":(0,_.validateCredentialCreate)(r);break;case"CredentialDelete":(0,A.validateCredentialDelete)(r);break;case"DIDDelete":(0,x.validateDIDDelete)(r);break;case"DIDSet":(0,T.validateDIDSet)(r);break;case"DelegateSet":(0,S.validateDelegateSet)(r);break;case"DepositPreauth":(0,E.validateDepositPreauth)(r);break;case"EscrowCancel":(0,I.validateEscrowCancel)(r);break;case"EscrowCreate":(0,k.validateEscrowCreate)(r);break;case"EscrowFinish":(0,O.validateEscrowFinish)(r);break;case"LoanBrokerCoverClawback":(0,C.validateLoanBrokerCoverClawback)(r);break;
18case"LoanBrokerCoverDeposit":(0,N.validateLoanBrokerCoverDeposit)(r);break;case"LoanBrokerCoverWithdraw":(0,P.validateLoanBrokerCoverWithdraw)(r);break;case"LoanBrokerDelete":(0,D.validateLoanBrokerDelete)(r);break;case"LoanBrokerSet":(0,R.validateLoanBrokerSet)(r);break;case"LoanSet":(0,U.validateLoanSet)(r);break;case"LoanManage":(0,B.validateLoanManage)(r);break;case"LoanDelete":(0,$.validateLoanDelete)(r);break;case"LoanPay":(0,L.validateLoanPay)(r);break;case"MPTokenAuthorize":(0,F.validateMPTokenAuthorize)(r);break;case"MPTokenIssuanceCreate":(0,M.validateMPTokenIssuanceCreate)(r);break;case"MPTokenIssuanceDestroy":(0,j.validateMPTokenIssuanceDestroy)(r);break;case"MPTokenIssuanceSet":(0,z.validateMPTokenIssuanceSet)(r);break;case"NFTokenAcceptOffer":(0,V.validateNFTokenAcceptOffer)(r);break;case"NFTokenBurn":(0,H.validateNFTokenBurn)(r);break;case"NFTokenCancelOffer":(0,q.validateNFTokenCancelOffer)(r);break;case"NFTokenCreateOffer":(0,W.validateNFTokenCreateOffer)(r);break;case"NFTokenMint":(0,K.validateNFTokenMint)(r);break;case"NFTokenModify":(0,G.validateNFTokenModify)(r);break;case"OfferCancel":(0,Z.validateOfferCancel)(r);break;case"OfferCreate":(0,X.validateOfferCreate)(r);break;case"OracleDelete":(0,J.validateOracleDelete)(r);break;case"OracleSet":(0,Y.validateOracleSet)(r);break;case"Payment":(0,Q.validatePayment)(r);break;case"PaymentChannelClaim":(0,ee.validatePaymentChannelClaim)(r);break;case"PaymentChannelCreate":(0,et.validatePaymentChannelCreate)(r);break;case"PaymentChannelFund":(0,er.validatePaymentChannelFund)(r);break;case"PermissionedDomainSet":(0,en.validatePermissionedDomainSet)(r);break;case"PermissionedDomainDelete":(0,ei.validatePermissionedDomainDelete)(r);break;case"SetRegularKey":(0,ea.validateSetRegularKey)(r);break;case"SignerListSet":(0,es.validateSignerListSet)(r);break;case"TicketCreate":(0,eo.validateTicketCreate)(r);break;case"TrustSet":(0,el.validateTrustSet)(r);break;case"VaultClawback":(0,eu.validateVaultClawback)(r);break;case"VaultCreate":(0,ec.validateVaultCreate)(r);break;case"VaultDelete":(0,ed.validateVaultDelete)(r);break;case"VaultDeposit":(0,ef.validateVaultDeposit)(r);break;case"VaultSet":(0,eh.validateVaultSet)(r);break;case"VaultWithdraw":(0,ep.validateVaultWithdraw)(r);break;case"XChainAccountCreateCommit":(0,eg.validateXChainAccountCreateCommit)(r);break;case"XChainAddAccountCreateAttestation":(0,em.validateXChainAddAccountCreateAttestation)(r);break;case"XChainAddClaimAttestation":(0,ey.validateXChainAddClaimAttestation)(r);break;case"XChainClaim":(0,ev.validateXChainClaim)(r);break;case"XChainCommit":(0,eb.validateXChainCommit)(r);break;case"XChainCreateBridge":(0,ew.validateXChainCreateBridge)(r);break;case"XChainCreateClaimID":(0,e_.validateXChainCreateClaimID)(r);break;case"XChainModifyBridge":(0,eA.validateXChainModifyBridge)(r);break;default:throw new i.ValidationError(`Invalid field TransactionType: ${r.TransactionType}`)}}},720169,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),r.EnableAmendmentFlags=void 0,(n=i||(r.EnableAmendmentFlags=i={}))[n.tfGotMajority=65536]="tfGotMajority",n[n.tfLostMajority=131072]="tfLostMajority"},382870,(e,t,r)=>{"use strict";var i=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.XChainModifyBridgeFlags=r.VaultWithdrawalPolicy=r.VaultCreateFlags=r.TrustSetFlags=r.PaymentChannelClaimFlags=r.PaymentFlags=r.OfferCreateFlags=r.validateNFTokenModify=r.NFTokenMintFlags=r.NFTokenCreateOfferFlags=r.MPTokenIssuanceSetFlags=r.MPTokenIssuanceCreateFlags=r.MPTokenAuthorizeFlags=r.LoanPayFlags=r.LoanManageFlags=r.LoanSetFlags=r.EnableAmendmentFlags=r.BatchFlags=r.AMMWithdrawFlags=r.AMMDepositFlags=r.AMMClawbackFlags=r.AccountSetTfFlags=r.AccountSetAsfFlags=r.validate=r.isMPTAmount=r.GlobalFlags=void 0;var a=e.r(798184);Object.defineProperty(r,"GlobalFlags",{enumerable:!0,get:function(){return a.GlobalFlags}}),Object.defineProperty(r,"isMPTAmount",{enumerable:!0,get:function(){return a.isMPTAmount}});var s=e.r(654914);Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return s.validate}}),n(e.r(858908),r);var o=e.r(715204);Object.defineProperty(r,"AccountSetAsfFlags",{enumerable:!0,get:function(){return o.AccountSetAsfFlags}}),Object.defineProperty(r,"AccountSetTfFlags",{enumerable:!0,get:function(){return o.AccountSetTfFlags}});var l=e.r(376204);Object.defineProperty(r,"AMMClawbackFlags",{enumerable:!0,get:function(){return l.AMMClawbackFlags}});var u=e.r(260390);Object.defineProperty(r,"AMMDepositFlags",{enumerable:!0,get:function(){return u.AMMDepositFlags}});var c=e.r(359256);Object.defineProperty(r,"AMMWithdrawFlags",{enumerable:!0,get:function(){return c.AMMWithdrawFlags}});var d=e.r(783020);Object.defineProperty(r,"BatchFlags",{enumerable:!0,get:function(){return d.BatchFlags}});var f=e.r(720169);Object.defineProperty(r,"EnableAmendmentFlags",{enumerable:!0,get:function(){return f.EnableAmendmentFlags}});var h=e.r(109172);Object.defineProperty(r,"LoanSetFlags",{enumerable:!0,get:function(){return h.LoanSetFlags}});var p=e.r(529802);Object.defineProperty(r,"LoanManageFlags",{enumerable:!0,get:function(){return p.LoanManageFlags}});var g=e.r(882843);Object.defineProperty(r,"LoanPayFlags",{enumerable:!0,get:function(){return g.LoanPayFlags}});var m=e.r(457648);Object.defineProperty(r,"MPTokenAuthorizeFlags",{enumerable:!0,get:function(){return m.MPTokenAuthorizeFlags}});var y=e.r(889678);Object.defineProperty(r,"MPTokenIssuanceCreateFlags",{enumerable:!0,get:function(){return y.MPTokenIssuanceCreateFlags}});var v=e.r(922370);Object.defineProperty(r,"MPTokenIssuanceSetFlags",{enumerable:!0,get:function(){return v.MPTokenIssuanceSetFlags}});var b=e.r(145725);Object.defineProperty(r,"NFTokenCreateOfferFlags",{enumerable:!0,get:function(){return b.NFTokenCreateOfferFlags}});var w=e.r(905489);Object.defineProperty(r,"NFTokenMintFlags",{enumerable:!0,get:function(){return w.NFTokenMintFlags}});var _=e.r(316577);Object.defineProperty(r,"validateNFTokenModify",{enumerable:!0,get:function(){return _.validateNFTokenModify}});var A=e.r(163326);Object.defineProperty(r,"OfferCreateFlags",{enumerable:!0,get:function(){return A.OfferCreateFlags}});var S=e.r(492805);Object.defineProperty(r,"PaymentFlags",{enumerable:!0,get:function(){return S.PaymentFlags}});var E=e.r(99653);Object.defineProperty(r,"PaymentChannelClaimFlags",{enumerable:!0,get:function(){return E.PaymentChannelClaimFlags}});var x=e.r(127984);Object.defineProperty(r,"TrustSetFlags",{enumerable:!0,get:function(){return x.TrustSetFlags}});var T=e.r(453557);Object.defineProperty(r,"VaultCreateFlags",{enumerable:!0,get:function(){return T.VaultCreateFlags}}),Object.defineProperty(r,"VaultWithdrawalPolicy",{enumerable:!0,get:function(){return T.VaultWithdrawalPolicy}});var I=e.r(872349);Object.defineProperty(r,"XChainModifyBridgeFlags",{enumerable:!0,get:function(){return I.XChainModifyBridgeFlags}})},397267,(e,t,r)=>{"use strict";var i=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);
18(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=e.e&&e.e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=e.e&&e.e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},s=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.encodeMPTokenMetadata=r.decodeMPTokenMetadata=r.validateMPTokenMetadata=r.parseTransactionFlags=r.convertTxFlagsToNumber=r.setTransactionFlagsToNumber=r.parseAccountRootFlags=r.LedgerEntry=void 0,r.LedgerEntry=a(e.r(429839));var o=e.r(529155);Object.defineProperty(r,"parseAccountRootFlags",{enumerable:!0,get:function(){return o.parseAccountRootFlags}}),Object.defineProperty(r,"setTransactionFlagsToNumber",{enumerable:!0,get:function(){return o.setTransactionFlagsToNumber}}),Object.defineProperty(r,"convertTxFlagsToNumber",{enumerable:!0,get:function(){return o.convertTxFlagsToNumber}}),Object.defineProperty(r,"parseTransactionFlags",{enumerable:!0,get:function(){return o.parseTransactionFlags}});var l=e.r(976749);Object.defineProperty(r,"validateMPTokenMetadata",{enumerable:!0,get:function(){return l.validateMPTokenMetadata}}),Object.defineProperty(r,"decodeMPTokenMetadata",{enumerable:!0,get:function(){return l.decodeMPTokenMetadata}}),Object.defineProperty(r,"encodeMPTokenMetadata",{enumerable:!0,get:function(){return l.encodeMPTokenMetadata}}),s(e.r(705861),r),s(e.r(382870),r),s(e.r(654501),r)},242576,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.computeSignature=r.getDecodedTransaction=r.addressToBigNumber=r.NUM_BITS_IN_HEX=r.compareSigners=void 0;let n=e.r(575280),a=i(e.r(892623)),s=e.r(550294),o=e.r(522236),l=e.r(377702);function u(e){let t=(0,n.bytesToHex)((0,s.decodeAccountID)(e));return new a.default(t,r.NUM_BITS_IN_HEX)}r.compareSigners=function(e,t){if(!e.Account||!t.Account)throw Error("compareSigners: Account cannot be null or undefined");let r=u(e.Account).comparedTo(u(t.Account));if(null===r)throw Error("compareSigners: Invalid account address comparison resulted in NaN");return r},r.NUM_BITS_IN_HEX=16,r.addressToBigNumber=u,r.getDecodedTransaction=function(e){return"object"==typeof e?(0,o.decode)((0,o.encode)(e)):(0,o.decode)(e)},r.computeSignature=function(e,t,r){if(r){let i=(0,s.isValidXAddress)(r)?(0,s.xAddressToClassicAddress)(r).classicAddress:r;return(0,l.sign)((0,o.encodeForMultisigning)(e,i),t)}return(0,l.sign)((0,o.encodeForSigning)(e),t)}},988063,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.combineBatchSigners=r.signMultiBatch=void 0;let i=e.r(522236),n=e.r(377702),a=e.r(227730),s=e.r(397267),o=e.r(783020),l=e.r(254234),u=e.r(242576);
18r.signMultiBatch=function(e,t,r={}){var o;let u=null!=(o=r.batchAccount)?o:e.classicAddress,c=!1;if("string"==typeof r.multisign?c=r.multisign:r.multisign&&(c=e.classicAddress),"Batch"!==t.TransactionType)throw new a.ValidationError("Must be a Batch transaction.");if((0,s.validate)(t),!new Set(t.RawTransactions.map(e=>e.RawTransaction.Account)).has(u))throw new a.ValidationError("Must be signing for an address submitting a transaction in the Batch.");let d={flags:t.Flags,txIDs:t.RawTransactions.map(e=>(0,l.hashSignedTx)(e.RawTransaction))},f=(0,n.sign)((0,i.encodeForSigningBatch)(d),e.privateKey);t.BatchSigners=[function(e,t,r,i=!1){return i?{BatchSigner:{Account:e,Signers:[{Signer:{Account:i,SigningPubKey:t.publicKey,TxnSignature:r}}]}}:{BatchSigner:{Account:e,SigningPubKey:t.publicKey,TxnSignature:r}}}(u,e,f,c)]},r.combineBatchSigners=function(e){var t;let r;if(0===e.length)throw new a.ValidationError("There are 0 transactions to combine.");let n=e.map(e=>(0,u.getDecodedTransaction)(e));return n.forEach(e=>{if("Batch"!==e.TransactionType)throw new a.ValidationError("TransactionType must be `Batch`.");if((0,o.validateBatch)(e),null==e.BatchSigners||0===e.BatchSigners.length)throw new a.ValidationError("For combining Batch transaction signatures, all transactions must include a BatchSigners field containing an array of signatures.");if(null!=e.TxnSignature||null!=e.Signers)throw new a.ValidationError("Batch transaction must be unsigned.")}),function(e){let t=JSON.stringify({flags:e[0].Flags,transactionIDs:e[0].RawTransactions.map(e=>(0,l.hashSignedTx)(e.RawTransaction))});if(e.slice(1).some(e=>JSON.stringify({flags:e.Flags,transactionIDs:e.RawTransactions.map(e=>(0,l.hashSignedTx)(e.RawTransaction))})!==t))throw new a.ValidationError("Flags and transaction hashes are not the same for all provided transactions.")}(n),(0,i.encode)((r=(t=n).flatMap(e=>{var t;return null!=(t=e.BatchSigners)?t:[]}).filter(e=>e.BatchSigner.Account!==t[0].Account).sort((e,t)=>(0,u.compareSigners)(e.BatchSigner,t.BatchSigner)),Object.assign(Object.assign({},t[0]),{BatchSigners:r})))}},591003,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.multisign=r.verifySignature=void 0;let i=e.r(522236),n=e.r(377702),a=e.r(227730),s=e.r(382870),o=e.r(242576);r.multisign=function(e){var t;let r;if(0===e.length)throw new a.ValidationError("There were 0 transactions to multisign");let n=e.map(e=>(0,o.getDecodedTransaction)(e));return n.forEach(e=>{if((0,s.validate)(e),null==e.Signers||0===e.Signers.length)throw new a.ValidationError("For multisigning all transactions must include a Signers field containing an array of signatures. You may have forgotten to pass the 'forMultisign' parameter when signing.");if(""!==e.SigningPubKey)throw new a.ValidationError("SigningPubKey must be an empty string for all transactions when multisigning.")}),function(e){let t=JSON.stringify(Object.assign(Object.assign({},e[0]),{Signers:null}));if(e.slice(1).some(e=>JSON.stringify(Object.assign(Object.assign({},e),{Signers:null}))!==t))throw new a.ValidationError("txJSON is not the same for all signedTransactions")}(n),(0,i.encode)((r=(t=n).flatMap(e=>{var t;return null!=(t=e.Signers)?t:[]}).sort((e,t)=>(0,o.compareSigners)(e.Signer,t.Signer)),Object.assign(Object.assign({},t[0]),{Signers:r})))},r.verifySignature=function(e,t){let r=(0,o.getDecodedTransaction)(e),a=t;if("string"!=typeof r.TxnSignature||!r.TxnSignature)throw Error("Transaction is missing a signature, TxnSignature");if(!a){if("string"!=typeof r.SigningPubKey||!r.SigningPubKey)throw Error("Transaction is missing a public key, SigningPubKey");a=r.SigningPubKey}return(0,n.verify)((0,i.encodeForSigning)(r),r.TxnSignature,a)}},609278,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.authorizeChannel=void 0;let i=e.r(522236),n=e.r(377702);r.authorizeChannel=function(e,t,r){let a=(0,i.encodeForSigningClaim)({channel:t,amount:r});return(0,n.sign)(a,e.privateKey)}},474012,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};
18Object.defineProperty(r,"__esModule",{value:!0}),r.combineLoanSetCounterpartySigners=r.signLoanSetByCounterparty=void 0;let n=i(e.r(580381)),a=e.r(522236),s=e.r(227730),o=e.r(397267),l=e.r(254234),u=e.r(242576);r.signLoanSetByCounterparty=function(e,t,r={}){let i=(0,u.getDecodedTransaction)(t);if("LoanSet"!==i.TransactionType)throw new s.ValidationError("Transaction must be a LoanSet transaction.");if(i.CounterpartySignature)throw new s.ValidationError("Transaction is already signed by the counterparty.");if(null==i.TxnSignature||null==i.SigningPubKey)throw new s.ValidationError("Transaction must be first signed by first party.");(0,o.validate)(i);let n=!1;"string"==typeof r.multisign?n=r.multisign:r.multisign&&(n=e.classicAddress),n?i.CounterpartySignature={Signers:[{Signer:{Account:n,SigningPubKey:e.publicKey,TxnSignature:(0,u.computeSignature)(i,e.privateKey,n)}}]}:i.CounterpartySignature={SigningPubKey:e.publicKey,TxnSignature:(0,u.computeSignature)(i,e.privateKey)};let c=(0,a.encode)(i);return{tx:i,tx_blob:c,hash:(0,l.hashSignedTx)(c)}},r.combineLoanSetCounterpartySigners=function(e){let t;if(0===e.length)throw new s.ValidationError("There are 0 transactions to combine.");let r=e.map(e=>(0,u.getDecodedTransaction)(e));r.forEach(e=>{var t;if((0,o.validate)(e),"LoanSet"!==e.TransactionType)throw new s.ValidationError("Transaction must be a LoanSet transaction.");if((null==(t=e.CounterpartySignature)?void 0:t.Signers)==null||0===e.CounterpartySignature.Signers.length)throw new s.ValidationError("CounterpartySignature must have Signers.");if(null==e.TxnSignature||null==e.SigningPubKey)throw new s.ValidationError("Transaction must be first signed by first party.")});var i,l=r;let c=(0,n.default)(Object.assign(Object.assign({},l[0]),{CounterpartySignature:Object.assign(Object.assign({},l[0].CounterpartySignature),{Signers:null})}));if(l.slice(1).some(e=>(0,n.default)(Object.assign(Object.assign({},e),{CounterpartySignature:Object.assign(Object.assign({},e.CounterpartySignature),{Signers:null})}))!==c))throw new s.ValidationError("LoanSet transactions are not the same.");let d=(t=(i=r).flatMap(e=>{var t,r;return null!=(r=null==(t=e.CounterpartySignature)?void 0:t.Signers)?r:[]}).sort((e,t)=>(0,u.compareSigners)(e.Signer,t.Signer)),Object.assign(Object.assign({},i[0]),{CounterpartySignature:{Signers:t}}));return{tx:d,tx_blob:(0,a.encode)(d)}}},827685,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.notImplemented=r.bitMask=r.utf8ToBytes=r.randomBytes=r.isBytes=r.hexToBytes=r.concatBytes=r.bytesToUtf8=r.bytesToHex=r.anumber=r.abytes=void 0,r.abool=function(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)},r.numberToHexUnpadded=o,r.hexToNumber=l,r.bytesToNumberBE=function(e){return l((0,i.bytesToHex)(e))},r.bytesToNumberLE=function(e){return(0,i.abytes)(e),l((0,i.bytesToHex)(Uint8Array.from(e).reverse()))},r.numberToBytesBE=u,r.numberToBytesLE=function(e,t){return u(e,t).reverse()},r.numberToVarBytesBE=function(e){return(0,i.hexToBytes)(o(e))},r.ensureBytes=function(e,t,r){let n;if("string"==typeof t)try{n=(0,i.hexToBytes)(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if((0,i.isBytes)(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let a=n.length;if("number"==typeof r&&a!==r)throw Error(e+" of length "+r+" expected, got "+a);return n},r.equalBytes=function(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i<e.length;i++)r|=e[i]^t[i];return 0===r},r.inRange=d,r.aInRange=function(e,t,r,i){if(!d(t,r,i))throw Error("expected valid "+e+": "+r+" <= n < "+i+", got "+t)},r.bitLen=function(e){let t;for(t=0;e>a;e>>=s,t+=1);return t},r.bitGet=function(e,t){return e>>BigInt(t)&s},r.bitSet=function(e,t,r){return e|(r?s:a)<<BigInt(t)},r.createHmacDrbg=function(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=e=>new Uint8Array(e),a=n(e),s=n(e),o=0,l=()=>{a.fill(1),s.fill(0),o=0},u=(...e)=>r(s,a,...e),c=(e=n(0))=>{(s=u(Uint8Array.of(0),e),a=u(),0!==e.length)&&(s=u(Uint8Array.of(1),e),a=u())},d=()=>
18{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(a=u()).slice();r.push(t),e+=a.length}return(0,i.concatBytes)(...r)};return(e,t)=>{let r;for(l(),c(e);!(r=t(d()));)c();return l(),r}},r.validateObject=function(e,t,r={}){let i=(t,r,i)=>{let n=f[r];if("function"!=typeof n)throw Error("invalid validator function");let a=e[t];if((!i||void 0!==a)&&!n(a,e))throw Error("param "+String(t)+" is invalid. Expected "+r+", got "+a)};for(let[e,r]of Object.entries(t))i(e,r,!1);for(let[e,t]of Object.entries(r))i(e,t,!0);return e},r.isHash=function(e){return"function"==typeof e&&Number.isSafeInteger(e.outputLen)},r._validateObject=function(e,t,r={}){if(!e||"object"!=typeof e)throw Error("expected valid options object");function i(t,r,i){let n=e[t];if(i&&void 0===n)return;let a=typeof n;if(a!==r||null===n)throw Error(`param "${t}" is invalid: expected ${r}, got ${a}`)}Object.entries(t).forEach(([e,t])=>i(e,t,!1)),Object.entries(r).forEach(([e,t])=>i(e,t,!0))},r.memoized=function(e){let t=new WeakMap;return(r,...i)=>{let n=t.get(r);if(void 0!==n)return n;let a=e(r,...i);return t.set(r,a),a}};let i=e.r(781887);var n=e.r(781887);Object.defineProperty(r,"abytes",{enumerable:!0,get:function(){return n.abytes}}),Object.defineProperty(r,"anumber",{enumerable:!0,get:function(){return n.anumber}}),Object.defineProperty(r,"bytesToHex",{enumerable:!0,get:function(){return n.bytesToHex}}),Object.defineProperty(r,"bytesToUtf8",{enumerable:!0,get:function(){return n.bytesToUtf8}}),Object.defineProperty(r,"concatBytes",{enumerable:!0,get:function(){return n.concatBytes}}),Object.defineProperty(r,"hexToBytes",{enumerable:!0,get:function(){return n.hexToBytes}}),Object.defineProperty(r,"isBytes",{enumerable:!0,get:function(){return n.isBytes}}),Object.defineProperty(r,"randomBytes",{enumerable:!0,get:function(){return n.randomBytes}}),Object.defineProperty(r,"utf8ToBytes",{enumerable:!0,get:function(){return n.utf8ToBytes}});let a=BigInt(0),s=BigInt(1);function o(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function l(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?a:BigInt("0x"+e)}function u(e,t){return(0,i.hexToBytes)(e.toString(16).padStart(2*t,"0"))}let c=e=>"bigint"==typeof e&&a<=e;function d(e,t,r){return c(e)&&c(t)&&c(r)&&t<=e&&e<r}r.bitMask=e=>(s<<BigInt(e))-s;let f={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||(0,i.isBytes)(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};r.notImplemented=()=>{throw Error("not implemented")}},34064,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isNegativeLE=void 0,r.mod=d,r.pow=function(e,t,r){return v(A(r),e,t)},r.pow2=function(e,t,r){let i=e;for(;t-- >n;)i*=i,i%=r;return i},r.invert=f,r.tonelliShanks=g,r.FpSqrt=m,r.validateField=function(e){let t=y.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});return(0,i._validateObject)(e,t),e},r.FpPow=v,r.FpInvertBatch=b,r.FpDiv=function(e,t,r){return e.mul(t,"bigint"==typeof r?f(r,e.ORDER):e.inv(r))},r.FpLegendre=w,r.FpIsSquare=function(e,t){return 1===w(e,t)},r.nLength=_,r.Field=A,r.FpSqrtOdd=function(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)},r.FpSqrtEven=function(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r},r.hashToPrivateScalar=function(e,t,r=!1){let n=(e=(0,i.ensureBytes)("privateHash",e)).length,s=_(t).nByteLength+8;if(s<24||n<s||n>1024)throw Error("hashToPrivateScalar: expected "+s+"-1024 bytes of input, got "+n);return d(r?(0,i.bytesToNumberLE)(e):(0,i.bytesToNumberBE)(e),t-a)+a},r.getFieldBytesLength=S,r.getMinHashLength=E,r.mapHashToField=function(e,t,r=!1){let n=e.length,s=S(t),o=E(t);if(n<16||n<o||n>1024)throw Error("expected "+o+"-1024 bytes of input, got "+n);let l=d(r?(0,i.bytesToNumberLE)(e):(0,i.bytesToNumberBE)(e),t-a)+a;return r?(0,i.numberToBytesLE)(l,s):(0,i.numberToBytesBE)(l,s)};let i=e.r(827685),n=BigInt(0),a=BigInt(1),s=BigInt(2),o=BigInt(3),l=BigInt(4),u=BigInt(5),c=BigInt(8);function d(e,t){let r=e%t;return r>=n?r:t+r}function f(e,t){if(e===n)throw Error("invert: expected non-zero number");if(t<=n)throw Error("invert: expected positive modulus, got "+t);let r=d(e,t),i=t,s=n,o=a,l=a,u=n;for(;r!==n;){let e=i/r,t=i%r,n=s-l*e,a=o-u*e;i=r,r=t,s=l,o=u,l=n,u=a}if(i!==a)throw Error("invert: does not exist");return d(s,t)}function h(e,t){let r=(e.ORDER+a)/l,i=e.pow(t,r);if(!e.eql(e.sqr(i),t))throw Error("Cannot find square root");return i}function p(e,t){let r=(e.ORDER-u)/c,i=e.mul(t,s),n=e.pow(i,r),a=e.mul(t,n),o=e.mul(e.mul(a,s),n),l=e.mul(a,e.sub(o,e.ONE));if(!e.eql(e.sqr(l),t))throw Error("Cannot find square root");return l}function g(e){if(e<BigInt(3))throw Error("sqrt is not defined for small field");let t=e-a,r=0;for(;t%s===n;)t/=s,r++;let i=s,o=A(e);for(;1===w(o,i);)if(i++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return h;let l=o.pow(i,t),u=(t+a)/s;return function(e,i){if(e.is0(i))return i;if(1!==w(e,i))throw Error("Cannot find square root");let n=r,s=e.mul(e.ONE,l),o=e.pow(i,t),c=e.pow(i,u);for(;!e.eql(o,e.ONE);){if(e.is0(o))return e.ZERO;let t=1,r=e.sqr(o);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===n)throw Error("Cannot find square root");let i=a<<BigInt(n-t-1),l=e.pow(s,i);n=t,s=e.sqr(l),o=e.mul(o,s),c=e.mul(c,l)}return c}}function m(e){return e%l===o?h:e%c===u?p:g(e)}r.isNegativeLE=(e,t)=>(d(e,t)&a)===a;let y=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function v(e,t,r){if(r<n)throw Error("invalid exponent, negatives unsupported");if(r===n)return e.ONE;if(r===a)return t;let i=e.ONE,s=t;for(;r>n;)r&a&&(i=e.mul(i,s)),s=e.sqr(s),r>>=a;return i}function b(e,t,r=!1){let i=Array(t.length).fill(r?e.ZERO:void 0),n=t.reduce((t,r,n)=>e.is0(r)?t:(i[n]=t,e.mul(t,r)),e.ONE),a=e.inv(n);return t.reduceRight((t,r,n)=>e.is0(r)?t:(i[n]=e.mul(t,i[n]),e.mul(t,r)),a),i}function w(e,t){let r=(e.ORDER-a)/s,i=e.pow(t,r),n=e.eql(i,e.ONE),o=e.eql(i,e.ZERO),l=e.eql(i,e.neg(e.ONE));if(!n&&!o&&!l)throw Error("invalid Legendre symbol result");return n?1:o?0:-1}function _(e,t){void 0!==t&&(0,i.anumber)(t);let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function A(e,t,r=!1,s={}){let o,l,u;if(e<=n)throw Error("invalid field: expected ORDER > 0, got "+e);if("object"==typeof t&&null!=t){if(s.sqrt||r)throw Error("cannot specify opts in two arguments");
18t.BITS&&(l=t.BITS),t.sqrt&&(u=t.sqrt),"boolean"==typeof t.isLE&&(r=t.isLE)}else"number"==typeof t&&(l=t),s.sqrt&&(u=s.sqrt);let{nBitLength:c,nByteLength:h}=_(e,l);if(h>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let p=Object.freeze({ORDER:e,isLE:r,BITS:c,BYTES:h,MASK:(0,i.bitMask)(c),ZERO:n,ONE:a,create:t=>d(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return n<=t&&t<e},is0:e=>e===n,isValidNot0:e=>!p.is0(e)&&p.isValid(e),isOdd:e=>(e&a)===a,neg:t=>d(-t,e),eql:(e,t)=>e===t,sqr:t=>d(t*t,e),add:(t,r)=>d(t+r,e),sub:(t,r)=>d(t-r,e),mul:(t,r)=>d(t*r,e),pow:(e,t)=>v(p,e,t),div:(t,r)=>d(t*f(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>f(t,e),sqrt:u||(t=>(o||(o=m(e)),o(p,t))),toBytes:e=>r?(0,i.numberToBytesLE)(e,h):(0,i.numberToBytesBE)(e,h),fromBytes:e=>{if(e.length!==h)throw Error("Field.fromBytes: expected "+h+" bytes, got "+e.length);return r?(0,i.bytesToNumberLE)(e):(0,i.bytesToNumberBE)(e)},invertBatch:e=>b(p,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(p)}function S(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function E(e){let t=S(e);return t+Math.ceil(t/2)}},711323,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.negateCt=o,r.normalizeZ=function(e,t,r){let i="pz"===t?e=>e.pz:e=>e.ez,a=(0,n.FpInvertBatch)(e.Fp,r.map(i));return r.map((e,t)=>e.toAffine(a[t])).map(e.fromAffine)},r.wNAF=function(e,t){return{constTimeNegate:o,hasPrecomputes:e=>1!==g(e),unsafeLadder(t,r,i=e.ZERO){let n=t;for(;r>a;)r&s&&(i=i.add(n)),n=n.double(),r>>=s;return i},precomputeWindow(e,r){let{windows:i,windowSize:n}=u(r,t),a=[],s=e,o=s;for(let e=0;e<i;e++){o=s,a.push(o);for(let e=1;e<n;e++)o=o.add(s),a.push(o);s=o.double()}return a},wNAF(r,i,n){let a=e.ZERO,s=e.BASE,l=u(r,t);for(let e=0;e<l.windows;e++){let{nextN:t,offset:r,isZero:u,isNeg:d,isNegF:f,offsetF:h}=c(n,e,l);n=t,u?s=s.add(o(f,i[h])):a=a.add(o(d,i[r]))}return m(n),{p:a,f:s}},wNAFUnsafe(r,i,n,s=e.ZERO){let o=u(r,t);for(let e=0;e<o.windows&&n!==a;e++){let{nextN:t,offset:r,isZero:a,isNeg:l}=c(n,e,o);if(n=t,!a){let e=i[r];s=s.add(l?e.negate():e)}}return m(n),s},getPrecomputes(e,t,r){let i=h.get(t);return i||(i=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(i=r(i)),h.set(t,i))),i},wNAFCached(e,t,r){let i=g(e);return this.wNAF(i,this.getPrecomputes(i,e,r),t)},wNAFCachedUnsafe(e,t,r,i){let n=g(e);return 1===n?this.unsafeLadder(e,t,i):this.wNAFUnsafe(n,this.getPrecomputes(n,e,r),t,i)},setWindowSize(e,r){l(r,t),p.set(e,r),h.delete(e)}}},r.mulEndoUnsafe=function(e,t,r,i){let n=t,o=e.ZERO,l=e.ZERO;for(;r>a||i>a;)r&s&&(o=o.add(n)),i&s&&(l=l.add(n)),n=n.double(),r>>=s,i>>=s;return{p1:o,p2:l}},r.pippenger=function(e,t,r,n){d(r,e),f(n,t);let a=r.length,s=n.length;if(a!==s)throw Error("arrays of points and scalars must have equal length");let o=e.ZERO,l=(0,i.bitLen)(BigInt(a)),u=1;l>12?u=l-3:l>4?u=l-2:l>0&&(u=2);let c=(0,i.bitMask)(u),h=Array(Number(c)+1).fill(o),p=Math.floor((t.BITS-1)/u)*u,g=o;for(let e=p;e>=0;e-=u){h.fill(o);for(let t=0;t<s;t++){let i=Number(n[t]>>BigInt(e)&c);h[i]=h[i].add(r[t])}let t=o;for(let e=h.length-1,r=o;e>0;e--)r=r.add(h[e]),t=t.add(r);if(g=g.add(t),0!==e)for(let e=0;e<u;e++)g=g.double()}return g},r.precomputeMSMUnsafe=function(e,t,r,n){l(n,t.BITS),d(r,e);let a=e.ZERO,s=2**n-1,o=Math.ceil(t.BITS/n),u=(0,i.bitMask)(n),c=r.map(e=>{let t=[];for(let r=0,i=e;r<s;r++)t.push(i),i=i.add(e);return t});return e=>{if(f(e,t),e.length>r.length)throw Error("array of scalars must be smaller than array of points");let i=a;for(let t=0;t<o;t++){if(i!==a)for(let e=0;e<n;e++)i=i.double();let r=BigInt(o*n-(t+1)*n);for(let t=0;t<e.length;t++){let n=Number(e[t]>>r&u);n&&(i=i.add(c[t][n-1]))}}return i}},r.validateBasic=function(e){return(0,n.validateField)(e.Fp),(0,i.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,n.nLength)(e.n,e.nBitLength),...e,...{p:e.Fp.ORDER}})},r._createCurveFields=function(e,t,r={}){if(!t||"object"!=typeof t)throw Error(`expected valid ${e} CURVE object`);for(let e of["p","n","h"]){let r=t[e];if(!("bigint"==typeof r&&r>a))throw Error(`CURVE.${e} must be positive bigint`)}let i=y(t.p,r.Fp),n=y(t.n,r.Fn);for(let r of["Gx","Gy","a","weierstrass"===e?"b":"d"])if(!i.isValid(t[r]))throw Error(`CURVE.${r} must be valid field element of CURVE.Fp`);return{Fp:i,Fn:n}};let i=e.r(827685),n=e.r(34064),a=BigInt(0),s=BigInt(1);function o(e,t){let r=t.negate();return e?r:t}function l(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function u(e,t){l(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),a=2**e;return{windows:r,windowSize:n,mask:(0,i.bitMask)(e),maxNumber:a,shiftBy:BigInt(e)}}function c(e,t,r){let{windowSize:i,mask:n,maxNumber:a,shiftBy:o}=r,l=Number(e&n),u=e>>o;l>i&&(l-=a,u+=s);let c=t*i,d=c+Math.abs(l)-1,f=0===l;return{nextN:u,offset:d,isZero:f,isNeg:l<0,isNegF:t%2!=0,offsetF:c}}function d(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)})}function f(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)})}let h=new WeakMap,p=new WeakMap;function g(e){return p.get(e)||1}function m(e){if(e!==a)throw Error("invalid wNAF")}function y(e,t){if(!t)return(0,n.Field)(e);if(t.ORDER!==e)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,n.validateField)(t),t}},816712,(e,t,r)=>{"use strict";
18Object.defineProperty(r,"__esModule",{value:!0}),r.DER=r.DERErr=void 0,r._legacyHelperEquat=p,r._legacyHelperNormPriv=g,r.weierstrassN=m,r.weierstrassPoints=function(e){let{CURVE:t,curveOpts:r}=b(e);return function(e,t){let{Fp:r,Fn:i}=t,a=p(r,e.a,e.b),s=g(i,e.allowedPrivateKeyLengths,e.wrapPrivateKey);return Object.assign({},{CURVE:e,Point:t,ProjectivePoint:t,normPrivateKeyToScalar:s,weierstrassEquation:a,isWithinCurveOrder:function(e){return(0,n.inRange)(e,c,i.ORDER)}})}(e,m(t,r))},r.ecdsa=v,r.weierstrass=function(e){let{CURVE:t,curveOpts:r,ecdsaOpts:i}=function(e){let{CURVE:t,curveOpts:r}=b(e);return{CURVE:t,curveOpts:r,ecdsaOpts:{hash:e.hash,hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN}}}(e),n=v(m(t,r),i,r);return Object.assign({},n,{ProjectivePoint:n.Point,CURVE:e})},r.SWUFpSqrtRatio=w,r.mapToCurveSimpleSWU=function(e,t){(0,s.validateField)(e);let{A:r,B:i,Z:n}=t;if(!e.isValid(r)||!e.isValid(i)||!e.isValid(n))throw Error("mapToCurveSimpleSWU: invalid opts");let a=w(e,n);if(!e.isOdd)throw Error("Field does not have .isOdd()");return t=>{let o,l,u,c,d,f,h,p;o=e.sqr(t),o=e.mul(o,n),l=e.sqr(o),l=e.add(l,o),u=e.add(l,e.ONE),u=e.mul(u,i),c=e.cmov(n,e.neg(l),!e.eql(l,e.ZERO)),c=e.mul(c,r),l=e.sqr(u),f=e.sqr(c),d=e.mul(f,r),l=e.add(l,d),l=e.mul(l,u),f=e.mul(f,c),d=e.mul(f,i),l=e.add(l,d),h=e.mul(o,u);let{isValid:g,value:m}=a(l,f);p=e.mul(o,t),p=e.mul(p,m),h=e.cmov(h,u,g),p=e.cmov(p,m,g);let y=e.isOdd(t)===e.isOdd(p);p=e.cmov(e.neg(p),p,y);let v=(0,s.FpInvertBatch)(e,[c],!0)[0];return{x:h=e.mul(h,v),y:p}}};let i=e.r(642135),n=e.r(827685),a=e.r(711323),s=e.r(34064);function o(e){void 0!==e.lowS&&(0,n.abool)("lowS",e.lowS),void 0!==e.prehash&&(0,n.abool)("prehash",e.prehash)}class l extends Error{constructor(e=""){super(e)}}r.DERErr=l,r.DER={Err:l,_tlv:{encode:(e,t)=>{let{Err:i}=r.DER;if(e<0||e>256)throw new i("tlv.encode: wrong tag");if(1&t.length)throw new i("tlv.encode: unpadded data");let a=t.length/2,s=(0,n.numberToHexUnpadded)(a);if(s.length/2&128)throw new i("tlv.encode: long form length too big");let o=a>127?(0,n.numberToHexUnpadded)(s.length/2|128):"";return(0,n.numberToHexUnpadded)(e)+o+s+t},decode(e,t){let{Err:i}=r.DER,n=0;if(e<0||e>256)throw new i("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new i("tlv.decode: wrong tlv");let a=t[n++],s=0;if(128&a){let e=127&a;if(!e)throw new i("tlv.decode(long): indefinite length not supported");if(e>4)throw new i("tlv.decode(long): byte length is too big");let r=t.subarray(n,n+e);if(r.length!==e)throw new i("tlv.decode: length bytes not complete");if(0===r[0])throw new i("tlv.decode(long): zero leftmost byte");for(let e of r)s=s<<8|e;if(n+=e,s<128)throw new i("tlv.decode(long): not minimal encoding")}else s=a;let o=t.subarray(n,n+s);if(o.length!==s)throw new i("tlv.decode: wrong value length");return{v:o,l:t.subarray(n+s)}}},_int:{encode(e){let{Err:t}=r.DER;if(e<u)throw new t("integer: negative integers are not allowed");let i=(0,n.numberToHexUnpadded)(e);if(8&Number.parseInt(i[0],16)&&(i="00"+i),1&i.length)throw new t("unexpected DER parsing assertion: unpadded hex");return i},decode(e){let{Err:t}=r.DER;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return(0,n.bytesToNumberBE)(e)}},toSig(e){let{Err:t,_int:i,_tlv:a}=r.DER,s=(0,n.ensureBytes)("signature",e),{v:o,l:l}=a.decode(48,s);if(l.length)throw new t("invalid signature: left bytes after parsing");let{v:u,l:c}=a.decode(2,o),{v:d,l:f}=a.decode(2,c);if(f.length)throw new t("invalid signature: left bytes after parsing");return{r:i.decode(u),s:i.decode(d)}},hexFromSig(e){let{_tlv:t,_int:i}=r.DER,n=t.encode(2,i.encode(e.r)),a=t.encode(2,i.encode(e.s));return t.encode(48,n+a)}};let u=BigInt(0),c=BigInt(1),d=BigInt(2),f=BigInt(3),h=BigInt(4);function p(e,t,r){return function(i){let n=e.sqr(i),a=e.mul(n,i);return e.add(e.add(a,e.mul(i,t)),r)}}function g(e,t,r){let{BYTES:i}=e;return function(a){let s;if("bigint"==typeof a)s=a;else{let r=(0,n.ensureBytes)("private key",a);if(t){if(!t.includes(2*r.length))throw Error("invalid private key");let e=new Uint8Array(i);e.set(r,e.length-r.length),r=e}try{s=e.fromBytes(r)}catch(e){throw Error(`invalid private key: expected ui8a of size ${i}, got ${typeof a}`)}}if(r&&(s=e.create(s)),!e.isValidNot0(s))throw Error("invalid private key: out of range [1..N-1]");return s}}function m(e,t={}){let{Fp:r,Fn:i}=(0,a._createCurveFields)("weierstrass",e,t),{h:s,n:o}=e;(0,n._validateObject)(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:l}=t;if(l&&(!r.is0(e.a)||"bigint"!=typeof l.beta||"function"!=typeof l.splitScalar))throw Error('invalid endo: expected "beta": bigint and "splitScalar": function');function d(){if(!r.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}let v=t.toBytes||function(e,t,i){let{x:a,y:s}=t.toAffine(),o=r.toBytes(a);
18if((0,n.abool)("isCompressed",i),!i)return(0,n.concatBytes)(Uint8Array.of(4),o,r.toBytes(s));{d();let e=!r.isOdd(s);return(0,n.concatBytes)(y(e),o)}},b=t.fromBytes||function(e){(0,n.abytes)(e);let t=r.BYTES,i=t+1,a=2*t+1,s=e.length,o=e[0],l=e.subarray(1);if(s===i&&(2===o||3===o)){let e,t=r.fromBytes(l);if(!r.isValid(t))throw Error("bad point: is not on curve, wrong x");let i=w(t);try{e=r.sqrt(i)}catch(e){throw Error("bad point: is not on curve, sqrt error"+(e instanceof Error?": "+e.message:""))}return d(),(1&o)==1!==r.isOdd(e)&&(e=r.neg(e)),{x:t,y:e}}if(s===a&&4===o){let e=r.fromBytes(l.subarray(0*t,+t)),i=r.fromBytes(l.subarray(+t,2*t));if(!_(e,i))throw Error("bad point: is not on curve");return{x:e,y:i}}throw Error(`bad point: got length ${s}, expected compressed=${i} or uncompressed=${a}`)},w=p(r,e.a,e.b);function _(e,t){let i=r.sqr(t),n=w(e);return r.eql(i,n)}if(!_(e.Gx,e.Gy))throw Error("bad curve params: generator point");let A=r.mul(r.pow(e.a,f),h),S=r.mul(r.sqr(e.b),BigInt(27));if(r.is0(r.add(A,S)))throw Error("bad curve params: a or b");function E(e,t,i=!1){if(!r.isValid(t)||i&&r.is0(t))throw Error(`bad point coordinate ${e}`);return t}function x(e){if(!(e instanceof O))throw Error("ProjectivePoint expected")}let T=(0,n.memoized)((e,t)=>{let{px:i,py:n,pz:a}=e;if(r.eql(a,r.ONE))return{x:i,y:n};let s=e.is0();null==t&&(t=s?r.ONE:r.inv(a));let o=r.mul(i,t),l=r.mul(n,t),u=r.mul(a,t);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw Error("invZ was invalid");return{x:o,y:l}}),I=(0,n.memoized)(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.py))return;throw Error("bad point: ZERO")}let{x:i,y:n}=e.toAffine();if(!r.isValid(i)||!r.isValid(n))throw Error("bad point: x or y not field elements");if(!_(i,n))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function k(e,t,i,n,s){return i=new O(r.mul(i.px,e),i.py,i.pz),t=(0,a.negateCt)(n,t),i=(0,a.negateCt)(s,i),t.add(i)}class O{constructor(e,t,r){this.px=E("x",e),this.py=E("y",t,!0),this.pz=E("z",r),Object.freeze(this)}static fromAffine(e){let{x:t,y:i}=e||{};if(!e||!r.isValid(t)||!r.isValid(i))throw Error("invalid affine point");if(e instanceof O)throw Error("projective point not allowed");return r.is0(t)&&r.is0(i)?O.ZERO:new O(t,i,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){return(0,a.normalizeZ)(O,"pz",e)}static fromBytes(e){return(0,n.abytes)(e),O.fromHex(e)}static fromHex(e){let t=O.fromAffine(b((0,n.ensureBytes)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){let r=g(i,t.allowedPrivateKeyLengths,t.wrapPrivateKey);return O.BASE.multiply(r(e))}static msm(e,t){return(0,a.pippenger)(O,i,e,t)}precompute(e=8,t=!0){return N.setWindowSize(this,e),t||this.multiply(f),this}_setWindowSize(e){this.precompute(e)}assertValidity(){I(this)}hasEvenY(){let{y:e}=this.toAffine();if(!r.isOdd)throw Error("Field doesn't support isOdd");return!r.isOdd(e)}equals(e){x(e);let{px:t,py:i,pz:n}=this,{px:a,py:s,pz:o}=e,l=r.eql(r.mul(t,o),r.mul(a,n)),u=r.eql(r.mul(i,o),r.mul(s,n));return l&&u}negate(){return new O(this.px,r.neg(this.py),this.pz)}double(){let{a:t,b:i}=e,n=r.mul(i,f),{px:a,py:s,pz:o}=this,l=r.ZERO,u=r.ZERO,c=r.ZERO,d=r.mul(a,a),h=r.mul(s,s),p=r.mul(o,o),g=r.mul(a,s);return g=r.add(g,g),c=r.mul(a,o),c=r.add(c,c),l=r.mul(t,c),u=r.mul(n,p),u=r.add(l,u),l=r.sub(h,u),u=r.add(h,u),u=r.mul(l,u),l=r.mul(g,l),c=r.mul(n,c),p=r.mul(t,p),g=r.sub(d,p),g=r.mul(t,g),g=r.add(g,c),c=r.add(d,d),d=r.add(c,d),d=r.add(d,p),d=r.mul(d,g),u=r.add(u,d),p=r.mul(s,o),p=r.add(p,p),d=r.mul(p,g),l=r.sub(l,d),c=r.mul(p,h),c=r.add(c,c),new O(l,u,c=r.add(c,c))}add(t){x(t);let{px:i,py:n,pz:a}=this,{px:s,py:o,pz:l}=t,u=r.ZERO,c=r.ZERO,d=r.ZERO,h=e.a,p=r.mul(e.b,f),g=r.mul(i,s),m=r.mul(n,o),y=r.mul(a,l),v=r.add(i,n),b=r.add(s,o);v=r.mul(v,b),b=r.add(g,m),v=r.sub(v,b),b=r.add(i,a);let w=r.add(s,l);return b=r.mul(b,w),w=r.add(g,y),b=r.sub(b,w),w=r.add(n,a),u=r.add(o,l),w=r.mul(w,u),u=r.add(m,y),w=r.sub(w,u),d=r.mul(h,b),u=r.mul(p,y),d=r.add(u,d),u=r.sub(m,d),d=r.add(m,d),c=r.mul(u,d),m=r.add(g,g),m=r.add(m,g),y=r.mul(h,y),b=r.mul(p,b),m=r.add(m,y),y=r.sub(g,y),y=r.mul(h,y),b=r.add(b,y),g=r.mul(m,b),c=r.add(c,g),g=r.mul(w,b),u=r.mul(v,u),u=r.sub(u,g),g=r.mul(v,m),d=r.mul(w,d),new O(u,c,d=r.add(d,g))}subtract(e){return this.add(e.negate())}is0(){return this.equals(O.ZERO)}multiply(e){let r,n,{endo:a}=t;if(!i.isValidNot0(e))throw Error("invalid scalar: out of range");let s=e=>N.wNAFCached(this,e,O.normalizeZ);
18if(a){let{k1neg:t,k1:i,k2neg:o,k2:l}=a.splitScalar(e),{p:u,f:c}=s(i),{p:d,f:f}=s(l);n=c.add(f),r=k(a.beta,u,d,t,o)}else{let{p:t,f:i}=s(e);r=t,n=i}return O.normalizeZ([r,n])[0]}multiplyUnsafe(e){let{endo:r}=t;if(!i.isValid(e))throw Error("invalid scalar: out of range");if(e===u||this.is0())return O.ZERO;if(e===c)return this;if(N.hasPrecomputes(this))return this.multiply(e);if(!r)return N.wNAFCachedUnsafe(this,e);{let{k1neg:t,k1:i,k2neg:n,k2:s}=r.splitScalar(e),{p1:o,p2:l}=(0,a.mulEndoUnsafe)(O,this,i,s);return k(r.beta,o,l,t,n)}}multiplyAndAddUnsafe(e,t,r){let i=this.multiplyUnsafe(t).add(e.multiplyUnsafe(r));return i.is0()?void 0:i}toAffine(e){return T(this,e)}isTorsionFree(){let{isTorsionFree:e}=t;return s===c||(e?e(O,this):N.wNAFCachedUnsafe(this,o).is0())}clearCofactor(){let{clearCofactor:e}=t;return s===c?this:e?e(O,this):this.multiplyUnsafe(s)}toBytes(e=!0){return(0,n.abool)("isCompressed",e),this.assertValidity(),v(O,this,e)}toRawBytes(e=!0){return this.toBytes(e)}toHex(e=!0){return(0,n.bytesToHex)(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}O.BASE=new O(e.Gx,e.Gy,r.ONE),O.ZERO=new O(r.ZERO,r.ONE,r.ZERO),O.Fp=r,O.Fn=i;let C=i.BITS,N=(0,a.wNAF)(O,t.endo?Math.ceil(C/2):C);return O}function y(e){return Uint8Array.of(e?2:3)}function v(e,t,a={}){(0,n._validateObject)(t,{hash:"function"},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let l=t.randomBytes||n.randomBytes,f=t.hmac||((e,...r)=>(0,i.hmac)(t.hash,e,(0,n.concatBytes)(...r))),{Fp:h,Fn:p}=e,{ORDER:m,BITS:b}=p;function w(e,t){if(!p.isValidNot0(t))throw Error(`invalid signature ${e}: out of range 1..CURVE.n`)}class _{constructor(e,t,r){w("r",e),w("s",t),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){let t=p.BYTES,r=(0,n.ensureBytes)("compactSignature",e,2*t);return new _(p.fromBytes(r.subarray(0,t)),p.fromBytes(r.subarray(t,2*t)))}static fromDER(e){let{r:t,s:i}=r.DER.toSig((0,n.ensureBytes)("DER",e));return new _(t,i)}assertValidity(){}addRecoveryBit(e){return new _(this.r,this.s,e)}recoverPublicKey(t){let r=h.ORDER,{r:i,s:a,recovery:s}=this;if(null==s||![0,1,2,3].includes(s))throw Error("recovery id invalid");if(m*d<r&&s>1)throw Error("recovery id is ambiguous for h>1 curve");let o=2===s||3===s?i+m:i;if(!h.isValid(o))throw Error("recovery id 2 or 3 invalid");let l=h.toBytes(o),u=e.fromHex((0,n.concatBytes)(y((1&s)==0),l)),c=p.inv(o),f=x((0,n.ensureBytes)("msgHash",t)),g=p.create(-f*c),v=p.create(a*c),b=e.BASE.multiplyUnsafe(g).add(u.multiplyUnsafe(v));if(b.is0())throw Error("point at infinify");return b.assertValidity(),b}hasHighS(){return this.s>m>>c}normalizeS(){return this.hasHighS()?new _(this.r,p.neg(this.s),this.recovery):this}toBytes(e){if("compact"===e)return(0,n.concatBytes)(p.toBytes(this.r),p.toBytes(this.s));if("der"===e)return(0,n.hexToBytes)(r.DER.hexFromSig(this));throw Error("invalid format")}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,n.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,n.bytesToHex)(this.toBytes("compact"))}}let A=g(p,a.allowedPrivateKeyLengths,a.wrapPrivateKey);function S(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;let r=(0,n.ensureBytes)("key",t).length,i=h.BYTES,s=i+1;if(!a.allowedPrivateKeyLengths&&p.BYTES!==s)return r===s||r===2*i+1}let E=t.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=(0,n.bytesToNumberBE)(e),r=8*e.length-b;return r>0?t>>BigInt(r):t},x=t.bits2int_modN||function(e){return p.create(E(e))},T=(0,n.bitMask)(b);function I(e){return(0,n.aInRange)("num < 2^"+b,e,u,T),p.toBytes(e)}let k={lowS:t.lowS,prehash:!1},O={lowS:t.lowS,prehash:!1};return e.BASE.precompute(8),Object.freeze({getPublicKey:function(t,r=!0){return e.fromPrivateKey(t).toBytes(r)},getSharedSecret:function(t,r,i=!0){if(!0===S(t))throw Error("first arg must be private key");if(!1===S(r))throw Error("second arg must be public key");return e.fromHex(r).multiply(A(t)).toBytes(i)},sign:function(r,i,a=k){let{seed:s,k2sig:d}=function(r,i,a=k){if(["recovered","canonical"].some(e=>e in a))throw Error("sign() legacy options not supported");let{hash:s}=t,{lowS:d,prehash:f,extraEntropy:g}=a;null==d&&(d=!0),r=(0,n.ensureBytes)("msgHash",r),o(a),f&&(r=(0,n.ensureBytes)("prehashed msgHash",s(r)));let y=x(r),v=A(i),b=[I(v),I(y)];if(null!=g&&!1!==g){let e=!0===g?l(h.BYTES):g;b.push((0,n.ensureBytes)("extraEntropy",e))}return{seed:(0,n.concatBytes)(...b),k2sig:function(t){var r;let i=E(t);if(!p.isValidNot0(i))return;let n=p.inv(i),a=e.BASE.multiply(i).toAffine(),s=p.create(a.x);if(s===u)return;let o=p.create(n*p.create(y+s*v));if(o===u)return;let l=2*(a.x!==s)|Number(a.y&c),f=o;return d&&o>m>>c&&(f=(r=o)>m>>c?p.neg(r):r,l^=1),new _(s,f,l)}}}(r,i,a);return(0,n.createHmacDrbg)(t.hash.outputLen,p.BYTES,f)(s,d)},verify:function(i,a,s,l=O){let u,c;a=(0,n.ensureBytes)("msgHash",a),s=(0,n.ensureBytes)("publicKey",s),o(l);let{lowS:d,prehash:f,format:h}=l;if("strict"in l)throw Error("options.strict was renamed to lowS");if(void 0!==h&&!["compact","der","js"].includes(h))throw Error('format must be "compact", "der" or "js"');let g="string"==typeof i||(0,n.isBytes)(i),m=!g&&!h&&"object"==typeof i&&null!==i&&"bigint"==typeof i.r&&"bigint"==typeof i.s;if(!g&&!m)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(m)if(void 0===h||"js"===h)c=new _(i.r,i.s);else throw Error("invalid format");if(g){try{"compact"!==h&&(c=_.fromDER(i))}catch(e){if(!(e instanceof r.DER.Err))throw e}c||"der"===h||(c=_.fromCompact(i))}u=e.fromHex(s)}catch(e){return!1}if(!c||d&&c.hasHighS())return!1;f&&(a=t.hash(a));
18let{r:y,s:v}=c,b=x(a),w=p.inv(v),A=p.create(b*w),S=p.create(y*w),E=e.BASE.multiplyUnsafe(A).add(u.multiplyUnsafe(S));return!E.is0()&&p.create(E.x)===y},utils:{isValidPrivateKey(e){try{return A(e),!0}catch(e){return!1}},normPrivateKeyToScalar:A,randomPrivateKey:()=>(0,s.mapHashToField)(l((0,s.getMinHashLength)(m)),m),precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)},Point:e,Signature:_})}function b(e){let t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r={Fp:e.Fp,Fn:(0,s.Field)(t.n,e.nBitLength),allowedPrivateKeyLengths:e.allowedPrivateKeyLengths,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,wrapPrivateKey:e.wrapPrivateKey,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:t,curveOpts:r}}function w(e,t){let r=e.ORDER,i=u;for(let e=r-c;e%d===u;e/=d)i+=c;let n=i,a=d<<n-c-c,s=a*d,o=(r-c)/s,l=(o-c)/d,p=s-c,g=e.pow(t,o),m=e.pow(t,(o+c)/d),y=(t,r)=>{let i=g,s=e.pow(r,p),o=e.sqr(s);o=e.mul(o,r);let u=e.mul(t,o);u=e.pow(u,l),u=e.mul(u,s),s=e.mul(u,r),o=e.mul(u,t);let f=e.mul(o,s);u=e.pow(f,a);let h=e.eql(u,e.ONE);s=e.mul(o,m),u=e.mul(f,i),o=e.cmov(s,o,h),f=e.cmov(u,f,h);for(let t=n;t>c;t--){let r=t-d;r=d<<r-c;let n=e.pow(f,r),a=e.eql(n,e.ONE);s=e.mul(o,i),i=e.mul(i,i),n=e.mul(f,i),o=e.cmov(s,o,a),f=e.cmov(n,f,a)}return{isValid:h,value:o}};if(e.ORDER%h===f){let r=(e.ORDER-f)/h,i=e.sqrt(e.neg(t));y=(t,n)=>{let a=e.sqr(n),s=e.mul(t,n);a=e.mul(a,s);let o=e.pow(a,r);o=e.mul(o,s);let l=e.mul(o,i),u=e.mul(e.sqr(o),n),c=e.eql(u,t),d=e.cmov(l,o,c);return{isValid:c,value:d}}}return y}},703464,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getHash=function(e){return{hash:e}},r.createCurve=function(e,t){let r=t=>(0,i.weierstrass)({...e,hash:t});return{...r(t),create:r}};let i=e.r(816712)},287832,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.expand_message_xmd=l,r.expand_message_xof=u,r.hash_to_field=c,r.isogenyMap=function(e,t){let r=t.map(e=>Array.from(e).reverse());return(t,i)=>{let[a,s,o,l]=r.map(r=>r.reduce((r,i)=>e.add(e.mul(r,t),i))),[u,c]=(0,n.FpInvertBatch)(e,[s,l],!0);return t=e.mul(a,u),i=e.mul(i,e.mul(o,c)),{x:t,y:i}}},r.createHasher=function(e,t,r){if("function"!=typeof t)throw Error("mapToCurve() must be defined");function i(r){return e.fromAffine(t(r))}function n(t){let r=t.clearCofactor();return r.equals(e.ZERO)?e.ZERO:(r.assertValidity(),r)}return{defaults:r,hashToCurve(e,t){let a=r.DST?r.DST:{},s=c(e,2,Object.assign({},r,a,t)),o=i(s[0]),l=i(s[1]);return n(o.add(l))},encodeToCurve(e,t){let a=r.encodeDST?r.encodeDST:{};return n(i(c(e,1,Object.assign({},r,a,t))[0]))},mapToCurve(e){if(!Array.isArray(e))throw Error("expected array of bigints");for(let t of e)if("bigint"!=typeof t)throw Error("expected array of bigints");return n(i(e))}}};let i=e.r(827685),n=e.r(34064),a=i.bytesToNumberBE;function s(e,t){if(o(e),o(t),e<0||e>=1<<8*t)throw Error("invalid I2OSP input: "+e);let r=Array.from({length:t}).fill(0);for(let i=t-1;i>=0;i--)r[i]=255&e,e>>>=8;return new Uint8Array(r)}function o(e){if(!Number.isSafeInteger(e))throw Error("number expected")}function l(e,t,r,n){(0,i.abytes)(e),(0,i.abytes)(t),o(r),t.length>255&&(t=n((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));let{outputLen:a,blockLen:l}=n,u=Math.ceil(r/a);if(r>65535||u>255)throw Error("expand_message_xmd: invalid lenInBytes");let c=(0,i.concatBytes)(t,s(t.length,1)),d=s(0,l),f=s(r,2),h=Array(u),p=n((0,i.concatBytes)(d,e,f,s(0,1),c));h[0]=n((0,i.concatBytes)(p,s(1,1),c));for(let e=1;e<=u;e++){let t=[function(e,t){let r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e[i]^t[i];return r}(p,h[e-1]),s(e+1,1),c];h[e]=n((0,i.concatBytes)(...t))}return(0,i.concatBytes)(...h).slice(0,r)}function u(e,t,r,n,a){if((0,i.abytes)(e),(0,i.abytes)(t),o(r),t.length>255){let e=Math.ceil(2*n/8);t=a.create({dkLen:e}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw Error("expand_message_xof: invalid lenInBytes");return a.create({dkLen:r}).update(e).update(s(r,2)).update(t).update(s(t.length,1)).digest()}function c(e,t,r){let s;(0,i._validateObject)(r,{p:"bigint",m:"number",k:"number",hash:"function"});let{p:c,k:d,m:f,hash:h,expand:p,DST:g}=r;if(!(0,i.isBytes)(g)&&"string"!=typeof g)throw Error("DST must be string or uint8array");if(!(0,i.isHash)(r.hash))throw Error("expected valid hash");(0,i.abytes)(e),o(t);let m="string"==typeof g?(0,i.utf8ToBytes)(g):g,y=Math.ceil((c.toString(2).length+d)/8),v=t*f*y;if("xmd"===p)s=l(e,m,v,h);else if("xof"===p)s=u(e,m,v,d,h);else if("_internal_pass"===p)s=e;else throw Error('expand must be "xmd" or "xof"');let b=Array(t);for(let e=0;e<t;e++){let t=Array(f);for(let r=0;r<f;r++){let i=y*(r+e*f),o=s.subarray(i,i+y);t[r]=(0,n.mod)(a(o),c)}b[e]=t}return b}},998103,(e,t,r)=>{"use strict";
18Object.defineProperty(r,"__esModule",{value:!0}),r.encodeToCurve=r.hashToCurve=r.secp256k1_hasher=r.schnorr=r.secp256k1=void 0;let i=e.r(775631),n=e.r(781887),a=e.r(703464),s=e.r(287832),o=e.r(34064),l=e.r(816712),u=e.r(827685),c={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},d=BigInt(0),f=BigInt(1),h=BigInt(2),p=(e,t)=>(e+t/h)/t;function g(e){let t=c.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),a=BigInt(22),s=BigInt(23),l=BigInt(44),u=BigInt(88),d=e*e*e%t,f=d*d*e%t,p=(0,o.pow2)(f,r,t)*f%t,g=(0,o.pow2)(p,r,t)*f%t,y=(0,o.pow2)(g,h,t)*d%t,v=(0,o.pow2)(y,n,t)*y%t,b=(0,o.pow2)(v,a,t)*v%t,w=(0,o.pow2)(b,l,t)*b%t,_=(0,o.pow2)(w,u,t)*w%t,A=(0,o.pow2)(_,l,t)*b%t,S=(0,o.pow2)(A,r,t)*f%t,E=(0,o.pow2)(S,s,t)*v%t,x=(0,o.pow2)(E,i,t)*d%t,T=(0,o.pow2)(x,h,t);if(!m.eql(m.sqr(T),e))throw Error("Cannot find square root");return T}let m=(0,o.Field)(c.p,void 0,void 0,{sqrt:g});r.secp256k1=(0,a.createCurve)({...c,Fp:m,lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=c.n,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-f*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=BigInt("0x100000000000000000000000000000000"),s=p(r*e,t),l=p(-i*e,t),u=(0,o.mod)(e-s*r-l*n,t),d=(0,o.mod)(-s*i-l*r,t),h=u>a,g=d>a;if(h&&(u=t-u),g&&(d=t-d),u>a||d>a)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:h,k1:u,k2neg:g,k2:d}}}},i.sha256);let y={};function v(e,...t){let r=y[e];if(void 0===r){let t=(0,i.sha256)(Uint8Array.from(e,e=>e.charCodeAt(0)));r=(0,u.concatBytes)(t,t),y[e]=r}return(0,i.sha256)((0,u.concatBytes)(r,...t))}let b=e=>e.toBytes(!0).slice(1),w=e=>(0,u.numberToBytesBE)(e,32),_=e=>(0,o.mod)(e,c.p),A=e=>(0,o.mod)(e,c.n),S=r.secp256k1.Point;function E(e){let t=r.secp256k1.utils.normPrivateKeyToScalar(e),i=S.fromPrivateKey(t);return{scalar:i.y%h===d?t:A(-t),bytes:b(i)}}function x(e){(0,u.aInRange)("x",e,f,c.p);let t=_(e*e),r=g(_(t*e+BigInt(7)));r%h!==d&&(r=_(-r));let i=S.fromAffine({x:e,y:r});return i.assertValidity(),i}let T=u.bytesToNumberBE;function I(...e){return A(T(v("BIP0340/challenge",...e)))}function k(e,t,r){let i=(0,u.ensureBytes)("signature",e,64),n=(0,u.ensureBytes)("message",t),a=(0,u.ensureBytes)("publicKey",r,32);try{let e=x(T(a)),t=T(i.subarray(0,32));if(!(0,u.inRange)(t,f,c.p))return!1;let r=T(i.subarray(32,64));if(!(0,u.inRange)(r,f,c.n))return!1;let s=I(w(t),b(e),n),o=S.BASE.multiplyUnsafe(r).add(e.multiplyUnsafe(A(-s))),{x:l,y:p}=o.toAffine();if(o.is0()||p%h!==d||l!==t)return!1;return!0}catch(e){return!1}}r.schnorr={getPublicKey:function(e){return E(e).bytes},sign:function(e,t,r=(0,n.randomBytes)(32)){let i=(0,u.ensureBytes)("message",e),{bytes:a,scalar:s}=E(t),o=w(s^T(v("BIP0340/aux",(0,u.ensureBytes)("auxRand",r,32)))),l=A(T(v("BIP0340/nonce",o,a,i)));if(l===d)throw Error("sign failed: k is zero");let{bytes:c,scalar:f}=E(l),h=I(c,a,i),p=new Uint8Array(64);if(p.set(c,0),p.set(w(A(f+h*s)),32),!k(p,i,a))throw Error("sign: Invalid signature produced");return p},verify:k,utils:{randomPrivateKey:r.secp256k1.utils.randomPrivateKey,lift_x:x,pointToBytes:b,numberToBytesBE:u.numberToBytesBE,bytesToNumberBE:u.bytesToNumberBE,taggedHash:v,mod:o.mod}};let O=(0,s.isogenyMap)(m,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(e=>
18BigInt(e)))),C=(0,l.mapToCurveSimpleSWU)(m,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:m.create(BigInt("-11"))});r.secp256k1_hasher=(0,s.createHasher)(r.secp256k1.Point,e=>{let{x:t,y:r}=C(m.create(e[0]));return O(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:m.ORDER,m:1,k:128,expand:"xmd",hash:i.sha256}),r.hashToCurve=r.secp256k1_hasher.hashToCurve,r.encodeToCurve=r.secp256k1_hasher.encodeToCurve},812458,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.HDKey=r.HARDENED_OFFSET=void 0;let i=e.r(34064),n=e.r(998103),a=e.r(642135),s=e.r(752387),o=e.r(775631),l=e.r(781887),u=e.r(701902),c=n.secp256k1.ProjectivePoint,d=(0,u.createBase58check)(o.sha256);function f(e){return(0,l.abytes)(e),BigInt("0x"+(0===e.length?"0":(0,l.bytesToHex)(e)))}let h=(0,l.utf8ToBytes)("Bitcoin seed"),p={private:0x488ade4,public:0x488b21e};r.HARDENED_OFFSET=0x80000000;let g=e=>{if(!Number.isSafeInteger(e)||e<0||e>0x100000000-1)throw Error("invalid number, should be from 0 to 2**32-1, got "+e);let t=new Uint8Array(4);return(0,l.createView)(t).setUint32(0,e,!1),t};class m{get fingerprint(){let e;if(!this.pubHash)throw Error("No publicKey set!");return e=this.pubHash,(0,l.createView)(e).getUint32(0,!1)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){let e=this.privateKey;if(!e)throw Error("No private key");return d.encode(this.serialize(this.versions.private,(0,l.concatBytes)(new Uint8Array([0]),e)))}get publicExtendedKey(){if(!this.pubKey)throw Error("No public key");return d.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(e,t=p){if((0,l.abytes)(e),8*e.length<128||8*e.length>512)throw Error("HDKey: seed length must be between 128 and 512 bits; 256 bits is advised, got "+e.length);let r=(0,a.hmac)(o.sha512,h,e);return new m({versions:t,chainCode:r.slice(32),privateKey:r.slice(0,32)})}static fromExtendedKey(e,t=p){let r=d.decode(e),i=(0,l.createView)(r),n=i.getUint32(0,!1),a={versions:t,depth:r[4],parentFingerprint:i.getUint32(5,!1),index:i.getUint32(9,!1),chainCode:r.slice(13,45)},s=r.slice(45),o=0===s[0];if(n!==t[o?"private":"public"])throw Error("Version mismatch");return new m(o?{...a,privateKey:s.slice(1)}:{...a,publicKey:s})}static fromJSON(e){return m.fromExtendedKey(e.xpriv)}constructor(e){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!e||"object"!=typeof e)throw Error("HDKey.constructor must not be called directly");if(this.versions=e.versions||p,this.depth=e.depth||0,this.chainCode=e.chainCode||null,this.index=e.index||0,this.parentFingerprint=e.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw Error("HDKey: zero depth with non-zero index/parent fingerprint");if(e.publicKey&&e.privateKey)throw Error("HDKey: publicKey and privateKey at same time.");if(e.privateKey){if(!n.secp256k1.utils.isValidPrivateKey(e.privateKey))throw Error("Invalid private key");this.privKey="bigint"==typeof e.privateKey?e.privateKey:f(e.privateKey),this.privKeyBytes=function(e){if("bigint"!=typeof e)throw Error("bigint expected");return(0,l.hexToBytes)(e.toString(16).padStart(64,"0"))}(this.privKey),this.pubKey=n.secp256k1.getPublicKey(e.privateKey,!0)}else if(e.publicKey)this.pubKey=c.fromHex(e.publicKey).toRawBytes(!0);else throw Error("HDKey: no public or private key provided");this.pubHash=(e=>(0,s.ripemd160)((0,o.sha256)(e)))(this.pubKey)}derive(e){if(!/^[mM]'?/.test(e))throw Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(e))return this;let t=e.replace(/^[mM]'?\//,"").split("/"),i=this;for(let e of t){let t=/^(\d+)('?)$/.exec(e),n=t&&t[1];if(!t||3!==t.length||"string"!=typeof n)throw Error("invalid child index: "+e);let a=+n;if(!Number.isSafeInteger(a)||a>=r.HARDENED_OFFSET)throw Error("Invalid index");"'"===t[2]&&(a+=r.HARDENED_OFFSET),i=i.deriveChild(a)}return i}deriveChild(e){if(!this.pubKey||!this.chainCode)throw Error("No publicKey or chainCode set");let t=g(e);
18if(e>=r.HARDENED_OFFSET){let e=this.privateKey;if(!e)throw Error("Could not derive hardened child key");t=(0,l.concatBytes)(new Uint8Array([0]),e,t)}else t=(0,l.concatBytes)(this.pubKey,t);let s=(0,a.hmac)(o.sha512,this.chainCode,t),u=f(s.slice(0,32)),d=s.slice(32);if(!n.secp256k1.utils.isValidPrivateKey(u))throw Error("Tweak bigger than curve order");let h={versions:this.versions,chainCode:d,depth:this.depth+1,parentFingerprint:this.fingerprint,index:e};try{if(this.privateKey){let e=(0,i.mod)(this.privKey+u,n.secp256k1.CURVE.n);if(!n.secp256k1.utils.isValidPrivateKey(e))throw Error("The tweak was out of range or the resulted private key is invalid");h.privateKey=e}else{let e=c.fromHex(this.pubKey).add(c.fromPrivateKey(u));if(e.equals(c.ZERO))throw Error("The tweak was equal to negative P, which made the result key invalid");h.publicKey=e.toRawBytes(!0)}return new m(h)}catch(t){return this.deriveChild(e+1)}}sign(e){if(!this.privateKey)throw Error("No privateKey set!");return(0,l.abytes)(e,32),n.secp256k1.sign(e,this.privKey).toCompactRawBytes()}verify(e,t){let r;if((0,l.abytes)(e,32),(0,l.abytes)(t,64),!this.publicKey)throw Error("No publicKey set!");try{r=n.secp256k1.Signature.fromCompact(t)}catch(e){return!1}return n.secp256k1.verify(r,e,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(e,t){if(!this.chainCode)throw Error("No chainCode set");return(0,l.abytes)(t,33),(0,l.concatBytes)(g(e),new Uint8Array([this.depth]),g(this.parentFingerprint),g(this.index),this.chainCode,t)}}r.HDKey=m},239540,(e,t,r)=>{"use strict";var i,n;Object.defineProperty(r,"__esModule",{value:!0}),(n=i||(i={})).ed25519="ed25519",n.secp256k1="ecdsa-secp256k1",r.default=i},956234,(e,t,r)=>{t.exports=JSON.parse('["A","ABE","ACE","ACT","AD","ADA","ADD","AGO","AID","AIM","AIR","ALL","ALP","AM","AMY","AN","ANA","AND","ANN","ANT","ANY","APE","APS","APT","ARC","ARE","ARK","ARM","ART","AS","ASH","ASK","AT","ATE","AUG","AUK","AVE","AWE","AWK","AWL","AWN","AX","AYE","BAD","BAG","BAH","BAM","BAN","BAR","BAT","BAY","BE","BED","BEE","BEG","BEN","BET","BEY","BIB","BID","BIG","BIN","BIT","BOB","BOG","BON","BOO","BOP","BOW","BOY","BUB","BUD","BUG","BUM","BUN","BUS","BUT","BUY","BY","BYE","CAB","CAL","CAM","CAN","CAP","CAR","CAT","CAW","COD","COG","COL","CON","COO","COP","COT","COW","COY","CRY","CUB","CUE","CUP","CUR","CUT","DAB","DAD","DAM","DAN","DAR","DAY","DEE","DEL","DEN","DES","DEW","DID","DIE","DIG","DIN","DIP","DO","DOE","DOG","DON","DOT","DOW","DRY","DUB","DUD","DUE","DUG","DUN","EAR","EAT","ED","EEL","EGG","EGO","ELI","ELK","ELM","ELY","EM","END","EST","ETC","EVA","EVE","EWE","EYE","FAD","FAN","FAR","FAT","FAY","FED","FEE","FEW","FIB","FIG","FIN","FIR","FIT","FLO","FLY","FOE","FOG","FOR","FRY","FUM","FUN","FUR","GAB","GAD","GAG","GAL","GAM","GAP","GAS","GAY","GEE","GEL","GEM","GET","GIG","GIL","GIN","GO","GOT","GUM","GUN","GUS","GUT","GUY","GYM","GYP","HA","HAD","HAL","HAM","HAN","HAP","HAS","HAT","HAW","HAY","HE","HEM","HEN","HER","HEW","HEY","HI","HID","HIM","HIP","HIS","HIT","HO","HOB","HOC","HOE","HOG","HOP","HOT","HOW","HUB","HUE","HUG","HUH","HUM","HUT","I","ICY","IDA","IF","IKE","ILL","INK","INN","IO","ION","IQ","IRA","IRE","IRK","IS","IT","ITS","IVY","JAB","JAG","JAM","JAN","JAR","JAW","JAY","JET","JIG","JIM","JO","JOB","JOE","JOG","JOT","JOY","JUG","JUT","KAY","KEG","KEN","KEY","KID","KIM","KIN","KIT","LA","LAB","LAC","LAD","LAG","LAM","LAP","LAW","LAY","LEA","LED","LEE","LEG","LEN","LEO","LET","LEW","LID","LIE","LIN","LIP","LIT","LO","LOB","LOG","LOP","LOS","LOT","LOU","LOW","LOY","LUG","LYE","MA","MAC","MAD","MAE","MAN","MAO","MAP","MAT","MAW","MAY","ME","MEG","MEL","MEN","MET","MEW","MID","MIN","MIT","MOB","MOD","MOE","MOO","MOP","MOS","MOT","MOW","MUD","MUG","MUM","MY","NAB","NAG","NAN","NAP","NAT","NAY","NE","NED","NEE","NET","NEW","NIB","NIL","NIP","NIT","NO","NOB","NOD","NON","NOR","NOT","NOV","NOW","NU","NUN","NUT","O","OAF","OAK","OAR","OAT","ODD","ODE","OF","OFF","OFT","OH","OIL","OK","OLD","ON","ONE","OR","ORB","ORE","ORR","OS","OTT","OUR","OUT","OVA","OW","OWE","OWL","OWN","OX","PA","PAD","PAL","PAM","PAN","PAP","PAR","PAT","PAW","PAY","PEA","PEG","PEN","PEP","PER","PET","PEW","PHI","PI","PIE","PIN","PIT","PLY","PO","POD","POE","POP","POT","POW","PRO","PRY","PUB","PUG","PUN","PUP","PUT","QUO","RAG","RAM","RAN","RAP","RAT","RAW","RAY","REB","RED","REP","RET","RIB","RID","RIG","RIM","RIO","RIP","ROB","ROD","ROE","RON","ROT","ROW","ROY","RUB","RUE","RUG","RUM","RUN","RYE","SAC","SAD","SAG","SAL","SAM","SAN","SAP","SAT","SAW","SAY","SEA","SEC","SEE","SEN","SET","SEW","SHE","SHY","SIN","SIP","SIR","SIS","SIT","SKI","SKY","SLY","SO","SOB","SOD","SON","SOP","SOW","SOY","SPA","SPY","SUB","SUD","SUE","SUM","SUN","SUP","TAB","TAD","TAG","TAN","TAP","TAR","TEA","TED","TEE","TEN","THE","THY","TIC","TIE","TIM","TIN","TIP","TO","TOE","TOG","TOM","TON","TOO","TOP","TOW","TOY","TRY","TUB","TUG","TUM","TUN","TWO","UN","UP","US","USE","VAN","VAT","VET","VIE","WAD","WAG","WAR","WAS","WAY","WE","WEB","WED","WEE","WET","WHO","WHY","WIN","WIT","WOK","WON","WOO","WOW","WRY","WU","YAM","YAP","YAW","YE","YEA","YES","YET","YOU","ABED","ABEL","ABET","ABLE","ABUT","ACHE","ACID","ACME","ACRE","ACTA","ACTS","ADAM","ADDS","ADEN","AFAR","AFRO","AGEE","AHEM","AHOY","AIDA","AIDE","AIDS","AIRY","AJAR","AKIN","ALAN","ALEC","ALGA","ALIA","ALLY","ALMA","ALOE","ALSO","ALTO","ALUM","ALVA","AMEN","AMES","AMID","AMMO","AMOK","AMOS","AMRA","ANDY","ANEW","ANNA","ANNE","ANTE","ANTI","AQUA","ARAB","ARCH","AREA","ARGO","ARID","ARMY","ARTS","ARTY","ASIA","ASKS","ATOM","AUNT","AURA","AUTO","AVER","AVID","AVIS","AVON","AVOW","AWAY","AWRY","BABE","BABY","BACH","BACK","BADE","BAIL","BAIT","BAKE","BALD","BALE","BALI","BALK","BALL","BALM","BAND","BANE","BANG","BANK","BARB","BARD","BARE","BARK","BARN","BARR","BASE","BASH","BASK","BASS","BATE","BATH","BAWD","BAWL","BEAD","BEAK","BEAM","BEAN","BEAR","BEAT","BEAU","BECK","BEEF","BEEN","BEER","BEET","BELA","BELL","BELT","BEND","BENT","BERG","BERN","BERT","BESS","BEST","BETA","BETH","BHOY","BIAS","BIDE","BIEN","BILE","BILK","BILL","BIND","BING","BIRD","BITE","BITS","BLAB","BLAT","BLED","BLEW","BLOB","BLOC","BLOT","BLOW","BLUE","BLUM","BLUR","BOAR","BOAT","BOCA","BOCK","BODE","BODY","BOGY","BOHR","BOIL","BOLD","BOLO","BOLT","BOMB","BONA","BOND","BONE","BONG","BONN","BONY","BOOK","BOOM","BOON","BOOT","BORE","BORG","BORN","BOSE","BOSS","BOTH","BOUT","BOWL","BOYD","BRAD","BRAE","BRAG","BRAN","BRAY","BRED","BREW","BRIG","BRIM","BROW","BUCK","BUDD","BUFF","BULB","BULK","BULL","BUNK","BUNT","BUOY","BURG","BURL","BURN","BURR","BURT","BURY","BUSH","BUSS","BUST","BUSY","BYTE","CADY","CAFE","CAGE","CAIN","CAKE","CALF","CALL","CALM","CAME","CANE","CANT","CARD","CARE","CARL","CARR","CART","CASE","CASH","CASK","CAST","CAVE","CEIL","CELL","CENT","CERN","CHAD","CHAR","CHAT","CHAW","CHEF","CHEN","CHEW","CHIC","CHIN","CHOU","CHOW","CHUB","CHUG","CHUM","CITE","CITY","CLAD","CLAM","CLAN","CLAW","CLAY","CLOD","CLOG","CLOT","CLUB","CLUE","COAL","COAT","COCA","COCK","COCO","CODA","CODE","CODY","COED","COIL","COIN","COKE","COLA","COLD","COLT","COMA","COMB","COME","COOK","COOL","COON","COOT","CORD","CORE","CORK","CORN","COST","COVE","COWL","CRAB","CRAG","CRAM","CRAY","CREW","CRIB","CROW","CRUD","CUBA","CUBE","CUFF","CULL","CULT","CUNY","CURB","CURD","CURE","CURL","CURT","CUTS","DADE","DALE","DAME","DANA","DANE","DANG","DANK","DARE","DARK","DARN","DART","DASH","DATA","DATE","DAVE","DAVY","DAWN","DAYS","DEAD","DEAF","DEAL","DEAN","DEAR","DEBT","DECK","DEED","DEEM","DEER","DEFT","DEFY","DELL","DENT","DENY","DESK","DIAL","DICE","DIED","DIET","DIME","DINE","DING","DINT","DIRE","DIRT","DISC","DISH","DISK","DIVE","DOCK","DOES","DOLE","DOLL","DOLT","DOME","DONE","DOOM","DOOR","DORA","DOSE","DOTE","DOUG","DOUR","DOVE","DOWN","DRAB","DRAG","DRAM","DRAW","DREW","DRUB","DRUG","DRUM","DUAL","DUCK","DUCT","DUEL","DUET","DUKE","DULL","DUMB","DUNE","DUNK","DUSK","DUST","DUTY","EACH","EARL","EARN","EASE","EAST","EASY","EBEN","ECHO","EDDY","EDEN","EDGE","EDGY","EDIT","EDNA","EGAN","ELAN","ELBA","ELLA","ELSE","EMIL","EMIT","EMMA","ENDS","ERIC","EROS","EVEN","EVER","EVIL","EYED","FACE","FACT","FADE","FAIL","FAIN","FAIR","FAKE","FALL","FAME","FANG","FARM","FAST","FATE","FAWN","FEAR","FEAT","FEED","FEEL","FEET","FELL","FELT","FEND","FERN","FEST","FEUD","FIEF","FIGS","FILE","FILL","FILM","FIND","FINE","FINK","FIRE","FIRM","FISH","FISK","FIST","FITS","FIVE","FLAG","FLAK","FLAM","FLAT","FLAW","FLEA","FLED","FLEW","FLIT","FLOC","FLOG","FLOW","FLUB","FLUE","FOAL","FOAM","FOGY","FOIL","FOLD","FOLK","FOND","FONT","FOOD","FOOL","FOOT","FORD","FORE","FORK","FORM","FORT","FOSS","FOUL","FOUR","FOWL","FRAU","FRAY","FRED","FREE","FRET","FREY","FROG","FROM","FUEL","FULL","FUME","FUND","FUNK","FURY","FUSE","FUSS","GAFF","GAGE","GAIL","GAIN","GAIT","GALA","GALE","GALL","GALT","GAME","GANG","GARB","GARY","GASH","GATE","GAUL","GAUR","GAVE","GAWK","GEAR","GELD","GENE","GENT","GERM","GETS","GIBE","GIFT","GILD","GILL","GILT","GINA","GIRD","GIRL","GIST","GIVE","GLAD","GLEE","GLEN","GLIB","GLOB","GLOM","GLOW","GLUE","GLUM","GLUT","GOAD","GOAL","GOAT","GOER","GOES","GOLD","GOLF","GO
18NE","GONG","GOOD","GOOF","GORE","GORY","GOSH","GOUT","GOWN","GRAB","GRAD","GRAY","GREG","GREW","GREY","GRID","GRIM","GRIN","GRIT","GROW","GRUB","GULF","GULL","GUNK","GURU","GUSH","GUST","GWEN","GWYN","HAAG","HAAS","HACK","HAIL","HAIR","HALE","HALF","HALL","HALO","HALT","HAND","HANG","HANK","HANS","HARD","HARK","HARM","HART","HASH","HAST","HATE","HATH","HAUL","HAVE","HAWK","HAYS","HEAD","HEAL","HEAR","HEAT","HEBE","HECK","HEED","HEEL","HEFT","HELD","HELL","HELM","HERB","HERD","HERE","HERO","HERS","HESS","HEWN","HICK","HIDE","HIGH","HIKE","HILL","HILT","HIND","HINT","HIRE","HISS","HIVE","HOBO","HOCK","HOFF","HOLD","HOLE","HOLM","HOLT","HOME","HONE","HONK","HOOD","HOOF","HOOK","HOOT","HORN","HOSE","HOST","HOUR","HOVE","HOWE","HOWL","HOYT","HUCK","HUED","HUFF","HUGE","HUGH","HUGO","HULK","HULL","HUNK","HUNT","HURD","HURL","HURT","HUSH","HYDE","HYMN","IBIS","ICON","IDEA","IDLE","IFFY","INCA","INCH","INTO","IONS","IOTA","IOWA","IRIS","IRMA","IRON","ISLE","ITCH","ITEM","IVAN","JACK","JADE","JAIL","JAKE","JANE","JAVA","JEAN","JEFF","JERK","JESS","JEST","JIBE","JILL","JILT","JIVE","JOAN","JOBS","JOCK","JOEL","JOEY","JOHN","JOIN","JOKE","JOLT","JOVE","JUDD","JUDE","JUDO","JUDY","JUJU","JUKE","JULY","JUNE","JUNK","JUNO","JURY","JUST","JUTE","KAHN","KALE","KANE","KANT","KARL","KATE","KEEL","KEEN","KENO","KENT","KERN","KERR","KEYS","KICK","KILL","KIND","KING","KIRK","KISS","KITE","KLAN","KNEE","KNEW","KNIT","KNOB","KNOT","KNOW","KOCH","KONG","KUDO","KURD","KURT","KYLE","LACE","LACK","LACY","LADY","LAID","LAIN","LAIR","LAKE","LAMB","LAME","LAND","LANE","LANG","LARD","LARK","LASS","LAST","LATE","LAUD","LAVA","LAWN","LAWS","LAYS","LEAD","LEAF","LEAK","LEAN","LEAR","LEEK","LEER","LEFT","LEND","LENS","LENT","LEON","LESK","LESS","LEST","LETS","LIAR","LICE","LICK","LIED","LIEN","LIES","LIEU","LIFE","LIFT","LIKE","LILA","LILT","LILY","LIMA","LIMB","LIME","LIND","LINE","LINK","LINT","LION","LISA","LIST","LIVE","LOAD","LOAF","LOAM","LOAN","LOCK","LOFT","LOGE","LOIS","LOLA","LONE","LONG","LOOK","LOON","LOOT","LORD","LORE","LOSE","LOSS","LOST","LOUD","LOVE","LOWE","LUCK","LUCY","LUGE","LUKE","LULU","LUND","LUNG","LURA","LURE","LURK","LUSH","LUST","LYLE","LYNN","LYON","LYRA","MACE","MADE","MAGI","MAID","MAIL","MAIN","MAKE","MALE","MALI","MALL","MALT","MANA","MANN","MANY","MARC","MARE","MARK","MARS","MART","MARY","MASH","MASK","MASS","MAST","MATE","MATH","MAUL","MAYO","MEAD","MEAL","MEAN","MEAT","MEEK","MEET","MELD","MELT","MEMO","MEND","MENU","MERT","MESH","MESS","MICE","MIKE","MILD","MILE","MILK","MILL","MILT","MIMI","MIND","MINE","MINI","MINK","MINT","MIRE","MISS","MIST","MITE","MITT","MOAN","MOAT","MOCK","MODE","MOLD","MOLE","MOLL","MOLT","MONA","MONK","MONT","MOOD","MOON","MOOR","MOOT","MORE","MORN","MORT","MOSS","MOST","MOTH","MOVE","MUCH","MUCK","MUDD","MUFF","MULE","MULL","MURK","MUSH","MUST","MUTE","MUTT","MYRA","MYTH","NAGY","NAIL","NAIR","NAME","NARY","NASH","NAVE","NAVY","NEAL","NEAR","NEAT","NECK","NEED","NEIL","NELL","NEON","NERO","NESS","NEST","NEWS","NEWT","NIBS","NICE","NICK","NILE","NINA","NINE","NOAH","NODE","NOEL","NOLL","NONE","NOOK","NOON","NORM","NOSE","NOTE","NOUN","NOVA","NUDE","NULL","NUMB","OATH","OBEY","OBOE","ODIN","OHIO","OILY","OINT","OKAY","OLAF","OLDY","OLGA","OLIN","OMAN","OMEN","OMIT","ONCE","ONES","ONLY","ONTO","ONUS","ORAL","ORGY","OSLO","OTIS","OTTO","OUCH","OUST","OUTS","OVAL","OVEN","OVER","OWLY","OWNS","QUAD","QUIT","QUOD","RACE","RACK","RACY","RAFT","RAGE","RAID","RAIL","RAIN","RAKE","RANK","RANT","RARE","RASH","RATE","RAVE","RAYS","READ","REAL","REAM","REAR","RECK","REED","REEF","REEK","REEL","REID","REIN","RENA","REND","RENT","REST","RICE","RICH","RICK","RIDE","RIFT","RILL","RIME","RING","RINK","RISE","RISK","RITE","ROAD","ROAM","ROAR","ROBE","ROCK","RODE","ROIL","ROLL","ROME","ROOD","ROOF","ROOK","ROOM","ROOT","ROSA","ROSE","ROSS","ROSY","ROTH","ROUT","ROVE","ROWE","ROWS","RUBE","RUBY","RUDE","RUDY","RUIN","RULE","RUNG","RUNS","RUNT","RUSE","RUSH","RUSK","RUSS","RUST","RUTH","SACK","SAFE","SAGE","SAID","SAIL","SALE","SALK","SALT","SAME","SAND","SANE","SANG","SANK","SARA","SAUL","SAVE","SAYS","SCAN","SCAR","SCAT","SCOT","SEAL","SEAM","SEAR","SEAT","SEED","SEEK","SEEM","SEEN","SEES","SELF","SELL","SEND","SENT","SETS","SEWN","SHAG","SHAM","SHAW","SHAY","SHED","SHIM","SHIN","SHOD","SHOE","SHOT","SHOW","SHUN","SHUT","SICK","SIDE","SIFT","SIGH","SIGN","SILK","SILL","SILO","SILT","SINE","SING","SINK","SIRE","SITE","SITS","SITU","SKAT","SKEW","SKID","SKIM","SKIN","SKIT","SLAB","SLAM","SLAT","SLAY","SLED","SLEW","SLID","SLIM","SLIT","SLOB","SLOG","SLOT","SLOW","SLUG","SLUM","SLUR","SMOG","SMUG","SNAG","SNOB","SNOW","SNUB","SNUG","SOAK","SOAR","SOCK","SODA","SOFA","SOFT","SOIL","SOLD","SOME","SONG","SOON","SOOT","SORE","SORT","SOUL","SOUR","SOWN","STAB","STAG","STAN","STAR","STAY","STEM","STEW","STIR","STOW","STUB","STUN","SUCH","SUDS","SUIT","SULK","SUMS","SUNG","SUNK","SURE","SURF","SWAB","SWAG","SWAM","SWAN","SWAT","SWAY","SWIM","SWUM","TACK","TACT","TAIL","TAKE","TALE","TALK","TALL","TANK","TASK","TATE","TAUT","TEAL","TEAM","TEAR","TECH","TEEM","TEEN","TEET","TELL","TEND","TENT","TERM","TERN","TESS","TEST","THAN","THAT","THEE","THEM","THEN","THEY","THIN","THIS","THUD","THUG","TICK","TIDE","TIDY","TIED","TIER","TILE","TILL","TILT","TIME","TINA","TINE","TINT","TINY","TIRE","TOAD","TOGO","TOIL","TOLD","TOLL","TONE","TONG","TONY","TOOK","TOOL","TOOT","TORE","TORN","TOTE","TOUR","TOUT","TOWN","TRAG","TRAM","TRAY","TREE","TREK","TRIG","TRIM","TRIO","TROD","TROT","TROY","TRUE","TUBA","TUBE","TUCK","TUFT","TUNA","TUNE","TUNG","TURF","TURN","TUSK","TWIG","TWIN","TWIT","ULAN","UNIT","URGE","USED","USER","USES","UTAH","VAIL","VAIN","VALE","VARY","VASE","VAST","VEAL","VEDA","VEIL","VEIN","VEND","VENT","VERB","VERY","VETO","VICE","VIEW","V
18INE","VISE","VOID","VOLT","VOTE","WACK","WADE","WAGE","WAIL","WAIT","WAKE","WALE","WALK","WALL","WALT","WAND","WANE","WANG","WANT","WARD","WARM","WARN","WART","WASH","WAST","WATS","WATT","WAVE","WAVY","WAYS","WEAK","WEAL","WEAN","WEAR","WEED","WEEK","WEIR","WELD","WELL","WELT","WENT","WERE","WERT","WEST","WHAM","WHAT","WHEE","WHEN","WHET","WHOA","WHOM","WICK","WIFE","WILD","WILL","WIND","WINE","WING","WINK","WINO","WIRE","WISE","WISH","WITH","WOLF","WONT","WOOD","WOOL","WORD","WORE","WORK","WORM","WORN","WOVE","WRIT","WYNN","YALE","YANG","YANK","YARD","YARN","YAWL","YAWN","YEAH","YEAR","YELL","YOGA","YOKE"]')},112067,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.keyToRFC1751Mnemonic=r.rfc1751MnemonicToKey=void 0;let n=e.r(575280),a=i(e.r(956234)).default,s=["0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"];function o(e){let t="";for(let r of e)t+=s[r>>4]+s[15&r];return t}function l(e,t,r){let i=e.substring(t,t+r),n=0;for(let e=0;e<i.length;e++)n=2*n+i.charCodeAt(e)-48;return n}function u(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function c(e){let t=function(e){let t=e.length;for(let r=0;r<t;r+=8)u(e,r,r+7),u(e,r+1,r+6),u(e,r+2,r+5),u(e,r+3,r+4);return e}(e);return(0,n.concat)([t.slice(8,16),t.slice(0,8)])}r.keyToRFC1751Mnemonic=function(e){var t;let r=(t=c((0,n.hexToBytes)(e.replace(/\s+/gu,""))),Array.prototype.slice.call(t)),i=[];for(let e=0;e<(8-r.length%8)%8;e++)i.push(0);r=i.concat(r);let s=[];for(let e=0;e<r.length;e+=8){let t=r.slice(e,e+8),i=o(t),n=0;for(let e=0;e<64;e+=2)n+=l(i,e,2);t.push(n<<6&255),i=o(t);for(let e=0;e<64;e+=11)s.push(a[l(i,e,11)])}return s.join(" ")},r.rfc1751MnemonicToKey=function(e){let t=e.split(" "),r=[];for(let e=0;e<t.length;e+=6){let{subKey:i,word:n}=function(e,t){let r=e.slice(t,t+6),i=0,n=[0,0,0,0,0,0,0,0,0],s="";for(s of r){let e=a.indexOf(s.toUpperCase());if(-1===e)throw TypeError(`Expected an RFC1751 word, but received '${s}'. For the full list of words in the RFC1751 encoding see https://datatracker.ietf.org/doc/html/rfc1751`);let t=(8-(i+11)%8)%8,r=e<<t,o=r>>16,l=r>>8&255,u=255&r,c=Math.floor(i/8);t>5?(n[c]|=o,n[c+1]|=l,n[c+2]|=u):t>-3?(n[c]|=l,n[c+1]|=u):n[c]|=u,i+=11}return{subKey:n.slice(),word:s}}(t,e),s=o(i),u=0;for(let e=0;e<64;e+=2)u+=l(s,e,2);if(l(s,64,2)!==(3&u))throw Error(`Parity error at ${n}`);r=r.concat(i.slice(0,8))}return c(Uint8Array.from(r))}},791395,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.combineLoanSetCounterpartySigners=r.signLoanSetByCounterparty=r.authorizeChannel=r.verifySignature=r.multisign=r.combineBatchSigners=r.signMultiBatch=r.Wallet=void 0;let n=e.r(812458),a=e.r(504381),s=e.r(813402),o=e.r(575280),l=i(e.r(892623)),u=e.r(550294),c=e.r(522236),d=e.r(377702),f=i(e.r(239540)),h=e.r(227730),p=e.r(382870),g=e.r(798184),m=e.r(932114),y=e.r(576781),v=e.r(78437),b=e.r(880432),w=e.r(112067),_=e.r(591003),A=e.r(242576),S=f.default.ed25519;class E{constructor(e,t,r={}){this.publicKey=e,this.privateKey=t,this.classicAddress=r.masterAddress?(0,y.ensureClassicAddress)(r.masterAddress):(0,d.deriveAddress)(e),this.seed=r.seed}get address(){return this.classicAddress}static generate(e=S){if(!Object.values(f.default).includes(e))throw new h.ValidationError("Invalid cryptographic signing algorithm");let t=(0,d.generateSeed)({algorithm:e});return E.fromSeed(t,{algorithm:e})}static fromSeed(e,t={}){return E.deriveWallet(e,{algorithm:t.algorithm,masterAddress:t.masterAddress})}static fromEntropy(e,t={}){var r;let i=null!=(r=t.algorithm)?r:S,n={entropy:Uint8Array.from(e),algorithm:i},a=(0,d.generateSeed)(n);return E.deriveWallet(a,{algorithm:i,masterAddress:t.masterAddress})}static fromMnemonic(e,t={}){var r;if("rfc1751"===t.mnemonicEncoding)return E.fromRFC1751Mnemonic(e,{masterAddress:t.masterAddress,algorithm:t.algorithm});if(!(0,a.validateMnemonic)(e,s.wordlist))throw new h.ValidationError("Unable to parse the given mnemonic using bip39 encoding");let i=(0,a.mnemonicToSeedSync)(e),l=n.HDKey.fromMasterSeed(i).derive(null!=(r=t.derivationPath)?r:"m/44'/144'/0'/0/0");if(!(l.privateKey instanceof Uint8Array))throw new h.ValidationError("Unable to derive privateKey from mnemonic input");if(!(l.publicKey instanceof Uint8Array))throw new h.ValidationError("Unable to derive publicKey from mnemonic input");let u=(0,o.bytesToHex)(l.publicKey),c=(0,o.bytesToHex)(l.privateKey);return new E(u,`00${c}`,{masterAddress:t.masterAddress})}static fromRFC1751Mnemonic(e,t){let r,i=(0,w.rfc1751MnemonicToKey)(e);r=t.algorithm===f.default.ed25519?"ed25519":"secp256k1";let n=(0,u.encodeSeed)(i,r);return E.fromSeed(n,{masterAddress:t.masterAddress,algorithm:t.algorithm})}static deriveWallet(e,t={}){var r;let{publicKey:i,privateKey:n}=(0,d.deriveKeypair)(e,{algorithm:null!=(r=t.algorithm)?r:S});return new E(i,n,{seed:e,masterAddress:t.masterAddress})}sign(e,t){var r;let i=!1;"string"==typeof t?i=t:t&&(i=this.classicAddress);let n=(0,v.omitBy)(Object.assign({},e),e=>null==e);if(n.TxnSignature||n.Signers)throw new h.ValidationError('txJSON must not contain "TxnSignature" or "Signers" properties');if("Payment"===(r=n).TransactionType&&"string"!=typeof r.Amount&&r.Amount.value.includes(".")&&r.Amount.value.endsWith("0")&&(r.Amount=Object.assign({},r.Amount),r.Amount.value=new l.default(r.Amount.value).toString()),(0,p.validate)(n),(0,m.hasFlag)(n,g.GlobalFlags.tfInnerBatchTxn,"tfInnerBatchTxn"))throw new h.ValidationError("Cannot sign a Batch inner transaction.");let a=Object.assign({},n);if(i){a.SigningPubKey="";let e={Account:i,SigningPubKey:this.publicKey,TxnSignature:(0,A.computeSignature)(a,this.privateKey,i)};a.Signers=[{Signer:e}]}else a.SigningPubKey=this.publicKey,a.TxnSignature=(0,A.computeSignature)(a,this.privateKey);let s=(0,c.encode)(a);return{tx_blob:s,hash:(0,b.hashSignedTx)(s)}}verifyTransaction(e){return(0,_.verifySignature)(e,this.publicKey)}getXAddress(e=!1,t=!1){return(0,u.classicAddressToXAddress)(this.classicAddress,e,t)}}r.Wallet=E,E.fromSecret=E.fromSeed;var x=e.r(988063);Object.defineProperty(r,"signMultiBatch",{enumerable:!0,get:function(){return x.signMultiBatch}}),Object.defineProperty(r,"combineBatchSigners",{enumerable:!0,get:function(){return x.combineBatchSigners}});var T=e.r(591003);Object.defineProperty(r,"multisign",{enumerable:!0,get:function(){return T.multisign}}),Object.defineProperty(r,"verifySignature",{enumerable:!0,get:function(){return T.verifySignature}});var I=e.r(609278);Object.defineProperty(r,"authorizeChannel",{enumerable:!0,get:function(){return I.authorizeChannel}});var k=e.r(474012);Object.defineProperty(r,"signLoanSetByCounterparty",{enumerable:!0,get:function(){return k.signLoanSetByCounterparty}}),Object.defineProperty(r,"combineLoanSetCounterpartySigners",{enumerable:!0,get:function(){return k.combineLoanSetCounterpartySigners}})},828536,(e,t,r)=>{"use strict";var i,n;
18Object.defineProperty(r,"__esModule",{value:!0}),r.getFaucetPath=r.getFaucetHost=r.faucetNetworkIDs=r.faucetNetworkPaths=r.FaucetNetwork=void 0;let a=e.r(227730);(n=i||(r.FaucetNetwork=i={})).Testnet="faucet.altnet.rippletest.net",n.Devnet="faucet.devnet.rippletest.net",r.faucetNetworkPaths={[i.Testnet]:"/accounts",[i.Devnet]:"/accounts"},r.faucetNetworkIDs=new Map([[1,i.Testnet],[2,i.Devnet]]),r.getFaucetHost=function(e){if(null==e.networkID)throw new a.XRPLFaucetError("Cannot create faucet URL without networkID or the faucetHost information");if(r.faucetNetworkIDs.has(e.networkID))return r.faucetNetworkIDs.get(e.networkID);if(0===e.networkID)throw new a.XRPLFaucetError("Faucet is not available for mainnet.");throw new a.XRPLFaucetError("Faucet URL is not defined or inferrable.")},r.getFaucetPath=function(e){return void 0===e?"/accounts":r.faucetNetworkPaths[e]||"/accounts"}},100816,(e,t,r)=>{"use strict";var i=e.e&&e.e.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(r,"__esModule",{value:!0}),r.requestFunding=r.getStartingBalance=r.generateWalletToFund=void 0;let n=e.r(550294),a=e.r(227730),s=e.r(828536),o=e.r(791395);r.generateWalletToFund=function(e){return e&&(0,n.isValidClassicAddress)(e.classicAddress)?e:o.Wallet.generate()},r.getStartingBalance=function(e,t){return i(this,void 0,void 0,function*(){let r=0;try{r=Number((yield e.getXrpBalance(t)))}catch(e){}return r})},r.requestFunding=function(e,t,r,n,o){var l,u,c,d;return i(this,void 0,void 0,function*(){let f=null!=(l=e.faucetHost)?l:(0,s.getFaucetHost)(t);if(!f)throw new a.XRPLFaucetError("No faucet hostname could be derived");let h=null!=(u=e.faucetPath)?u:(0,s.getFaucetPath)(f),p=null!=(c=e.faucetProtocol)?c:"https",g=yield fetch(`${p}://${f}${h}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});return g.ok&&(null==(d=g.headers.get("Content-Type"))?void 0:d.startsWith("application/json"))?function(e,t,r,n){return i(this,void 0,void 0,function*(){if(!t)return Promise.reject(new a.XRPLFaucetError("The faucet account is undefined"));let s=yield function(e,t,r){return i(this,void 0,void 0,function*(){return new Promise((n,s)=>{let o=20,l=setInterval(()=>i(this,void 0,void 0,function*(){o<0?(clearInterval(l),n(r)):o-=1;try{let i;try{i=Number((yield e.getXrpBalance(t)))}catch(e){}i>r&&(clearInterval(l),n(i))}catch(e){clearInterval(l),e instanceof Error&&s(new a.XRPLFaucetError(`Unable to check if the address ${t} balance has increased. Error: ${e.message}`)),s(e)}}),1e3)})})}(e,t,n);if(s>n)return{wallet:r,balance:s};throw new a.XRPLFaucetError("Unable to fund address with faucet after waiting 20 seconds")})}(t,(yield g.json()).account.classicAddress,n,r):function(e){var t;return i(this,void 0,void 0,function*(){let r={contentType:null!=(t=e.headers.get("Content-Type"))?t:void 0,statusCode:e.status},i=e.clone();try{r.body=yield e.json()}catch(e){r.body=yield i.text()}return Promise.reject(new a.XRPLFaucetError(`Request failed: ${JSON.stringify(r)}`))})}(g)})}},517944,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let i=e.r(597967);class n extends i.EventEmitter{constructor(e,t,r){super(),this.ws=new WebSocket(e),this.ws.onclose=e=>{let t;e.reason&&(t=new TextEncoder().encode(e.reason)),this.emit("close",e.code,t)},this.ws.onopen=()=>{this.emit("open")},this.ws.onerror=e=>{this.emit("error",e)},this.ws.onmessage=e=>{this.emit("message",e.data)}}get readyState(){return this.ws.readyState}close(e,t){1===this.readyState&&this.ws.close(e,t)}send(e){this.ws.send(e)}}n.CONNECTING=0,n.OPEN=1,n.CLOSING=2,n.CLOSED=3,r.default=n},658714,(e,t,r)=>{"use strict";var i=e.e&&e.e.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((i=i.apply(e,t||[])).next())})};
18Object.defineProperty(r,"__esModule",{value:!0}),r.default=class{constructor(){this.promisesAwaitingConnection=[]}resolveAllAwaiting(){this.promisesAwaitingConnection.map(({resolve:e})=>e()),this.promisesAwaitingConnection=[]}rejectAllAwaiting(e){this.promisesAwaitingConnection.map(({reject:t})=>t(e)),this.promisesAwaitingConnection=[]}awaitConnection(){return i(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.promisesAwaitingConnection.push({resolve:e,reject:t})})})}}},577980,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=class{constructor(e={}){var t,r;this.factor=2,this.numAttempts=0,this.ms=null!=(t=e.min)?t:100,this.max=null!=(r=e.max)?r:1e3}get attempts(){return this.numAttempts}duration(){let e=this.ms*Math.pow(this.factor,this.numAttempts);return this.numAttempts+=1,Math.floor(Math.min(e,this.max))}reset(){this.numAttempts=0}}},510583,(e,t,r)=>{"use strict";var i=e.e&&e.e.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(227730);r.default=class{constructor(){this.nextId=0,this.promisesAwaitingResponse=new Map}addPromise(e,t){return i(this,void 0,void 0,function*(){return new Promise((r,i)=>{this.promisesAwaitingResponse.set(e,{resolve:r,reject:i,timer:t})})})}resolve(e,t){let r=this.promisesAwaitingResponse.get(e);if(null==r)throw new n.XrplError(`No existing promise with id ${e}`,{type:"resolve",response:t});clearTimeout(r.timer),r.resolve(t),this.deletePromise(e)}reject(e,t){let r=this.promisesAwaitingResponse.get(e);if(null==r)throw new n.XrplError(`No existing promise with id ${e}`,{type:"reject",error:t});clearTimeout(r.timer),r.reject(t),this.deletePromise(e)}rejectAll(e){this.promisesAwaitingResponse.forEach((t,r,i)=>{this.reject(r,e),this.deletePromise(r)})}createRequest(e,t){let r;null==e.id?(r=this.nextId,this.nextId+=1):r=e.id;let i=JSON.stringify(Object.assign(Object.assign({},e),{id:r})),a=setTimeout(()=>{this.reject(r,new n.TimeoutError(`Timeout for request: ${JSON.stringify(e)} with id ${r}`,e))},t);if(a.unref&&a.unref(),this.promisesAwaitingResponse.has(r))throw clearTimeout(a),new n.XrplError(`Response with id '${r}' is already pending`,e);let s=new Promise((e,t)=>{this.promisesAwaitingResponse.set(r,{resolve:e,reject:t,timer:a})});return[r,i,s]}handleResponse(e){var t,r,i;if(null==e.id||"string"!=typeof e.id&&"number"!=typeof e.id)throw new n.ResponseFormatError("valid id not found in response",e);if(this.promisesAwaitingResponse.has(e.id)){if(null==e.status){let t=new n.ResponseFormatError("Response has no status");this.reject(e.id,t)}if("error"===e.status){let i=new n.RippledError(null!=(r=null!=(t=e.error_message)?t:e.error_exception)?r:e.error,e);this.reject(e.id,i);return}if("success"!==e.status){let t=new n.ResponseFormatError(`unrecognized response.status: ${null!=(i=e.status)?i:""}`,e);this.reject(e.id,t);return}delete e.status,this.resolve(e.id,e)}}deletePromise(e){this.promisesAwaitingResponse.delete(e)}}},10393,(e,t,r)=>{"use strict";var i=e.e&&e.e.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((i=i.apply(e,t||[])).next())})},n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.Connection=r.INTENTIONAL_DISCONNECT_CODE=void 0;let a=e.r(575280),s=n(e.r(517944)),o=e.r(757784),l=e.r(227730),u=n(e.r(658714)),c=n(e.r(577980)),d=n(e.r(510583));r.INTENTIONAL_DISCONNECT_CODE=4e3;class f extends o.EventEmitter{constructor(e,t={}){super(),this.ws=null,this.reconnectTimeoutID=null,this.heartbeatIntervalID=null,this.retryConnectionBackoff=new c.default({min:100,max:6e4}),this.requestManager=new d.default,this.connectionManager=new u.default,this.trace=()=>{},this.url=e,this.config=Object.assign({timeout:2e4,connectionTimeout:5e3},t),"function"==typeof t.trace?this.trace=t.trace:t.trace&&(this.trace=console.log)}get state(){return this.ws?this.ws.readyState:s.default.CLOSED}get shouldBeConnected(){return null!==this.ws}isConnected(){return this.state===s.default.OPEN}connect(){return i(this,void 0,void 0,function*(){var e,t;let r,i;if(this.isConnected())return Promise.resolve();if(this.state===s.default.CONNECTING)return this.connectionManager.awaitConnection();if(!this.url)return Promise.reject(new l.ConnectionError("Cannot connect because no server was specified"));if(null!=this.ws)return Promise.reject(new l.XrplError("Websocket connection never cleaned up.",{state:this.state}));let n=setTimeout(()=>{this.onConnectionFailed(new l.ConnectionError(`Error: connect() timed out after ${this.config.connectionTimeout} ms. If your internet connection is working, the rippled server may be blocked or inaccessible. You can also try setting the 'connectionTimeout' option in the Client constructor.`))},this.config.connectionTimeout);if(this.ws=(e=this.url,r={agent:(t=this.config).agent},t.headers&&(r.headers=t.headers),null!=t.authorization&&(r.headers=Object.assign(Object.assign({},r.headers),{Authorization:`Basic ${btoa(t.authorization)}`})),i=Object.assign({},r),new s.default(e,i)),null==this.ws)throw new l.XrplError("Connect: created null websocket");return this.ws.on("error",e=>this.onConnectionFailed(e)),this.ws.on("error",()=>clearTimeout(n)),this.ws.on("close",e=>this.onConnectionFailed(e)),this.ws.on("close",()=>clearTimeout(n)),this.ws.once("open",()=>{this.onceOpen(n)}),this.connectionManager.awaitConnection()})}disconnect(){return i(this,void 0,void 0,function*(){return(this.clearHeartbeatInterval(),null!==this.reconnectTimeoutID&&(clearTimeout(this.reconnectTimeoutID),this.reconnectTimeoutID=null),this.state===s.default.CLOSED||null==this.ws)?Promise.resolve(void 0):new Promise(e=>{null==this.ws&&e(void 0),null!=this.ws&&this.ws.once("close",t=>e(t)),null!=this.ws&&this.state!==s.default.CLOSING&&this.ws.close(r.INTENTIONAL_DISCONNECT_CODE)})})}
18reconnect(){return i(this,void 0,void 0,function*(){this.emit("reconnect"),yield this.disconnect(),yield this.connect()})}request(e,t){return i(this,void 0,void 0,function*(){if(!this.shouldBeConnected||null==this.ws)throw new l.NotConnectedError(JSON.stringify(e),e);let[r,n,a]=this.requestManager.createRequest(e,null!=t?t:this.config.timeout);return this.trace("send",n),(function(e,t){return i(this,void 0,void 0,function*(){return new Promise((r,i)=>{e.send(t,e=>{e?i(new l.DisconnectedError(e.message,e)):r()})})})})(this.ws,n).catch(e=>{try{this.requestManager.reject(r,e)}catch(e){e instanceof l.XrplError?this.trace("send",`send errored after connection was closed: ${e.toString()}`):this.trace("send",String(e))}}),a})}getUrl(){var e;return null!=(e=this.url)?e:""}onMessage(e){let t;this.trace("receive",e);try{t=JSON.parse(e)}catch(t){t instanceof Error&&this.emit("error","badMessage",t.message,e);return}if(null==t.type&&t.error)return void this.emit("error",t.error,t.error_message,t);if(t.type&&this.emit(t.type,t),"response"===t.type)try{this.requestManager.handleResponse(t)}catch(t){t instanceof Error?this.emit("error","badMessage",t.message,e):this.emit("error","badMessage",t,t)}}onceOpen(e){return i(this,void 0,void 0,function*(){if(null==this.ws)throw new l.XrplError("onceOpen: ws is null");this.ws.removeAllListeners(),clearTimeout(e),this.ws.on("message",e=>this.onMessage(e)),this.ws.on("error",e=>this.emit("error","websocket",e.message,e)),this.ws.once("close",(e,t)=>{if(null==this.ws)throw new l.XrplError("onceClose: ws is null");this.clearHeartbeatInterval(),this.requestManager.rejectAll(new l.DisconnectedError(`websocket was closed, ${t?(0,a.hexToString)((0,a.bytesToHex)(t)):""}`)),this.ws.removeAllListeners(),this.ws=null,void 0===e?this.emit("disconnected",1011):this.emit("disconnected",e),e!==r.INTENTIONAL_DISCONNECT_CODE&&void 0!==e&&this.intentionalDisconnect()});try{this.retryConnectionBackoff.reset(),this.startHeartbeatInterval(),this.connectionManager.resolveAllAwaiting(),this.emit("connected")}catch(e){e instanceof Error&&(this.connectionManager.rejectAllAwaiting(e),yield this.disconnect().catch(()=>{}))}})}intentionalDisconnect(){let e=this.retryConnectionBackoff.duration();this.trace("reconnect",`Retrying connection in ${e}ms.`),this.emit("reconnecting",this.retryConnectionBackoff.attempts),this.reconnectTimeoutID=setTimeout(()=>{this.reconnect().catch(e=>{this.emit("error","reconnect",e.message,e)})},e)}clearHeartbeatInterval(){this.heartbeatIntervalID&&clearInterval(this.heartbeatIntervalID)}startHeartbeatInterval(){this.clearHeartbeatInterval(),this.heartbeatIntervalID=setInterval(()=>{this.heartbeat()},this.config.timeout)}heartbeat(){return i(this,void 0,void 0,function*(){this.request({command:"ping"}).catch(()=>i(this,void 0,void 0,function*(){return this.reconnect().catch(e=>{this.emit("error","reconnect",e.message,e)})}))})}onConnectionFailed(e){this.ws&&(this.ws.removeAllListeners(),this.ws.on("error",()=>{}),this.ws.close(),this.ws=null),"number"==typeof e?this.connectionManager.rejectAllAwaiting(new l.NotConnectedError(`Connection failed with code ${e}.`,{code:e})):(null==e?void 0:e.message)?this.connectionManager.rejectAllAwaiting(new l.NotConnectedError(e.message,e)):this.connectionManager.rejectAllAwaiting(new l.NotConnectedError("Connection failed."))}}r.Connection=f},845477,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.handleStreamPartialPayment=r.handlePartialPayment=void 0;let n=i(e.r(892623)),a=e.r(522236),s=e.r(382870),o=e.r(932114);function l(e,t){var r,i;if(null==e||null==t||"Payment"!==e.TransactionType)return!1;let l=t;if("string"==typeof l){if("unavailable"===l)return!1;l=(0,a.decode)(l)}if(!("number"==typeof e.Flags?(0,o.isFlagEnabled)(e.Flags,s.PaymentFlags.tfPartialPayment):null==(r=e.Flags)?void 0:r.tfPartialPayment))return!1;let u=l.delivered_amount,c=null!=(i=e.DeliverMax)?i:e.Amount;return void 0!==u&&!function(e,t){if("string"==typeof e&&"string"==typeof t)return e===t;if("string"==typeof e||"string"==typeof t)return!1;if((0,s.isMPTAmount)(e)&&(0,s.isMPTAmount)(t)){let r=new n.default(e.value),i=new n.default(t.value);return e.mpt_issuance_id===t.mpt_issuance_id&&r.isEqualTo(i)}if((0,s.isMPTAmount)(e)||(0,s.isMPTAmount)(t))return!1;let r=new n.default(e.value),i=new n.default(t.value);return e.currency===t.currency&&e.issuer===t.issuer&&r.isEqualTo(i)}(u,c)}r.handlePartialPayment=function(e,t){var r;if(function(e,t){switch(e){case"tx":return l(t.result.tx_json,t.result.meta);case"transaction_entry":return l(t.result.tx_json,t.result.metadata);case"account_tx":return function(e){let{transactions:t}=e.result;return t.some(e=>null!=e.tx_json?l(e.tx_json,e.meta):l(e.tx,e.meta))}(t);default:return!1}}(e,t)){let e=null!=(r=t.warnings)?r:[];e.push({id:2001,message:"This response contains a Partial Payment"}),t.warnings=e}},r.handleStreamPartialPayment=function(e,t){var r,i;if(l(null!=(r=e.tx_json)?r:e.transaction,e.meta)){let r=null!=(i=e.warnings)?i:[];r.push({id:2001,message:"This response contains a Partial Payment"}
18),e.warnings=r,t("Partial payment received",JSON.stringify(e))}}},564495,(e,t,r)=>{"use strict";var i=e.e&&e.e.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(r,"__esModule",{value:!0}),r.Client=void 0;let n=e.r(757784),a=e.r(227730),s=e.r(654501),o=e.r(529155),l=e.r(1738),u=e.r(320387),c=e.r(188486),d=e.r(77625),f=e.r(277871),h=e.r(791395),p=e.r(100816),g=e.r(10393),m=e.r(845477);class y extends n.EventEmitter{constructor(e,t={}){var r,i;if(super(),this.apiVersion=s.DEFAULT_API_VERSION,"string"!=typeof e||!/wss?(?:\+unix)?:\/\//u.exec(e))throw new a.ValidationError("server URI must start with `wss://`, `ws://`, `wss+unix://`, or `ws+unix://`.");this.feeCushion=null!=(r=t.feeCushion)?r:1.2,this.maxFeeXRP=null!=(i=t.maxFeeXRP)?i:"2",this.connection=new g.Connection(e,t),this.connection.on("error",(e,t,r)=>{this.emit("error",e,t,r)}),this.connection.on("reconnect",()=>{this.connection.on("connected",()=>
18this.emit("connected"))}),this.connection.on("disconnected",e=>{let t=e;t===g.INTENTIONAL_DISCONNECT_CODE&&(t=1e3),this.emit("disconnected",t)}),this.connection.on("ledgerClosed",e=>{this.emit("ledgerClosed",e)}),this.connection.on("transaction",e=>{(0,m.handleStreamPartialPayment)(e,this.connection.trace),this.emit("transaction",e)}),this.connection.on("validationReceived",e=>{this.emit("validationReceived",e)}),this.connection.on("manifestReceived",e=>{this.emit("manifestReceived",e)}),this.connection.on("peerStatusChange",e=>{this.emit("peerStatusChange",e)}),this.connection.on("consensusPhase",e=>{this.emit("consensusPhase",e)}),this.connection.on("path_find",e=>{this.emit("path_find",e)})}get url(){return this.connection.getUrl()}request(e){var t;return i(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},e),{account:"string"==typeof e.account?(0,l.ensureClassicAddress)(e.account):void 0,api_version:null!=(t=e.api_version)?t:this.apiVersion}),i=yield this.connection.request(r);return(0,m.handlePartialPayment)(e.command,i),i})}requestNextPage(e,t){return i(this,void 0,void 0,function*(){if(!t.result.marker)return Promise.reject(new a.NotFoundError("response does not have a next page"));let r=Object.assign(Object.assign({},e),{marker:t.result.marker});return this.request(r)})}on(e,t){return super.on(e,t)}requestAll(e,t){var r;return i(this,void 0,void 0,function*(){let i=null!=t?t:function(e){switch(e){case"account_channels":return"channels";case"account_lines":return"lines";case"account_objects":return"account_objects";case"account_tx":return"transactions";case"account_offers":case"book_offers":return"offers";case"ledger_data":return"state";default:return null}}(e.command);if(!i)throw new a.ValidationError(`no collect key for command ${e.command}`);let n=null!=(r=e.limit)?r:1/0,s=0,o=e.marker,l=[];do{let t=Math.min(Math.max(n-s,10),400),r=Object.assign(Object.assign({},e),{limit:t,marker:o}),u=yield this.connection.request(r),c=u.result;if(!(i in c))throw new a.XrplError(`${i} not in result`);let d=c[i];o=c.marker,l.push(u),Array.isArray(d)&&(s+=d.length)}while(!!o&&s<n)return l})}getServerInfo(){var e;return i(this,void 0,void 0,function*(){try{let t=yield this.request({command:"server_info"});this.networkID=null!=(e=t.result.info.network_id)?e:void 0,this.buildVersion=t.result.info.build_version}catch(e){console.error(e)}})}connect(){return i(this,void 0,void 0,function*(){return this.connection.connect().then(()=>i(this,void 0,void 0,function*(){yield this.getServerInfo(),this.emit("connected")}))})}disconnect(){return i(this,void 0,void 0,function*(){yield this.connection.disconnect()})}isConnected(){return this.connection.isConnected()}autofill(e,t){return i(this,void 0,void 0,function*(){let r=Object.assign({},e);(0,u.setValidAddresses)(r),r.Flags=(0,o.convertTxFlagsToNumber)(r);let i=[];return null!=r.NetworkID||(r.NetworkID=(0,u.txNeedsNetworkID)(this)?this.networkID:void 0),null==r.Sequence&&i.push((0,u.setNextValidSequenceNumber)(this,r)),null==r.Fee&&i.push((0,u.getTransactionFee)(this,r,t)),null==r.LastLedgerSequence&&i.push((0,u.setLatestValidatedLedgerSequence)(this,r)),"AccountDelete"===r.TransactionType&&i.push((0,u.checkAccountDeleteBlockers)(this,r)),"Batch"===r.TransactionType&&i.push((0,u.autofillBatchTxn)(this,r)),"Payment"===r.TransactionType&&null!=r.DeliverMax&&(0,u.handleDeliverMax)(r),Promise.all(i).then(()=>r)})}simulate(e,t){var r;return i(this,void 0,void 0,function*(){let i=null!=(r=null==t?void 0:t.binary)&&r;return this.request("string"==typeof e?{command:"simulate",tx_blob:e,binary:i}:{command:"simulate",tx_json:e,binary:i})})}submit(e,t){return i(this,void 0,void 0,function*(){let r=yield(0,l.getSignedTx)(this,e,t);return(0,l.submitRequest)(this,r,null==t?void 0:t.failHard)})}submitAndWait(e,t){return i(this,void 0,void 0,function*(){let r=yield(0,l.getSignedTx)(this,e,t),i=(0,l.getLastLedgerSequence)(r);if(null==i)throw new a.ValidationError("Transaction must contain a LastLedgerSequence value for reliable submission.");let n=yield(0,l.submitRequest)(this,r,null==t?void 0:t.failHard);if(n.result.engine_result.startsWith("tem"))throw new a.XrplError(`Transaction failed, ${n.result.engine_result}: ${n.result.engine_result_message}`);let s=f.hashes.hashSignedTx(r);return(0,l.waitForFinalTransactionOutcome)(this,s,i,n.result.engine_result)})}prepareTransaction(e,t){return i(this,void 0,void 0,function*(){return this.autofill(e,t)})}getXrpBalance(e,t={}){var r;return i(this,void 0,void 0,function*(){let i={command:"account_info",account:e,ledger_index:null!=(r=t.ledger_index)?r:"validated",ledger_hash:t.ledger_hash},n=yield this.request(i);return(0,f.dropsToXrp)(n.result.account_data.Balance)})}getBalances(e,t={}){var r;return i(this,void 0,void 0,function*(){let i=[],n=Promise.resolve(0);t.peer||(n=this.getXrpBalance(e,{ledger_hash:t.ledger_hash,ledger_index:t.ledger_index}));let a={command:"account_lines",account:e,ledger_index:null!=(r=t.ledger_index)?r:"validated",ledger_hash:t.ledger_hash,peer:t.peer,limit:t.limit},s=this.requestAll(a);return yield Promise.all([n,s]).then(([e,t])=>{let r=t.flatMap(e=>(0,c.formatBalances)(e.result.lines));0!==e&&i.push({currency:"XRP",value:e.toString()}),i.push(...r)}),i.slice(0,t.limit)})}getOrderbook(e,t,r={}){return i(this,void 0,void 0,function*(){(0,d.validateOrderbookOptions)(r);let i=(0,d.createBookOffersRequest)(e,t,r),n=yield(0,d.requestAllOffers)(this,i),a=yield(0,d.requestAllOffers)(this,(0,d.reverseRequest)(i)),s=(0,d.extractOffers)(n),o=(0,d.extractOffers)(a),l=(0,d.combineOrders)(s,o),{buy:u,sell:c}=(0,d.separateBuySellOrders)(l);return{buy:(0,d.sortAndLimitOffers)(u,r.limit),sell:(0,d.sortAndLimitOffers)(c,r.limit)}})}getLedgerIndex(){return i(this,void 0,void 0,function*(){return(yield this.request({command:"ledger",ledger_index:"validated"})).result.ledger_index})}fundWallet(e,t={}){return i(this,void 0,void 0,function*(){if(!this.isConnected())throw new a.RippledError("Client not connected, cannot call faucet");let r=!!e,i=e&&(0,f.isValidClassicAddress)(e.classicAddress)?e:h.Wallet.generate(),n={destination:i.classicAddress,xrpAmount:t.amount,usageContext:t.usageContext,userAgent:"xrpl.js"},s=0;if(r)try{s=Number((yield this.getXrpBalance(i.classicAddress)))}catch(e){}return(0,p.requestFunding)(t,this,s,i,n)})}}r.Client=y},392725,(e,t,r)=>{"use strict";
18Object.defineProperty(r,"__esModule",{value:!0}),r.parseSecretString=r.checkChecksum=r.calculateChecksum=r.secretToEntropy=r.entropyToSecret=r.randomSecret=r.randomEntropy=void 0;let i=e.r(575280);function n(){return(0,i.randomBytes)(16)}function a(e,t){return t*(2*e+1)%9}function s(e,t,r){let i,n;if("string"==typeof t){if(6!==t.length)throw Error("value must have a length of 6");i=parseInt(t.slice(5),10),n=parseInt(t.slice(0,5),10)}else{if("number"!=typeof r)throw Error("checksum must be a number when value is a number");i=r,n=t}return n*(2*e+1)%9===i}function o(e){let t=Array.from(Array(Math.ceil(e.length/2)),(t,r)=>{let n=e.slice(2*r,(r+1)*2),s=parseInt((0,i.bytesToHex)(n),16);return"0".repeat(5-String(s).length)+String(s)+String(a(r,s))});if(8!==t.length)throw Error("Chucks must have 8 digits");return t}r.randomEntropy=n,r.calculateChecksum=a,r.checkChecksum=s,r.entropyToSecret=o,r.randomSecret=function(){return o(n())},r.secretToEntropy=function(e){return(0,i.concat)(e.map((e,t)=>{let r=Number(e.slice(0,5)),n=Number(e.slice(5));if(6!==e.length)throw Error("Invalid secret: number invalid");if(!s(t,r,n))throw Error("Invalid secret part: checksum invalid");let a=`0000${r.toString(16)}`.slice(-4);return(0,i.hexToBytes)(a)}))},r.parseSecretString=function(e){let t=e.replace(/[^0-9]/gu,"");if(48!==t.length)throw Error("Invalid secret string (should contain 8 blocks of 6 digits");return Array.from(Array(8),(e,r)=>t.slice(6*r,(r+1)*6))}},79117,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Account=void 0;let i=e.r(377702),n=e.r(392725);r.Account=class{constructor(e){this._account={familySeed:"",address:"",keypair:{publicKey:"",privateKey:""}},"string"==typeof e?this._secret=(0,n.parseSecretString)(e):Array.isArray(e)?this._secret=e:e instanceof Uint8Array?this._secret=(0,n.entropyToSecret)(e):this._secret=(0,n.randomSecret)(),function(e){if(8!==e.length)throw Error("Secret must have 8 numbers");e.forEach(e=>{if(6!==e.length)throw Error("Each secret number must be 6 digits")})}(this._secret),this.derive()}getSecret(){return this._secret}getSecretString(){return this._secret.join(" ")}getAddress(){return this._account.address}getFamilySeed(){return this._account.familySeed}getKeypair(){return this._account.keypair}toString(){return this.getSecretString()}derive(){try{let e=(0,n.secretToEntropy)(this._secret);this._account.familySeed=(0,i.generateSeed)({entropy:e}),this._account.keypair=(0,i.deriveKeypair)(this._account.familySeed),this._account.address=(0,i.deriveAddress)(this._account.keypair.publicKey)}catch(t){let e="Unknown Error";throw t instanceof Error&&(e=t.message),Error(e)}}}},859867,(e,t,r)=>{"use strict";var i=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),n(e.r(79117),r),n(e.r(392725),r)},997162,(e,t,r)=>{"use strict";var i=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.walletFromSecretNumbers=void 0;let n=e.r(859867),a=i(e.r(239540)),s=e.r(791395);r.walletFromSecretNumbers=function(e,t){var r;let i=new n.Account(e).getFamilySeed(),o={masterAddress:void 0,algorithm:void 0};return void 0===t?o.algorithm=a.default.secp256k1:(o.masterAddress=t.masterAddress,o.algorithm=null!=(r=t.algorithm)?r:a.default.secp256k1),s.Wallet.fromSecret(i,o)}},72232,(e,t,r)=>{"use strict";var i=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)}
18,a=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.rfc1751MnemonicToKey=r.keyToRFC1751Mnemonic=r.walletFromSecretNumbers=r.ECDSA=r.Client=void 0;var s=e.r(564495);Object.defineProperty(r,"Client",{enumerable:!0,get:function(){return s.Client}}),n(e.r(397267),r),n(e.r(277871),r);var o=e.r(239540);Object.defineProperty(r,"ECDSA",{enumerable:!0,get:function(){return a(o).default}}),n(e.r(227730),r),n(e.r(791395),r);var l=e.r(997162);Object.defineProperty(r,"walletFromSecretNumbers",{enumerable:!0,get:function(){return l.walletFromSecretNumbers}});var u=e.r(112067);Object.defineProperty(r,"keyToRFC1751Mnemonic",{enumerable:!0,get:function(){return u.keyToRFC1751Mnemonic}}),Object.defineProperty(r,"rfc1751MnemonicToKey",{enumerable:!0,get:function(){return u.rfc1751MnemonicToKey}})},602638,(e,t,r)=>{var i=e.i(335292);let n="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,a=()=>n.now(),s=e=>e===1/0||e&&e===Math.floor(e)&&e>0&&isFinite(e);class o{constructor({max:e=1/0,ttl:t,updateAgeOnGet:r=!1,checkAgeOnGet:i=!1,noUpdateTTL:n=!1,dispose:a,noDisposeOnSet:o=!1}={}){if(this.expirations=Object.create(null),this.data=new Map,this.expirationMap=new Map,void 0!==t&&!s(t))throw TypeError("ttl must be positive integer or Infinity if set");if(!s(e))throw TypeError("max must be positive integer or Infinity");if(this.ttl=t,this.max=e,this.updateAgeOnGet=!!r,this.checkAgeOnGet=!!i,this.noUpdateTTL=!!n,this.noDisposeOnSet=!!o,void 0!==a){if("function"!=typeof a)throw TypeError("dispose must be function if set");this.dispose=a}this.timer=void 0,this.timerExpiration=void 0}setTimer(e,t){if(this.timerExpiration<e)return;this.timer&&clearTimeout(this.timer);let r=setTimeout(()=>{for(let e in this.timer=void 0,this.timerExpiration=void 0,this.purgeStale(),this.expirations){this.setTimer(e,e-a());break}},t);r.unref&&r.unref(),this.timerExpiration=e,this.timer=r}cancelTimer(){this.timer&&(clearTimeout(this.timer),this.timerExpiration=void 0,this.timer=void 0)}cancelTimers(){return i.default.emitWarning('TTLCache.cancelTimers has been renamed to TTLCache.cancelTimer (no "s"), and will be removed in the next major version update'),this.cancelTimer()}clear(){let e=this.dispose!==o.prototype.dispose?[...this]:[];for(let[t,r]of(this.data.clear(),this.expirationMap.clear(),this.cancelTimer(),this.expirations=Object.create(null),e))this.dispose(r,t,"delete")}setTTL(e,t=this.ttl){let r=this.expirationMap.get(e);if(void 0!==r){let t=this.expirations[r];!t||t.length<=1?delete this.expirations[r]:this.expirations[r]=t.filter(t=>t!==e)}if(t!==1/0){let r=Math.floor(a()+t);this.expirationMap.set(e,r),this.expirations[r]||(this.expirations[r]=[],this.setTimer(r,t)),this.expirations[r].push(e)}else this.expirationMap.set(e,1/0)}set(e,t,{ttl:r=this.ttl,noUpdateTTL:i=this.noUpdateTTL,noDisposeOnSet:n=this.noDisposeOnSet}={}){if(!s(r))throw TypeError("ttl must be positive integer or Infinity");if(this.expirationMap.has(e)){i||this.setTTL(e,r);let a=this.data.get(e);a!==t&&(this.data.set(e,t),n||this.dispose(a,e,"set"))}else this.setTTL(e,r),this.data.set(e,t);for(;this.size>this.max;)this.purgeToCapacity();return this}has(e){return this.data.has(e)}getRemainingTTL(e){let t=this.expirationMap.get(e);return t===1/0?t:void 0!==t?Math.max(0,Math.ceil(t-a())):0}get(e,{updateAgeOnGet:t=this.updateAgeOnGet,ttl:r=this.ttl,checkAgeOnGet:i=this.checkAgeOnGet}={}){let n=this.data.get(e);return i&&0===this.getRemainingTTL(e)?void this.delete(e):(t&&this.setTTL(e,r),n)}dispose(e,t){}delete(e){let t=this.expirationMap.get(e);if(void 0!==t){let r=this.data.get(e);this.data.delete(e),this.expirationMap.delete(e);let i=this.expirations[t];return i&&(i.length<=1?delete this.expirations[t]:this.expirations[t]=i.filter(t=>t!==e)),this.dispose(r,e,"delete"),0===this.size&&this.cancelTimer(),!0}return!1}purgeToCapacity(){for(let e in this.expirations){let t=this.expirations[e];if(this.size-t.length>=this.max){delete this.expirations[e];let r=[];for(let e of t)r.push([e,this.data.get(e)]),this.data.delete(e),this.expirationMap.delete(e);for(let[e,t]of r)this.dispose(t,e,"evict")}else{let e=this.size-this.max,r=[];for(let i of t.splice(0,e))r.push([i,this.data.get(i)]),this.data.delete(i),this.expirationMap.delete(i);for(let[e,t]of r)this.dispose(t,e,"evict");return}}}get size(){return this.data.size}purgeStale(){let e=Math.ceil(a());for(let t in this.expirations){if("Infinity"===t||t>e)return;let r=[...this.expirations[t]||[]],i=[];for(let e of(delete this.expirations[t],r))i.push([e,this.data.get(e)]),this.data.delete(e),this.expirationMap.delete(e);for(let[e,t]of i)this.dispose(t,e,"stale")}0===this.size&&this.cancelTimer()}*entries(){for(let e in this.expirations)for(let t of this.expirations[e])yield[t,this.data.get(t)]}*keys(){for(let e in this.expirations)for(let t of this.expirations[e])yield t}*values(){for(let e in this.expirations)for(let t of this.expirations[e])yield this.data.get(t)}[Symbol.iterator](){return this.entries()}}t.exports=o},278932,738993,712291,e=>{"use strict";var t=e.i(324137),r=e.i(854449),i=e.i(881837),n=e.i(134932),a=e.i(472074);async function s(e,t,r){let i=await e.json(),s=a.safeParse(r,i);if(s.success){if(void 0!==s.output.error)throw new n.RpcRequestError({body:t,error:s.output.error,url:e.url});return s.output.result}throw new n.RpcRequestError({body:t,error:{code:-1,data:i,message:"Invalid response"},url:e.url})}e.s(["handleRPCResponse",0,s],738993);let o={THIRTY_SECS_AGGRESSIVE:{delay:500,minDelay:500,factor:2,maxAttempts:6,jitter:!0},ONE_MIN_MODERATE:{delay:1e3,minDelay:1e3,factor:1.5,maxAttempts:8,jitter:!0},TWO_MINS_GRADUAL:{delay:500,minDelay:500,factor:1.5,maxAttempts:12,jitter:!0},FIVE_MINS_STEADY:{delay:2e3,minDelay:2e3,factor:1.4,maxAttempts:12,jitter:!0},THIRTY_MINS_PATIENT:{delay:5e3,minDelay:5e3,factor:1.3,maxAttempts:18,jitter:!0},TWO_HOURS_PERSISTENT:{delay:1e4,minDelay:1e4,factor:1.2,maxAttempts:27,jitter:!0}};e.s(["RETRY_CONFIGS",0,o],712291);let l=a.union([a.object({jsonrpc:a.literal("2.0"),id:a.string(),result:a.unknown()}),a.object({jsonrpc:a.literal("2.0"),id:a.string(),error:a.pipe(a.string(),a.transform(e=>({code:-1,data:null,message:e})))})]);async function u(e,t,n){let a=new URL("rpc",n?.baseURL??r.config.env.poaBridgeBaseURL);a.searchParams.set("method",String(e));let u={id:n?.requestId??"dontcare",jsonrpc:"2.0",method:e,params:void 0!==t?[t]:void 0};return s(await (0,i.request)({url:a,body:u,...n,fetchOptions:{...n?.fetchOptions,method:"POST"},retryOptions:n?.retryOptions??o.THIRTY_SECS_AGGRESSIVE,logger:n?.logger}),u,l)}async function c(e,t={}){return await u("supported_tokens",e,t)}async function d(e,t={}){return await u("deposit_address",e,t)}async function f(e,t={}){return await u("recent_deposits",e,t)}async function h(e,t={}){return await u("withdrawal_status",e,t)}async function p(e,t={}){return await u("hot_omni_withdraw",e,t)}async function g(e,t={}){return(await (0,i.request)({url:`${t.baseURL??r.config.env.poaBridgeBaseURL}/console/tokenBalances?${e.map(e=>`addresses[]=${e}`).join("&")}`,fetchOptions:{method:"GET"}})).json()}async function m(e,t={}){return await u("withdrawal_estimate",e,t)}var y=(0,t.__exportAll)({getDepositAddress:()=>d,getDepositStatus:()=>
18f,getSupportedTokens:()=>c,getTokenBalancesRequest:()=>g,getWithdrawalEstimate:()=>m,getWithdrawalStatus:()=>h,hotOmniWithdraw:()=>p}),v=e.i(116453),b=e.i(438239),w=v,_=class extends w.BaseError{constructor(e,t,r,i){super("Withdrawal is not in an expected shape.",{metaMessages:[`TxHash: ${r}`,`Criteria: ${(0,b.serialize)(i)}`,`Result: ${(0,b.serialize)(t)}`],details:e,name:"PoaWithdrawalInvariant"}),this.details=e,this.result=t,this.txHash=r,this.withdrawalCriteria=i}},A=class extends w.BaseError{constructor(e,t,r){super("POA withdrawal not found.",{metaMessages:[`TxHash: ${e}`,`Criteria: ${(0,b.serialize)(t)}`],name:"PoaWithdrawalNotFoundError",cause:r}),this.txHash=e,this.withdrawalCriteria=t}},S=class extends w.BaseError{constructor(e,t,r){super("POA withdrawal is still pending.",{metaMessages:[`TxHash: ${t}`,`Criteria: ${(0,b.serialize)(r)}`,`Result: ${(0,b.serialize)(e)}`],name:"PoaWithdrawalPendingError"}),this.result=e,this.txHash=t,this.withdrawalCriteria=r}},E=e.i(391836);async function x({txHash:e,withdrawalCriteria:t,signal:r,baseURL:i,retryOptions:a=o.TWO_MINS_GRADUAL,logger:s}){return(0,E.retry)(async()=>{var n,a;let o=await h({withdrawal_hash:e},{baseURL:i,fetchOptions:{signal:r},logger:s}),l=(n=o.withdrawals,a=t,n.find(e=>`nep141:${e.data.near_token_id}`===a.assetId));if(null==l)throw new _("POA Bridge didn't return withdrawal matching criteria",o,e,t);if("COMPLETED"===l.status){if(null==l.data.transfer_tx_hash)throw new _("POA Bridge didn't return transfer_tx_hash for COMPLETED withdrawal",o,e,t);return{destinationTxHash:l.data.transfer_tx_hash,chain:l.data.chain}}throw new S(o,e,t)},{...a,handleError:(r,i)=>{var a;if((a=r)instanceof n.RpcRequestError&&"Withdrawals not found"===a.details){if(i.attemptsRemaining>0)return;throw new A(e,t,r)}r instanceof S&&i.attemptsRemaining>0||r instanceof v.BaseError&&r.walk(e=>e instanceof n.HttpRequestError||e instanceof n.TimeoutError||e instanceof n.RpcRequestError)||i.abort()}})}var T=e.i(640126);async function I(e){let t=[],r=0,i=0;for(;i<50;){let n=await f({account_id:e,limit:20,offset:r,status:"PENDING"});for(let e of n.deposits)t.push(e);if(r+=n.deposits.length,i++,r>=n.total||n.deposits.length<20)break}return t}var k=(0,t.__exportAll)({BlockchainEnum:()=>T.BlockchainEnum,PoaBridgeNetworkReference:()=>T.PoaBridgeNetworkReference,VirtualNetworkReference:()=>T.VirtualNetworkReference,getPendingDeposits:()=>I,httpClient:()=>y,waitForWithdrawalCompletion:()=>x});e.s(["poaBridge",0,k],278932)},916937,713440,545937,334724,255832,878621,198769,438763,601841,201667,212635,e=>{"use strict";let t,r,i,n,a;var s,o,l,u,c,d,f,h,p,g,m,y,v,b,w,_,A,S,E,x,T,I,k,O,C,N,P,D,R,$,B,L,U,F,M,j,z,V,H,q,W,K,G,Z,X,J,Y,Q,ee,et,er,ei,en,ea,es,eo,el,eu,ec,ed,ef,eh,ep,eg,em,ey,ev,eb,ew=e.i(569871),e_=e.i(885258),eA=e.i(114402),eS=e.i(772693),eE=e.i(552181),ex=e.i(324137),eT=e.i(607300),eI=e.i(760061),ek=e.i(268793),eO=e.i(632570),eC=e.i(192328),eN=e.i(579930);async function eP(...e){let[t,r]=e;return(0,eT.publishIntents)(t,{timeout:3e4,...r,retryOptions:{delay:1e3,factor:1.5,maxAttempts:7,jitter:!0,minDelay:1e3}}).then(e=>{var r,i;return r=t,"OK"===(i=e).status||"already processed"===i.reason?(0,eN.Ok)(i.intent_hashes):(0,eN.Err)((0,eC.toRelayPublishError)(r,i))},e=>(0,eN.Err)(new eC.RelayPublishResultUnknownError({reason:"Failed to receive a usable publish response from the relay. Publish result is unknown.",publishParams:t,cause:e}))).then(t=>{if(t.isErr()){let r=t.unwrapErr();e[1]?.logger?.error(r)}return t})}var eD=e.i(116453),eR=e.i(134932),e$=eD;let eB="COOLING",eL="COLD",eU={HOT:300,[eB]:3e3,[eL]:1e4},eF=Symbol("poll.pending");var eM=class extends e$.BaseError{constructor(e,t){super("Polling timed out",{details:`Operation did not complete within ${t}ms (elapsed: ${e}ms)`}),this.elapsedMs=e,this.timeoutMs=t,this.name="PollTimeoutError"}};async function ej(e,t){let{stats:r,signal:i,minInterval:n=300,maxInterval:a=3e4}=t,{p50:s,p90:o,p99:l}=r,u=performance.now();for(;;){var c,d,f;i?.throwIfAborted();let t=performance.now()-u;if(t>=l)throw new eM(t,l);let r=await e();if(r!==eF)return r;let h=eU[c=t,d=s,f=o,c<d?"HOT":c<f?eB:eL];await function(e,t){return new Promise((r,i)=>{if(t?.aborted)return void i(t.reason);let n=()=>{clearTimeout(a),i(t?.reason)},a=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e);t?.addEventListener("abort",n)})}(Math.max(n,Math.min(a,h)),i)}}e.s(["POLL_PENDING",0,eF,"PollTimeoutError",0,eM,"poll",0,ej],713440);var ez=eD,eV=class extends ez.BaseError{constructor(e){super("Intent settlement failed.",{details:"Intent is published but not settled.",metaMessages:[`Status: ${e.status}`,`Intent hash: ${e.intent_hash}`,..."data"in e&&e.data?[`Tx hash: ${e.data.hash}`]:[]],name:"IntentSettlementError"}),this.result=e}};let eH={p50:2e3,p90:1e4,p99:356e3};async function eq({intentHash:e,signal:t,baseURL:r,logger:i,solverRelayApiKey:n,...a}){let s=!1;return ej(async()=>{try{let o=await (0,eT.getStatus)({intent_hash:e},{baseURL:r,fetchOptions:{signal:t},logger:i,solverRelayApiKey:n});
18if(s||"TX_BROADCASTED"!==o.status&&"SETTLED"!==o.status||(s=!0,a.onTxHashKnown?.(o.data.hash)),"SETTLED"===o.status)return{txHash:o.data.hash,intentHash:o.intent_hash};if("NOT_FOUND_OR_NOT_VALID"===o.status&&"FAILED"===o.status_details)throw new eV(o);return eF}catch(e){var o;if(!((o=e)instanceof eV)&&o instanceof eD.BaseError&&null!==o.walk(e=>e instanceof eR.HttpRequestError||e instanceof eR.TimeoutError||e instanceof eR.RpcRequestError))return eF;throw e}},{stats:eH,signal:t})}var eW=e.i(514425),eK=e.i(396302);function eG(e,t,r,i={}){return eP({signed_datas:[(0,eK.prepareSwapSignedData)(e,t)],quote_hashes:r},i).then(e=>e.map(e=>{let t=e[0];return(0,eW.assert)(null!=t,"Should include at least one intent hash"),t}))}var eZ=(0,ex.__exportAll)({getQuote:()=>ek.getQuote,getStatus:()=>eO.getStatus,httpClient:()=>eI.solverRelayHttpClient_exports,publishIntent:()=>eG,publishIntents:()=>eP,quote:()=>eT.quote,waitForIntentSettlement:()=>eq});function eX(e,t,r){let i=e.underlyingFees?.[t];if(void 0===i)throw Error(`Missing underlying fees for route "${String(t)}". Fee estimation must populate underlyingFees before creating withdrawal intents.`);return i[r]}async function eJ({feeAmount:e,feeAssetId:t,tokenAssetId:r,quoteOptions:i,envConfig:n,logger:a,solverRelayApiKey:s}){try{return await eZ.getQuote({quoteParams:{defuse_asset_identifier_in:r,defuse_asset_identifier_out:t,exact_amount_out:e.toString(),wait_ms:i?.waitMs,min_wait_ms:i?.minWaitMs,max_wait_ms:i?.maxWaitMs,trusted_metadata:i?.trustedMetadata},config:{baseURL:n.solverRelayBaseURL,logBalanceSufficient:!1,logger:a,solverRelayApiKey:s}})}catch(w){if(!(w instanceof eE.QuoteError))throw w;a?.info("Can't get exact out quote, trying to get exact in quote with x1.2");let o=await (0,eS.tokens)({envConfig:n}),l=o.items.find(e=>e.defuse_asset_id===t),u=o.items.find(e=>e.defuse_asset_id===r);if(null==l||null==u)throw w;let c=BigInt(Math.round(1e6*l.price)),d=BigInt(Math.round(1e6*u.price)),f=BigInt(l.decimals),h=BigInt(u.decimals),p=e*c*12n*10n**h,g=d*10n**f*10n,m=p/g;p%g!==0n&&(m+=1n),0n===m&&(m=1n);let y=await eZ.getQuote({quoteParams:{defuse_asset_identifier_in:r,defuse_asset_identifier_out:t,exact_amount_in:m.toString(),wait_ms:i?.waitMs,min_wait_ms:i?.minWaitMs,max_wait_ms:i?.maxWaitMs,trusted_metadata:i?.trustedMetadata},config:{baseURL:n.solverRelayBaseURL,logBalanceSufficient:!1,logger:a,solverRelayApiKey:s}}),v=1000n*BigInt(y.amount_out)/e,b=Number(v)/Number(1000n);if(v>1500n)throw a?.warn(`Quote amount_out ratio is too high: ${b.toFixed(2)}x`),w;if(BigInt(y.amount_out)<e)throw a?.warn(`Quote amount_out (${y.amount_out}) is less than feeAmount (${e}), exact_amount_in: ${m}, fee asset price: ${l.price} USD, token asset price: ${u.price} USD`),w;return y}}e.s(["solverRelay",0,eZ],545937);var eY=e.i(104147);function eQ(e){try{return eY.utils.parseDefuseAssetId(e)}catch{throw new ew.UnsupportedAssetIdError(e,"Invalid asset id format.")}}var e0=e.i(929707),e1=e.i(314259);function e2(e){return(0,e1.getAddress)(e).slice(2).toLowerCase()}function e6(e){(0,eW.assert)(null!=e.routeConfig,"Bridge config is required"),(0,eW.assert)(e.routeConfig.route===e_.RouteEnum.VirtualChain,"Bridge is not aurora_engine")}var e5=e.i(641348),e4=e.i(472074),e3=e.i(987750);let e8=async({contractId:e,accountId:t,nearProvider:r})=>
18{try{let i=e3.base64.encode(new TextEncoder().encode(JSON.stringify({account_id:t}))),n=(0,e5.decodeQueryResult)(await r.query({request_type:"call_function",method_name:"storage_balance_of",account_id:e,args_base64:i,finality:"optimistic"}),e4.union([e4.null(),e4.object({total:e4.string()})]));return BigInt(n?.total||"0")}catch(e){throw Error("Error fetching balance",{cause:e})}},e7=async({contractId:e,nearProvider:t})=>BigInt((0,e5.decodeQueryResult)(await t.query({request_type:"call_function",method_name:"storage_balance_bounds",account_id:e,args_base64:e3.base64.encode(new TextEncoder().encode(JSON.stringify({}))),finality:"optimistic"}),e4.object({min:e4.string(),max:e4.string()})).min);e.s(["getNearNep141MinStorageBalance",0,e7,"getNearNep141StorageBalance",0,e8],334724);var e9=class{constructor({envConfig:e,nearProvider:t,solverRelayApiKey:r}){this.route=e_.RouteEnum.VirtualChain,this.envConfig=e,this.nearProvider=t,this.solverRelayApiKey=r}is(e){return e.route===this.route}async supports(e){if(null==e.routeConfig||!this.is(e.routeConfig))return!1;let t="nep141"===eQ(e.assetId).standard;if(!t)throw new ew.UnsupportedAssetIdError(e.assetId,"`assetId` does not match `routeConfig`.");return t}parseAssetId(){return null}createWithdrawalIntents(e){e6(e.withdrawalParams);let t=[];return null!=e.feeEstimation.quote&&t.push({intent:"token_diff",diff:{[e.feeEstimation.quote.defuse_asset_identifier_in]:`-${e.feeEstimation.quote.amount_in}`,[e.feeEstimation.quote.defuse_asset_identifier_out]:e.feeEstimation.quote.amount_out},referral:e.referral}),t.push(function(e){let{contractId:t,standard:r}=eY.utils.parseDefuseAssetId(e.assetId);return((0,eW.assert)("nep141"===r,"Only NEP-141 is supported"),null==e.proxyTokenContractId)?{intent:"ft_withdraw",token:t,receiver_id:e.auroraEngineContractId,amount:e.amount.toString(),msg:e2(e.destinationAddress),storage_deposit:e.storageDeposit>0n?e.storageDeposit.toString():void 0,min_gas:"38500000000000"}:{intent:"ft_withdraw",token:t,receiver_id:e.proxyTokenContractId,amount:e.amount.toString(),msg:`${e.auroraEngineContractId}:${e2(e.destinationAddress)}`,storage_deposit:e.storageDeposit>0n?e.storageDeposit.toString():void 0,min_gas:"100000000000000"}}({assetId:e.withdrawalParams.assetId,auroraEngineContractId:e.withdrawalParams.routeConfig.auroraEngineContractId,proxyTokenContractId:e.withdrawalParams.routeConfig.proxyTokenContractId,destinationAddress:e.withdrawalParams.destinationAddress,amount:e.withdrawalParams.amount,storageDeposit:eX(e.feeEstimation,e_.RouteEnum.VirtualChain,"storageDepositFee")})),Promise.resolve(t)}async validateWithdrawal(e){if(!1===(0,e0.validateAddress)(e.destinationAddress,eA.Chains.Ethereum))throw new ew.InvalidDestinationAddressForWithdrawalError(e.destinationAddress,"virtual-chain")}async estimateWithdrawalFee(e){e6(e.withdrawalParams);let{contractId:t,standard:r}=eY.utils.parseDefuseAssetId(e.withdrawalParams.assetId);(0,eW.assert)("nep141"===r,"Only NEP-141 is supported");let[i,n]=await Promise.all([e7({contractId:t,nearProvider:this.nearProvider}),e8({contractId:t,accountId:e.withdrawalParams.routeConfig.auroraEngineContractId,nearProvider:this.nearProvider})]);if(i<=n)return{amount:0n,quote:null,underlyingFees:{[e_.RouteEnum.VirtualChain]:{storageDepositFee:0n}}};let a="nep141:wrap.near",s=i-n,o=e.withdrawalParams.assetId===a?null:await eJ({feeAmount:s,feeAssetId:a,tokenAssetId:e.withdrawalParams.assetId,logger:e.logger,envConfig:this.envConfig,quoteOptions:e.quoteOptions,solverRelayApiKey:this.solverRelayApiKey});return{amount:o?BigInt(o.amount_in):s,quote:o,underlyingFees:{[e_.RouteEnum.VirtualChain]:{storageDepositFee:s}}}}createWithdrawalIdentifier(e){return{landingChain:eA.Chains.Near,index:e.index,withdrawalParams:e.withdrawalParams,tx:e.tx}}async describeWithdrawal(){return{status:"completed",txHash:null}}};e.s(["AuroraEngineBridge",0,e9],916937);let te="omni",tt="nep141:wrap.near";var tr=e.i(195637),ti=e.i(100582);function tn(e){(0,eW.assert)(!e.routeConfig||e.routeConfig.route===e_.RouteEnum.NearWithdrawal,"Bridge is not direct")}async function ta(e,t){try{return await (0,tr.unwrapNearFailoverRpcProvider)(e).query({request_type:"view_account",account_id:t,finality:"final"}),!0}catch(e){if(e instanceof ti.providers.TypedError&&"AccountDoesNotExist"===e.type)return!1;throw e}}var ts=eD,to=class extends ts.BaseError{constructor(e){super("Destination explicit NEAR account doesn't exist.",{metaMessages:[`Account Id: ${e}`],name:"DestinationExplicitNearAccountDoesntExistError"}),this.accountId=e}},tl=e.i(335292),tu={hasSubscribers:!1},tc="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,td=new Set,tf="object"==typeof tl.default&&tl.default?tl.default:{},th=e=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),tp=e=>th(e)?e<=256?Uint8Array:e<=65536?Uint16Array:e<=0x100000000?Uint32Array:e<=Number.MAX_SAFE_INTEGER?tg:null:null,tg=class extends Array{constructor(e){super(e),this.fill(0)}},tm=class e{heap;length;static #e=!1;static create(t){let r=tp(t);if(!r)return[];e.#e=!0;let i=new e(t,r);return e.#e=!1,i}constructor(t,r){if(!e.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ty=class e{#e;#t;#r;#i;#n;#a;#s;#o;get perf(){return this.#o}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#l;#u;#c;#d;#f;#h;#p;#g;#m;#y;#v;#b;#w;#_;#A;#S;#E;#x;#T;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#_,autopurgeTimers:e.#A,sizes:e.#b,keyMap:e.#c,keyList:e.#d,valList:e.#f,next:e.#h,prev:e.#p,get head(){return e.#g},get tail(){return e.#m}
18,free:e.#y,isBackgroundFetch:t=>e.#I(t),backgroundFetch:(t,r,i,n)=>e.#k(t,r,i,n),moveToTail:t=>e.#O(t),indexes:t=>e.#C(t),rindexes:t=>e.#N(t),isStale:t=>e.#P(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#u}get size(){return this.#l}get fetchMethod(){return this.#a}get memoMethod(){return this.#s}get dispose(){return this.#r}get onInsert(){return this.#i}get disposeAfter(){return this.#n}constructor(t){let{max:r=0,ttl:i,ttlResolution:n=1,ttlAutopurge:a,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:l,dispose:u,onInsert:c,disposeAfter:d,noDisposeOnSet:f,noUpdateTTL:h,maxSize:p=0,maxEntrySize:g=0,sizeCalculation:m,fetchMethod:y,memoMethod:v,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:A,ignoreFetchAbort:S,backgroundFetchSize:E=1,perf:x}=t;if(this.backgroundFetchSize=E,void 0!==x&&"function"!=typeof x?.now)throw TypeError("perf option must have a now() method if specified");if(this.#o=x??tc,0!==r&&!th(r))throw TypeError("max option must be a nonnegative integer");let T=r?tp(r):Array;if(!T)throw Error("invalid max value: "+r);if(this.#e=r,this.#t=p,this.maxEntrySize=g||this.#t,this.sizeCalculation=m,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw TypeError("sizeCalculation set to non-function")}if(void 0!==v&&"function"!=typeof v)throw TypeError("memoMethod must be a function if defined");if(this.#s=v,void 0!==y&&"function"!=typeof y)throw TypeError("fetchMethod must be a function if specified");if(this.#a=y,this.#E=!!y,this.#c=new Map,this.#d=Array.from({length:r}).fill(void 0),this.#f=Array.from({length:r}).fill(void 0),this.#h=new T(r),this.#p=new T(r),this.#g=0,this.#m=0,this.#y=tm.create(r),this.#l=0,this.#u=0,"function"==typeof u&&(this.#r=u),"function"==typeof c&&(this.#i=c),"function"==typeof d?(this.#n=d,this.#v=[]):(this.#n=void 0,this.#v=void 0),this.#S=!!this.#r,this.#T=!!this.#i,this.#x=!!this.#n,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!S,0!==this.maxEntrySize){if(0!==this.#t&&!th(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!th(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=th(n)||0===n?n:1,this.ttlAutopurge=!!a,this.ttl=i||0,this.ttl){if(!th(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#R()}if(0===this.#e&&0===this.ttl&&0===this.#t)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t="LRU_CACHE_UNBOUNDED";(e=>!td.has(e))(t)&&(td.add(t),((e,t,r,i)=>{"function"==typeof tf.emitWarning?tf.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)})("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,e))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#R(){let e=new tg(this.#e),t=new tg(this.#e);this.#_=e,this.#w=t;let r=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#A=r,this.#$=(r,n,a=this.#o.now())=>{t[r]=0!==n?a:0,e[r]=n,i(r,n)},this.#B=r=>{t[r]=0!==e[r]?this.#o.now():0,i(r,e[r])};let i=this.ttlAutopurge?(e,t)=>{if(r?.[e]&&(clearTimeout(r[e]),r[e]=void 0),t&&0!==t&&r){let n=setTimeout(()=>{this.#P(e)?(this.#L(this.#d[e],"expire"),r[e]=void 0):i(e,s(e))},t+1);n.unref&&n.unref(),r[e]=n}}:()=>{};this.#U=(r,i)=>{if(e[i]){let s=e[i],o=t[i];if(!s||!o)return;r.ttl=s,r.start=o,r.now=n||a();let l=r.now-o;r.remainingTTL=s-l}};let n=0,a=()=>{let e=this.#o.now();if(this.ttlResolution>0){n=e;let t=setTimeout(()=>n=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=e=>{let t=this.#c.get(e);return void 0===t?0:s(t)};let s=r=>{let i=e[r],s=t[r];return i&&s?i-((n||a())-s):1/0};this.#P=r=>{let i=t[r],s=e[r];return!!s&&!!i&&(n||a())-i>s}}#B=()=>{};#U=()=>{};#$=()=>{};#P=()=>!1;#D(){let e=new tg(this.#e);this.#u=0,this.#b=e,this.#F=t=>{this.#u-=e[t],e[t]=0},this.#M=(e,t,r,i)=>{if(!th(r)){if(this.#I(t))return this.backgroundFetchSize;if(i){if("function"!=typeof i)throw TypeError("sizeCalculation must be a function");if(!th(r=i(t,e)))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return r},this.#j=(t,r,i)=>{if(e[t]=r,this.#t){let r=this.#t-e[t];for(;this.#u>r;)this.#z(!0)}this.#u+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#u)}}#F=e=>{};#j=(e,t,r)=>{};#M=(e,t,r,i)=>{if(r||i)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#C({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#m;this.#V(t)&&((e||!this.#P(t))&&(yield t),t!==this.#g);)t=this.#p[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#g;this.#V(t)&&((e||!this.#P(t))&&(yield t),t!==this.#m);)t=this.#h[t]}#V(e){return void 0!==e&&this.#c.get(this.#d[e])===e}*entries(){for(let e of this.#C())void 0===this.#f[e]||void 0===this.#d[e]||this.#I(this.#f[e])||(yield[this.#d[e],this.#f[e]])}*rentries(){for(let e of this.#N())void 0===this.#f[e]||void 0===this.#d[e]||this.#I(this.#f[e])||(yield[this.#d[e],this.#f[e]])}*keys(){for(let e of this.#C()){let t=this.#d[e];void 0===t||this.#I(this.#f[e])||(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#d[e];void 0===t||this.#I(this.#f[e])||(yield t)}}*values(){for(let e of this.#C())void 0===this.#f[e]||this.#I(this.#f[e])||(yield this.#f[e])}*rvalues(){for(let e of this.#N())void 0===this.#f[e]||this.#I(this.#f[e])||(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#C()){let i=this.#f[r],n=this.#I(i)?i.__staleWhileFetching:i;if(void 0!==n&&e(n,this.#d[r],this))return this.#H(this.#d[r],t)}}forEach(e,t=this){for(let r of this.#C()){let i=this.#f[r],n=this.#I(i)?i.__staleWhileFetching:i;void 0!==n&&e.call(t,n,this.#d[r],this)}}
18rforEach(e,t=this){for(let r of this.#N()){let i=this.#f[r],n=this.#I(i)?i.__staleWhileFetching:i;void 0!==n&&e.call(t,n,this.#d[r],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#P(t)&&(this.#L(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#c.get(e);if(void 0===t)return;let r=this.#f[t],i=this.#I(r)?r.__staleWhileFetching:r;if(void 0===i)return;let n={value:i};if(this.#_&&this.#w){let e=this.#_[t],r=this.#w[t];e&&r&&(n.ttl=e-(this.#o.now()-r),n.start=Date.now())}return this.#b&&(n.size=this.#b[t]),n}dump(){let e=[];for(let t of this.#C({allowStale:!0})){let r=this.#d[t],i=this.#f[t],n=this.#I(i)?i.__staleWhileFetching:i;if(void 0===n||void 0===r)continue;let a={value:n};if(this.#_&&this.#w){a.ttl=this.#_[t];let e=this.#o.now()-this.#w[t];a.start=Math.floor(Date.now()-e)}this.#b&&(a.size=this.#b[t]),e.unshift([r,a])}return e}load(e){for(let[t,r]of(this.clear(),e)){if(r.start){let e=Date.now()-r.start;r.start=this.#o.now()-e}this.#q(t,r.value,r)}}set(e,t,r={}){let{status:i=tu.hasSubscribers?{}:void 0}=r;r.status=i,i&&(i.op="set",i.key=e,void 0!==t&&(i.value=t),i.cache=this);let n=this.#q(e,t,r);return i&&tu.hasSubscribers&&tu.publish(i),n}
18#q(e,t,r,i){let{ttl:n=this.ttl,start:a,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:l}=r,u=this.#I(t);if(void 0===t)return l&&(l.set="deleted"),this.delete(e),this;let{noUpdateTTL:c=this.noUpdateTTL}=r;l&&!u&&(l.value=t);let d=this.#M(e,t,r.size||0,o,l);if(this.maxEntrySize&&d>this.maxEntrySize)return this.#L(e,"set"),l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this;let f=0===this.#l?void 0:this.#c.get(e);if(void 0===f)f=0===this.#l?this.#m:0!==this.#y.length?this.#y.pop():this.#l===this.#e?this.#z(!1):this.#l,this.#d[f]=e,this.#f[f]=t,this.#c.set(e,f),this.#h[this.#m]=f,this.#p[f]=this.#m,this.#m=f,this.#l++,this.#j(f,d,l),l&&(l.set="add"),c=!1,this.#T&&!u&&this.#i?.(t,e,"add");else{this.#O(f);let r=this.#f[f];if(t!==r){if(!s)if(this.#I(r)){r!==i&&r.__abortController.abort(Error("replaced"));let{__staleWhileFetching:n}=r;void 0!==n&&n!==t&&(this.#S&&this.#r?.(n,e,"set"),this.#x&&this.#v?.push([n,e,"set"]))}else this.#S&&this.#r?.(r,e,"set"),this.#x&&this.#v?.push([r,e,"set"]);if(this.#F(f),this.#j(f,d,l),this.#f[f]=t,!u){let i=r&&this.#I(r)?r.__staleWhileFetching:r,n=void 0===i?"add":t!==i?"replace":"update";l&&(l.set=n,void 0!==i&&(l.oldValue=i)),this.#T&&this.onInsert?.(t,e,n)}}else u||(l&&(l.set="update"),this.#T&&this.onInsert?.(t,e,"update"))}if(0===n||this.#_||this.#R(),this.#_&&(c||this.#$(f,n,a),l&&this.#U(l,f)),!s&&this.#x&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#n?.(...t)}return this}pop(){try{for(;this.#l;){let e=this.#f[this.#g];if(this.#z(!0),this.#I(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#x&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#n?.(...t)}}}#z(e){let t=this.#g,r=this.#d[t],i=this.#f[t],n=this.#I(i);n&&i.__abortController.abort(Error("evicted"));let a=n?i.__staleWhileFetching:i;return(this.#S||this.#x)&&void 0!==a&&(this.#S&&this.#r?.(a,r,"evict"),this.#x&&this.#v?.push([a,r,"evict"])),this.#F(t),this.#A?.[t]&&(clearTimeout(this.#A[t]),this.#A[t]=void 0),e&&(this.#d[t]=void 0,this.#f[t]=void 0,this.#y.push(t)),1===this.#l?(this.#g=this.#m=0,this.#y.length=0):this.#g=this.#h[t],this.#c.delete(r),this.#l--,t}has(e,t={}){let{status:r=tu.hasSubscribers?{}:void 0}=t;t.status=r,r&&(r.op="has",r.key=e,r.cache=this);let i=this.#W(e,t);return tu.hasSubscribers&&tu.publish(r),i}#W(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t,n=this.#c.get(e);if(void 0!==n){let e=this.#f[n];if(this.#I(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#P(n))return r&&this.#B(n),i&&(i.has="hit",this.#U(i,n)),!0;i&&(i.has="stale",this.#U(i,n))}else i&&(i.has="miss");return!1}peek(e,t={}){let{status:r=tu.hasSubscribers||tu.hasSubscribers?{}:void 0}=t;r&&(r.op="peek",r.key=e,r.cache=this),t.status=r;let i=this.#K(e,t);return tu.hasSubscribers&&tu.publish(r),i}#K(e,t){let{status:r,allowStale:i=this.allowStale}=t,n=this.#c.get(e);if(void 0===n||!i&&this.#P(n)){r&&(r.peek=void 0===n?"miss":"stale");return}let a=this.#f[n],s=this.#I(a)?a.__staleWhileFetching:a;return r&&(void 0!==s?(r.peek="hit",r.value=s):r.peek="miss"),s}#k(e,t,r,i){let n=void 0===t?void 0:this.#f[t];if(this.#I(n))return n;let a=new AbortController,{signal:s}=r;s?.addEventListener("abort",()=>a.abort(s.reason),{signal:a.signal});let o={signal:a.signal,options:r,context:i},l=(i,n=!1)=>{let{aborted:s}=a.signal,l=r.ignoreFetchAbort&&void 0!==i,c=r.ignoreFetchAbort||!!(r.allowStaleOnFetchAbort&&void 0!==i);if(r.status&&(s&&!n?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,l&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!l&&!n)return u(a.signal.reason,c);let f=this.#f[t];return(f===d||void 0===f&&l&&n)&&(void 0===i?void 0!==d.__staleWhileFetching?this.#f[t]=d.__staleWhileFetching:this.#L(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.#q(e,i,o.options,d))),i},u=(i,n)=>{let{aborted:s}=a.signal,o=s&&r.allowStaleOnFetchAbort,l=o||r.allowStaleOnFetchRejection,u=l||r.noDeleteOnFetchRejection;if(this.#f[t]===d&&(u&&(n||void 0!==d.__staleWhileFetching)?o||(this.#f[t]=d.__staleWhileFetching):this.#L(e,"fetch")),l)return r.status&&void 0!==d.__staleWhileFetching&&(r.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw i},c=(t,i)=>{let s=this.#a?.(e,n,o);a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))}),s&&s instanceof Promise?s.then(e=>t(void 0===e?void 0:e),i):void 0!==s&&t(s)};
18r.status&&(r.status.fetchDispatched=!0);let d=new Promise(c).then(l,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),u(e,!1))),f=Object.assign(d,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return void 0===t?(this.#q(e,f,{...o.options,status:void 0}),t=this.#c.get(e)):this.#f[t]=f,f}#I(e){return!!this.#E&&!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(e,t={}){let r=tu.hasSubscribers,{status:i=tu.hasSubscribers||tu.hasSubscribers?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let n=this.#G(e,t);return i&&r&&(i.trace=!0,tu.tracePromise(()=>n,i).catch(()=>{})),n}async #G(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:h=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=!1,status:m,signal:y}=t;if(m&&(m.op="fetch",m.key=e,g&&(m.forceRefresh=!0),m.cache=this),!this.#E)return m&&(m.fetch="get"),this.#H(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:m});let v={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:s,size:o,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:h,ignoreFetchAbort:f,status:m,signal:y},b=this.#c.get(e);if(void 0===b){m&&(m.fetch="miss");let t=this.#k(e,b,v,p);return t.__returned=t}{let t=this.#f[b];if(this.#I(t)){let e=r&&void 0!==t.__staleWhileFetching;return m&&(m.fetch="inflight",e&&(m.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let n=this.#P(b);if(!g&&!n)return m&&(m.fetch="hit"),this.#O(b),i&&this.#B(b),m&&this.#U(m,b),t;let a=this.#k(e,b,v,p),s=void 0!==a.__staleWhileFetching&&r;return m&&(m.fetch=n?"stale":"refresh",s&&n&&(m.returnedStale=!0)),s?a.__staleWhileFetching:a.__returned=a}}forceFetch(e,t={}){let r=tu.hasSubscribers,{status:i=tu.hasSubscribers||tu.hasSubscribers?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let n=this.#Z(e,t);return i&&r&&(i.trace=!0,tu.tracePromise(()=>n,i).catch(()=>{})),n}async #Z(e,t={}){let r=await this.#G(e,t);if(void 0===r)throw Error("fetch() returned undefined");return r}memo(e,t={}){let{status:r=tu.hasSubscribers?{}:void 0}=t;t.status=r,r&&(r.op="memo",r.key=e,t.context&&(r.context=t.context),r.cache=this);let i=this.#X(e,t);return r&&(r.value=i),tu.hasSubscribers&&tu.publish(r),i}#X(e,t={}){let r=this.#s;if(!r)throw Error("no memoMethod provided to constructor");let{context:i,status:n,forceRefresh:a,...s}=t;n&&a&&(n.forceRefresh=!0);let o=this.#H(e,s),l=a||void 0===o;if(n&&(n.memo=l?"miss":"hit",l||(n.value=o)),!l)return o;let u=r(e,o,{options:s,context:i});return n&&(n.value=u),this.#q(e,u,s),u}get(e,t={}){let{status:r=tu.hasSubscribers?{}:void 0}=t;t.status=r,r&&(r.op="get",r.key=e,r.cache=this);let i=this.#H(e,t);return r&&(void 0!==i&&(r.value=i),tu.hasSubscribers&&tu.publish(r)),i}#H(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,s=this.#c.get(e);if(void 0===s){a&&(a.get="miss");return}let o=this.#f[s],l=this.#I(o);return a&&this.#U(a,s),this.#P(s)?l?(a&&(a.get="stale-fetching"),r&&void 0!==o.__staleWhileFetching?(a&&(a.returnedStale=!0),o.__staleWhileFetching):void 0):(n||this.#L(e,"expire"),a&&(a.get="stale"),r?(a&&(a.returnedStale=!0),o):void 0):(a&&(a.get=l?"fetching":"hit"),this.#O(s),i&&this.#B(s),l?o.__staleWhileFetching:o)}#J(e,t){this.#p[t]=e,this.#h[e]=t}#O(e){e!==this.#m&&(e===this.#g?this.#g=this.#h[e]:this.#J(this.#p[e],this.#h[e]),this.#J(this.#m,e),this.#m=e)}delete(e){return this.#L(e,"delete")}#L(e,t){tu.hasSubscribers&&tu.publish({op:"delete",delete:t,key:e,cache:this});let r=!1;if(0!==this.#l){let i=this.#c.get(e);if(void 0!==i)if(this.#A?.[i]&&(clearTimeout(this.#A[i]),this.#A[i]=void 0),r=!0,
181===this.#l)this.#Y(t);else{this.#F(i);let r=this.#f[i];if(this.#I(r)?r.__abortController.abort(Error("deleted")):(this.#S||this.#x)&&(this.#S&&this.#r?.(r,e,t),this.#x&&this.#v?.push([r,e,t])),this.#c.delete(e),this.#d[i]=void 0,this.#f[i]=void 0,i===this.#m)this.#m=this.#p[i];else if(i===this.#g)this.#g=this.#h[i];else{let e=this.#p[i];this.#h[e]=this.#h[i];let t=this.#h[i];this.#p[t]=this.#p[i]}this.#l--,this.#y.push(i)}}if(this.#x&&this.#v?.length){let e=this.#v,t;for(;t=e?.shift();)this.#n?.(...t)}return r}clear(){return this.#Y("delete")}#Y(e){for(let t of this.#N({allowStale:!0})){let r=this.#f[t];if(this.#I(r))r.__abortController.abort(Error("deleted"));else{let i=this.#d[t];this.#S&&this.#r?.(r,i,e),this.#x&&this.#v?.push([r,i,e])}}if(this.#c.clear(),this.#f.fill(void 0),this.#d.fill(void 0),this.#_&&this.#w){for(let e of(this.#_.fill(0),this.#w.fill(0),this.#A??[]))void 0!==e&&clearTimeout(e);this.#A?.fill(void 0)}if(this.#b&&this.#b.fill(0),this.#g=0,this.#m=0,this.#y.length=0,this.#u=0,this.#l=0,this.#x&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#n?.(...t)}}},tv=class{constructor({envConfig:e,nearProvider:t,solverRelayApiKey:r}){this.route=e_.RouteEnum.NearWithdrawal,this.storageDepositCache=new ty({max:100,ttl:36e5}),this.accountExistenceCache=new ty({max:100,ttl:36e5}),this.envConfig=e,this.nearProvider=t,this.solverRelayApiKey=r}is(e){return e.route===e_.RouteEnum.NearWithdrawal}async supports(e){if(null!=e.routeConfig&&!this.is(e.routeConfig))return!1;let t=null!=this.parseAssetId(e.assetId);if(!t&&null!=e.routeConfig)throw new ew.UnsupportedAssetIdError(e.assetId,"`assetId` does not match `routeConfig`.");return t}parseAssetId(e){let t=eQ(e);return"nep141"===t.standard?Object.assign(t,{blockchain:eA.Chains.Near,bridgeName:null,address:t.contractId}):null}createWithdrawalIntents(e){tn(e.withdrawalParams);let t=[];return null!=e.feeEstimation.quote&&t.push({intent:"token_diff",diff:{[e.feeEstimation.quote.defuse_asset_identifier_in]:`-${e.feeEstimation.quote.amount_in}`,[e.feeEstimation.quote.defuse_asset_identifier_out]:e.feeEstimation.quote.amount_out},referral:e.referral}),t.push(function(e){if(e.assetId===tt&&void 0===e.msg)return{intent:"native_withdraw",receiver_id:e.destinationAddress,amount:e.amount.toString()};let{contractId:t,standard:r}=eY.utils.parseDefuseAssetId(e.assetId);return(0,eW.assert)("nep141"===r,"Only NEP-141 is supported"),void 0!==e.msg&&e.logger?.warn("min_gas is not set for direct-bridge withdrawal with msg, gas consumption is unpredictable"),{intent:"ft_withdraw",token:t,receiver_id:e.destinationAddress,amount:e.amount.toString(),storage_deposit:e.storageDeposit>0n?e.storageDeposit.toString():void 0,msg:e.msg,min_gas:null==e.msg?"17050000000000":void 0}}({assetId:e.withdrawalParams.assetId,destinationAddress:e.withdrawalParams.destinationAddress,amount:e.withdrawalParams.amount,storageDeposit:eX(e.feeEstimation,e_.RouteEnum.NearWithdrawal,"storageDepositFee"),msg:e.withdrawalParams.routeConfig?.msg,logger:e.logger})),Promise.resolve(t)}async validateWithdrawal(e){if(!1===(0,e0.validateAddress)(e.destinationAddress,eA.Chains.Near))throw new ew.InvalidDestinationAddressForWithdrawalError(e.destinationAddress,eA.Chains.Near);if(!1===eY.utils.isImplicitAccount(e.destinationAddress)&&await this.getCachedAccountExistenceCheck(e.destinationAddress)===!1)throw new to(e.destinationAddress)}async estimateWithdrawalFee(e){tn(e.withdrawalParams);let{contractId:t,standard:r}=eY.utils.parseDefuseAssetId(e.withdrawalParams.assetId);if((0,eW.assert)("nep141"===r,"Only NEP-141 is supported"),e.withdrawalParams.assetId===tt&&e.withdrawalParams.routeConfig?.msg===void 0)return{amount:0n,quote:null,underlyingFees:{[e_.RouteEnum.NearWithdrawal]:{storageDepositFee:0n}}};let[i,n]=await this.getCachedStorageDepositValue(t,e.withdrawalParams.destinationAddress);if(i<=n)return{amount:0n,quote:null,underlyingFees:{[e_.RouteEnum.NearWithdrawal]:{storageDepositFee:0n}}};let a=i-n,s=e.withdrawalParams.assetId===tt?null:await eJ({feeAmount:a,feeAssetId:tt,tokenAssetId:e.withdrawalParams.assetId,logger:e.logger,envConfig:this.envConfig,quoteOptions:e.quoteOptions,solverRelayApiKey:this.solverRelayApiKey});return{amount:s?BigInt(s.amount_in):a,quote:s,underlyingFees:{[e_.RouteEnum.NearWithdrawal]:{storageDepositFee:a}}}}async getCachedStorageDepositValue(e,t){let r=`${e}${t}`,i=this.storageDepositCache.get(r);if(void 0!==i)return i;let n=await Promise.all([e7({contractId:e,nearProvider:this.nearProvider}),e8({contractId:e,accountId:t,nearProvider:this.nearProvider})]);return n[1]>=n[0]&&this.storageDepositCache.set(r,n),n}async getCachedAccountExistenceCheck(e){let t=this.accountExistenceCac
18he.get(e);if(void 0!==t)return t;let r=await ta(this.nearProvider,e);return r&&this.accountExistenceCache.set(e,r),r}createWithdrawalIdentifier(e){return{landingChain:eA.Chains.Near,index:e.index,withdrawalParams:e.withdrawalParams,tx:e.tx}}async describeWithdrawal(e){return{status:"completed",txHash:e.tx.hash}}};e.s(["DirectBridge",0,tv],255832);let tb=[eA.Chains.Polygon,eA.Chains.BNB,eA.Chains.TON,eA.Chains.Optimism,eA.Chains.Avalanche,eA.Chains.Monad,eA.Chains.Stellar,eA.Chains.LayerX,eA.Chains.Adi,eA.Chains.Scroll,eA.Chains.Plasma],tw=tb.filter(e=>e.startsWith("eip155:"));e.s(["HotBridgeChains",0,tb,"HotBridgeEVMChains",0,tw],878621);var t_=eD,tA=class extends t_.BaseError{constructor(e,t){super("Withdrawal with given index is not found.",{metaMessages:[`TxHash: ${e}`,`Index: ${t}`],name:"HotWithdrawalNotFoundError"}),this.txHash=e,this.index=t}},tS=class extends t_.BaseError{constructor(){super("Hot bridge withdrawal fee request timed out.",{name:"HotWithdrawalApiFeeRequestTimeoutError"})}},tE=e.i(861488);let tx={[eA.Chains.BNB]:"nep245:v2_1.omni.hot.tg:56_11111111111111111111",[eA.Chains.Polygon]:"nep245:v2_1.omni.hot.tg:137_11111111111111111111",[eA.Chains.Monad]:"nep245:v2_1.omni.hot.tg:143_11111111111111111111",[eA.Chains.TON]:"nep245:v2_1.omni.hot.tg:1117_",[eA.Chains.Optimism]:"nep245:v2_1.omni.hot.tg:10_11111111111111111111",[eA.Chains.Avalanche]:"nep245:v2_1.omni.hot.tg:43114_11111111111111111111",[eA.Chains.Stellar]:"nep245:v2_1.omni.hot.tg:1100_111bzQBB5v7AhLyPMDwS8uJgQV24KaAPXtwyVWu2KXbbfQU6NXRCz",[eA.Chains.LayerX]:"nep245:v2_1.omni.hot.tg:196_11111111111111111111",[eA.Chains.Adi]:"nep245:v2_1.omni.hot.tg:36900_11111111111111111111",[eA.Chains.Scroll]:"nep245:v2_1.omni.hot.tg:534352_11111111111111111111",[eA.Chains.Plasma]:"nep245:v2_1.omni.hot.tg:9745_11111111111111111111"},tT={[eA.Chains.BNB]:tE.Network.Bnb,[eA.Chains.Polygon]:tE.Network.Polygon,[eA.Chains.Monad]:143,[eA.Chains.TON]:tE.Network.Ton,[eA.Chains.Optimism]:tE.Network.Optimism,[eA.Chains.Avalanche]:tE.Network.Avalanche,[eA.Chains.Stellar]:tE.Network.Stellar,[eA.Chains.LayerX]:tE.Network.Xlayer,[eA.Chains.Adi]:36900,[eA.Chains.Scroll]:tE.Network.Scroll,[eA.Chains.Plasma]:9745},tI=Object.fromEntries(Object.entries(tT).map(([e,t])=>[t,e]));function tk(e,t){return t.startsWith("eip155:")?`0x${e}`:e}function tO(e){(0,eW.assert)(tb.includes(e),`${e} is not a valid HOT Bridge blockchain. Supported values: ${tb.join()}`)}function tC(e){return e.length%2==0&&/^[0-9A-Fa-f]+$/.test(e)}let tN=e4.object({hash:e4.nullable(e4.string()),nonce:e4.string(),chain_id:e4.nullable(e4.number()),withdraw_asset:e4.nullable(e4.string()),withdraw_token:e4.nullable(e4.string()),withdraw_amount:e4.nullable(e4.string()),receiver_address:e4.nullable(e4.string()),signature:e4.nullable(e4.string()),near_tx_time:e4.nullable(e4.string()),near_tx_block:e4.nullable(e4.string()),destination_chain_block:e4.nullable(e4.string())}),tP=e4.object({near_trx:e4.nullable(e4.string()),withdrawals:e4.array(tN)});var tD=e.i(854449),tR=e.i(881837),t$=e.i(438239);async function tB(e,t,r){let i;try{i=await e.json()}catch(r){throw new eR.HttpRequestError({body:t,details:"Failed to deserialize JSON",cause:r instanceof Error?r:Error(String(r)),url:e.url})}let n=e4.safeParse(r,i);if(n.success)return n.output;throw new eR.HttpRequestError({body:t,details:"Failed to parse response JSON",cause:Error((0,t$.serialize)(n.issues)),url:e.url})}async function tL(e,t,r,i){let n=new URL(e,r?.baseUrl??tD.config.env.bridgeIndexerURL);if(t)for(let[e,r]of Object.entries(t))n.searchParams.set(e,r);return tB(await (0,tR.request)({url:n,timeout:r?.timeout,fetchOptions:r?.fetchOptions,retryOptions:r?.retryOptions,logger:r?.logger}),void 0,i)}async function tU(e,t){return tL("/api/v1/withdrawals",{near_trx:e},t,tP)}var tF=(0,ex.__exportAll)({BridgeIndexerResponseSchema:()=>tP,withdrawalsByNearTxHash:()=>tU}),tM=(0,ex.__exportAll)({httpClient:()=>tF}),tj=e.i(325118),tz=e.i(897436),tV=e.i(674758),tV=tV;let tH=e4.object({hash:e4.nullable(e4.string()),nonce:e4.string(),near_trx:e4.string(),verified_withdraw:e4.boolean(),chain_id:e4.number()}),tq=e4.object({hash:e4.nullable(e4.string()),nonce:e4.string(),near_trx:e4.string(),withdrawals:e4.array(tH)});var tW=class e{static{this.API_FALLBACK_TIMEOUT_MS=5e3}static{this.NEAR_RPC_TIMEOUT_MS=1e4}constructor({envConfig:t,hotSdk:r,solverRelayApiKey:i}){this.route=e_.RouteEnum.HotBridge,this.envConfig=t,this.hotSdk=r,this.solverRelayApiKey=i,this.noncesCache=new ty({max:50,ttl:36e5,fetchMethod:async(t,r,{context:i})=>(0,tj.withTimeout)(()=>this.hotSdk.near.parseWithdrawalNonces(i.hash,i.accountId),{timeout:e.NEAR_RPC_TIMEOUT_MS})})}getNoncesCacheKey(e){return`${e.hash}:${e.accountId}`}is(e){return e.route===e_.RouteEnum.HotBridge}async supports(e){if(null!=e.routeConfig&&!this.is(e.routeConfig))return!1;let t=null!=this.parseAssetId(e.assetId);if(!t&&null!=e.routeConfig)throw new ew.UnsupportedAssetIdError(e.assetId,"`assetId` does not match `routeConfig`.");return t}parseAssetId(e){let t,r=eQ(e);if(r.contractId!==tz.GlobalSettings.omniHotContract)return null;if("nep245"!==r.standard)throw new ew.UnsupportedAssetIdError(e,'Should start with "nep245:".');let[i,n]=tV.fromOmni(r.tokenId).split(":");if(null==i||null==n)throw new ew.UnsupportedAssetIdError(e,"Asset has invali
18d token id format.");try{t=function(e){let t=tI[e];if(null!=t)return t;throw Error(`Unsupported HOT Bridge chain = ${e}`)}(i)}catch{throw new ew.UnsupportedAssetIdError(e,"Asset belongs to unknown blockchain.")}return Object.assign(r,{blockchain:t,bridgeName:"hot"},"native"===n?{native:!0}:{address:n})}async createWithdrawalIntents(e){var t;let r=this.parseAssetId(e.withdrawalParams.assetId);if((0,eW.assert)(null!=r,"Asset is not supported"),null!=e.withdrawalParams.destinationMemo&&""!==e.withdrawalParams.destinationMemo)throw new ew.UnsupportedDestinationMemoError(r.blockchain,e.withdrawalParams.assetId);let i=[],n=eX(e.feeEstimation,e_.RouteEnum.HotBridge,"relayerFee"),a=eX(e.feeEstimation,e_.RouteEnum.HotBridge,"blockNumber");null!==e.feeEstimation.quote&&i.push({intent:"token_diff",diff:{[e.feeEstimation.quote.defuse_asset_identifier_in]:`-${e.feeEstimation.quote.amount_in}`,[e.feeEstimation.quote.defuse_asset_identifier_out]:e.feeEstimation.quote.amount_out},referral:e.referral});let s="native"in r,o=e.withdrawalParams.amount+(s?n:0n),l=await this.hotSdk.buildGaslessWithdrawIntent({feeToken:"native",feeAmount:n,blockNumber:a,chain:(tO(t=r.blockchain),tT[t]),token:s?"native":r.address,amount:o,receiver:e.withdrawalParams.destinationAddress});return(0,eW.assert)(l.amounts[0]===o.toString(),"Amount is not correct"),2===l.amounts.length&&(0,eW.assert)(l.amounts[1]===n.toString(),"Amount is not correct"),l.min_gas="91300000000000",i.push(l),i}async validateWithdrawal(e){let t=this.parseAssetId(e.assetId);if((0,eW.assert)(null!=t,"Asset is not supported"),tO(t.blockchain),!1===(0,e0.validateAddress)(e.destinationAddress,t.blockchain))throw new ew.InvalidDestinationAddressForWithdrawalError(e.destinationAddress,t.blockchain);if(t.blockchain===eA.Chains.Stellar){let r="native"in t?"native":t.address;if(!await this.hotSdk.stellar.isTrustlineExists(e.destinationAddress,r))throw new ew.TrustlineNotFoundError(e.destinationAddress,e.assetId,t.blockchain,r)}}async estimateWithdrawalFee(e){let t=this.parseAssetId(e.withdrawalParams.assetId);(0,eW.assert)(null!=t,"Asset is not supported"),tO(t.blockchain);let r=tx[t.blockchain],{gasPrice:i,blockNumber:n}=await (0,tj.withTimeout)(async()=>{var i;let n=await this.hotSdk.getGaslessWithdrawFee({chain:(tO(i=t.blockchain),tT[i]),token:"native"in t?"native":t.address,receiver:e.withdrawalParams.destinationAddress});return t.blockchain===eA.Chains.Plasma&&e.withdrawalParams.assetId!==r&&(n.gasPrice*=100n),n},{errorInstance:new tS,timeout:"u">typeof window?1e4:3e3}),a=e.withdrawalParams.assetId===r||0n===i?null:await eJ({feeAmount:i,feeAssetId:r,tokenAssetId:e.withdrawalParams.assetId,logger:e.logger,envConfig:this.envConfig,quoteOptions:e.quoteOptions,solverRelayApiKey:this.solverRelayApiKey});return{amount:a?BigInt(a.amount_in):i,quote:a,underlyingFees:{[e_.RouteEnum.HotBridge]:{relayerFee:i,blockNumber:n}}}}createWithdrawalIdentifier(e){let t=this.parseAssetId(e.withdrawalParams.assetId);return(0,eW.assert)(null!=t,"Asset is not supported"),{landingChain:t.blockchain,index:e.index,withdrawalParams:e.withdrawalParams,tx:e.tx}}async describeWithdrawal(e){let t=this.getNoncesCacheKey(e.tx),r=await this.noncesCache.fetch(t,{context:e.tx});if(null==r)throw new tA(e.tx.hash,e.index);let i=r[e.index];if(null==i)throw new tA(e.tx.hash,e.index);let n=await this.hotSdk.getGaslessWithdrawStatus(i.toString());if("CANCELED"===n)return{status:"failed",reason:"Withdrawal was cancelled"};let a=e.landingChain.startsWith("eip155:"),s=e.landingChain===eA.Chains.TON;if(a||e.landingChain===eA.Chains.Stellar||s)try{e.logger?.info("Fetching withdrawal hash from bridge indexer",{nearTxHash:e.tx.hash,nonce:i.toString()});let t=await this.fetchWithdrawalHashBridgeIndexer(e.tx.hash,i.toString(),e.logger);if(null!==t)return e.logger?.info("Bridge indexer found withdrawal hash",{withdrawalHash:t,nearTxHash:e.tx.hash,nonce:i.toString()}),{status:"completed",txHash:t}}catch(r){if(s)return e.logger?.error("Bridge indexer failed unexpectedly, keeping TON withdrawal pending",{nearTxHash:e.tx.hash,nonce:i.toString(),error:r}),{status:"pending"};e.logger?.error("Bridge indexer failed unexpectedly, trying HOT API fallback",{nearTxHash:e.tx.hash,nonce:i.toString(),error:r});let t=await this.fetchWithdrawalHashFromApi(e.tx.hash,i,e.logger);if(null!=t)return e.logger?.info("HOT API fallback found withdrawal hash",{withdrawalHash:t,nearTxHash:e.tx.hash,nonce:i.toString()}),{status:"completed",txHash:tk(t,e.landingChain)}}else{if("COMPLETED"===n)return{status:"completed",txHash:null};if("string"==typeof n)return tC(n)?{status:"completed",txHash:tk(n,e.landingChain)}:(e.logger?.warn("HOT Bridge incorrect destination tx hash detected",{value:n}),{status:"completed",txHash:null});let t=await this.fetchWithdrawalHashFromApi(e.tx.hash,i,e.logger);if(null!=t)return{status:"completed",txHash:tk(t,e.landingChain)}}return{status:"pending"}}async fetchWithdrawalHashBridgeIndexer(e,t,r){let{withdrawals:i}=await tM.httpClient.withdrawalsByNearTxHash(e,{timeout:"u">typeof window?1e4:3e3,logger:r}),n=i.find(e=>e.nonce===t);return void 0===n?(r?.info("HOT Bridge indexer withdrawal hash not found",{nearTxHash:e,nonce:t.toString()}),null):null===n.hash||""===n.hash?(r?.info(`HOT Bridge returned invali
18d hash, expected a non empty string, got ${n.hash}`,{nearTxHash:e,nonce:t.toString()}),null):n.hash}async fetchWithdrawalHashFromApi(t,r,i){try{let n=await (await (0,tj.withTimeout)(()=>this.hotSdk.api.requestApi(`/api/v1/evm/bridge_withdrawal_hash?near_trx=${t}`,{method:"GET"}),{timeout:e.API_FALLBACK_TIMEOUT_MS})).json(),a=e4.safeParse(tq,n);if(!a.success)return i?.debug("HOT API response parse failed",{issues:a.issues}),null;let s=a.output.withdrawals.find(e=>e.nonce===r.toString());if(s?.hash){let e=s.hash.replace(/^0x/,"");if(tC(e))return i?.info("HOT withdrawal hash found via API fallback",{nearTxHash:t,nonce:r.toString()}),e}return null}catch(e){return i?.debug("HOT API fallback failed",{error:e,nearTxHash:t}),null}}};e.s(["HotBridge",0,tW],198769);var tK=class{constructor(){this.route=e_.RouteEnum.InternalTransfer}is(e){return e.route===this.route}async supports(e){return"routeConfig"in e&&null!=e.routeConfig&&this.is(e.routeConfig)}parseAssetId(){return null}createWithdrawalIntents(e){return Promise.resolve([{intent:"transfer",receiver_id:e.withdrawalParams.destinationAddress,tokens:{[e.withdrawalParams.assetId]:e.withdrawalParams.amount.toString()},memo:e.withdrawalParams.destinationMemo}])}async validateWithdrawal(e){if(!1===(0,e0.validateAddress)(e.destinationAddress,eA.Chains.Near))throw new ew.InvalidDestinationAddressForWithdrawalError(e.destinationAddress,"near-intents")}async estimateWithdrawalFee(){return{amount:0n,quote:null,underlyingFees:{[e_.RouteEnum.InternalTransfer]:null}}}createWithdrawalIdentifier(e){return{landingChain:eA.Chains.Near,index:e.index,withdrawalParams:e.withdrawalParams,tx:e.tx}}async describeWithdrawal(e){return{status:"completed",txHash:e.tx.hash}}};e.s(["IntentsBridge",0,tK],438763);var tG=eD,tZ=class extends tG.BaseError{constructor(e,t){super(`The token ${e} doesn't exist in destination chain ${t}`,{metaMessages:[`Token: ${e}`,`Destination Chain: ${t}`],name:"TokenNotFoundInDestinationChainError"}),this.token=e,this.destinationChain=t}},tX=class extends tG.BaseError{constructor(e,t){super("Invalid fee value",{metaMessages:[`Token: ${e}`,`Fee value: ${t}`],name:"InvalidFeeValueError"}),this.token=e}},tJ=class extends tG.BaseError{constructor(e){super("Omni storage balance of intents contract is too low to complete this transaction safely.",{metaMessages:[`Balance: ${e}`],name:"IntentsNearOmniAvailableBalanceTooLowError",details:`The available Omni storage balance for intents contract is ${e}, which is too low to complete this transaction safely. The balance needs to be topped up before retrying.`}),this.balance=e}},tY=class extends tG.BaseError{constructor(){super("Omni bridge withdrawal fee request timed out.",{name:"OmniWithdrawalApiFeeRequestTimeoutError"})}},tQ=class extends tG.BaseError{constructor(e){super("Insufficient utxo for withdrawal to a utxo chain.",{metaMessages:[`Destination Chain: ${e}`],name:"InsufficientUtxoForOmniBridgeWithdrawalError"}),this.destinationChain=e}};let t0="nep141:wrap.near",t1="omni.bridge.near",t2="INTENTS_STORAGE_BALANCE",t6=["nep141:lsd-usdt.rhealab.near"],t5=Object.freeze({status:"aborted"});function t4(e,t,r){function i(r,i){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:i,constr:s,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,i);let n=s.prototype,a=Object.keys(n);for(let e=0;e<a.length;e++){let t=a[e];t in r||(r[t]=n[t].bind(r))}}let n=r?.Parent??Object;class a extends n{}function s(e){var t;let n=r?.Parent?new a:this;for(let r of(i(n,e),(t=n._zod).deferred??(t.deferred=[]),n._zod.deferred))r();return n}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}let t3=Symbol("zod_brand");class t8 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}
18class t7 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(F=globalThis).__zod_globalConfig??(F.__zod_globalConfig={});let t9=globalThis.__zod_globalConfig;function re(e){return e&&Object.assign(t9,e),t9}function rt(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function rr(e,t="|"){return e.map(e=>rE(e)).join(t)}function ri(e,t){return"bigint"==typeof t?t.toString():t}function rn(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ra(e){return null==e}function rs(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ro(e,t){let r=e/t,i=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}e.s(["$ZodAsyncError",0,t8,"$ZodEncodeError",0,t7,"$brand",0,t3,"$constructor",0,t4,"NEVER",0,t5,"config",0,re,"globalConfig",0,t9],863631);let rl=Symbol("evaluating");function ru(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==rl)return void 0===i&&(i=rl,i=r()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function rc(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function rd(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function rf(e){return JSON.stringify(e)}function rh(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let rp="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rg(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let rm=rn(()=>{if(t9.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function ry(e){if(!1===rg(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==rg(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function rv(e){return ry(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let rb=new Set(["string","number","symbol"]),rw=new Set(["string","number","bigint","boolean","symbol","undefined"]);function r_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rA(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}function rS(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function rE(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function rx(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let rT={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},rI={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function rk(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function rO(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function rC(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function rN(e){return"string"==typeof e?e:e?.message}function rP(e,t,r){let i=e.message?e.message:rN(e.inst?._zod.def?.error?.(e))??rN(t?.error?.(e))??rN(r.customError?.(e))??rN(r.localeError?.(e))??"Invalid input",{inst:n,continue:a,input:s,...o}=e;return o.path??(o.path=[]),o.message=i,t?.reportInput&&(o.input=s),o}function rD(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function rR(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function r$(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function rB(...e){let[t,r,i]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:i}:{...t}}function rL(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function rU(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function rF(){let e,t,r;return{localeError:(e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"},i=>
18{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;return`Invalid input: expected ${e}, received ${n}`}case"invalid_value":if(1===i.values.length)return`Invalid input: expected ${rE(i.values[0])}`;return`Invalid option: expected one of ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Too big: expected ${i.origin??"value"} to have ${t}${i.maximum.toString()} ${r.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Too small: expected ${i.origin} to have ${t}${i.minimum.toString()} ${r.unit}`;return`Too small: expected ${i.origin} to be ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Invalid string: must start with "${i.prefix}"`;if("ends_with"===i.format)return`Invalid string: must end with "${i.suffix}"`;if("includes"===i.format)return`Invalid string: must include "${i.includes}"`;if("regex"===i.format)return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${t[i.format]??i.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":if(i.options&&Array.isArray(i.options)&&i.options.length>0){let e=i.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}})}}e.s(["BIGINT_FORMAT_RANGES",0,rI,"Class",0,class{constructor(...e){}},"NUMBER_FORMAT_RANGES",0,rT,"aborted",0,rk,"allowsEval",0,rm,"assert",0,function(e){},"assertEqual",0,function(e){return e},"assertIs",0,function(e){},"assertNever",0,function(e){throw Error("Unexpected value in exhaustive check")},"assertNotEqual",0,function(e){return e},"assignProp",0,rc,"base64ToUint8Array",0,rL,"base64urlToUint8Array",0,function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return rL(t+r)},"cached",0,rn,"captureStackTrace",0,rp,"cleanEnum",0,function(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])},"cleanRegex",0,rs,"clone",0,rA,"cloneDef",0,function(e){return rd(e._zod.def)},"createTransparentProxy",0,function(e){let t;return new Proxy({},{get:(r,i,n)=>(t??(t=e()),Reflect.get(t,i,n)),set:(r,i,n,a)=>(t??(t=e()),Reflect.set(t,i,n,a)),has:(r,i)=>(t??(t=e()),Reflect.has(t,i)),deleteProperty:(r,i)=>(t??(t=e()),Reflect.deleteProperty(t,i)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,i)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)),defineProperty:(r,i,n)=>(t??(t=e()),Reflect.defineProperty(t,i,n))})},"defineLazy",0,ru,"esc",0,rf,"escapeRegex",0,r_,"explicitlyAborted",0,rO,"extend",0,function(e,t){if(!ry(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=rd(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return rc(this,"shape",r),r}});return rA(e,i)},"finalizeIssue",0,rP,"floatSafeRemainder",0,ro,"getElementAtPath",0,function(e,t){return t?t.reduce((e,t)=>e?.[t],e):e},"getEnumValues",0,rt,"getLengthableOrigin",0,rR,"getParsedType",0,e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},"getSizableOrigin",0,rD,"hexToUint8Array",0,function(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)r[e/2]=Number.parseInt(t.slice(e,e+2),16);return r},"isObject",0,rg,"isPlainObject",0,ry,"issue",0,rB,"joinValues",0,rr,"jsonStringifyReplacer",0,ri,"merge",0,function(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=rd(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return rc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return rA(e,r)},"mergeDefs",0,rd,"normalizeParams",0,rS,"nullish",0,ra,"numKeys",0,function(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t},"objectClone",0,function(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))},"omit",0,function(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let n=rd(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return rc(this,"shape",i),i},checks:[]});return rA(e,n)},"optionalKeys",0,rx,"parsedType",0,r$,"partial",0,function(e,t,r){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let n=rd(t._zod.def,{get shape(){let i=t._zod.def.shape,n={...i};if(r)for(let t in r){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);r[t]&&(n[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(let t in i)n[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return rc(this,"shape",n),n},checks:[]});return rA(t,n)},"pick",0,function(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let n=rd(e._zod.def,{get shape(){let e={};for(let i in t){if(!(i in r.shape))throw Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=r.shape[i])}return rc(this,"shape",e),e},checks:[]});return rA(e,n)}
18,"prefixIssues",0,rC,"primitiveTypes",0,rw,"promiseAllObject",0,function(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=e[i];return r})},"propertyKeyTypes",0,rb,"randomString",0,function(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r},"required",0,function(e,t,r){let i=rd(t._zod.def,{get shape(){let i=t._zod.def.shape,n={...i};if(r)for(let t in r){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);r[t]&&(n[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(let t in i)n[t]=new e({type:"nonoptional",innerType:i[t]});return rc(this,"shape",n),n}});return rA(t,i)},"safeExtend",0,function(e,t){if(!ry(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=rd(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return rc(this,"shape",r),r}});return rA(e,r)},"shallowClone",0,rv,"slugify",0,rh,"stringifyPrimitive",0,rE,"uint8ArrayToBase64",0,rU,"uint8ArrayToBase64url",0,function(e){return rU(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},"uint8ArrayToHex",0,function(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")},"unwrapMessage",0,rN],459669),re(rF()),e.s([],584377),e.i(584377),e.s([],113188),e.i(113188),e.i(863631);let rM=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ri,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},rj=t4("$ZodError",rM),rz=t4("$ZodError",rM,{Parent:Error});function rV(e,t=e=>e.message){let r={},i=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function rH(e,t=e=>e.message){let r={_errors:[]},i=(e,n=[])=>{for(let a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>i({issues:e},[...n,...a.path]));else if("invalid_key"===a.code)i({issues:a.issues},[...n,...a.path]);else if("invalid_element"===a.code)i({issues:a.issues},[...n,...a.path]);else{let e=[...n,...a.path];if(0===e.length)r._errors.push(t(a));else{let i=r,n=0;for(;n<e.length;){let r=e[n];n===e.length-1?(i[r]=i[r]||{_errors:[]},i[r]._errors.push(t(a))):i[r]=i[r]||{_errors:[]},i=i[r],n++}}}};return i(e),r}function rq(e,t=e=>e.message){let r={errors:[]},i=(e,n=[])=>{var a,s;for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>i({issues:e},[...n,...o.path]));else if("invalid_key"===o.code)i({issues:o.issues},[...n,...o.path]);else if("invalid_element"===o.code)i({issues:o.issues},[...n,...o.path]);else{let e=[...n,...o.path];if(0===e.length){r.errors.push(t(o));continue}let i=r,l=0;for(;l<e.length;){let r=e[l],n=l===e.length-1;"string"==typeof r?(i.properties??(i.properties={}),(a=i.properties)[r]??(a[r]={errors:[]}),i=i.properties[r]):(i.items??(i.items=[]),(s=i.items)[r]??(s[r]={errors:[]}),i=i.items[r]),n&&i.errors.push(t(o)),l++}}};return i(e),r}function rW(e){let t=[];for(let r of e.map(e=>"object"==typeof e?e.key:e))"number"==typeof r?t.push(`[${r}]`):"symbol"==typeof r?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function rK(e){let t=[];for(let r of[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length))t.push(`â ${r.message}`),r.path?.length&&t.push(` â at ${rW(r.path)}`);return t.join("\n")}e.s(["$ZodError",0,rj,"$ZodRealError",0,rz,"flattenError",0,rV,"formatError",0,rH,"prettifyError",0,rK,"toDotPath",0,rW,"treeifyError",0,rq],54347);let rG=e=>(t,r,i,n)=>{let a=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new t8;if(s.issues.length){let t=new(n?.Err??e)(s.issues.map(e=>rP(e,a,re())));throw rp(t,n?.callee),t}return s.value},rZ=rG(rz),rX=e=>async(t,r,i,n)=>{let a=i?{...i,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(n?.Err??e)(s.issues.map(e=>rP(e,a,re())));throw rp(t,n?.callee),t}return s.value},rJ=rX(rz),rY=e=>(t,r,i)=>{let n=i?{...i,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},n);if(a instanceof Promise)throw new t8;return a.issues.length?{success:!1,error:new(e??rj)(a.issues.map(e=>rP(e,n,re())))}:{success:!0,data:a.value}},rQ=rY(rz),r0=e=>async(t,r,i)=>{let n=i?{...i,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},n);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>rP(e,n,re())))}:{success:!0,data:a.value}},r1=r0(rz),r2=e=>(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return rG(e)(t,r,n)},r6=r2(rz),r5=e=>(t,r,i)=>rG(e)(t,r,i),r4=r5(rz),r3=e=>async(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return rX(e)(t,r,n)},r8=r3(rz),r7=e=>async(t,r,i)=>rX(e)(t,r,i),r9=r7(rz),ie=e=>(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return rY(e)(t,r,n)},it=ie(rz),ir=e=>(t,r,i)=>
18rY(e)(t,r,i),ii=ir(rz),ia=e=>async(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return r0(e)(t,r,n)},is=ia(rz),io=e=>async(t,r,i)=>r0(e)(t,r,i),il=io(rz);e.s(["_decode",0,r5,"_decodeAsync",0,r7,"_encode",0,r2,"_encodeAsync",0,r3,"_parse",0,rG,"_parseAsync",0,rX,"_safeDecode",0,ir,"_safeDecodeAsync",0,io,"_safeEncode",0,ie,"_safeEncodeAsync",0,ia,"_safeParse",0,rY,"_safeParseAsync",0,r0,"decode",0,r4,"decodeAsync",0,r9,"encode",0,r6,"encodeAsync",0,r8,"parse",0,rZ,"parseAsync",0,rJ,"safeDecode",0,ii,"safeDecodeAsync",0,il,"safeEncode",0,it,"safeEncodeAsync",0,is,"safeParse",0,rQ,"safeParseAsync",0,r1],831679),e.i(831679),e.i(54347);let iu=/^[cC][0-9a-z]{6,}$/,ic=/^[0-9a-z]+$/,id=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ih=/^[0-9a-vA-V]{20}$/,ip=/^[A-Za-z0-9]{27}$/,ig=/^[a-zA-Z0-9_-]{21}$/,im=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,iy=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,iv=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ib=iv(4),iw=iv(6),i_=iv(7),iA=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,iS=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function iE(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let ix=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,iT=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,iI=e=>{let t=r_(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},ik=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,iO=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,iC=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,iN=/^[A-Za-z0-9_-]*$/,iP=/^https?$/,iD=/^\+[1-9]\d{6,14}$/,iR="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",i$=RegExp(`^${iR}$`);function iB(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function iL(e){return RegExp(`^${iB(e)}$`)}function iU(e){let t=iB({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${r.join("|")})`;return RegExp(`^${iR}T(?:${i})$`)}let iF=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},iM=/^-?\d+n?$/,ij=/^-?\d+$/,iz=/^-?\d+(?:\.\d+)?$/,iV=/^(?:true|false)$/i,iH=/^null$/i,iq=/^undefined$/i,iW=/^[^A-Z]*$/,iK=/^[^a-z]*$/;function iG(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function iZ(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let iX=iG(22,"=="),iJ=iZ(22),iY=iG(27,"="),iQ=iZ(27),i0=iG(43,"="),i1=iZ(43),i2=iG(64,""),i6=iZ(64),i5=iG(86,"=="),i4=iZ(86);e.s(["base64",0,iC,"base64url",0,iN,"bigint",0,iM,"boolean",0,iV,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,ik,"cidrv6",0,iO,"cuid",0,iu,"cuid2",0,ic,"date",0,i$,"datetime",0,iU,"domain",0,/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,"duration",0,im,"e164",0,iD,"email",0,iA,"emoji",0,iE,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,iy,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"httpProtocol",0,iP,"idnEmail",0,iS,"integer",0,ij,"ipv4",0,ix,"ipv6",0,iT,"ksuid",0,ip,"lowercase",0,iW,"mac",0,iI,"md5_base64",0,iX,"md5_base64url",0,iJ,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,ig,"null",0,iH,"number",0,iz,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\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,}))$/,"sha1_base64",0,iY,"sha1_base64url",0,iQ,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,i0,"sha256_base64url",0,i1,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,i2,"sha384_base64url",0,i6,"sha384_hex",0,/^[0-9a-fA-F]{96}
18$/,"sha512_base64",0,i5,"sha512_base64url",0,i4,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,iF,"time",0,iL,"ulid",0,id,"undefined",0,iq,"unicodeEmail",0,iS,"uppercase",0,iK,"uuid",0,iv,"uuid4",0,ib,"uuid6",0,iw,"uuid7",0,i_,"xid",0,ih],891724);let i3=t4("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),i8={number:"number",bigint:"bigint",object:"date"},i7=t4("$ZodCheckLessThan",(e,t)=>{i3.init(e,t);let r=i8[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<i&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),i9=t4("$ZodCheckGreaterThan",(e,t)=>{i3.init(e,t);let r=i8[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>i&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ne=t4("$ZodCheckMultipleOf",(e,t)=>{i3.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0===ro(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),nt=t4("$ZodCheckNumberFormat",(e,t)=>{i3.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[n,a]=rT[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=a,r&&(i.pattern=ij)}),e._zod.check=s=>{let o=s.value;if(r){if(!Number.isInteger(o))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?s.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):s.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}))}o<n&&s.issues.push({origin:"number",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>a&&s.issues.push({origin:"number",input:o,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),nr=t4("$ZodCheckBigIntFormat",(e,t)=>{i3.init(e,t);let[r,i]=rI[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=r,n.maximum=i}),e._zod.check=n=>{let a=n.value;a<r&&n.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>i&&n.issues.push({origin:"bigint",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),ni=t4("$ZodCheckMaxSize",(e,t)=>{var r;i3.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!ra(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let i=r.value;i.size<=t.maximum||r.issues.push({origin:rD(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),nn=t4("$ZodCheckMinSize",(e,t)=>{var r;i3.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!ra(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let i=r.value;i.size>=t.minimum||r.issues.push({origin:rD(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),na=t4("$ZodCheckSizeEquals",(e,t)=>{var r;i3.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!ra(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=r=>{let i=r.value,n=i.size;if(n===t.size)return;let a=n>t.size;r.issues.push({origin:rD(i),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ns=t4("$ZodCheckMaxLength",(e,t)=>{var r;i3.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!ra(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let i=r.value;if(i.length<=t.maximum)return;let n=rR(i);r.issues.push({origin:n,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),no=t4("$ZodCheckMinLength",(e,t)=>{var r;i3.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!ra(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let i=r.value;if(i.length>=t.minimum)return;let n=rR(i);r.issues.push({origin:n,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),nl=t4("$ZodCheckLengthEquals",(e,t)=>{var r;i3.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!ra(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let i=r.value,n=i.length;if(n===t.length)return;let a=rR(i),s=n>t.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),nu=t4("$ZodCheckStringFormat",(e,t)=>{var r,i;i3.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),nc=t4("$ZodCheckRegex",(e,t)=>{nu.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nd=t4("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=iW),nu.init(e,t)}),nf=t4("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=iK),nu.init(e,t)}),nh=t4("$ZodCheckIncludes",(e,t)=>{i3.init(e,t);let r=r_(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input
18:r.value,inst:e,continue:!t.abort})}}),np=t4("$ZodCheckStartsWith",(e,t)=>{i3.init(e,t);let r=RegExp(`^${r_(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),ng=t4("$ZodCheckEndsWith",(e,t)=>{i3.init(e,t);let r=RegExp(`.*${r_(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function nm(e,t,r){e.issues.length&&t.issues.push(...rC(r,e.issues))}let ny=t4("$ZodCheckProperty",(e,t)=>{i3.init(e,t),e._zod.check=e=>{let r=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(r=>nm(r,e,t.property));nm(r,e,t.property)}}),nv=t4("$ZodCheckMimeType",(e,t)=>{i3.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),nb=t4("$ZodCheckOverwrite",(e,t)=>{i3.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});e.s(["$ZodCheck",0,i3,"$ZodCheckBigIntFormat",0,nr,"$ZodCheckEndsWith",0,ng,"$ZodCheckGreaterThan",0,i9,"$ZodCheckIncludes",0,nh,"$ZodCheckLengthEquals",0,nl,"$ZodCheckLessThan",0,i7,"$ZodCheckLowerCase",0,nd,"$ZodCheckMaxLength",0,ns,"$ZodCheckMaxSize",0,ni,"$ZodCheckMimeType",0,nv,"$ZodCheckMinLength",0,no,"$ZodCheckMinSize",0,nn,"$ZodCheckMultipleOf",0,ne,"$ZodCheckNumberFormat",0,nt,"$ZodCheckOverwrite",0,nb,"$ZodCheckProperty",0,ny,"$ZodCheckRegex",0,nc,"$ZodCheckSizeEquals",0,na,"$ZodCheckStartsWith",0,np,"$ZodCheckStringFormat",0,nu,"$ZodCheckUpperCase",0,nf],856279);class nw{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}e.s(["Doc",0,nw],353007);let n_={major:4,minor:4,patch:3};e.s(["version",0,n_],579772);let nA=t4("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=n_;let i=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&i.unshift(e),i))for(let r of t._zod.onattach)r(e);if(0===i.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let i,n=rk(e);for(let a of t){if(a._zod.def.when){if(rO(e)||!a._zod.def.when(e))continue}else if(n)continue;let t=e.issues.length,s=a._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new t8;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(n||(n=rk(e,t)))});else{if(e.issues.length===t)continue;n||(n=rk(e,t))}}return i?i.then(()=>e):e},r=(r,n,a)=>{if(rk(r))return r.aborted=!0,r;let s=t(n,i,a);if(s instanceof Promise){if(!1===a.async)throw new t8;return s.then(t=>e._zod.parse(t,a))}return e._zod.parse(s,a)};e._zod.run=(n,a)=>{if(a.skipChecks)return e._zod.parse(n,a);if("backward"===a.direction){let t=e._zod.parse({value:n.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,n,a)):r(t,n,a)}let s=e._zod.parse(n,a);if(s instanceof Promise){if(!1===a.async)throw new t8;return s.then(e=>t(e,i,a))}return t(s,i,a)}}ru(e,"~standard",()=>({validate:t=>{try{let r=rQ(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return r1(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),nS=t4("$ZodString",(e,t)=>{nA.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??iF(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),nE=t4("$ZodStringFormat",(e,t)=>{nu.init(e,t),nS.init(e,t)}),nx=t4("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=iy),nE.init(e,t)}),nT=t4("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=iv(e))}else t.pattern??(t.pattern=iv());nE.init(e,t)}),nI=t4("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=iA),nE.init(e,t)}),nk=t4("$ZodURL",(e,t)=>{nE.init(e,t),e._zod.check=r=>{try{let i=r.value.trim();if(!t.normalize&&t.protocol?.source===iP.source&&!/^https?:\/\//i.test(i))return void r.issues.push({code:"invalid_format",format:"url",n
18ote:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let n=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=i;return}catch(i){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),nO=t4("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=iE()),nE.init(e,t)}),nC=t4("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ig),nE.init(e,t)}),nN=t4("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=iu),nE.init(e,t)}),nP=t4("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ic),nE.init(e,t)}),nD=t4("$ZodULID",(e,t)=>{t.pattern??(t.pattern=id),nE.init(e,t)}),nR=t4("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ih),nE.init(e,t)}),n$=t4("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ip),nE.init(e,t)}),nB=t4("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=iU(t)),nE.init(e,t)}),nL=t4("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=i$),nE.init(e,t)}),nU=t4("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=iL(t)),nE.init(e,t)}),nF=t4("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=im),nE.init(e,t)}),nM=t4("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ix),nE.init(e,t),e._zod.bag.format="ipv4"}),nj=t4("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=iT),nE.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),nz=t4("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=iI(t.delimiter)),nE.init(e,t),e._zod.bag.format="mac"}),nV=t4("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ik),nE.init(e,t)}),nH=t4("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=iO),nE.init(e,t),e._zod.check=r=>{let i=r.value.split("/");try{if(2!==i.length)throw Error();let[e,t]=i;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function nq(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let nW=t4("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=iC),nE.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{nq(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function nK(e){if(!iN.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return nq(t.padEnd(4*Math.ceil(t.length/4),"="))}let nG=t4("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=iN),nE.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{nK(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),nZ=t4("$ZodE164",(e,t)=>{t.pattern??(t.pattern=iD),nE.init(e,t)});function nX(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));if("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}let nJ=t4("$ZodJWT",(e,t)=>{nE.init(e,t),e._zod.check=r=>{nX(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),nY=t4("$ZodCustomStringFormat",(e,t)=>{nE.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),nQ=t4("$ZodNumber",(e,t)=>{nA.init(e,t),e._zod.pattern=e._zod.bag.pattern??iz,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let n=r.value;if("number"==typeof n&&!Number.isNaN(n)&&Number.isFinite(n))return r;let a="number"==typeof n?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...a?{received:a}:{}}),r}}),n0=t4("$ZodNumberFormat",(e,t)=>{nt.init(e,t),nQ.init(e,t)}),n1=t4("$ZodBoolean",(e,t)=>{nA.init(e,t),e._zod.pattern=iV,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let n=r.value;return"boolean"==typeof n||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),n2=t4("$ZodBigInt",(e,t)=>{nA.init(e,t),e._zod.pattern=iM,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(e){}return"bigint"==typeof r.value||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),n6=t4("$ZodBigIntFormat",(e,t)=>{nr.init(e,t),n2.init(e,t)}),n5=t4("$ZodSymbol",(e,t)=>{nA.init(e,t),e._zod.parse=(t,r)=>{let i=t.value;return"symbol"==typeof i||t.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),t}}),n4=t4("$ZodUndefined",(e,t)=>{nA.init(e,t),e._zod.pattern=iq,e._zod.values=new Set([void 0]),e._zod.parse=(t,r)=>{let i=t.value;return void 0===i||t.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),t}}),n3=t4("$ZodNull",(e,t)=>{nA.init(e,t),e._zod.pattern=iH,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let i=t.value;return null===i||t.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),t}}),n8=t4("$ZodAny",(e,t)=>{nA.init(e,t),e._zod.parse=e=>e}),n7=t4("$ZodUnknown",(e,t)=>{nA.init(e,t),e._zod.parse=e=>e}),n9=t4("$ZodNever",(e,t)=>{nA.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),ae=t4("$ZodVoid",(e,t)=>{nA.init(e,t),e._zod.parse=(t,r)=>{let i=t.value;return void 0===i||t.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),t}}),at=t4("$ZodDate",(e,t)=>{nA.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let n=r.value,a=n instanceof Date;return a&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...a?{received:"Invalid Date"}:{},inst:e}),r}});function ar(e,t,r){e.issues.length&&t.issues.push(...rC(r,e.issues)),t.value[r]=e.value}let ai=t4("$ZodArray",(e,t)=>{nA.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let a=[];for(let e=0;e<n.length;e++){let s=n[e],o=t.element._zod.run({value:s,issues:[]},i);o instanceof Promise?a.push(o.then(t=>
18ar(t,r,e))):ar(o,r,e)}return a.length?Promise.all(a).then(()=>r):r}});function an(e,t,r,i,n,a){let s=r in i;if(e.issues.length){if(n&&a&&!s)return;t.issues.push(...rC(r,e.issues))}if(!s&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?s&&(t.value[r]=void 0):t.value[r]=e.value}function aa(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=rx(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function as(e,t,r,i,n,a){let s=[],o=n.keySet,l=n.catchall._zod,u=l.def.type,c="optional"===l.optin,d="optional"===l.optout;for(let n in t){if("__proto__"===n||o.has(n))continue;if("never"===u){s.push(n);continue}let a=l.run({value:t[n],issues:[]},i);a instanceof Promise?e.push(a.then(e=>an(e,r,n,t,c,d))):an(a,r,n,t,c,d)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:a}),e.length)?Promise.all(e).then(()=>r):r}let ao=t4("$ZodObject",(e,t)=>{let r;nA.init(e,t);let i=Object.getOwnPropertyDescriptor(t,"shape");if(!i?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let n=rn(()=>aa(t));ru(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let i=e[t]._zod;if(i.values)for(let e of(r[t]??(r[t]=new Set),i.values))r[t].add(e)}return r});let a=t.catchall;e._zod.parse=(t,i)=>{r??(r=n.value);let s=t.value;if(!rg(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};let o=[],l=r.shape;for(let e of r.keys){let r=l[e],n="optional"===r._zod.optin,a="optional"===r._zod.optout,u=r._zod.run({value:s[e],issues:[]},i);u instanceof Promise?o.push(u.then(r=>an(r,t,e,s,n,a))):an(u,t,e,s,n,a)}return a?as(o,s,t,i,n.value,e):o.length?Promise.all(o).then(()=>t):t}}),al=t4("$ZodObjectJIT",(e,t)=>{let r,i;ao.init(e,t);let n=e._zod.parse,a=rn(()=>aa(t)),s=!t9.jitless,o=s&&rm.value,l=t.catchall;e._zod.parse=(u,c)=>{i??(i=a.value);let d=u.value;return rg(d)?s&&o&&c?.async===!1&&!0!==c.jitless?(r||(r=(e=>{let t=new nw(["shape","payload","ctx"]),r=a.value,i=e=>{let t=rf(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let n=Object.create(null),s=0;for(let e of r.keys)n[e]=`key_${s++}`;for(let a of(t.write("const newResult = {};"),r.keys)){let r=n[a],s=rf(a),o=e[a],l=o?._zod?.optin==="optional",u=o?._zod?.optout==="optional";t.write(`const ${r} = ${i(a)};`),l&&u?t.write(` 19 if (${r}.issues.length) { 20 if (${s} in input) { 21 payload.issues = payload.issues.concat(${r}.issues.map(iss => ({ 22 ...iss, 23 path: iss.path ? [${s}, ...iss.path] : [${s}] 24 }))); 25 } 26 } 27 28 if (${r}.value === undefined) { 29 if (${s} in input) { 30 newResult[${s}] = undefined; 31 } 32 } else { 33 newResult[${s}] = ${r}.value; 34 } 35 36 `):l?t.write(` 37 if (${r}.issues.length) { 38 payload.issues = payload.issues.concat(${r}.issues.map(iss => ({ 39 ...iss, 40 path: iss.path ? [${s}, ...iss.path] : [${s}] 41 }))); 42 } 43 44 if (${r}.value === undefined) { 45 if (${s} in input) { 46 newResult[${s}] = undefined; 47 } 48 } else { 49 newResult[${s}] = ${r}.value; 50 } 51 52 `):t.write(` 53 const ${r}_present = ${s} in input; 54 if (${r}.issues.length) { 55 payload.issues = payload.issues.concat(${r}.issues.map(iss => ({ 56 ...iss, 57 path: iss.path ? [${s}, ...iss.path] : [${s}] 58 }))); 59 } 60 if (!${r}_present && !${r}.issues.length) { 61 payload.issues.push({ 62 code: "invalid_type", 63 expected: "nonoptional", 64 input: undefined, 65 path: [${s}] 66 }); 67 } 68 69 if (${r}_present) { 70 if (${r}.value === undefined) { 71 newResult[${s}] = undefined; 72 } else { 73 newResult[${s}] = ${r}.value; 74 } 75 } 76 77 `)}t.write("payload.value = newResult;"),t.write("return payload;");let o=t.compile();return(t,r)=>o(e,t,r)})(t.shape)),u=r(u,c),l)?as([],d,u,c,i,e):u:n(u,c):(u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u)}});
77function au(e,t,r,i){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let n=e.filter(e=>!rk(e));return 1===n.length?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>rP(e,i,re())))}),t)}let ac=t4("$ZodUnion",(e,t)=>{nA.init(e,t),ru(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),ru(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),ru(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),ru(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>rs(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(i,n)=>{if(r)return r(i,n);let a=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},n);if(t instanceof Promise)s.push(t),a=!0;else{if(0===t.issues.length)return t;s.push(t)}}return a?Promise.all(s).then(t=>au(t,i,e,n)):au(s,i,e,n)}});function ad(e,t,r,i){let n=e.filter(e=>0===e.issues.length);return 1===n.length?t.value=n[0].value:0===n.length?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>rP(e,i,re())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t}let af=t4("$ZodXor",(e,t)=>{ac.init(e,t),t.inclusive=!1;let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(i,n)=>{if(r)return r(i,n);let a=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},n);t instanceof Promise?(s.push(t),a=!0):s.push(t)}return a?Promise.all(s).then(t=>ad(t,i,e,n)):ad(s,i,e,n)}}),ah=t4("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ac.init(e,t);let r=e._zod.parse;ru(e._zod,"propValues",()=>{let e={};for(let r of t.options){let i=r._zod.propValues;if(!i||0===Object.keys(i).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(i))for(let i of(e[t]||(e[t]=new Set),r))e[t].add(i)}return e});let i=rn(()=>{let e=t.options,r=new Map;for(let i of e){let e=i._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,i)}}return r});e._zod.parse=(n,a)=>{let s=n.value;if(!rg(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let o=i.value.get(s?.[t.discriminator]);return o?o._zod.run(n,a):t.unionFallback||"backward"===a.direction?r(n,a):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()),input:s,path:[t.discriminator],inst:e}),n)}}),ap=t4("$ZodIntersection",(e,t)=>{nA.init(e,t),e._zod.parse=(e,r)=>{let i=e.value,n=t.left._zod.run({value:i,issues:[]},r),a=t.right._zod.run({value:i,issues:[]},r);return n instanceof Promise||a instanceof Promise?Promise.all([n,a]).then(([t,r])=>ag(e,t,r)):ag(e,n,a)}});function ag(e,t,r){let i,n=new Map;for(let r of t.issues)if("unrecognized_keys"===r.code)for(let e of(i??(i=r),r.keys))n.has(e)||n.set(e,{}),n.get(e).l=!0;else e.issues.push(r);for(let t of r.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)n.has(e)||n.set(e,{}),n.get(e).r=!0;else e.issues.push(t);let a=[...n].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),rk(e))return e;let s=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(ry(t)&&ry(r)){let i=Object.keys(r),n=Object.keys(t).filter(e=>-1!==i.indexOf(e)),a={...t,...r};for(let i of n){let n=e(t[i],r[i]);if(!n.valid)return{valid:!1,mergeErrorPath:[i,...n.mergeErrorPath]};a[i]=n.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let i=[];for(let n=0;n<t.length;n++){let a=e(t[n],r[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};i.push(a.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}let am=t4("$ZodTuple",(e,t)=>{nA.init(e,t);let r=t.items;e._zod.parse=(i,n)=>{let a=i.value;if(!Array.isArray(a))return i.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],o=ay(r,"optin"),l=ay(r,"optout");if(!t.rest){if(a.length<o)return i.issues.push({code:"too_small",minimum:o,inclusive:!0,input:a,inst:e,origin:"array"}),i;a.length>r.length&&i.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:a,inst:e,origin:"array"})}let u=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e]._zod.run({value:a[e],issues:[]},n);t instanceof Promise?s.push(t.then(t=>{u[e]=t})):u[e]=t}if(t.rest){let e=r.length-1;for(let o of a.slice(r.length)){e++;let r=t.rest._zod.run({value:o,issues:[]},n);r instanceof Promise?s.push(r.then(t=>av(t,i,e))):av(r,i,e)}}return s.length?Promise.all(s).then(()=>ab(u,i,r,a,l)):ab(u,i,r,a,l)}});function ay(e,t){for(let r=e.length-1;r>=0;r--)if("optional"!==e[r]._zod[t])return r+1;return 0}function av(e,t,r){e.issues.length&&t.issues.push(...rC(r,e.issues)),t.value[r]=e.value}function ab(e,t,r,i,n){for(let a=0;a<r.length;a++){let r=e[a],s=a<i.length;if(r.issues.length){if(!s&&a>=n){t.value.length=a;break}t.issues.push(...rC(a,r.issues))}t.value[a]=r.value}for(let e=t.value.length-1;e>=i.length;e--)if("optional"===r[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}let aw=t4("$ZodRecord",(e,t)=>{nA.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!ry(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let a=[],s=t.keyType._zod.values;if(s){let o;r.value={};let l=new Set;for(let o of s)if("string"==typeof o||"number"==typeof o||"symbol"==typeof o){l.add("number"==typeof o?o.toString():o);let s=t.keyType._zod.run({value:o,issues:[]},i);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>
77rP(e,i,re())),input:o,path:[o],inst:e});continue}let u=s.value,c=t.valueType._zod.run({value:n[o],issues:[]},i);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&r.issues.push(...rC(o,e.issues)),r.value[u]=e.value})):(c.issues.length&&r.issues.push(...rC(o,c.issues)),r.value[u]=c.value)}for(let e in n)l.has(e)||(o=o??[]).push(e);o&&o.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:o})}else for(let s of(r.value={},Reflect.ownKeys(n))){if("__proto__"===s||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let o=t.keyType._zod.run({value:s,issues:[]},i);if(o instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof s&&iz.test(s)&&o.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},i);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(o=e)}if(o.issues.length){"loose"===t.mode?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map(e=>rP(e,i,re())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:n[s],issues:[]},i);l instanceof Promise?a.push(l.then(e=>{e.issues.length&&r.issues.push(...rC(s,e.issues)),r.value[o.value]=e.value})):(l.issues.length&&r.issues.push(...rC(s,l.issues)),r.value[o.value]=l.value)}return a.length?Promise.all(a).then(()=>r):r}}),a_=t4("$ZodMap",(e,t)=>{nA.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let a=[];for(let[s,o]of(r.value=new Map,n)){let l=t.keyType._zod.run({value:s,issues:[]},i),u=t.valueType._zod.run({value:o,issues:[]},i);l instanceof Promise||u instanceof Promise?a.push(Promise.all([l,u]).then(([t,a])=>{aA(t,a,r,s,n,e,i)}
77)):aA(l,u,r,s,n,e,i)}return a.length?Promise.all(a).then(()=>r):r}});function aA(e,t,r,i,n,a,s){e.issues.length&&(rb.has(typeof i)?r.issues.push(...rC(i,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:a,issues:e.issues.map(e=>rP(e,s,re()))})),t.issues.length&&(rb.has(typeof i)?r.issues.push(...rC(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:a,key:i,issues:t.issues.map(e=>rP(e,s,re()))})),r.value.set(e.value,t.value)}let aS=t4("$ZodSet",(e,t)=>{nA.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let a=[];for(let e of(r.value=new Set,n)){let n=t.valueType._zod.run({value:e,issues:[]},i);n instanceof Promise?a.push(n.then(e=>aE(e,r))):aE(n,r)}return a.length?Promise.all(a).then(()=>r):r}});function aE(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}let ax=t4("$ZodEnum",(e,t)=>{nA.init(e,t);let r=rt(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=RegExp(`^(${r.filter(e=>rb.has(typeof e)).map(e=>"string"==typeof e?r_(e):e.toString()).join("|")})$`),e._zod.parse=(t,n)=>{let a=t.value;return i.has(a)||t.issues.push({code:"invalid_value",values:r,input:a,inst:e}),t}}),aT=t4("$ZodLiteral",(e,t)=>{if(nA.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?r_(e):e?r_(e.toString()):String(e)).join("|")})$`),e._zod.parse=(i,n)=>{let a=i.value;return r.has(a)||i.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),i}}),aI=t4("$ZodFile",(e,t)=>{nA.init(e,t),e._zod.parse=(t,r)=>{let i=t.value;return i instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),t}}),ak=t4("$ZodTransform",(e,t)=>{nA.init(e,t),e._zod.optin="optional",e._zod.parse=(r,i)=>{if("backward"===i.direction)throw new t7(e.constructor.name);let n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(e=>(r.value=e,r.fallback=!0,r));if(n instanceof Promise)throw new t8;return r.value=n,r.fallback=!0,r}});function aO(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let aC=t4("$ZodOptional",(e,t)=>{nA.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ru(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ru(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${rs(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){let i=e.value,n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>aO(e,i)):aO(n,i)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),aN=t4("$ZodExactOptional",(e,t)=>{aC.init(e,t),ru(e._zod,"values",()=>t.innerType._zod.values),ru(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),aP=t4("$ZodNullable",(e,t)=>{nA.init(e,t),ru(e._zod,"optin",()=>t.innerType._zod.optin),ru(e._zod,"optout",()=>t.innerType._zod.optout),ru(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${rs(e.source)}|null)$`):void 0}),ru(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),aD=t4("$ZodDefault",(e,t)=>{nA.init(e,t),e._zod.optin="optional",ru(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(e=>aR(e,t)):aR(i,t)}});function aR(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let a$=t4("$ZodPrefault",(e,t)=>{nA.init(e,t),e._zod.optin="optional",ru(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),aB=t4("$ZodNonOptional",(e,t)=>{nA.init(e,t),ru(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(t=>aL(t,e)):aL(n,e)}});function aL(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let aU=t4("$ZodSuccess",(e,t)=>{nA.init(e,t),e._zod.parse=(e,r)=>{if("backward"===r.direction)throw new t7("ZodSuccess");let i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===i.issues.length,e)}}),aF=t4("$ZodCatch",(e,t)=>{nA.init(e,t),e._zod.optin="optional",ru(e._zod,"optout",()=>t.innerType._zod.optout),ru(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(e=>rP(e,r,re()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(e=>rP(e,r,re()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),aM=t4("$ZodNaN",(e,t)=>{nA.init(e,t),e._zod.parse=(t,r)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),aj=t4("$ZodPipe",(e,t)=>{nA.init(e,t),ru(e._zod,"values",()=>t.in._zod.values),ru(e._zod,"optin",()=>t.in._zod.optin),ru(e._zod,"optout",()=>t.out._zod.optout),ru(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let i=t.out._zod.run(e,r);return i instanceof Promise?i.then(e=>az(e,t.in,r)):az(i,t.in,r)}let i=t.in._zod.run(e,r);return i instanceof Promise?i.then(e=>az(e,t.out,r)):az(i,t.out,r)}});function az(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}let aV=t4("$ZodCodec",(e,t)=>{nA.init(e,t),ru(e._zod,"values",()=>t.in._zod.values),ru(e._zod,"optin",()=>t.in._zod.optin),ru(e._zod,"optout",()=>t.out._zod.optout),ru(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("forward"===(r.direction||"forward")){let i=t.in._zod.run(e,r);return i instanceof Promise?i.then(e=>aH(e,t,r)):aH(i,t,r)}{let i=t.out._zod.run(e,r);return i instanceof Promise?i.then(e=>aH(e,t,r)):aH(i,t,r)}}});function aH(e,t,r){if(e.issues.length)return e.aborted=!0,e;if("forward"===(r.direction||"forward")){let i=t.transform(e.value,e);return i instanceof Promise?i.then(i=>aq(e,i,t.out,r)):aq(e,i,t.out,r)}{let i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(i=>aq(e,i,t.in,r)):aq(e,i,t.in,r)}}
77function aq(e,t,r,i){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},i)}let aW=t4("$ZodPreprocess",(e,t)=>{aj.init(e,t)}),aK=t4("$ZodReadonly",(e,t)=>{nA.init(e,t),ru(e._zod,"propValues",()=>t.innerType._zod.propValues),ru(e._zod,"values",()=>t.innerType._zod.values),ru(e._zod,"optin",()=>t.innerType?._zod?.optin),ru(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(aG):aG(i)}});function aG(e){return e.value=Object.freeze(e.value),e}let aZ=t4("$ZodTemplateLiteral",(e,t)=>{nA.init(e,t);let r=[];for(let e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let i=+!!t.startsWith("^"),n=t.endsWith("$")?t.length-1:t.length;r.push(t.slice(i,n))}else if(null===e||rw.has(typeof e))r.push(r_(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${r.join("")}$`),e._zod.parse=(r,i)=>("string"!=typeof r.value?r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),r)}),aX=t4("$ZodFunction",(e,t)=>(nA.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if("function"!=typeof t)throw Error("implement() must be called with a function");return function(...r){let i=Reflect.apply(t,this,e._def.input?rZ(e._def.input,r):r);return e._def.output?rZ(e._def.output,i):i}},e.implementAsync=t=>{if("function"!=typeof t)throw Error("implementAsync() must be called with a function");return async function(...r){let i=e._def.input?await rJ(e._def.input,r):r,n=await Reflect.apply(t,this,i);return e._def.output?await rJ(e._def.output,n):n}},e._zod.parse=(t,r)=>("function"!=typeof t.value?t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:e}):e._def.output&&"promise"===e._def.output._zod.def.type?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t),e.input=(...t)=>{let r=e.constructor;return new r(Array.isArray(t[0])?{type:"function",input:new am({type:"tuple",items:t[0],rest:t[1]}),output:e._def.output}:{type:"function",input:t[0],output:e._def.output})},e.output=t=>new e.constructor({type:"function",input:e._def.input,output:t}),e)),aJ=t4("$ZodPromise",(e,t)=>{nA.init(e,t),e._zod.parse=(e,r)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},r))}),aY=t4("$ZodLazy",(e,t)=>{nA.init(e,t),ru(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),ru(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ru(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ru(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ru(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)}),aQ=t4("$ZodCustom",(e,t)=>{i3.init(e,t),nA.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then(t=>a0(t,r,i,e));a0(n,r,i,e)}});function a0(e,t,r,i){if(!e){let e={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(rB(e))}}e.s(["$ZodAny",0,n8,"$ZodArray",0,ai,"$ZodBase64",0,nW,"$ZodBase64URL",0,nG,"$ZodBigInt",0,n2,"$ZodBigIntFormat",0,n6,"$ZodBoolean",0,n1,"$ZodCIDRv4",0,nV,"$ZodCIDRv6",0,nH,"$ZodCUID",0,nN,"$ZodCUID2",0,nP,"$ZodCatch",0,aF,"$ZodCodec",0,aV,"$ZodCustom",0,aQ,"$ZodCustomStringFormat",0,nY,"$ZodDate",0,at,"$ZodDefault",0,aD,"$ZodDiscriminatedUnion",0,ah,"$ZodE164",0,nZ,"$ZodEmail",0,nI,"$ZodEmoji",0,nO,"$ZodEnum",0,ax,"$ZodExactOptional",0,aN,"$ZodFile",0,aI,"$ZodFunction",0,aX,"$ZodGUID",0,nx,"$ZodIPv4",0,nM,"$ZodIPv6",0,nj,"$ZodISODate",0,nL,"$ZodISODateTime",0,nB,"$ZodISODuration",0,nF,"$ZodISOTime",0,nU,"$ZodIntersection",0,ap,"$ZodJWT",0,nJ,"$ZodKSUID",0,n$,"$ZodLazy",0,aY,"$ZodLiteral",0,aT,"$ZodMAC",0,nz,"$ZodMap",0,a_,"$ZodNaN",0,aM,"$ZodNanoID",0,nC,"$ZodNever",0,n9,"$ZodNonOptional",0,aB,"$ZodNull",0,n3,"$ZodNullable",0,aP,"$ZodNumber",0,nQ,"$ZodNumberFormat",0,n0,"$ZodObject",0,ao,"$ZodObjectJIT",0,al,"$ZodOptional",0,aC,"$ZodPipe",0,aj,"$ZodPrefault",0,a$,"$ZodPreprocess",0,aW,"$ZodPromise",0,aJ,"$ZodReadonly",0,aK,"$ZodRecord",0,aw,"$ZodSet",0,aS,"$ZodString",0,nS,"$ZodStringFormat",0,nE,"$ZodSuccess",0,aU,"$ZodSymbol",0,n5,"$ZodTemplateLiteral",0,aZ,"$ZodTransform",0,ak,"$ZodTuple",0,am,"$ZodType",0,nA,"$ZodULID",0,nD,"$ZodURL",0,nk,"$ZodUUID",0,nT,"$ZodUndefined",0,n4,"$ZodUnion",0,ac,"$ZodUnknown",0,n7,"$ZodVoid",0,ae,"$ZodXID",0,nR,"$ZodXor",0,af,"isValidBase64",0,nq,"isValidBase64URL",0,nK,"isValidJWT",0,nX],576734),e.i(576734),e.s(["$ZodAny",0,n8,"$ZodArray",0,ai,"$ZodBase64",0,nW,"$ZodBase64URL",0,nG,"$ZodBigInt",0,n2,"$ZodBigIntFormat",0,n6,"$ZodB
77oolean",0,n1,"$ZodCIDRv4",0,nV,"$ZodCIDRv6",0,nH,"$ZodCUID",0,nN,"$ZodCUID2",0,nP,"$ZodCatch",0,aF,"$ZodCodec",0,aV,"$ZodCustom",0,aQ,"$ZodCustomStringFormat",0,nY,"$ZodDate",0,at,"$ZodDefault",0,aD,"$ZodDiscriminatedUnion",0,ah,"$ZodE164",0,nZ,"$ZodEmail",0,nI,"$ZodEmoji",0,nO,"$ZodEnum",0,ax,"$ZodExactOptional",0,aN,"$ZodFile",0,aI,"$ZodFunction",0,aX,"$ZodGUID",0,nx,"$ZodIPv4",0,nM,"$ZodIPv6",0,nj,"$ZodISODate",0,nL,"$ZodISODateTime",0,nB,"$ZodISODuration",0,nF,"$ZodISOTime",0,nU,"$ZodIntersection",0,ap,"$ZodJWT",0,nJ,"$ZodKSUID",0,n$,"$ZodLazy",0,aY,"$ZodLiteral",0,aT,"$ZodMAC",0,nz,"$ZodMap",0,a_,"$ZodNaN",0,aM,"$ZodNanoID",0,nC,"$ZodNever",0,n9,"$ZodNonOptional",0,aB,"$ZodNull",0,n3,"$ZodNullable",0,aP,"$ZodNumber",0,nQ,"$ZodNumberFormat",0,n0,"$ZodObject",0,ao,"$ZodObjectJIT",0,al,"$ZodOptional",0,aC,"$ZodPipe",0,aj,"$ZodPrefault",0,a$,"$ZodPreprocess",0,aW,"$ZodPromise",0,aJ,"$ZodReadonly",0,aK,"$ZodRecord",0,aw,"$ZodSet",0,aS,"$ZodString",0,nS,"$ZodStringFormat",0,nE,"$ZodSuccess",0,aU,"$ZodSymbol",0,n5,"$ZodTemplateLiteral",0,aZ,"$ZodTransform",0,ak,"$ZodTuple",0,am,"$ZodType",0,nA,"$ZodULID",0,nD,"$ZodURL",0,nk,"$ZodUUID",0,nT,"$ZodUndefined",0,n4,"$ZodUnion",0,ac,"$ZodUnknown",0,n7,"$ZodVoid",0,ae,"$ZodXID",0,nR,"$ZodXor",0,af,"clone",0,rA,"isValidBase64",0,nq,"isValidBase64URL",0,nK,"isValidJWT",0,nX],318912),e.i(318912),e.i(856279),e.i(579772);var a1=e.i(459669),a2=e.i(891724);function a6(e,t,r,i){let n=Math.abs(e),a=n%10,s=n%100;return s>=11&&s<=19?i:1===a?t:a>=2&&a<=4?r:i}function a5(e,t,r){return 1===Math.abs(e)?t:r}function a4(e){if(!e)return"";let t=e[e.length-1];return e+(["Õ¡","Õ¥","Õ¨","Õ«","Õ¸","Õ¸Ö","Ö
"].includes(t)?"Õ¶":"Õ¨")}function a3(){let e,t,r;return{localeError:(e={string:{unit:"áá½á¢áááá",verb:"áá½ááá¶á"},file:{unit:"áá",verb:"áá½ááá¶á"},array:{unit:"áá¶áá»",verb:"áá½ááá¶á"},set:{unit:"áá¶áá»",verb:"áá½ááá¶á"}},t={regex:"áá·áááááááááá
á¼á",email:"á¢á¶áááááá¶áá¢áá¸ááá",url:"URL",emoji:"ááááá¶á¢á¶áááááá",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"áá¶áááá·á
áááá áá·ááááá ISO",date:"áá¶áááá·á
áááá ISO",time:"áááá ISO",duration:"áááááá ISO",ipv4:"á¢á¶áááááá¶á IPv4",ipv6:"á¢á¶áááááá¶á IPv6",cidrv4:"áááá¢á¶áááááá¶á IPv4",cidrv6:"áááá¢á¶áááááá¶á IPv6",base64:"ááááá¢ááááá¢áá·áá¼á base64",base64url:"ááááá¢ááááá¢áá·áá¼á base64url",json_string:"ááááá¢áááá JSON",e164:"ááá E.164",jwt:"JWT",template_literal:"áá·áááááááááá
á¼á"},r={nan:"NaN",number:"ááá",array:"á¢á¶áá (Array)",null:"áááá¶áááááá (null)"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`áá·áááááááááá
á¼ááá·ááááá¹ááááá¼áá áááá¼ááá¶á instanceof ${i.expected} ááá»ááááááá½ááá¶á ${n}`;return`áá·áááááááááá
á¼ááá·ááááá¹ááááá¼áá áááá¼ááá¶á ${e} ááá»ááááááá½ááá¶á ${n}`}case"invalid_value":if(1===i.values.length)return`áá·áááááááááá
á¼ááá·ááááá¹ááááá¼áá áááá¼ááá¶á ${rE(i.values[0])}`;return`ááááá¾ááá·ááááá¹ááááá¼áá áááá¼ááá¶áá½ááááá»áá
áááá ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`áááááá áááá¼ááá¶á ${i.origin??"ááááá"} ${t} ${i.maximum.toString()} ${r.unit??"áá¶áá»"}`;return`áááááá áááá¼ááá¶á ${i.origin??"ááááá"} ${t} ${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`áá¼á
áááá áááá¼ááá¶á ${i.origin} ${t} ${i.minimum.toString()} ${r.unit}`;return`áá¼á
áááá áááá¼ááá¶á ${i.origin} ${t} ${i.minimum.toString()}`}
77case"invalid_format":if("starts_with"===i.format)return`ááááá¢áááááá·ááááá¹ááááá¼áá áááá¼áá
á¶áááááá¾áááá "${i.prefix}"`;if("ends_with"===i.format)return`ááááá¢áááááá·ááááá¹ááááá¼áá áááá¼ááááá
ááááá "${i.suffix}"`;if("includes"===i.format)return`ááááá¢áááááá·ááááá¹ááááá¼áá áááá¼ááá¶á "${i.includes}"`;if("regex"===i.format)return`ááááá¢áááááá·ááááá¹ááááá¼áá áááá¼ááááááá¼áááááá¹áááááááááááá¶áááááá ${i.pattern}`;return`áá·ááááá¹ááááá¼áá ${t[i.format]??i.format}`;case"not_multiple_of":return`ááááá·ááááá¹ááááá¼áá áááá¼ááááá¶áá á»áá»ááá ${i.divisor}`;case"unrecognized_keys":return`áááá¾ááááá·ááááá¶ááá ${rr(i.keys,", ")}`;case"invalid_key":return`áááá·ááááá¹ááááá¼ááá
áááá»á ${i.origin}`;case"invalid_union":default:return"áá·áááááááá·ááááá¹ááááá¼á";case"invalid_element":return`áá·áááááááá·ááááá¹ááááá¼ááá
áááá»á ${i.origin}`}})}}e.s([],100431),e.i(100431);let a8=e=>e.charAt(0).toUpperCase()+e.slice(1);function a7(e){let t=Math.abs(e),r=t%10,i=t%100;return i>=11&&i<=19||0===r?"many":1===r?"one":"few"}function a9(e,t,r,i){let n=Math.abs(e),a=n%10,s=n%100;return s>=11&&s<=19?i:1===a?t:a>=2&&a<=4?r:i}function se(){let e,t,r;return{localeError:(e={string:{unit:"ÑимволÑв",verb:"маÑиме"},file:{unit:"байÑÑв",verb:"маÑиме"},array:{unit:"елеменÑÑв",verb:"маÑиме"},set:{unit:"елеменÑÑв",verb:"маÑиме"}},t={regex:"вÑ
ÑÐ´Ð½Ñ Ð´Ð°Ð½Ñ",email:"адÑеÑа елекÑÑÐ¾Ð½Ð½Ð¾Ñ Ð¿Ð¾ÑÑи",url:"URL",emoji:"емодзÑ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"даÑа Ñа ÑÐ°Ñ ISO",date:"даÑа ISO",time:"ÑÐ°Ñ ISO",duration:"ÑÑивалÑÑÑÑ ISO",ipv4:"адÑеÑа IPv4",ipv6:"адÑеÑа IPv6",cidrv4:"дÑапазон IPv4",cidrv6:"дÑапазон IPv6",base64:"ÑÑдок Ñ ÐºÐ¾Ð´ÑÐ²Ð°Ð½Ð½Ñ base64",base64url:"ÑÑдок Ñ ÐºÐ¾Ð´ÑÐ²Ð°Ð½Ð½Ñ base64url",json_string:"ÑÑдок JSON",e164:"Ð½Ð¾Ð¼ÐµÑ E.164",jwt:"JWT",template_literal:"вÑ
ÑÐ´Ð½Ñ Ð´Ð°Ð½Ñ"},r={nan:"NaN",number:"ÑиÑло",array:"маÑив"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`ÐепÑавилÑÐ½Ñ Ð²Ñ
ÑÐ´Ð½Ñ Ð´Ð°Ð½Ñ: оÑÑкÑÑÑÑÑÑ instanceof ${i.expected}, оÑÑимано ${n}`;return`ÐепÑавилÑÐ½Ñ Ð²Ñ
ÑÐ´Ð½Ñ Ð´Ð°Ð½Ñ: оÑÑкÑÑÑÑÑÑ ${e}, оÑÑимано ${n}`}case"invalid_value":if(1===i.values.length)return`ÐепÑавилÑÐ½Ñ Ð²Ñ
ÑÐ´Ð½Ñ Ð´Ð°Ð½Ñ: оÑÑкÑÑÑÑÑÑ ${rE(i.values[0])}`;return`ÐепÑавилÑна опÑÑÑ: оÑÑкÑÑÑÑÑÑ Ð¾Ð´Ð½Ðµ з ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`ÐанадÑо велике: оÑÑкÑÑÑÑÑÑ, Ñо ${i.origin??"знаÑеннÑ"} ${r.verb} ${t}${i.maximum.toString()} ${r.unit??"елеменÑÑв"}`;return`ÐанадÑо велике: оÑÑкÑÑÑÑÑÑ, Ñо ${i.origin??"знаÑеннÑ"} бÑде ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`ÐанадÑо мале: оÑÑкÑÑÑÑÑÑ, Ñо ${i.origin} ${r.verb} ${t}${i.minimum.toString()} ${r.unit}`;return`ÐанадÑо мале: оÑÑкÑÑÑÑÑÑ, Ñо ${i.origin} бÑде ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`ÐепÑавилÑний ÑÑдок: повинен поÑинаÑиÑÑ Ð· "${i.prefix}"`;if("ends_with"===i.format)return`ÐепÑавилÑний ÑÑдок: повинен закÑнÑÑваÑиÑÑ Ð½Ð° "${i.suffix}"`;if("includes"===i.format)return`ÐепÑавилÑний ÑÑдок: повинен мÑÑÑиÑи "${i.includes}"`;if("regex"===i.format)return`ÐепÑавилÑний ÑÑдок: повинен вÑдповÑдаÑи ÑÐ°Ð±Ð»Ð¾Ð½Ñ ${i.pattern}`;return`ÐепÑавилÑний ${t[i.format]??i.format}`;case"not_multiple_of":return`ÐепÑавилÑне ÑиÑло: повинно бÑÑи Ð
77ºÑаÑним ${i.divisor}`;case"unrecognized_keys":return`ÐеÑозпÑзнаний клÑÑ${i.keys.length>1?"Ñ":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`ÐепÑавилÑний клÑÑ Ñ ${i.origin}`;case"invalid_union":default:return"ÐепÑавилÑÐ½Ñ Ð²Ñ
ÑÐ´Ð½Ñ Ð´Ð°Ð½Ñ";case"invalid_element":return`ÐепÑавилÑне знаÑÐµÐ½Ð½Ñ Ñ ${i.origin}`}})}}e.s(["ar",0,function(){let e,t,r;return{localeError:(e={string:{unit:"ØØ±Ù",verb:"Ø£Ù ÙØÙÙ"},file:{unit:"Ø¨Ø§ÙØª",verb:"Ø£Ù ÙØÙÙ"},array:{unit:"Ø¹ÙØµØ±",verb:"Ø£Ù ÙØÙÙ"},set:{unit:"Ø¹ÙØµØ±",verb:"Ø£Ù ÙØÙÙ"}},t={regex:"Ù
دخÙ",email:"Ø¨Ø±ÙØ¯ Ø¥ÙÙØªØ±ÙÙÙ",url:"رابط",emoji:"Ø¥ÙÙ
ÙØ¬Ù",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ØªØ§Ø±ÙØ® ÙÙÙØª بÙ
Ø¹ÙØ§Ø± ISO",date:"ØªØ§Ø±ÙØ® بÙ
Ø¹ÙØ§Ø± ISO",time:"ÙÙØª بÙ
Ø¹ÙØ§Ø± ISO",duration:"Ù
دة بÙ
Ø¹ÙØ§Ø± ISO",ipv4:"عÙÙØ§Ù IPv4",ipv6:"عÙÙØ§Ù IPv6",cidrv4:"Ù
Ø¯Ù Ø¹ÙØ§ÙÙÙ Ø¨ØµÙØºØ© IPv4",cidrv6:"Ù
Ø¯Ù Ø¹ÙØ§ÙÙÙ Ø¨ØµÙØºØ© IPv6",base64:"ÙÙØµ بترÙ
ÙØ² base64-encoded",base64url:"ÙÙØµ بترÙ
ÙØ² base64url-encoded",json_string:"ÙÙØµ عÙÙ ÙÙØ¦Ø© JSON",e164:"رÙÙ
ÙØ§ØªÙ بÙ
Ø¹ÙØ§Ø± E.164",jwt:"JWT",template_literal:"Ù
دخÙ"},r={nan:"NaN"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Ù
Ø¯Ø®ÙØ§Øª ØºÙØ± Ù
ÙØ¨ÙÙØ©: ÙÙØªØ±Ø¶ إدخا٠instanceof ${i.expected}Ø ÙÙÙ٠تÙ
إدخا٠${n}`;return`Ù
Ø¯Ø®ÙØ§Øª ØºÙØ± Ù
ÙØ¨ÙÙØ©: ÙÙØªØ±Ø¶ إدخا٠${e}Ø ÙÙÙ٠تÙ
إدخا٠${n}`}case"invalid_value":if(1===i.values.length)return`Ù
Ø¯Ø®ÙØ§Øª ØºÙØ± Ù
ÙØ¨ÙÙØ©: ÙÙØªØ±Ø¶ إدخا٠${rE(i.values[0])}`;return`Ø§Ø®ØªÙØ§Ø± ØºÙØ± Ù
ÙØ¨ÙÙ: ÙØªÙÙØ¹ Ø§ÙØªÙاء Ø£ØØ¯ ÙØ°Ù Ø§ÙØ®Ùارات: ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return` Ø£ÙØ¨Ø± Ù
٠اÙÙØ§Ø²Ù
: ÙÙØªØ±Ø¶ أ٠تÙÙÙ ${i.origin??"اÙÙÙÙ
Ø©"} ${t} ${i.maximum.toString()} ${r.unit??"Ø¹ÙØµØ±"}`;return`Ø£ÙØ¨Ø± Ù
٠اÙÙØ§Ø²Ù
: ÙÙØªØ±Ø¶ أ٠تÙÙÙ ${i.origin??"اÙÙÙÙ
Ø©"} ${t} ${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`أصغر Ù
٠اÙÙØ§Ø²Ù
: ÙÙØªØ±Ø¶ ÙÙ ${i.origin} Ø£Ù ÙÙÙÙ ${t} ${i.minimum.toString()} ${r.unit}`;return`أصغر Ù
٠اÙÙØ§Ø²Ù
: ÙÙØªØ±Ø¶ ÙÙ ${i.origin} Ø£Ù ÙÙÙÙ ${t} ${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`ÙÙØµ ØºÙØ± Ù
ÙØ¨ÙÙ: ÙØ¬Ø¨ Ø£Ù ÙØ¨Ø¯Ø£ ب٠"${i.prefix}"`;if("ends_with"===i.format)return`ÙÙØµ ØºÙØ± Ù
ÙØ¨ÙÙ: ÙØ¬Ø¨ Ø£Ù ÙÙØªÙ٠ب٠"${i.suffix}"`;if("includes"===i.format)return`ÙÙØµ ØºÙØ± Ù
ÙØ¨ÙÙ: ÙØ¬Ø¨ Ø£Ù ÙØªØ¶Ù
ÙÙÙ "${i.includes}"`;if("regex"===i.format)return`ÙÙØµ ØºÙØ± Ù
ÙØ¨ÙÙ: ÙØ¬Ø¨ Ø£Ù ÙØ·Ø§Ø¨Ù اÙÙÙ
Ø· ${i.pattern}`;return`${t[i.format]??i.format} ØºÙØ± Ù
ÙØ¨ÙÙ`;case"not_multiple_of":return`رÙÙ
ØºÙØ± Ù
ÙØ¨ÙÙ: ÙØ¬Ø¨ Ø£Ù ÙÙÙÙ Ù
Ù Ù
Ø¶Ø§Ø¹ÙØ§Øª ${i.divisor}`;case"unrecognized_keys":return`Ù
عرÙ${i.keys.length>1?"ات":""} ØºØ±ÙØ¨${i.keys.length>1?"Ø©":""}: ${rr(i.keys,"Ø ")}`;case"invalid_key":return`Ù
Ø¹Ø±Ù ØºÙØ± Ù
ÙØ¨ÙÙ ÙÙ ${i.origin}`;case"invalid_union":default:return"Ù
Ø¯Ø®Ù ØºÙØ± Ù
ÙØ¨ÙÙ";case"invalid_element":return`Ù
Ø¯Ø®Ù ØºÙØ± Ù
ÙØ¨ÙÙ ÙÙ ${i.origin}`}})}},"az",0,function(){let e,t,r;return{localeError:(e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"},i=>
77{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`YanlıŠdÉyÉr: g\xf6zlÉnilÉn instanceof ${i.expected}, daxil olan ${n}`;return`YanlıŠdÉyÉr: g\xf6zlÉnilÉn ${e}, daxil olan ${n}`}case"invalid_value":if(1===i.values.length)return`YanlıŠdÉyÉr: g\xf6zlÉnilÉn ${rE(i.values[0])}`;return`YanlıŠse\xe7im: aÅaÄıdakılardan biri olmalıdır: ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`\xc7ox b\xf6y\xfck: g\xf6zlÉnilÉn ${i.origin??"dÉyÉr"} ${t}${i.maximum.toString()} ${r.unit??"element"}`;return`\xc7ox b\xf6y\xfck: g\xf6zlÉnilÉn ${i.origin??"dÉyÉr"} ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`\xc7ox ki\xe7ik: g\xf6zlÉnilÉn ${i.origin} ${t}${i.minimum.toString()} ${r.unit}`;return`\xc7ox ki\xe7ik: g\xf6zlÉnilÉn ${i.origin} ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`YanlıŠmÉtn: "${i.prefix}" ilÉ baÅlamalıdır`;if("ends_with"===i.format)return`YanlıŠmÉtn: "${i.suffix}" ilÉ bitmÉlidir`;if("includes"===i.format)return`YanlıŠmÉtn: "${i.includes}" daxil olmalıdır`;if("regex"===i.format)return`YanlıŠmÉtn: ${i.pattern} Åablonuna uyÄun olmalıdır`;return`YanlıŠ${t[i.format]??i.format}`;case"not_multiple_of":return`YanlıŠÉdÉd: ${i.divisor} ilÉ b\xf6l\xfcnÉ bilÉn olmalıdır`;case"unrecognized_keys":return`Tanınmayan a\xe7ar${i.keys.length>1?"lar":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilindÉ yanlıŠa\xe7ar`;case"invalid_union":default:return"YanlıŠdÉyÉr";case"invalid_element":return`${i.origin} daxilindÉ yanlıŠdÉyÉr`}})}},"be",0,function(){let e,t,r;return{localeError:(e={string:{unit:{one:"ÑÑмвал",few:"ÑÑмвалÑ",many:"ÑÑмвалаÑ"},verb:"меÑÑ"},array:{unit:{one:"ÑлеменÑ",few:"ÑлеменÑÑ",many:"ÑлеменÑаÑ"},verb:"меÑÑ"},set:{unit:{one:"ÑлеменÑ",few:"ÑлеменÑÑ",many:"ÑлеменÑаÑ"},verb:"меÑÑ"},file:{unit:{one:"байÑ",few:"байÑÑ",many:"байÑаÑ"},verb:"меÑÑ"}},t={regex:"Ñвод",email:"email адÑаÑ",url:"URL",emoji:"ÑмодзÑ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO даÑа Ñ ÑаÑ",date:"ISO даÑа",time:"ISO ÑаÑ",duration:"ISO пÑаÑÑглаÑÑÑ",ipv4:"IPv4 адÑаÑ",ipv6:"IPv6 адÑаÑ",cidrv4:"IPv4 дÑÑпазон",cidrv6:"IPv6 дÑÑпазон",base64:"Ñадок Ñ ÑаÑмаÑе base64",base64url:"Ñадок Ñ ÑаÑмаÑе base64url",json_string:"JSON Ñадок",e164:"нÑÐ¼Ð°Ñ E.164",jwt:"JWT",template_literal:"Ñвод"},r={nan:"NaN",number:"лÑк",array:"маÑÑÑ"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`ÐÑпÑавÑлÑÐ½Ñ Ñвод: ÑакаÑÑÑ instanceof ${i.expected}, аÑÑÑмана ${n}`;return`ÐÑпÑавÑлÑÐ½Ñ Ñвод: ÑакаÑÑÑ ${e}, аÑÑÑмана ${n}`}case"invalid_value":if(1===i.values.length)return`ÐÑпÑавÑлÑÐ½Ñ Ñвод: ÑакалаÑÑ ${rE(i.values[0])}`;return`ÐÑпÑавÑлÑÐ½Ñ Ð²Ð°ÑÑÑнÑ: ÑакаÑÑÑ Ð°Ð´Ð·Ñн з ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r){let e=a6(Number(i.maximum),r.unit.one,r.unit.few,r.unit.many);return`ÐанадÑа вÑлÑкÑ: ÑакалаÑÑ, ÑÑо ${i.origin??"знаÑÑнне"} павÑнна ${r.verb} ${t}${i.maximum.toString()} ${e}`}return`ÐанадÑа вÑлÑкÑ: ÑакалаÑÑ, ÑÑо ${i.origin??"знаÑÑнне"} павÑнна бÑÑÑ ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r){let e=a6(Number(i.minimum),r.unit.one,r.unit.few,r.unit.many);return`ÐанадÑа малÑ: ÑакалаÑÑ, ÑÑо ${i.origin} павÑнна ${r.verb} ${t}${i.minimum.toString()} ${e}`}return`ÐанадÑа малÑ: ÑакалаÑÑ, ÑÑо ${i.origin} павÑнна бÑÑÑ ${t}${i.minimum.toString()}`}
77case"invalid_format":if("starts_with"===i.format)return`ÐÑпÑавÑлÑÐ½Ñ Ñадок: павÑнен паÑÑнаÑÑа з "${i.prefix}"`;if("ends_with"===i.format)return`ÐÑпÑавÑлÑÐ½Ñ Ñадок: павÑнен заканÑваÑÑа на "${i.suffix}"`;if("includes"===i.format)return`ÐÑпÑавÑлÑÐ½Ñ Ñадок: павÑнен змÑÑÑаÑÑ "${i.includes}"`;if("regex"===i.format)return`ÐÑпÑавÑлÑÐ½Ñ Ñадок: павÑнен адпавÑдаÑÑ ÑÐ°Ð±Ð»Ð¾Ð½Ñ ${i.pattern}`;return`ÐÑпÑавÑлÑÐ½Ñ ${t[i.format]??i.format}`;case"not_multiple_of":return`ÐÑпÑавÑлÑÐ½Ñ Ð»Ñк: павÑнен бÑÑÑ ÐºÑаÑнÑм ${i.divisor}`;case"unrecognized_keys":return`ÐеÑаÑÐ¿Ð°Ð·Ð½Ð°Ð½Ñ ${i.keys.length>1?"клÑÑÑ":"клÑÑ"}: ${rr(i.keys,", ")}`;case"invalid_key":return`ÐÑпÑавÑлÑÐ½Ñ ÐºÐ»ÑÑ Ñ ${i.origin}`;case"invalid_union":default:return"ÐÑпÑавÑлÑÐ½Ñ Ñвод";case"invalid_element":return`ÐÑпÑавÑлÑнае знаÑÑнне Ñ ${i.origin}`}})}},"bg",0,function(){let e,t,r;return{localeError:(e={string:{unit:"Ñимвола",verb:"да ÑÑдÑÑжа"},file:{unit:"байÑа",verb:"да ÑÑдÑÑжа"},array:{unit:"елеменÑа",verb:"да ÑÑдÑÑжа"},set:{unit:"елеменÑа",verb:"да ÑÑдÑÑжа"}},t={regex:"вÑ
од",email:"имейл адÑеÑ",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO вÑеме",date:"ISO даÑа",time:"ISO вÑеме",duration:"ISO пÑодÑлжиÑелноÑÑ",ipv4:"IPv4 адÑеÑ",ipv6:"IPv6 адÑеÑ",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиÑан низ",base64url:"base64url-кодиÑан низ",json_string:"JSON низ",e164:"E.164 номеÑ",jwt:"JWT",template_literal:"вÑ
од"},r={nan:"NaN",number:"ÑиÑло",array:"маÑив"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Ðевалиден вÑ
од: оÑакван instanceof ${i.expected}, полÑÑен ${n}`;return`Ðевалиден вÑ
од: оÑакван ${e}, полÑÑен ${n}`}case"invalid_value":if(1===i.values.length)return`Ðевалиден вÑ
од: оÑакван ${rE(i.values[0])}`;return`Ðевалидна опÑиÑ: оÑаквано едно Ð¾Ñ ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`ТвÑÑде голÑмо: оÑаква Ñе ${i.origin??"ÑÑойноÑÑ"} да ÑÑдÑÑжа ${t}${i.maximum.toString()} ${r.unit??"елеменÑа"}`;return`ТвÑÑде голÑмо: оÑаква Ñе ${i.origin??"ÑÑойноÑÑ"} да бÑде ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`ТвÑÑде малко: оÑаква Ñе ${i.origin} да ÑÑдÑÑжа ${t}${i.minimum.toString()} ${r.unit}`;return`ТвÑÑде малко: оÑаква Ñе ${i.origin} да бÑде ${t}${i.minimum.toString()}`}case"invalid_format":{if("starts_with"===i.format)return`Ðевалиден низ: ÑÑÑбва да запоÑва Ñ "${i.prefix}"`;if("ends_with"===i.format)return`Ðевалиден низ: ÑÑÑбва да завÑÑÑва Ñ "${i.suffix}"`;if("includes"===i.format)return`Ðевалиден низ: ÑÑÑбва да вклÑÑва "${i.includes}"`;if("regex"===i.format)return`Ðевалиден низ: ÑÑÑбва да ÑÑвпада Ñ ${i.pattern}`;let e="Ðевалиден";return"emoji"===i.format&&(e="Ðевалидно"),"datetime"===i.format&&(e="Ðевалидно"),"date"===i.format&&(e="Ðевалидна"),"time"===i.format&&(e="Ðевалидно"),"duration"===i.format&&(e="Ðевалидна"),`${e} ${t[i.format]??i.format}`}case"not_multiple_of":return`Ðевалидно ÑиÑло: ÑÑÑбва да бÑде кÑаÑно на ${i.divisor}`;case"unrecognized_keys":return`ÐеÑазпознаÑ${i.keys.length>1?"и":""} клÑÑ${i.keys.length>1?"ове":""}: ${rr(i.keys,", ")}`;
77case"invalid_key":return`Ðевалиден клÑÑ Ð² ${i.origin}`;case"invalid_union":default:return"Ðевалиден вÑ
од";case"invalid_element":return`Ðевалидна ÑÑойноÑÑ Ð² ${i.origin}`}})}},"ca",0,function(){let e,t,r;return{localeError:(e={string:{unit:"carà cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}},t={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Tipus inv\xe0lid: s'esperava instanceof ${i.expected}, s'ha rebut ${n}`;return`Tipus inv\xe0lid: s'esperava ${e}, s'ha rebut ${n}`}case"invalid_value":if(1===i.values.length)return`Valor inv\xe0lid: s'esperava ${rE(i.values[0])}`;return`Opci\xf3 inv\xe0lida: s'esperava una de ${rr(i.values," o ")}`;case"too_big":{let t=i.inclusive?"com a mà xim":"menys de",r=e[i.origin]??null;if(r)return`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xe9s ${t} ${i.maximum.toString()} ${r.unit??"elements"}`;return`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${t} ${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?"com a mÃnim":"més de",r=e[i.origin]??null;if(r)return`Massa petit: s'esperava que ${i.origin} contingu\xe9s ${t} ${i.minimum.toString()} ${r.unit}`;return`Massa petit: s'esperava que ${i.origin} fos ${t} ${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Format inv\xe0lid: ha de comen\xe7ar amb "${i.prefix}"`;if("ends_with"===i.format)return`Format inv\xe0lid: ha d'acabar amb "${i.suffix}"`;if("includes"===i.format)return`Format inv\xe0lid: ha d'incloure "${i.includes}"`;if("regex"===i.format)return`Format inv\xe0lid: ha de coincidir amb el patr\xf3 ${i.pattern}`;return`Format inv\xe0lid per a ${t[i.format]??i.format}`;case"not_multiple_of":return`N\xfamero inv\xe0lid: ha de ser m\xfaltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`Clau inv\xe0lida a ${i.origin}`;case"invalid_union":default:return"Entrada invà lida";case"invalid_element":return`Element inv\xe0lid a ${i.origin}`}})}},"cs",0,function(){let e,t,r;return{localeError:(e={string:{unit:"znaků",verb:"mÃt"},file:{unit:"bajtů",verb:"mÃt"},array:{unit:"prvků",verb:"mÃt"},set:{unit:"prvků",verb:"mÃt"}},t={regex:"regulárnà výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a Äas ve formátu ISO",date:"datum ve formátu ISO",time:"Äas ve formátu ISO",duration:"doba trvánà ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"ÅetÄzec zakódovaný ve formátu base64",base64url:"ÅetÄzec zakódovaný ve formátu base64url",json_string:"ÅetÄzec ve formátu JSON",e164:"ÄÃslo E.164",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"ÄÃslo",string:"ÅetÄzec",function:"funkce",array:"pole"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Neplatn\xfd vstup: oÄek\xe1v\xe1no instanceof ${i.expected}, obdrženo ${n}`;return`Neplatn\xfd vstup: oÄek\xe1v\xe1no ${e}, obdrženo ${n}`}case"invalid_value":if(1===i.values.length)return`Neplatn\xfd vstup: oÄek\xe1v\xe1no ${rE(i.values[0])}`;return`Neplatn\xe1 možnost: oÄek\xe1v\xe1na jedna z hodnot ${rr(i.values,"|")}`;
77case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Hodnota je pÅ\xedliÅ¡ velk\xe1: ${i.origin??"hodnota"} mus\xed m\xedt ${t}${i.maximum.toString()} ${r.unit??"prvků"}`;return`Hodnota je pÅ\xedliÅ¡ velk\xe1: ${i.origin??"hodnota"} mus\xed b\xfdt ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Hodnota je pÅ\xedliÅ¡ mal\xe1: ${i.origin??"hodnota"} mus\xed m\xedt ${t}${i.minimum.toString()} ${r.unit??"prvků"}`;return`Hodnota je pÅ\xedliÅ¡ mal\xe1: ${i.origin??"hodnota"} mus\xed b\xfdt ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Neplatn\xfd ÅetÄzec: mus\xed zaÄ\xednat na "${i.prefix}"`;if("ends_with"===i.format)return`Neplatn\xfd ÅetÄzec: mus\xed konÄit na "${i.suffix}"`;if("includes"===i.format)return`Neplatn\xfd ÅetÄzec: mus\xed obsahovat "${i.includes}"`;if("regex"===i.format)return`Neplatn\xfd ÅetÄzec: mus\xed odpov\xeddat vzoru ${i.pattern}`;return`Neplatn\xfd form\xe1t ${t[i.format]??i.format}`;case"not_multiple_of":return`Neplatn\xe9 Ä\xedslo: mus\xed b\xfdt n\xe1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xe1m\xe9 kl\xedÄe: ${rr(i.keys,", ")}`;case"invalid_key":return`Neplatn\xfd kl\xedÄ v ${i.origin}`;case"invalid_union":default:return"Neplatný vstup";case"invalid_element":return`Neplatn\xe1 hodnota v ${i.origin}`}})}},"da",0,function(){let e,t,r;return{localeError:(e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},t={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-omrÃ¥de",ipv6:"IPv6-omrÃ¥de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Ugyldigt input: forventede instanceof ${i.expected}, fik ${n}`;return`Ugyldigt input: forventede ${e}, fik ${n}`}case"invalid_value":if(1===i.values.length)return`Ugyldig v\xe6rdi: forventede ${rE(i.values[0])}`;return`Ugyldigt valg: forventede en af f\xf8lgende ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null,a=r[i.origin]??i.origin;if(n)return`For stor: forventede ${a??"value"} ${n.verb} ${t} ${i.maximum.toString()} ${n.unit??"elementer"}`;return`For stor: forventede ${a??"value"} havde ${t} ${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null,a=r[i.origin]??i.origin;if(n)return`For lille: forventede ${a} ${n.verb} ${t} ${i.minimum.toString()} ${n.unit}`;return`For lille: forventede ${a} havde ${t} ${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Ugyldig streng: skal starte med "${i.prefix}"`;if("ends_with"===i.format)return`Ugyldig streng: skal ende med "${i.suffix}"`;if("includes"===i.format)return`Ugyldig streng: skal indeholde "${i.includes}"`;if("regex"===i.format)return`Ugyldig streng: skal matche m\xf8nsteret ${i.pattern}`;return`Ugyldig ${t[i.format]??i.format}`;case"not_multiple_of":return`Ugyldigt tal: skal v\xe6re deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${rr(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xf8gle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xe6rdi i ${i.origin}`;default:return"Ugyldigt input"}})}},"de",0,function(){let e,t,r;return{localeError:(e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}},t={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},r={nan:"NaN",number:"Zahl",array:"Array"},i=>
77{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Ung\xfcltige Eingabe: erwartet instanceof ${i.expected}, erhalten ${n}`;return`Ung\xfcltige Eingabe: erwartet ${e}, erhalten ${n}`}case"invalid_value":if(1===i.values.length)return`Ung\xfcltige Eingabe: erwartet ${rE(i.values[0])}`;return`Ung\xfcltige Option: erwartet eine von ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Zu gro\xdf: erwartet, dass ${i.origin??"Wert"} ${t}${i.maximum.toString()} ${r.unit??"Elemente"} hat`;return`Zu gro\xdf: erwartet, dass ${i.origin??"Wert"} ${t}${i.maximum.toString()} ist`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Zu klein: erwartet, dass ${i.origin} ${t}${i.minimum.toString()} ${r.unit} hat`;return`Zu klein: erwartet, dass ${i.origin} ${t}${i.minimum.toString()} ist`}case"invalid_format":if("starts_with"===i.format)return`Ung\xfcltiger String: muss mit "${i.prefix}" beginnen`;if("ends_with"===i.format)return`Ung\xfcltiger String: muss mit "${i.suffix}" enden`;if("includes"===i.format)return`Ung\xfcltiger String: muss "${i.includes}" enthalten`;if("regex"===i.format)return`Ung\xfcltiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ung\xfcltig: ${t[i.format]??i.format}`;case"not_multiple_of":return`Ung\xfcltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${rr(i.keys,", ")}`;case"invalid_key":return`Ung\xfcltiger Schl\xfcssel in ${i.origin}`;case"invalid_union":default:return"Ungültige Eingabe";case"invalid_element":return`Ung\xfcltiger Wert in ${i.origin}`}})}},"el",0,function(){let e,t,r;return{localeError:(e={string:{unit:"ÏαÏακÏήÏεÏ",verb:"να ÎÏει"},file:{unit:"bytes",verb:"να ÎÏει"},array:{unit:"ÏÏοιÏεία",verb:"να ÎÏει"},set:{unit:"ÏÏοιÏεία",verb:"να ÎÏει"},map:{unit:"καÏαÏÏÏήÏειÏ",verb:"να ÎÏει"}},t={regex:"είÏοδοÏ",email:"διεÏθÏ
νÏη email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ημεÏομηνία και ÏÏα",date:"ISO ημεÏομηνία",time:"ISO ÏÏ
77α",duration:"ISO διάÏκεια",ipv4:"διεÏθÏ
νÏη IPv4",ipv6:"διεÏθÏ
νÏη IPv6",mac:"διεÏθÏ
νÏη MAC",cidrv4:"εÏÏÎ¿Ï IPv4",cidrv6:"εÏÏÎ¿Ï IPv6",base64:"ÏÏ
μβολοÏειÏά κÏδικοÏοιημÎνη Ïε base64",base64url:"ÏÏ
μβολοÏειÏά κÏδικοÏοιημÎνη Ïε base64url",json_string:"ÏÏ
μβολοÏειÏά JSON",e164:"αÏιθμÏÏ E.164",jwt:"JWT",template_literal:"είÏοδοÏ"},r={nan:"NaN"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if("string"==typeof i.expected&&/^[A-Z]/.test(i.expected))return`Îη ÎγκÏ
Ïη είÏοδοÏ: αναμενÏÏαν instanceof ${i.expected}, λήÏθηκε ${n}`;return`Îη ÎγκÏ
Ïη είÏοδοÏ: αναμενÏÏαν ${e}, λήÏθηκε ${n}`}case"invalid_value":if(1===i.values.length)return`Îη ÎγκÏ
Ïη είÏοδοÏ: αναμενÏÏαν ${rE(i.values[0])}`;return`Îη ÎγκÏ
Ïη εÏιλογή: αναμενÏÏαν Îνα αÏÏ ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Î Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿: αναμενÏÏαν ${i.origin??"Ïιμή"} να ÎÏει ${t}${i.maximum.toString()} ${r.unit??"ÏÏοιÏεία"}`;return`Î Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿: αναμενÏÏαν ${i.origin??"Ïιμή"} να είναι ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Î Î¿Î»Ï Î¼Î¹ÎºÏÏ: αναμενÏÏαν ${i.origin} να ÎÏει ${t}${i.minimum.toString()} ${r.unit}`;return`Î Î¿Î»Ï Î¼Î¹ÎºÏÏ: αναμενÏÏαν ${i.origin} να είναι ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Îη ÎγκÏ
Ïη ÏÏ
μβολοÏειÏά: ÏÏÎÏει να ξεκινά με "${i.prefix}"`;if("ends_with"===i.format)return`Îη ÎγκÏ
Ïη ÏÏ
μβολοÏειÏά: ÏÏÎÏει να ÏελειÏνει με "${i.suffix}"`;if("includes"===i.format)return`Îη ÎγκÏ
Ïη ÏÏ
μβολοÏειÏά: ÏÏÎÏει να ÏεÏιÎÏει "${i.includes}"`;if("regex"===i.format)return`Îη ÎγκÏ
Ïη ÏÏ
μβολοÏειÏά: ÏÏÎÏει να ÏαιÏιάζει με Ïο μοÏίβο ${i.pattern}`;return`Îη ÎγκÏ
Ïο: ${t[i.format]??i.format}`;case"not_multiple_of":return`Îη ÎγκÏ
ÏÎ¿Ï Î±ÏιθμÏÏ: ÏÏÎÏει να είναι ÏολλαÏλάÏιο ÏοÏ
${i.divisor}`;case"unrecognized_keys":return`ÎγνÏÏÏ${i.keys.length>1?"α":"ο"} κλειδ${i.keys.length>1?"ιά":"ί"}: ${rr(i.keys,", ")}`;case"invalid_key":return`Îη ÎγκÏ
Ïο κλειδί ÏÏο ${i.origin}`;case"invalid_union":default:return"Îη ÎγκÏ
Ïη είÏοδοÏ";case"invalid_element":return`Îη ÎγκÏ
Ïη Ïιμή ÏÏο ${i.origin}`}})}},"en",0,rF,"eo",0,function(){let e,t,r;return{localeError:(e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}},t={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoÄio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daÅro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Nevalida enigo: atendiÄis instanceof ${i.expected}, riceviÄis ${n}`;return`Nevalida enigo: atendiÄis ${e}, riceviÄis ${n}`}case"invalid_value":if(1===i.values.length)return`Nevalida enigo: atendiÄis ${rE(i.values[0])}`;return`Nevalida opcio: atendiÄis unu el ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Tro granda: atendiÄis ke ${i.origin??"valoro"} havu ${t}${i.maximum.toString()} ${r.unit??"elementojn"}`;return`Tro granda: atendiÄis ke ${i.origin??"valoro"} havu ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Tro malgranda: atendiÄis ke ${i.origin} havu ${t}${i.minimum.toString()} ${r.unit}`;return`Tro malgranda: atendiÄis ke ${i.origin} estu ${t}${i.minimum.toString()}`}
77case"invalid_format":if("starts_with"===i.format)return`Nevalida karaktraro: devas komenciÄi per "${i.prefix}"`;if("ends_with"===i.format)return`Nevalida karaktraro: devas finiÄi per "${i.suffix}"`;if("includes"===i.format)return`Nevalida karaktraro: devas inkluzivi "${i.includes}"`;if("regex"===i.format)return`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`;return`Nevalida ${t[i.format]??i.format}`;case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} Ålosilo${i.keys.length>1?"j":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`Nevalida Ålosilo en ${i.origin}`;case"invalid_union":default:return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`}})}},"es",0,function(){let e,t,r;return{localeError:(e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol
77:"sÃmbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacÃo",never:"nunca",unknown:"desconocido",any:"cualquiera"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Entrada inv\xe1lida: se esperaba instanceof ${i.expected}, recibido ${n}`;return`Entrada inv\xe1lida: se esperaba ${e}, recibido ${n}`}case"invalid_value":if(1===i.values.length)return`Entrada inv\xe1lida: se esperaba ${rE(i.values[0])}`;return`Opci\xf3n inv\xe1lida: se esperaba una de ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null,a=r[i.origin]??i.origin;if(n)return`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${t}${i.maximum.toString()} ${n.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${a??"valor"} fuera ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null,a=r[i.origin]??i.origin;if(n)return`Demasiado peque\xf1o: se esperaba que ${a} tuviera ${t}${i.minimum.toString()} ${n.unit}`;return`Demasiado peque\xf1o: se esperaba que ${a} fuera ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Cadena inv\xe1lida: debe comenzar con "${i.prefix}"`;if("ends_with"===i.format)return`Cadena inv\xe1lida: debe terminar en "${i.suffix}"`;if("includes"===i.format)return`Cadena inv\xe1lida: debe incluir "${i.includes}"`;if("regex"===i.format)return`Cadena inv\xe1lida: debe coincidir con el patr\xf3n ${i.pattern}`;return`Inv\xe1lido ${t[i.format]??i.format}`;case"not_multiple_of":return`N\xfamero inv\xe1lido: debe ser m\xfaltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`Llave inv\xe1lida en ${r[i.origin]??i.origin}`;case"invalid_union":default:return"Entrada inválida";case"invalid_element":return`Valor inv\xe1lido en ${r[i.origin]??i.origin}`}})}},"fa",0,function(){let e,t,r;return{localeError:(e={string:{unit:"کاراکتر",verb:"داشت٠باشد"},file:{unit:"Ø¨Ø§ÛØª",verb:"داشت٠باشد"},array:{unit:"Ø¢ÛØªÙ
",verb:"داشت٠باشد"},set:{unit:"Ø¢ÛØªÙ
",verb:"داشت٠باشد"}},t={regex:"ÙØ±ÙدÛ",email:"آدرس اÛÙ
ÛÙ",url:"URL",emoji:"اÛÙ
ÙØ¬Û",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ØªØ§Ø±ÛØ® ٠زÙ
Ø§Ù Ø§ÛØ²Ù",date:"ØªØ§Ø±ÛØ® Ø§ÛØ²Ù",time:"زÙ
Ø§Ù Ø§ÛØ²Ù",duration:"Ù
دت زÙ
Ø§Ù Ø§ÛØ²Ù",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 داÙ
ÙÙ",cidrv6:"IPv6 داÙ
ÙÙ",base64:"base64-encoded رشتÙ",base64url:"base64url-encoded رشتÙ",json_string:"JSON رشتÙ",e164:"E.164 عدد",jwt:"JWT",template_literal:"ÙØ±ÙدÛ"},r={nan:"NaN",number:"عدد",array:"آراÛÙ"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`ÙØ±ÙØ¯Û ÙØ§Ù
عتبر: Ù
ÛâØ¨Ø§ÛØ³Øª instanceof ${i.expected} Ù
ÛâØ¨ÙØ¯Ø ${n} Ø¯Ø±ÛØ§Ùت شد`;return`ÙØ±ÙØ¯Û ÙØ§Ù
عتبر: Ù
ÛâØ¨Ø§ÛØ³Øª ${e} Ù
ÛâØ¨ÙØ¯Ø ${n} Ø¯Ø±ÛØ§Ùت شد`}case"invalid_value":if(1===i.values.length)return`ÙØ±ÙØ¯Û ÙØ§Ù
عتبر: Ù
ÛâØ¨Ø§ÛØ³Øª ${rE(i.values[0])} Ù
ÛâØ¨ÙØ¯`;return`گزÛÙÙ ÙØ§Ù
عتبر: Ù
ÛâØ¨Ø§ÛØ³Øª ÛÚ©Û Ø§Ø² ${rr(i.values,"|")} Ù
ÛâØ¨ÙØ¯`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Ø®ÛÙÛ Ø¨Ø²Ø±Ú¯: ${i.origin??"Ù
ÙØ¯Ø§Ø±"} Ø¨Ø§ÛØ¯ ${t}${i.maximum.toString()} ${r.unit??"Ø¹ÙØµØ±"} باشد`;return`Ø®ÛÙÛ Ø¨Ø²Ø±Ú¯: ${i.origin??"Ù
ÙØ¯Ø§Ø±"} Ø¨Ø§ÛØ¯ ${t}${i.maximum.toString()} باشد`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Ø®ÛÙÛ Ú©ÙÚÚ©: ${i.origin} Ø¨Ø§ÛØ¯ ${t}${i.minimum.toString()} ${r.unit} باشد`;return`Ø®ÛÙÛ Ú©ÙÚÚ©: ${i.origin} Ø¨Ø§ÛØ¯ ${t}${i.minimum.toString()} باشد`}
77case"invalid_format":if("starts_with"===i.format)return`Ø±Ø´ØªÙ ÙØ§Ù
عتبر: Ø¨Ø§ÛØ¯ با "${i.prefix}" Ø´Ø±ÙØ¹ Ø´ÙØ¯`;if("ends_with"===i.format)return`Ø±Ø´ØªÙ ÙØ§Ù
عتبر: Ø¨Ø§ÛØ¯ با "${i.suffix}" تÙ
اÙ
Ø´ÙØ¯`;if("includes"===i.format)return`Ø±Ø´ØªÙ ÙØ§Ù
عتبر: Ø¨Ø§ÛØ¯ شاÙ
Ù "${i.includes}" باشد`;if("regex"===i.format)return`Ø±Ø´ØªÙ ÙØ§Ù
عتبر: Ø¨Ø§ÛØ¯ با اÙÚ¯ÙÛ ${i.pattern} Ù
Ø·Ø§Ø¨ÙØª داشت٠باشد`;return`${t[i.format]??i.format} ÙØ§Ù
عتبر`;case"not_multiple_of":return`عدد ÙØ§Ù
عتبر: Ø¨Ø§ÛØ¯ Ù
ضرب ${i.divisor} باشد`;case"unrecognized_keys":return`Ú©ÙÛØ¯${i.keys.length>1?"ÙØ§Û":""} ÙØ§Ø´Ùاس: ${rr(i.keys,", ")}`;case"invalid_key":return`Ú©ÙÛØ¯ ÙØ§Ø´Ùاس در ${i.origin}`;case"invalid_union":default:return"ÙØ±ÙØ¯Û ÙØ§Ù
عتبر";case"invalid_element":return`Ù
ÙØ¯Ø§Ø± ÙØ§Ù
عتبر در ${i.origin}`}})}},"fi",0,function(){let e,t,r;return{localeError:(e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}},t={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},r={nan:"NaN"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${n}`;return`Virheellinen tyyppi: odotettiin ${e}, oli ${n}`}case"invalid_value":if(1===i.values.length)return`Virheellinen sy\xf6te: t\xe4ytyy olla ${rE(i.values[0])}`;return`Virheellinen valinta: t\xe4ytyy olla yksi seuraavista: ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Liian suuri: ${r.subject} t\xe4ytyy olla ${t}${i.maximum.toString()} ${r.unit}`.trim();return`Liian suuri: arvon t\xe4ytyy olla ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Liian pieni: ${r.subject} t\xe4ytyy olla ${t}${i.minimum.toString()} ${r.unit}`.trim();return`Liian pieni: arvon t\xe4ytyy olla ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Virheellinen sy\xf6te: t\xe4ytyy alkaa "${i.prefix}"`;if("ends_with"===i.format)return`Virheellinen sy\xf6te: t\xe4ytyy loppua "${i.suffix}"`;if("includes"===i.format)return`Virheellinen sy\xf6te: t\xe4ytyy sis\xe4lt\xe4\xe4 "${i.includes}"`;if("regex"===i.format)return`Virheellinen sy\xf6te: t\xe4ytyy vastata s\xe4\xe4nn\xf6llist\xe4 lauseketta ${i.pattern}`;return`Virheellinen ${t[i.format]??i.format}`;case"not_multiple_of":return`Virheellinen luku: t\xe4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${rr(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}})}},"fr",0,function(){let e,t,r;return{localeError:(e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}},t={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"}
77,r={string:"chaîne",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Entr\xe9e invalide : instanceof ${i.expected} attendu, ${n} re\xe7u`;return`Entr\xe9e invalide : ${e} attendu, ${n} re\xe7u`}case"invalid_value":if(1===i.values.length)return`Entr\xe9e invalide : ${rE(i.values[0])} attendu`;return`Option invalide : une valeur parmi ${rr(i.values,"|")} attendue`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Trop grand : ${r[i.origin]??"valeur"} doit ${n.verb} ${t}${i.maximum.toString()} ${n.unit??"élément(s)"}`;return`Trop grand : ${r[i.origin]??"valeur"} doit \xeatre ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Trop petit : ${r[i.origin]??"valeur"} doit ${n.verb} ${t}${i.minimum.toString()} ${n.unit}`;return`Trop petit : ${r[i.origin]??"valeur"} doit \xeatre ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Cha\xeene invalide : doit commencer par "${i.prefix}"`;if("ends_with"===i.format)return`Cha\xeene invalide : doit se terminer par "${i.suffix}"`;if("includes"===i.format)return`Cha\xeene invalide : doit inclure "${i.includes}"`;if("regex"===i.format)return`Cha\xeene invalide : doit correspondre au mod\xe8le ${i.pattern}`;return`${t[i.format]??i.format} invalide`;case"not_multiple_of":return`Nombre invalide : doit \xeatre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xe9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${rr(i.keys,", ")}`;case"invalid_key":return`Cl\xe9 invalide dans ${i.origin}`;case"invalid_union":default:return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`}})}},"frCA",0,function(){let e,t,r;return{localeError:(e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}},t={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},r={nan:"NaN"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Entr\xe9e invalide : attendu instanceof ${i.expected}, re\xe7u ${n}`;return`Entr\xe9e invalide : attendu ${e}, re\xe7u ${n}`}case"invalid_value":if(1===i.values.length)return`Entr\xe9e invalide : attendu ${rE(i.values[0])}`;
77return`Option invalide : attendu l'une des valeurs suivantes ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"â¤":"<",r=e[i.origin]??null;if(r)return`Trop grand : attendu que ${i.origin??"la valeur"} ait ${t}${i.maximum.toString()} ${r.unit}`;return`Trop grand : attendu que ${i.origin??"la valeur"} soit ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?"â¥":">",r=e[i.origin]??null;if(r)return`Trop petit : attendu que ${i.origin} ait ${t}${i.minimum.toString()} ${r.unit}`;return`Trop petit : attendu que ${i.origin} soit ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Cha\xeene invalide : doit commencer par "${i.prefix}"`;if("ends_with"===i.format)return`Cha\xeene invalide : doit se terminer par "${i.suffix}"`;if("includes"===i.format)return`Cha\xeene invalide : doit inclure "${i.includes}"`;if("regex"===i.format)return`Cha\xeene invalide : doit correspondre au motif ${i.pattern}`;return`${t[i.format]??i.format} invalide`;case"not_multiple_of":return`Nombre invalide : doit \xeatre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xe9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${rr(i.keys,", ")}`;case"invalid_key":return`Cl\xe9 invalide dans ${i.origin}`;case"invalid_union":default:return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`}})}},"he",0,function(){let e,t,r,i,n,a,s,o,l;return{localeError:(e={string:{label:"××ר××ת",gender:"f"},number:{label:"×ספר",gender:"m"},boolean:{label:"×¢×¨× ×××××× ×",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"ת×ר××",gender:"m"},array:{label:"×ער×",gender:"m"},object:{label:"××××××§×",gender:"m"},null:{label:"×¢×¨× ×¨××§ (null)",gender:"m"},undefined:{label:"×¢×¨× ×× ××××ר (undefined)",gender:"m"},symbol:{label:"ס××××× (Symbol)",gender:"m"},function:{label:"פ×× ×§×¦××",gender:"f"},map:{label:"××¤× (Map)",gender:"f"},set:{label:"×§×××¦× (Set)",gender:"f"},file:{label:"×§×××¥",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"×¢×¨× ×× ××××¢",gender:"m"},value:{label:"ער×",gender:"m"}},t={string:{unit:"ת××××",shortLabel:"קצר",longLabel:"×ר××"},file:{unit:"××××××",shortLabel:"×§××",longLabel:"××××"},array:{unit:"פר××××",shortLabel:"×§××",longLabel:"××××"},set:{unit:"פר××××",shortLabel:"×§××",longLabel:"××××"},number:{unit:"",shortLabel:"×§××",longLabel:"××××"}},r=t=>t?e[t]:void 0,i=t=>{let i=r(t);return i?i.label:t??e.unknown.label},n=e=>`×${i(e)}`,a=e=>{let t=r(e);return"f"===(t?.gender??"m")?"צר××× ××××ת":"צר×× ××××ת"},s=e=>e?t[e]??null:null,o={regex:{label:"×§××",gender:"m"},email:{label:"×ת××ת ××××××",gender:"f"},url:{label:"×ת××ת רשת",gender:"f"},emoji:{label:"×××××'×",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"ת×ר×× ×××× ISO",gender:"m"},date:{label:"ת×ר×× ISO",gender:"m"},time:{label:"××× ISO",gender:"m"},duration:{label:"××©× ××× ISO",gender:"m"},ipv4:{label:"×ת××ת IPv4",gender:"f"},ipv6:{label:"×ת××ת IPv6",gender:"f"},cidrv4:{label:"×××× IPv4",gender:"m"},cidrv6:{label:"×××× IPv6",gender:"m"},base64:{label:"××ר××ת ××ס×ס 64",gender:"f"},base64url:{label:"××ר××ת ××ס×ס 64 ××ת×××ת רשת",gender:"f"},json_string:{label:"××ר××ת JSON",gender:"f"},e164:{label:"×ספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"×§××",gender:"m"},includes:{label:"×§××",gender:"m"},lowercase:{label:"×§××",gender:"m"},starts_with:{label:"×§××",gender:"m"},uppercase:{label:"×§××",gender:"m"}},l={nan:"NaN"},t=>{switch(t.code){case"invalid_type":{let r=t.expected,n=l[r??""]??i(r),a=r$(t.input),s=l[a]??e[a]?.label??a;
77if(/^[A-Z]/.test(t.expected))return`×§×× ×× ×ª×§××: צר×× ××××ת instanceof ${t.expected}, ×תק×× ${s}`;return`×§×× ×× ×ª×§××: צר×× ××××ת ${n}, ×תק×× ${s}`}case"invalid_value":{if(1===t.values.length)return`×¢×¨× ×× ×ª×§××: ××¢×¨× ×××× ××××ת ${rE(t.values[0])}`;let e=t.values.map(e=>rE(e));if(2===t.values.length)return`×¢×¨× ×× ×ª×§××: ××פשר×××ת ××ת××××ת ×× ${e[0]} ×× ${e[1]}`;let r=e[e.length-1],i=e.slice(0,-1).join(", ");return`×¢×¨× ×× ×ª×§××: ××פשר×××ת ××ת××××ת ×× ${i} ×× ${r}`}case"too_big":{let e=s(t.origin),r=n(t.origin??"value");if("string"===t.origin)return`${e?.longLabel??"×ר××"} ×××: ${r} צר××× ××××× ${t.maximum.toString()} ${e?.unit??""} ${t.inclusive?"×× ×¤××ת":"××× ×××תר"}`.trim();if("number"===t.origin){let e=t.inclusive?`×§×× ×× ×©××× ×-${t.maximum}`:`×§×× ×-${t.maximum}`;return`×××× ×××: ${r} צר×× ××××ת ${e}`}if("array"===t.origin||"set"===t.origin){let i="set"===t.origin?"צר×××":"צר××",n=t.inclusive?`${t.maximum} ${e?.unit??""} ×× ×¤××ת`:`פ××ת ×-${t.maximum} ${e?.unit??""}`;return`×××× ×××: ${r} ${i} ××××× ${n}`.trim()}let i=t.inclusive?"<=":"<",o=a(t.origin??"value");if(e?.unit)return`${e.longLabel} ×××: ${r} ${o} ${i}${t.maximum.toString()} ${e.unit}`;return`${e?.longLabel??"××××"} ×××: ${r} ${o} ${i}${t.maximum.toString()}`}case"too_small":{let e=s(t.origin),r=n(t.origin??"value");if("string"===t.origin)return`${e?.shortLabel??"קצר"} ×××: ${r} צר××× ××××× ${t.minimum.toString()} ${e?.unit??""} ${t.inclusive?"×× ××תר":"×פ××ת"}`.trim();if("number"===t.origin){let e=t.inclusive?`×××× ×× ×©××× ×-${t.minimum}`:`×××× ×-${t.minimum}`;return`×§×× ×××: ${r} צר×× ××××ת ${e}`}if("array"===t.origin||"set"===t.origin){let i="set"===t.origin?"צר×××":"צר××";if(1===t.minimum&&t.inclusive){let e=(t.origin,"×פ××ת פר×× ×××");return`×§×× ×××: ${r} ${i} ××××× ${e}`}let n=t.inclusive?`${t.minimum} ${e?.unit??""} ×× ××תר`:`××תר ×-${t.minimum} ${e?.unit??""}`;return`×§×× ×××: ${r} ${i} ××××× ${n}`.trim()}let i=t.inclusive?">=":">",o=a(t.origin??"value");if(e?.unit)return`${e.shortLabel} ×××: ${r} ${o} ${i}${t.minimum.toString()} ${e.unit}`;return`${e?.shortLabel??"×§××"} ×××: ${r} ${o} ${i}${t.minimum.toString()}`}case"invalid_format":{if("starts_with"===t.format)return`×××ר××ת ××××ת ××ת××× × "${t.prefix}"`;if("ends_with"===t.format)return`×××ר××ת ××××ת ××סת××× × "${t.suffix}"`;if("includes"===t.format)return`×××ר××ת ××××ת ××××× "${t.includes}"`;if("regex"===t.format)return`×××ר××ת ××××ת ××ת××× ×ת×× ×ת ${t.pattern}`;let e=o[t.format],r=e?.label??t.format,i=e?.gender??"m";return`${r} ×× ${"f"===i?"תק×× ×":"תק××"}`}case"not_multiple_of":return`×ספר ×× ×ª×§××: ×××× ××××ת ××פ×× ×©× ${t.divisor}`;case"unrecognized_keys":return`×פת×${t.keys.length>1?"×ת":""} ×× ××××${t.keys.length>1?"××":"×"}: ${rr(t.keys,", ")}`;case"invalid_key":return"ש×× ×× ×ª×§×× ×××××××§×";case"invalid_union":default:return"×§×× ×× ×ª×§××";case"invalid_element":{let e=n(t.origin??"array");return`×¢×¨× ×× ×ª×§×× ×${e}`}}})}},"hr",0,function(){let e,t,r;return{localeError:(e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}},t={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},r={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol
77:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Neispravan unos: oÄekuje se instanceof ${i.expected}, a primljeno je ${n}`;return`Neispravan unos: oÄekuje se ${e}, a primljeno je ${n}`}case"invalid_value":if(1===i.values.length)return`Neispravna vrijednost: oÄekivano ${rE(i.values[0])}`;return`Neispravna opcija: oÄekivano jedno od ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null,a=r[i.origin]??i.origin;if(n)return`Preveliko: oÄekivano da ${a??"vrijednost"} ima ${t}${i.maximum.toString()} ${n.unit??"elemenata"}`;return`Preveliko: oÄekivano da ${a??"vrijednost"} bude ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null,a=r[i.origin]??i.origin;if(n)return`Premalo: oÄekivano da ${a} ima ${t}${i.minimum.toString()} ${n.unit}`;return`Premalo: oÄekivano da ${a} bude ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Neispravan tekst: mora zapoÄinjati s "${i.prefix}"`;if("ends_with"===i.format)return`Neispravan tekst: mora zavrÅ¡avati s "${i.suffix}"`;if("includes"===i.format)return`Neispravan tekst: mora sadržavati "${i.includes}"`;if("regex"===i.format)return`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`;return`Neispravna ${t[i.format]??i.format}`;case"not_multiple_of":return`Neispravan broj: mora biti viÅ¡ekratnik od ${i.divisor}`;case"unrecognized_keys":return`Neprepoznat${i.keys.length>1?"i kljuÄevi":" kljuÄ"}: ${rr(i.keys,", ")}`;case"invalid_key":return`Neispravan kljuÄ u ${r[i.origin]??i.origin}`;case"invalid_union":default:return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${r[i.origin]??i.origin}`}})}},"hu",0,function(){let e,t,r;return{localeError:(e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}},t={regex:"bemenet",email:"email cÃm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO idÅbélyeg",date:"ISO dátum",time:"ISO idÅ",duration:"ISO idÅintervallum",ipv4:"IPv4 cÃm",ipv6:"IPv6 cÃm",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},r={nan:"NaN",number:"szám",array:"tömb"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k instanceof ${i.expected}, a kapott \xe9rt\xe9k ${n}`;return`\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k ${e}, a kapott \xe9rt\xe9k ${n}`}case"invalid_value":if(1===i.values.length)return`\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k ${rE(i.values[0])}`;return`\xc9rv\xe9nytelen opci\xf3: valamelyik \xe9rt\xe9k v\xe1rt ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`T\xfal nagy: ${i.origin??"érték"} m\xe9rete t\xfal nagy ${t}${i.maximum.toString()} ${r.unit??"elem"}`;return`T\xfal nagy: a bemeneti \xe9rt\xe9k ${i.origin??"érték"} t\xfal nagy: ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`T\xfal kicsi: a bemeneti \xe9rt\xe9k ${i.origin} m\xe9rete t\xfal kicsi ${t}${i.minimum.toString()} ${r.unit}`;return`T\xfal kicsi: a bemeneti \xe9rt\xe9k ${i.origin} t\xfal kicsi ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`\xc9rv\xe9nytelen string: "${i.prefix}" \xe9rt\xe9kkel kell kezdÅdnie`;if("ends_with"===i.format)return`\xc9rv\xe9nytelen string: "${i.suffix}" \xe9rt\xe9kkel kell v\xe9gzÅdnie`;if("includes"===i.format)return`\xc9rv\xe9nytelen string: "${i.includes}" \xe9rt\xe9ket kell tartalmaznia`;if("regex"===i.format)return`\xc9rv\xe9nytelen string: ${i.pattern} mint\xe1nak kell megfelelnie`;return`\xc9rv\xe9nytelen ${t[i.format]??i.format}`;case"not_multiple_of":return`\xc9rv\xe9nytelen sz\xe1m: ${i.divisor} t\xf6bbsz\xf6r\xf6s\xe9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>
771?"s":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`\xc9rv\xe9nytelen kulcs ${i.origin}`;case"invalid_union":default:return"Ãrvénytelen bemenet";case"invalid_element":return`\xc9rv\xe9nytelen \xe9rt\xe9k: ${i.origin}`}})}},"hy",0,function(){let e,t,r;return{localeError:(e={string:{unit:{one:"Õ¶Õ·Õ¡Õ¶",many:"Õ¶Õ·Õ¡Õ¶Õ¶Õ¥Ö"},verb:"Õ¸ÖÕ¶Õ¥Õ¶Õ¡Õ¬"},file:{unit:{one:"Õ¢Õ¡ÕµÕ©",many:"Õ¢Õ¡ÕµÕ©Õ¥Ö"},verb:"Õ¸ÖÕ¶Õ¥Õ¶Õ¡Õ¬"},array:{unit:{one:"Õ¿Õ¡ÖÖ",many:"Õ¿Õ¡ÖÖÕ¥Ö"},verb:"Õ¸ÖÕ¶Õ¥Õ¶Õ¡Õ¬"},set:{unit:{one:"Õ¿Õ¡ÖÖ",many:"Õ¿Õ¡ÖÖÕ¥Ö"},verb:"Õ¸ÖÕ¶Õ¥Õ¶Õ¡Õ¬"}},t={regex:"Õ´Õ¸ÖÕ¿Ö",email:"Õ§Õ¬. Õ°Õ¡Õ½ÖÕ¥",url:"URL",emoji:"Õ§Õ´Õ¸Õ»Õ«",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO Õ¡Õ´Õ½Õ¡Õ©Õ«Õ¾ Ö ÕªÕ¡Õ´",date:"ISO Õ¡Õ´Õ½Õ¡Õ©Õ«Õ¾",time:"ISO ÕªÕ¡Õ´",duration:"ISO Õ¿ÖÕ¸Õ²Õ¸ÖÕ©ÕµÕ¸ÖÕ¶",ipv4:"IPv4 Õ°Õ¡Õ½ÖÕ¥",ipv6:"IPv6 Õ°Õ¡Õ½ÖÕ¥",cidrv4:"IPv4 Õ´Õ«Õ»Õ¡Õ¯Õ¡ÕµÖ",cidrv6:"IPv6 Õ´Õ«Õ»Õ¡Õ¯Õ¡ÕµÖ",base64:"base64 Õ±ÖÕ¡Õ¹Õ¡ÖÕ¸Õ¾ Õ¿Õ¸Õ²",base64url:"base64url Õ±ÖÕ¡Õ¹Õ¡ÖÕ¸Õ¾ Õ¿Õ¸Õ²",json_string:"JSON Õ¿Õ¸Õ²",e164:"E.164 Õ°Õ¡Õ´Õ¡Ö",jwt:"JWT",template_literal:"Õ´Õ¸ÖÕ¿Ö"},r={nan:"NaN",number:"Õ©Õ«Õ¾",array:"Õ¦Õ¡Õ¶Õ£Õ¾Õ¡Õ®"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`ÕÕÕ¡Õ¬ Õ´Õ¸ÖÕ¿ÖÕ¡Õ£ÖÕ¸Öմ⤠սպասվոÖÕ´ Õ§Ö instanceof ${i.expected}, Õ½Õ¿Õ¡ÖÕ¾Õ¥Õ¬ Õ§ ${n}`;return`ÕÕÕ¡Õ¬ Õ´Õ¸ÖÕ¿ÖÕ¡Õ£ÖÕ¸Öմ⤠սպասվոÖÕ´ Õ§Ö ${e}, Õ½Õ¿Õ¡ÖÕ¾Õ¥Õ¬ Õ§ ${n}`}case"invalid_value":if(1===i.values.length)return`ÕÕÕ¡Õ¬ Õ´Õ¸ÖÕ¿ÖÕ¡Õ£ÖÕ¸Öմ⤠սպասվոÖÕ´ Õ§Ö ${rE(i.values[1])}`;return`ÕÕÕ¡Õ¬ Õ¿Õ¡ÖÕ¢Õ¥Öակ⤠սպասվոÖÕ´ Õ§Ö Õ°Õ¥Õ¿ÖÕµÕ¡Õ¬Õ¶Õ¥ÖÕ«Ö Õ´Õ¥Õ¯Õ¨Õ ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r){let e=a5(Number(i.maximum),r.unit.one,r.unit.many);return`ÕÕ¡ÖÕ¡Õ¦Õ¡Õ¶Ö Õ´Õ¥Õ® Õ¡ÖÕªÕ¥Ö⤠սպասվոÖÕ´ Õ§, Õ¸Ö ${a4(i.origin??"Õ¡ÖÕªÕ¥Ö")} Õ¯Õ¸ÖÕ¶Õ¥Õ¶Õ¡ ${t}${i.maximum.toString()} ${e}`}return`ÕÕ¡ÖÕ¡Õ¦Õ¡Õ¶Ö Õ´Õ¥Õ® Õ¡ÖÕªÕ¥Ö⤠սպասվոÖÕ´ Õ§, Õ¸Ö ${a4(i.origin??"Õ¡ÖÕªÕ¥Ö")} Õ¬Õ«Õ¶Õ« ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r){let e=a5(Number(i.minimum),r.unit.one,r.unit.many);return`ÕÕ¡ÖÕ¡Õ¦Õ¡Õ¶Ö ÖÕ¸ÖÖ Õ¡ÖÕªÕ¥Ö⤠սպասվոÖÕ´ Õ§, Õ¸Ö ${a4(i.origin)} Õ¯Õ¸ÖÕ¶Õ¥Õ¶Õ¡ ${t}${i.minimum.toString()} ${e}`}return`ÕÕ¡ÖÕ¡Õ¦Õ¡Õ¶Ö ÖÕ¸ÖÖ Õ¡ÖÕªÕ¥Ö⤠սպասվոÖÕ´ Õ§, Õ¸Ö ${a4(i.origin)} Õ¬Õ«Õ¶Õ« ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`ÕÕÕ¡Õ¬ Õ¿Õ¸Õ²â¤ ÕºÕ¥Õ¿Ö Õ§ Õ½Õ¯Õ½Õ¾Õ« "${i.prefix}"-Õ¸Õ¾`;if("ends_with"===i.format)return`ÕÕÕ¡Õ¬ Õ¿Õ¸Õ²â¤ ÕºÕ¥Õ¿Ö Õ§ Õ¡Õ¾Õ¡ÖÕ¿Õ¾Õ« "${i.suffix}"-Õ¸Õ¾`;if("includes"===i.format)return`ÕÕÕ¡Õ¬ Õ¿Õ¸Õ²â¤ ÕºÕ¥Õ¿Ö Õ§ ÕºÕ¡ÖÕ¸ÖÕ¶Õ¡Õ¯Õ« "${i.includes}"`;if("regex"===i.format)return`ÕÕÕ¡Õ¬ Õ¿Õ¸Õ²â¤ ÕºÕ¥Õ¿Ö Õ§ Õ°Õ¡Õ´Õ¡ÕºÕ¡Õ¿Õ¡Õ½ÕÕ¡Õ¶Õ« ${i.pattern} Õ±ÖÕ¡Õ¹Õ¡ÖÕ«Õ¶`;return`ÕÕÕ¡Õ¬ ${t[i.format]??i.format}`;case"not_multiple_of":return`ÕÕÕ¡Õ¬ Õ©Õ«Õ¾â¤ ÕºÕ¥Õ¿Ö Õ§ Õ¢Õ¡Õ¦Õ´Õ¡ÕºÕ¡Õ¿Õ«Õ¯ Õ¬Õ«Õ¶Õ« ${i.divisor}-Õ«`;case"unrecognized_keys":return`ÕÕ³Õ¡Õ¶Õ¡Õ¹Õ¾Õ¡Õ® Õ¢Õ¡Õ¶Õ¡Õ¬Õ«${i.keys.length>1?"Õ¶Õ¥Ö":""}. ${rr(i.keys,", ")}`;case"invalid_key":return`ÕÕÕ¡Õ¬ Õ¢Õ¡Õ¶Õ¡Õ¬Õ« ${a4(i.origin)}-Õ¸ÖÕ´`;case"invalid_union":default:return"ÕÕÕ¡Õ¬ Õ´Õ¸ÖÕ¿ÖÕ¡Õ£ÖÕ¸ÖÕ´";case"invalid_element":return`ÕÕÕ¡Õ¬ Õ¡ÖÕªÕ¥Ö ${a4(i.origin)}-Õ¸ÖÕ´`}})}},"id",0,function(){let e,t,r;return{localeError:(e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}},t={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN"},i=>
77{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${n}`;return`Input tidak valid: diharapkan ${e}, diterima ${n}`}case"invalid_value":if(1===i.values.length)return`Input tidak valid: diharapkan ${rE(i.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${t}${i.maximum.toString()} ${r.unit??"elemen"}`;return`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Terlalu kecil: diharapkan ${i.origin} memiliki ${t}${i.minimum.toString()} ${r.unit}`;return`Terlalu kecil: diharapkan ${i.origin} menjadi ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if("ends_with"===i.format)return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if("includes"===i.format)return`String tidak valid: harus menyertakan "${i.includes}"`;if("regex"===i.format)return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${t[i.format]??i.format} tidak valid`;case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":default:return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`}})}},"is",0,function(){let e,t,r;return{localeError:(e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}},t={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tÃmi",date:"ISO dagsetning",time:"ISO tÃmi",duration:"ISO tÃmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},r={nan:"NaN",number:"númer",array:"fylki"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Rangt gildi: \xde\xfa sl\xf3st inn ${n} \xfear sem \xe1 a\xf0 vera instanceof ${i.expected}`;return`Rangt gildi: \xde\xfa sl\xf3st inn ${n} \xfear sem \xe1 a\xf0 vera ${e}`}case"invalid_value":if(1===i.values.length)return`Rangt gildi: gert r\xe1\xf0 fyrir ${rE(i.values[0])}`;return`\xd3gilt val: m\xe1 vera eitt af eftirfarandi ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Of st\xf3rt: gert er r\xe1\xf0 fyrir a\xf0 ${i.origin??"gildi"} hafi ${t}${i.maximum.toString()} ${r.unit??"hluti"}`;return`Of st\xf3rt: gert er r\xe1\xf0 fyrir a\xf0 ${i.origin??"gildi"} s\xe9 ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Of l\xedti\xf0: gert er r\xe1\xf0 fyrir a\xf0 ${i.origin} hafi ${t}${i.minimum.toString()} ${r.unit}`;return`Of l\xedti\xf0: gert er r\xe1\xf0 fyrir a\xf0 ${i.origin} s\xe9 ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`\xd3gildur strengur: ver\xf0ur a\xf0 byrja \xe1 "${i.prefix}"`;if("ends_with"===i.format)return`\xd3gildur strengur: ver\xf0ur a\xf0 enda \xe1 "${i.suffix}"`;if("includes"===i.format)return`\xd3gildur strengur: ver\xf0ur a\xf0 innihalda "${i.includes}"`;if("regex"===i.format)return`\xd3gildur strengur: ver\xf0ur a\xf0 fylgja mynstri ${i.pattern}`;return`Rangt ${t[i.format]??i.format}`;case"not_multiple_of":return`R\xf6ng tala: ver\xf0ur a\xf0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xd3\xfeekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${rr(i.keys,", ")}`;
77case"invalid_key":return`Rangur lykill \xed ${i.origin}`;case"invalid_union":default:return"Rangt gildi";case"invalid_element":return`Rangt gildi \xed ${i.origin}`}})}},"it",0,function(){let e,t,r;return{localeError:(e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}},t={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"numero",array:"vettore"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Input non valido: atteso instanceof ${i.expected}, ricevuto ${n}`;return`Input non valido: atteso ${e}, ricevuto ${n}`}case"invalid_value":if(1===i.values.length)return`Input non valido: atteso ${rE(i.values[0])}`;return`Opzione non valida: atteso uno tra ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Troppo grande: ${i.origin??"valore"} deve avere ${t}${i.maximum.toString()} ${r.unit??"elementi"}`;return`Troppo grande: ${i.origin??"valore"} deve essere ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Troppo piccolo: ${i.origin} deve avere ${t}${i.minimum.toString()} ${r.unit}`;return`Troppo piccolo: ${i.origin} deve essere ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Stringa non valida: deve iniziare con "${i.prefix}"`;if("ends_with"===i.format)return`Stringa non valida: deve terminare con "${i.suffix}"`;if("includes"===i.format)return`Stringa non valida: deve includere "${i.includes}"`;if("regex"===i.format)return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Input non valido: ${t[i.format]??i.format}`;case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${rr(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":default:return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`}})}},"ja",0,function(){let e,t,r;return{localeError:(e={string:{unit:"æå",verb:"ã§ãã"},file:{unit:"ãã¤ã",verb:"ã§ãã"},array:{unit:"è¦ç´ ",verb:"ã§ãã"},set:{unit:"è¦ç´ ",verb:"ã§ãã"}},t={regex:"å
¥åå¤",email:"ã¡ã¼ã«ã¢ãã¬ã¹",url:"URL",emoji:"çµµæå",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISOæ¥æ",date:"ISOæ¥ä»",time:"ISOæå»",duration:"ISOæé",ipv4:"IPv4ã¢ãã¬ã¹",ipv6:"IPv6ã¢ãã¬ã¹",cidrv4:"IPv4ç¯å²",cidrv6:"IPv6ç¯å²",base64:"base64ã¨ã³ã³ã¼ãæåå",base64url:"base64urlã¨ã³ã³ã¼ãæåå",json_string:"JSONæåå",e164:"E.164çªå·",jwt:"JWT",template_literal:"å
¥åå¤"},r={nan:"NaN",number:"æ°å¤",array:"é
å"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`ç¡å¹ãªå
¥å: instanceof ${i.expected}ãæå¾
ããã¾ãããã${n}ãå
¥åããã¾ãã`;return`ç¡å¹ãªå
¥å: ${e}ãæå¾
ããã¾ãããã${n}ãå
¥åããã¾ãã`}case"invalid_value":if(1===i.values.length)return`ç¡å¹ãªå
¥å: ${rE(i.values[0])}ãæå¾
ããã¾ãã`;return`ç¡å¹ãªé¸æ: ${rr(i.values,"ã")}ã®ããããã§ããå¿
è¦ãããã¾ã`;case"too_big":{let t=i.inclusive?"以ä¸ã§ãã":"ããå°ãã",r=e[i.origin]??null;if(r)return`大ããããå¤: ${i.origin??"å¤"}ã¯${i.maximum.toString()}${r.unit??"è¦ç´ "}${t}å¿
è¦ãããã¾ã`;return`大ããããå¤: ${i.origin??"å¤"}ã¯${i.maximum.toString()}${t}å¿
è¦ãããã¾ã`}case"too_small":{let t=i.inclusive?"以ä¸ã§ãã":"ãã大ãã",r=e[i.origin]??null;if(r)return`å°ããããå¤: ${i.origin}ã¯${i.minimum.toString()}${r.unit}${t}å¿
è¦ãããã¾ã`;return`å°ããããå¤: ${i.origin}ã¯${i.minimum.toString()}${t}å¿
è¦ãããã¾ã`}
77case"invalid_format":if("starts_with"===i.format)return`ç¡å¹ãªæåå: "${i.prefix}"ã§å§ã¾ãå¿
è¦ãããã¾ã`;if("ends_with"===i.format)return`ç¡å¹ãªæåå: "${i.suffix}"ã§çµããå¿
è¦ãããã¾ã`;if("includes"===i.format)return`ç¡å¹ãªæåå: "${i.includes}"ãå«ãå¿
è¦ãããã¾ã`;if("regex"===i.format)return`ç¡å¹ãªæåå: ãã¿ã¼ã³${i.pattern}ã«ä¸è´ããå¿
è¦ãããã¾ã`;return`ç¡å¹ãª${t[i.format]??i.format}`;case"not_multiple_of":return`ç¡å¹ãªæ°å¤: ${i.divisor}ã®åæ°ã§ããå¿
è¦ãããã¾ã`;case"unrecognized_keys":return`èªèããã¦ããªããã¼${i.keys.length>1?"群":""}: ${rr(i.keys,"ã")}`;case"invalid_key":return`${i.origin}å
ã®ç¡å¹ãªãã¼`;case"invalid_union":default:return"ç¡å¹ãªå
¥å";case"invalid_element":return`${i.origin}å
ã®ç¡å¹ãªå¤`}})}},"ka",0,function(){let e,t,r;return{localeError:(e={string:{unit:"á¡áááááá",verb:"á£ááá á¨áááªááááá¡"},file:{unit:"áááá¢á",verb:"á£ááá á¨áááªááááá¡"},array:{unit:"ááááááá¢á",verb:"á£ááá á¨áááªááááá¡"},set:{unit:"ááááááá¢á",verb:"á£ááá á¨áááªááááá¡"}},t={regex:"á¨áá§áááá",email:"áá-á¤áá¡á¢áá¡ ááá¡áááá áá",url:"URL",emoji:"áááá¯á",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ááá áá¦á-áá á",date:"ááá áá¦á",time:"áá á",duration:"á®áááá á«áááááá",ipv4:"IPv4 ááá¡áááá áá",ipv6:"IPv6 ááá¡áááá áá",cidrv4:"IPv4 ááááááááá",cidrv6:"IPv6 ááááááááá",base64:"base64-ááááá ááá£áá áááá",base64url:"base64url-ááááá ááá£áá áááá",json_string:"JSON áááá",e164:"E.164 ááááá á",jwt:"JWT",template_literal:"á¨áá§áááá"},r={nan:"NaN",number:"á ááªá®áá",string:"áááá",boolean:"áá£ááááá",function:"á¤á£áá¥áªáá",array:"ááá¡ááá"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`áá áá¡á¬áá á á¨áá§áááá: ááá¡áááááááá instanceof ${i.expected}, ááá¦ááá£áá ${n}`;return`áá áá¡á¬áá á á¨áá§áááá: ááá¡áááááááá ${e}, ááá¦ááá£áá ${n}`}case"invalid_value":if(1===i.values.length)return`áá áá¡á¬áá á á¨áá§áááá: ááá¡áááááááá ${rE(i.values[0])}`;return`áá áá¡á¬áá á ááá áááá¢á: ááá¡ááááááááá áá á-áá áá ${rr(i.values,"|")}-ááá`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`áááááá¢áá áááá: ááá¡áááááááá ${i.origin??"áááá¨ááááááá"} ${r.verb} ${t}${i.maximum.toString()} ${r.unit}`;return`áááááá¢áá áááá: ááá¡áááááááá ${i.origin??"áááá¨ááááááá"} áá§áá¡ ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`áááááá¢áá ááá¢áá á: ááá¡áááááááá ${i.origin} ${r.verb} ${t}${i.minimum.toString()} ${r.unit}`;return`áááááá¢áá ááá¢áá á: ááá¡áááááááá ${i.origin} áá§áá¡ ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`áá áá¡á¬áá á áááá: á£ááá áá¬á§áááááá¡ "${i.prefix}"-áá`;if("ends_with"===i.format)return`áá áá¡á¬áá á áááá: á£ááá ááááá ááááááá¡ "${i.suffix}"-áá`;if("includes"===i.format)return`áá áá¡á¬áá á áááá: á£ááá á¨áááªááááá¡ "${i.includes}"-á¡`;if("regex"===i.format)return`áá áá¡á¬áá á áááá: á£ááá á¨ááá¡áááááááááá¡ á¨áááááá¡ ${i.pattern}`;return`áá áá¡á¬áá á ${t[i.format]??i.format}`;case"not_multiple_of":return`áá áá¡á¬áá á á ááªá®áá: á£ááá áá§áá¡ ${i.divisor}-áá¡ á¯áá ááá`;case"unrecognized_keys":return`á£áªáááá ááá¡áá¦áá${i.keys.length>1?"ááá":"á"}: ${rr(i.keys,", ")}`;
77case"invalid_key":return`áá áá¡á¬áá á ááá¡áá¦ááá ${i.origin}-á¨á`;case"invalid_union":default:return"áá áá¡á¬áá á á¨áá§áááá";case"invalid_element":return`áá áá¡á¬áá á áááá¨ááááááá ${i.origin}-á¨á`}})}},"kh",0,function(){return a3()},"km",0,a3,"ko",0,function(){let e,t,r;return{localeError:(e={string:{unit:"문ì",verb:"to have"},file:{unit:"ë°ì´í¸",verb:"to have"},array:{unit:"ê°",verb:"to have"},set:{unit:"ê°",verb:"to have"}},t={regex:"ì
ë ¥",email:"ì´ë©ì¼ 주ì",url:"URL",emoji:"ì´ëª¨ì§",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ë ì§ìê°",date:"ISO ë ì§",time:"ISO ìê°",duration:"ISO 기ê°",ipv4:"IPv4 주ì",ipv6:"IPv6 주ì",cidrv4:"IPv4 ë²ì",cidrv6:"IPv6 ë²ì",base64:"base64 ì¸ì½ë© 문ìì´",base64url:"base64url ì¸ì½ë© 문ìì´",json_string:"JSON 문ìì´",e164:"E.164 ë²í¸",jwt:"JWT",template_literal:"ì
ë ¥"},r={nan:"NaN"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`ì못ë ì
ë ¥: ìì íì
ì instanceof ${i.expected}, ë°ì íì
ì ${n}ì
ëë¤`;return`ì못ë ì
ë ¥: ìì íì
ì ${e}, ë°ì íì
ì ${n}ì
ëë¤`}case"invalid_value":if(1===i.values.length)return`ì못ë ì
ë ¥: ê°ì ${rE(i.values[0])} ì´ì´ì¼ í©ëë¤`;return`ì못ë ìµì
: ${rr(i.values,"ëë ")} ì¤ íëì¬ì¼ í©ëë¤`;case"too_big":{let t=i.inclusive?"ì´í":"미ë§",r="미ë§"===t?"ì´ì´ì¼ í©ëë¤":"ì¬ì¼ í©ëë¤",n=e[i.origin]??null,a=n?.unit??"ìì";if(n)return`${i.origin??"ê°"}ì´ ë무 í½ëë¤: ${i.maximum.toString()}${a} ${t}${r}`;return`${i.origin??"ê°"}ì´ ë무 í½ëë¤: ${i.maximum.toString()} ${t}${r}`}case"too_small":{let t=i.inclusive?"ì´ì":"ì´ê³¼",r="ì´ì"===t?"ì´ì´ì¼ í©ëë¤":"ì¬ì¼ í©ëë¤",n=e[i.origin]??null,a=n?.unit??"ìì";if(n)return`${i.origin??"ê°"}ì´ ë무 ììµëë¤: ${i.minimum.toString()}${a} ${t}${r}`;return`${i.origin??"ê°"}ì´ ë무 ììµëë¤: ${i.minimum.toString()} ${t}${r}`}case"invalid_format":if("starts_with"===i.format)return`ì못ë 문ìì´: "${i.prefix}"(ì¼)ë¡ ììí´ì¼ í©ëë¤`;if("ends_with"===i.format)return`ì못ë 문ìì´: "${i.suffix}"(ì¼)ë¡ ëëì¼ í©ëë¤`;if("includes"===i.format)return`ì못ë 문ìì´: "${i.includes}"ì(를) í¬í¨í´ì¼ í©ëë¤`;if("regex"===i.format)return`ì못ë 문ìì´: ì ê·ì ${i.pattern} í¨í´ê³¼ ì¼ì¹í´ì¼ í©ëë¤`;return`ì못ë ${t[i.format]??i.format}`;case"not_multiple_of":return`ì못ë ì«ì: ${i.divisor}ì ë°°ìì¬ì¼ í©ëë¤`;case"unrecognized_keys":return`ì¸ìí ì ìë í¤: ${rr(i.keys,", ")}`;case"invalid_key":return`ì못ë í¤: ${i.origin}`;case"invalid_union":default:return"ì못ë ì
ë ¥";case"invalid_element":return`ì못ë ê°: ${i.origin}`}})}},"lt",0,function(){return{localeError:(()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi bÅ«ti ne ilgesnÄ kaip",notInclusive:"turi bÅ«ti trumpesnÄ kaip"},bigger:{inclusive:"turi bÅ«ti ne trumpesnÄ kaip",notInclusive:"turi bÅ«ti ilgesnÄ kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi bÅ«ti ne didesnis kaip",notInclusive:"turi bÅ«ti mažesnis kaip"},bigger:{inclusive:"turi bÅ«ti ne mažesnis kaip",notInclusive:"turi bÅ«ti didesnis kaip"}}},array:{unit:{one:"elementÄ
",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turÄti ne daugiau kaip",notInclusive:"turi turÄti mažiau kaip"},bigger:{inclusive:"turi turÄti ne mažiau kaip",notInclusive:"turi turÄti daugiau kaip"}}},set:{unit:{one:"elementÄ
",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turÄti ne daugiau kaip",notInclusive:"turi turÄti mažiau kaip"},bigger:{inclusive:"turi turÄti ne mažiau kaip",notInclusive:"turi turÄti daugiau kaip"}}}};function t(t,r,i,n){let a=e[t]??null;return null===a?a:{unit:a.unit[r],verb:a.verb[n][i?"inclusive":"notInclusive"]}}let r={regex:"įvestis",email:"el. paÅ¡to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmÄ",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutÄ",base64url:"base64url užkoduota eilutÄ",json_string:"JSON eilutÄ",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},i={nan:"NaN",number:"skaiÄius",bigint:"sveikasis skaiÄius",string:"eilutÄ",boolean:"loginÄ reikÅ¡mÄ",undefined:"neapibrÄžta reikÅ¡mÄ",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinÄ reikÅ¡mÄ"};return e=>
77{switch(e.code){case"invalid_type":{let t=i[e.expected]??e.expected,r=r$(e.input),n=i[r]??r;if(/^[A-Z]/.test(e.expected))return`Gautas tipas ${n}, o tikÄtasi - instanceof ${e.expected}`;return`Gautas tipas ${n}, o tikÄtasi - ${t}`}case"invalid_value":if(1===e.values.length)return`Privalo bÅ«ti ${rE(e.values[0])}`;return`Privalo bÅ«ti vienas iÅ¡ ${rr(e.values,"|")} pasirinkimų`;case"too_big":{let r=i[e.origin]??e.origin,n=t(e.origin,a7(Number(e.maximum)),e.inclusive??!1,"smaller");if(n?.verb)return`${a8(r??e.origin??"reikÅ¡mÄ")} ${n.verb} ${e.maximum.toString()} ${n.unit??"elementų"}`;let a=e.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${a8(r??e.origin??"reikÅ¡mÄ")} turi bÅ«ti ${a} ${e.maximum.toString()} ${n?.unit}`}case"too_small":{let r=i[e.origin]??e.origin,n=t(e.origin,a7(Number(e.minimum)),e.inclusive??!1,"bigger");if(n?.verb)return`${a8(r??e.origin??"reikÅ¡mÄ")} ${n.verb} ${e.minimum.toString()} ${n.unit??"elementų"}`;let a=e.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${a8(r??e.origin??"reikÅ¡mÄ")} turi bÅ«ti ${a} ${e.minimum.toString()} ${n?.unit}`}case"invalid_format":if("starts_with"===e.format)return`EilutÄ privalo prasidÄti "${e.prefix}"`;if("ends_with"===e.format)return`EilutÄ privalo pasibaigti "${e.suffix}"`;if("includes"===e.format)return`EilutÄ privalo įtraukti "${e.includes}"`;if("regex"===e.format)return`EilutÄ privalo atitikti ${e.pattern}`;return`Neteisingas ${r[e.format]??e.format}`;case"not_multiple_of":return`SkaiÄius privalo bÅ«ti ${e.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${e.keys.length>1?"i":"as"} rakt${e.keys.length>1?"ai":"as"}: ${rr(e.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":default:return"Klaidinga įvestis";case"invalid_element":{let t=i[e.origin]??e.origin;return`${a8(t??e.origin??"reikÅ¡mÄ")} turi klaidingÄ
įvestį`}}}})()}},"mk",0,function(){let e,t,r;return{localeError:(e={string:{unit:"знаÑи",verb:"да имааÑ"},file:{unit:"баÑÑи",verb:"да имааÑ"},array:{unit:"ÑÑавки",verb:"да имааÑ"},set:{unit:"ÑÑавки",verb:"да имааÑ"}},t={regex:"внеÑ",email:"адÑеÑа на е-поÑÑа",url:"URL",emoji:"емоÑи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO даÑÑм и вÑеме",date:"ISO даÑÑм",time:"ISO вÑеме",duration:"ISO вÑемеÑÑаеÑе",ipv4:"IPv4 адÑеÑа",ipv6:"IPv6 адÑеÑа",cidrv4:"IPv4 опÑег",cidrv6:"IPv6 опÑег",base64:"base64-енкодиÑана низа",base64url:"base64url-енкодиÑана низа",json_string:"JSON низа",e164:"E.164 бÑоÑ",jwt:"JWT",template_literal:"внеÑ"},r={nan:"NaN",number:"бÑоÑ",array:"низа"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`ÐÑеÑен внеÑ: Ñе оÑекÑва instanceof ${i.expected}, пÑимено ${n}`;return`ÐÑеÑен внеÑ: Ñе оÑекÑва ${e}, пÑимено ${n}`}case"invalid_value":if(1===i.values.length)return`Invalid input: expected ${rE(i.values[0])}`;return`ÐÑеÑана опÑиÑа: Ñе оÑекÑва една ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`ÐÑÐµÐ¼Ð½Ð¾Ð³Ñ Ð³Ð¾Ð»ÐµÐ¼: Ñе оÑекÑва ${i.origin??"вÑедноÑÑа"} да има ${t}${i.maximum.toString()} ${r.unit??"елеменÑи"}`;return`ÐÑÐµÐ¼Ð½Ð¾Ð³Ñ Ð³Ð¾Ð»ÐµÐ¼: Ñе оÑекÑва ${i.origin??"вÑедноÑÑа"} да биде ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`ÐÑÐµÐ¼Ð½Ð¾Ð³Ñ Ð¼Ð°Ð»: Ñе оÑекÑва ${i.origin} да има ${t}${i.minimum.toString()} ${r.unit}`;return`ÐÑÐµÐ¼Ð½Ð¾Ð³Ñ Ð¼Ð°Ð»: Ñе оÑекÑва ${i.origin} да биде ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`ÐеважеÑка низа: моÑа да запоÑнÑва Ñо "${i.prefix}"`;if("ends_with"===i.format)return`ÐеважеÑка низа: моÑа да завÑÑÑва Ñо "${i.suffix}"`;if("includes"===i.format)return`ÐеважеÑка низа: моÑа да вклÑÑÑва "${i.includes}"`;if("regex"===i.format)return`ÐеважеÑка низа: моÑа да одгоаÑа на паÑеÑÐ½Ð¾Ñ ${i.pattern}`;return`Invalid ${t[i.format]??i.format}`;case"not_multiple_of":return`ÐÑеÑен бÑоÑ: моÑа да биде делив Ñо ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"ÐепÑепознаени клÑÑеви":"ÐепÑепознаен клÑÑ"}: ${rr(i.keys,", ")}`;
77case"invalid_key":return`ÐÑеÑен клÑÑ Ð²Ð¾ ${i.origin}`;case"invalid_union":default:return"ÐÑеÑен внеÑ";case"invalid_element":return`ÐÑеÑна вÑедноÑÑ Ð²Ð¾ ${i.origin}`}})}},"ms",0,function(){let e,t,r;return{localeError:(e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}},t={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"nombor"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${n}`;return`Input tidak sah: dijangka ${e}, diterima ${n}`}case"invalid_value":if(1===i.values.length)return`Input tidak sah: dijangka ${rE(i.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Terlalu besar: dijangka ${i.origin??"nilai"} ${r.verb} ${t}${i.maximum.toString()} ${r.unit??"elemen"}`;return`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Terlalu kecil: dijangka ${i.origin} ${r.verb} ${t}${i.minimum.toString()} ${r.unit}`;return`Terlalu kecil: dijangka ${i.origin} adalah ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if("ends_with"===i.format)return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if("includes"===i.format)return`String tidak sah: mesti mengandungi "${i.includes}"`;if("regex"===i.format)return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${t[i.format]??i.format} tidak sah`;case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${rr(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":default:return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`}})}},"nl",0,function(){let e,t,r;return{localeError:(e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}},t={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},r={nan:"NaN",number:"getal"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${n}`;return`Ongeldige invoer: verwacht ${e}, ontving ${n}`}case"invalid_value":if(1===i.values.length)return`Ongeldige invoer: verwacht ${rE(i.values[0])}`;return`Ongeldige optie: verwacht \xe9\xe9n van ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null,n="date"===i.origin?"laat":"string"===i.origin?"lang":"groot";if(r)return`Te ${n}: verwacht dat ${i.origin??"waarde"} ${t}${i.maximum.toString()} ${r.unit??"elementen"} ${r.verb}`;return`Te ${n}: verwacht dat ${i.origin??"waarde"} ${t}${i.maximum.toString()} is`}case"too_small":{let t=i.inclusive?">=":">
77",r=e[i.origin]??null,n="date"===i.origin?"vroeg":"string"===i.origin?"kort":"klein";if(r)return`Te ${n}: verwacht dat ${i.origin} ${t}${i.minimum.toString()} ${r.unit} ${r.verb}`;return`Te ${n}: verwacht dat ${i.origin} ${t}${i.minimum.toString()} is`}case"invalid_format":if("starts_with"===i.format)return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if("ends_with"===i.format)return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if("includes"===i.format)return`Ongeldige tekst: moet "${i.includes}" bevatten`;if("regex"===i.format)return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${t[i.format]??i.format}`;case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":default:return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`}})}},"no",0,function(){let e,t,r;return{localeError:(e={string:{unit:"tegn",verb:"Ã¥ ha"},file:{unit:"bytes",verb:"Ã¥ ha"},array:{unit:"elementer",verb:"Ã¥ inneholde"},set:{unit:"elementer",verb:"Ã¥ inneholde"}},t={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omrÃ¥de",ipv6:"IPv6-omrÃ¥de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tall",array:"liste"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Ugyldig input: forventet instanceof ${i.expected}, fikk ${n}`;return`Ugyldig input: forventet ${e}, fikk ${n}`}case"invalid_value":if(1===i.values.length)return`Ugyldig verdi: forventet ${rE(i.values[0])}`;return`Ugyldig valg: forventet en av ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`For stor(t): forventet ${i.origin??"value"} til \xe5 ha ${t}${i.maximum.toString()} ${r.unit??"elementer"}`;return`For stor(t): forventet ${i.origin??"value"} til \xe5 ha ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`For lite(n): forventet ${i.origin} til \xe5 ha ${t}${i.minimum.toString()} ${r.unit}`;return`For lite(n): forventet ${i.origin} til \xe5 ha ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Ugyldig streng: m\xe5 starte med "${i.prefix}"`;if("ends_with"===i.format)return`Ugyldig streng: m\xe5 ende med "${i.suffix}"`;if("includes"===i.format)return`Ugyldig streng: m\xe5 inneholde "${i.includes}"`;if("regex"===i.format)return`Ugyldig streng: m\xe5 matche m\xf8nsteret ${i.pattern}`;return`Ugyldig ${t[i.format]??i.format}`;case"not_multiple_of":return`Ugyldig tall: m\xe5 v\xe6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${rr(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xf8kkel i ${i.origin}`;case"invalid_union":default:return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`}})}},"ota",0,function(){let e,t,r;return{localeError:(e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}},t={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 niÅânı",ipv6:"IPv6 niÅânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-Åifreli metin",base64url:"base64url-Åifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"},i=>
77{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`F\xe2sit giren: umulan instanceof ${i.expected}, alınan ${n}`;return`F\xe2sit giren: umulan ${e}, alınan ${n}`}case"invalid_value":if(1===i.values.length)return`F\xe2sit giren: umulan ${rE(i.values[0])}`;return`F\xe2sit tercih: m\xfbteberler ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Fazla b\xfcy\xfck: ${i.origin??"value"}, ${t}${i.maximum.toString()} ${r.unit??"elements"} sahip olmalıydı.`;return`Fazla b\xfcy\xfck: ${i.origin??"value"}, ${t}${i.maximum.toString()} olmalıydı.`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Fazla k\xfc\xe7\xfck: ${i.origin}, ${t}${i.minimum.toString()} ${r.unit} sahip olmalıydı.`;return`Fazla k\xfc\xe7\xfck: ${i.origin}, ${t}${i.minimum.toString()} olmalıydı.`}case"invalid_format":if("starts_with"===i.format)return`F\xe2sit metin: "${i.prefix}" ile baÅlamalı.`;if("ends_with"===i.format)return`F\xe2sit metin: "${i.suffix}" ile bitmeli.`;if("includes"===i.format)return`F\xe2sit metin: "${i.includes}" ihtiv\xe2 etmeli.`;if("regex"===i.format)return`F\xe2sit metin: ${i.pattern} nakÅına uymalı.`;return`F\xe2sit ${t[i.format]??i.format}`;case"not_multiple_of":return`F\xe2sit sayı: ${i.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${i.keys.length>1?"s":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xe7in tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${i.origin} i\xe7in tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}})}},"pl",0,function(){let e,t,r;return{localeError:(e={string:{unit:"znaków",verb:"mieÄ"},file:{unit:"bajtów",verb:"mieÄ"},array:{unit:"elementów",verb:"mieÄ"},set:{unit:"elementów",verb:"mieÄ"}},t={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciÄ
g znaków zakodowany w formacie base64",base64url:"ciÄ
g znaków zakodowany w formacie base64url",json_string:"ciÄ
g znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejÅcie"},r={nan:"NaN",number:"liczba",array:"tablica"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`NieprawidÅowe dane wejÅciowe: oczekiwano instanceof ${i.expected}, otrzymano ${n}`;return`NieprawidÅowe dane wejÅciowe: oczekiwano ${e}, otrzymano ${n}`}case"invalid_value":if(1===i.values.length)return`NieprawidÅowe dane wejÅciowe: oczekiwano ${rE(i.values[0])}`;return`NieprawidÅowa opcja: oczekiwano jednej z wartoÅci ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Za duża wartoÅÄ: oczekiwano, że ${i.origin??"wartoÅÄ"} bÄdzie mieÄ ${t}${i.maximum.toString()} ${r.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${i.origin??"wartoÅÄ"} bÄdzie wynosiÄ ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Za maÅa wartoÅÄ: oczekiwano, że ${i.origin??"wartoÅÄ"} bÄdzie mieÄ ${t}${i.minimum.toString()} ${r.unit??"elementów"}`;return`Zbyt maÅ(y/a/e): oczekiwano, że ${i.origin??"wartoÅÄ"} bÄdzie wynosiÄ ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`NieprawidÅowy ciÄ
g znak\xf3w: musi zaczynaÄ siÄ od "${i.prefix}"`;if("ends_with"===i.format)return`NieprawidÅowy ciÄ
g znak\xf3w: musi koÅczyÄ siÄ na "${i.suffix}"`;if("includes"===i.format)return`NieprawidÅowy ciÄ
g znak\xf3w: musi zawieraÄ "${i.includes}"`;if("regex"===i.format)return`NieprawidÅowy ciÄ
g znak\xf3w: musi odpowiadaÄ wzorcowi ${i.pattern}`;return`NieprawidÅow(y/a/e) ${t[i.format]??i.format}`;case"not_multiple_of":return`NieprawidÅowa liczba: musi byÄ wielokrotnoÅciÄ
${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>
771?"s":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`NieprawidÅowy klucz w ${i.origin}`;case"invalid_union":default:return"NieprawidÅowe dane wejÅciowe";case"invalid_element":return`NieprawidÅowa wartoÅÄ w ${i.origin}`}})}},"ps",0,function(){let e,t,r;return{localeError:(e={string:{unit:"تÙÚ©Ù",verb:"ÙÙØ±Ù"},file:{unit:"باÛټس",verb:"ÙÙØ±Ù"},array:{unit:"تÙÚ©Ù",verb:"ÙÙØ±Ù"},set:{unit:"تÙÚ©Ù",verb:"ÙÙØ±Ù"}},t={regex:"ÙØ±ÙدÙ",email:"برÛÚÙØ§ÙÛÚ©",url:"Û٠آر اÙ",emoji:"اÛÙ
ÙØ¬Ù",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ÙÛÙ¼Ù Ø§Ù ÙØ®Øª",date:"ÙÛÙ¼Ù",time:"ÙØ®Øª",duration:"Ù
ÙØ¯Ù",ipv4:"د IPv4 پتÙ",ipv6:"د IPv6 پتÙ",cidrv4:"د IPv4 ساØÙ",cidrv6:"د IPv6 ساØÙ",base64:"base64-encoded Ù
تÙ",base64url:"base64url-encoded Ù
تÙ",json_string:"JSON Ù
تÙ",e164:"د E.164 Ø´Ù
ÛØ±Ù",jwt:"JWT",template_literal:"ÙØ±ÙدÙ"},r={nan:"NaN",number:"عدد",array:"ارÛ"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`ÙØ§Ø³Ù
ÙØ±ÙدÙ: Ø¨Ø§ÛØ¯ instanceof ${i.expected} ÙØ§Û, Ù
ګر ${n} ØªØ±ÙØ§Ø³Ù Ø´Ù`;return`ÙØ§Ø³Ù
ÙØ±ÙدÙ: Ø¨Ø§ÛØ¯ ${e} ÙØ§Û, Ù
ګر ${n} ØªØ±ÙØ§Ø³Ù Ø´Ù`}case"invalid_value":if(1===i.values.length)return`ÙØ§Ø³Ù
ÙØ±ÙدÙ: Ø¨Ø§ÛØ¯ ${rE(i.values[0])} ÙØ§Û`;return`ÙØ§Ø³Ù
Ø§ÙØªØ®Ø§Ø¨: Ø¨Ø§ÛØ¯ ÛÙ ÙÙ ${rr(i.values,"|")} Ú
Ø®Ù ÙØ§Û`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`ÚÛØ± ÙÙÛ: ${i.origin??"Ø§Ø±Ø²ÚØª"} Ø¨Ø§ÛØ¯ ${t}${i.maximum.toString()} ${r.unit??"Ø¹ÙØµØ±ÙÙÙ"} ÙÙØ±Ù`;return`ÚÛØ± ÙÙÛ: ${i.origin??"Ø§Ø±Ø²ÚØª"} Ø¨Ø§ÛØ¯ ${t}${i.maximum.toString()} ÙÙ`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`ÚÛØ± Ú©ÙÚÙÛ: ${i.origin} Ø¨Ø§ÛØ¯ ${t}${i.minimum.toString()} ${r.unit} ÙÙØ±Ù`;return`ÚÛØ± Ú©ÙÚÙÛ: ${i.origin} Ø¨Ø§ÛØ¯ ${t}${i.minimum.toString()} ÙÙ`}case"invalid_format":if("starts_with"===i.format)return`ÙØ§Ø³Ù
Ù
تÙ: Ø¨Ø§ÛØ¯ د "${i.prefix}" سر٠پÛÙ Ø´Ù`;if("ends_with"===i.format)return`ÙØ§Ø³Ù
Ù
تÙ: Ø¨Ø§ÛØ¯ د "${i.suffix}" Ø³Ø±Ù Ù¾Ø§Û ØªÙ ÙØ±Ø³ÙÚÙ`;if("includes"===i.format)return`ÙØ§Ø³Ù
Ù
تÙ: Ø¨Ø§ÛØ¯ "${i.includes}" ÙÙØ±Ù`;if("regex"===i.format)return`ÙØ§Ø³Ù
Ù
تÙ: Ø¨Ø§ÛØ¯ د ${i.pattern} سر٠Ù
Ø·Ø§Ø¨ÙØª ÙÙØ±Ù`;return`${t[i.format]??i.format} ÙØ§Ø³Ù
دÛ`;case"not_multiple_of":return`ÙØ§Ø³Ù
عدد: Ø¨Ø§ÛØ¯ د ${i.divisor} Ù
ضرب ÙÙ`;case"unrecognized_keys":return`ÙØ§Ø³Ù
${i.keys.length>1?"Ú©ÙÛÚÙÙÙ":"Ú©ÙÛÚ"}: ${rr(i.keys,", ")}`;case"invalid_key":return`ÙØ§Ø³Ù
Ú©ÙÛÚ Ù¾Ù ${i.origin} Ú©Û`;case"invalid_union":default:return"ÙØ§Ø³Ù
Ù ÙØ±ÙدÙ";case"invalid_element":return`ÙØ§Ø³Ù
Ø¹ÙØµØ± Ù¾Ù ${i.origin} Ú©Û`}})}},"pt",0,function(){let e,t,r;return{localeError:(e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}},t={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",number:"número",null:"nulo"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Tipo inv\xe1lido: esperado instanceof ${i.expected}, recebido ${n}`;return`Tipo inv\xe1lido: esperado ${e}, recebido ${n}`}case"invalid_value":if(1===i.values.length)return`Entrada inv\xe1lida: esperado ${rE(i.values[0])}`;return`Op\xe7\xe3o inv\xe1lida: esperada uma das ${rr(i.values,"|")}`;
77case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Muito grande: esperado que ${i.origin??"valor"} tivesse ${t}${i.maximum.toString()} ${r.unit??"elementos"}`;return`Muito grande: esperado que ${i.origin??"valor"} fosse ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Muito pequeno: esperado que ${i.origin} tivesse ${t}${i.minimum.toString()} ${r.unit}`;return`Muito pequeno: esperado que ${i.origin} fosse ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Texto inv\xe1lido: deve come\xe7ar com "${i.prefix}"`;if("ends_with"===i.format)return`Texto inv\xe1lido: deve terminar com "${i.suffix}"`;if("includes"===i.format)return`Texto inv\xe1lido: deve incluir "${i.includes}"`;if("regex"===i.format)return`Texto inv\xe1lido: deve corresponder ao padr\xe3o ${i.pattern}`;return`${t[i.format]??i.format} inv\xe1lido`;case"not_multiple_of":return`N\xfamero inv\xe1lido: deve ser m\xfaltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`Chave inv\xe1lida em ${i.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inv\xe1lido em ${i.origin}`;default:return"Campo inválido"}})}},"ro",0,function(){let e,t,r;return{localeError:(e={string:{unit:"caractere",verb:"sÄ aibÄ"},file:{unit:"octeÈi",verb:"sÄ aibÄ"},array:{unit:"elemente",verb:"sÄ aibÄ"},set:{unit:"elemente",verb:"sÄ aibÄ"},map:{unit:"intrÄri",verb:"sÄ aibÄ"}},t={regex:"intrare",email:"adresÄ de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datÄ Èi orÄ ISO",date:"datÄ ISO",time:"orÄ ISO",duration:"duratÄ ISO",ipv4:"adresÄ IPv4",ipv6:"adresÄ IPv6",mac:"adresÄ MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"Èir codat base64",base64url:"Èir codat base64url",json_string:"Èir JSON",e164:"numÄr E.164",jwt:"JWT",template_literal:"intrare"},r={nan:"NaN",string:"Èir",number:"numÄr",boolean:"boolean",function:"funcÈie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"numÄr mare",void:"void",never:"never",map:"hartÄ",set:"set"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;return`Intrare invalidÄ: aÈteptat ${e}, primit ${n}`}case"invalid_value":if(1===i.values.length)return`Intrare invalidÄ: aÈteptat ${rE(i.values[0])}`;return`OpÈiune invalidÄ: aÈteptat una dintre ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Prea mare: aÈteptat ca ${i.origin??"valoarea"} ${r.verb} ${t}${i.maximum.toString()} ${r.unit??"elemente"}`;return`Prea mare: aÈteptat ca ${i.origin??"valoarea"} sÄ fie ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Prea mic: aÈteptat ca ${i.origin} ${r.verb} ${t}${i.minimum.toString()} ${r.unit}`;return`Prea mic: aÈteptat ca ${i.origin} sÄ fie ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Èir invalid: trebuie sÄ \xeenceapÄ cu "${i.prefix}"`;if("ends_with"===i.format)return`Èir invalid: trebuie sÄ se termine cu "${i.suffix}"`;if("includes"===i.format)return`Èir invalid: trebuie sÄ includÄ "${i.includes}"`;if("regex"===i.format)return`Èir invalid: trebuie sÄ se potriveascÄ cu modelul ${i.pattern}`;return`Format invalid: ${t[i.format]??i.format}`;case"not_multiple_of":return`NumÄr invalid: trebuie sÄ fie multiplu de ${i.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${rr(i.keys,", ")}`;case"invalid_key":return`Cheie invalidÄ \xeen ${i.origin}`;case"invalid_union":default:return"Intrare invalidÄ";case"invalid_element":return`Valoare invalidÄ \xeen ${i.origin}`}})}},"ru",0,function(){let e,t,r;return{localeError:(e={string:{unit:{one:"Ñимвол",few:"Ñимвола",many:"Ñимволов"},verb:"имеÑÑ"},file:{unit:{one:"байÑ",few:"байÑа",many:"байÑ"},verb:"имеÑÑ"},array:{unit:{one:"ÑлеменÑ",few:"ÑлеменÑа",many:"ÑлеменÑов"},verb:"имеÑÑ"},set:{unit:{one:"ÑлеменÑ",few:"ÑлеменÑа",many:"ÑлеменÑов"},verb:"имеÑÑ"}},t={regex:"ввод",email:"email адÑеÑ",url:"URL",emoji:"Ñмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO даÑа и вÑемÑ",date:"ISO даÑа",time:"ISO вÑемÑ",duration:"ISO длиÑелÑноÑÑÑ",ipv4:"IPv4 адÑеÑ",ipv6:"IPv6 адÑеÑ",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"ÑÑÑока в ÑоÑмаÑе base64",base64url:"ÑÑÑока в ÑоÑмаÑе base64url",json_string:"JSON ÑÑÑока",e164:"Ð½Ð¾Ð¼ÐµÑ E.164",jwt:"JWT",template_literal:"ввод"},r={nan:"NaN",number:"ÑиÑло",array:"маÑÑив"},i=>
77{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`ÐевеÑнÑй ввод: ожидалоÑÑ instanceof ${i.expected}, полÑÑено ${n}`;return`ÐевеÑнÑй ввод: ожидалоÑÑ ${e}, полÑÑено ${n}`}case"invalid_value":if(1===i.values.length)return`ÐевеÑнÑй ввод: ожидалоÑÑ ${rE(i.values[0])}`;return`ÐевеÑнÑй ваÑианÑ: ожидалоÑÑ Ð¾Ð´Ð½Ð¾ из ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r){let e=a9(Number(i.maximum),r.unit.one,r.unit.few,r.unit.many);return`СлиÑком болÑÑое знаÑение: ожидалоÑÑ, ÑÑо ${i.origin??"знаÑение"} бÑÐ´ÐµÑ Ð¸Ð¼ÐµÑÑ ${t}${i.maximum.toString()} ${e}`}return`СлиÑком болÑÑое знаÑение: ожидалоÑÑ, ÑÑо ${i.origin??"знаÑение"} бÑÐ´ÐµÑ ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r){let e=a9(Number(i.minimum),r.unit.one,r.unit.few,r.unit.many);return`СлиÑком маленÑкое знаÑение: ожидалоÑÑ, ÑÑо ${i.origin} бÑÐ´ÐµÑ Ð¸Ð¼ÐµÑÑ ${t}${i.minimum.toString()} ${e}`}return`СлиÑком маленÑкое знаÑение: ожидалоÑÑ, ÑÑо ${i.origin} бÑÐ´ÐµÑ ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`ÐевеÑÐ½Ð°Ñ ÑÑÑока: должна наÑинаÑÑÑÑ Ñ "${i.prefix}"`;if("ends_with"===i.format)return`ÐевеÑÐ½Ð°Ñ ÑÑÑока: должна заканÑиваÑÑÑÑ Ð½Ð° "${i.suffix}"`;if("includes"===i.format)return`ÐевеÑÐ½Ð°Ñ ÑÑÑока: должна ÑодеÑжаÑÑ "${i.includes}"`;if("regex"===i.format)return`ÐевеÑÐ½Ð°Ñ ÑÑÑока: должна ÑооÑвеÑÑÑвоваÑÑ ÑÐ°Ð±Ð»Ð¾Ð½Ñ ${i.pattern}`;return`ÐевеÑнÑй ${t[i.format]??i.format}`;case"not_multiple_of":return`ÐевеÑное ÑиÑло: должно бÑÑÑ ÐºÑаÑнÑм ${i.divisor}`;case"unrecognized_keys":return`ÐеÑаÑпознанн${i.keys.length>1?"Ñе":"Ñй"} клÑÑ${i.keys.length>1?"и":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`ÐевеÑнÑй клÑÑ Ð² ${i.origin}`;case"invalid_union":default:return"ÐевеÑнÑе вÑ
однÑе даннÑе";case"invalid_element":return`ÐевеÑное знаÑение в ${i.origin}`}})}},"sl",0,function(){let e,t,r;return{localeError:(e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}},t={regex:"vnos",email:"e-poÅ¡tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in Äas",date:"ISO datum",time:"ISO Äas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 Å¡tevilka",jwt:"JWT",template_literal:"vnos"},r={nan:"NaN",number:"Å¡tevilo",array:"tabela"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Neveljaven vnos: priÄakovano instanceof ${i.expected}, prejeto ${n}`;return`Neveljaven vnos: priÄakovano ${e}, prejeto ${n}`}case"invalid_value":if(1===i.values.length)return`Neveljaven vnos: priÄakovano ${rE(i.values[0])}`;return`Neveljavna možnost: priÄakovano eno izmed ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Preveliko: priÄakovano, da bo ${i.origin??"vrednost"} imelo ${t}${i.maximum.toString()} ${r.unit??"elementov"}`;return`Preveliko: priÄakovano, da bo ${i.origin??"vrednost"} ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Premajhno: priÄakovano, da bo ${i.origin} imelo ${t}${i.minimum.toString()} ${r.unit}`;return`Premajhno: priÄakovano, da bo ${i.origin} ${t}${i.minimum.toString()}`}
77case"invalid_format":if("starts_with"===i.format)return`Neveljaven niz: mora se zaÄeti z "${i.prefix}"`;if("ends_with"===i.format)return`Neveljaven niz: mora se konÄati z "${i.suffix}"`;if("includes"===i.format)return`Neveljaven niz: mora vsebovati "${i.includes}"`;if("regex"===i.format)return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${t[i.format]??i.format}`;case"not_multiple_of":return`Neveljavno Å¡tevilo: mora biti veÄkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i kljuÄi":" kljuÄ"}: ${rr(i.keys,", ")}`;case"invalid_key":return`Neveljaven kljuÄ v ${i.origin}`;case"invalid_union":default:return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`}})}},"sv",0,function(){let e,t,r;return{localeError:(e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehÃ¥lla"},set:{unit:"objekt",verb:"att innehÃ¥lla"}},t={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},r={nan:"NaN",number:"antal",array:"lista"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Ogiltig inmatning: f\xf6rv\xe4ntat instanceof ${i.expected}, fick ${n}`;return`Ogiltig inmatning: f\xf6rv\xe4ntat ${e}, fick ${n}`}case"invalid_value":if(1===i.values.length)return`Ogiltig inmatning: f\xf6rv\xe4ntat ${rE(i.values[0])}`;return`Ogiltigt val: f\xf6rv\xe4ntade en av ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`F\xf6r stor(t): f\xf6rv\xe4ntade ${i.origin??"värdet"} att ha ${t}${i.maximum.toString()} ${r.unit??"element"}`;return`F\xf6r stor(t): f\xf6rv\xe4ntat ${i.origin??"värdet"} att ha ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`F\xf6r lite(t): f\xf6rv\xe4ntade ${i.origin??"värdet"} att ha ${t}${i.minimum.toString()} ${r.unit}`;return`F\xf6r lite(t): f\xf6rv\xe4ntade ${i.origin??"värdet"} att ha ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Ogiltig str\xe4ng: m\xe5ste b\xf6rja med "${i.prefix}"`;if("ends_with"===i.format)return`Ogiltig str\xe4ng: m\xe5ste sluta med "${i.suffix}"`;if("includes"===i.format)return`Ogiltig str\xe4ng: m\xe5ste inneh\xe5lla "${i.includes}"`;if("regex"===i.format)return`Ogiltig str\xe4ng: m\xe5ste matcha m\xf6nstret "${i.pattern}"`;return`Ogiltig(t) ${t[i.format]??i.format}`;case"not_multiple_of":return`Ogiltigt tal: m\xe5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${rr(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"värdet"}`;case"invalid_union":default:return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xe4rde i ${i.origin??"värdet"}`}})}},"ta",0,function(){let e,t,r;return{localeError:(e={string:{unit:"à®à®´à¯à®¤à¯à®¤à¯à®à¯à®à®³à¯",verb:"à®à¯à®£à¯à®à®¿à®°à¯à®à¯à® வà¯à®£à¯à®à¯à®®à¯"},file:{unit:"பà¯à®à¯à®à¯à®à®³à¯",verb:"à®à¯à®£à¯à®à®¿à®°à¯à®à¯à® வà¯à®£à¯à®à¯à®®à¯"},array:{unit:"à®à®±à¯à®ªà¯à®ªà¯à®à®³à¯",verb:"à®à¯à®£à¯à®à®¿à®°à¯à®à¯à® வà¯à®£à¯à®à¯à®®à¯"},set:{unit:"à®à®±à¯à®ªà¯à®ªà¯à®à®³à¯",verb:"à®à¯à®£à¯à®à®¿à®°à¯à®à¯à® வà¯à®£à¯à®à¯à®®à¯"}},t={regex:"à®à®³à¯à®³à¯à®à¯",email:"மினà¯à®©à®à¯à®à®²à¯ à®®à¯à®à®µà®°à®¿",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தà¯à®¤à®¿ நà¯à®°à®®à¯",date:"ISO தà¯à®¤à®¿",time:"ISO நà¯à®°à®®à¯",duration:"ISO à®à®¾à®² à®
ளவà¯",ipv4:"IPv4 à®®à¯à®à®µà®°à®¿",ipv6:"IPv6 à®®à¯à®à®µà®°à®¿",cidrv4:"IPv4 வரமà¯à®ª
77à¯",cidrv6:"IPv6 வரமà¯à®ªà¯",base64:"base64-encoded à®à®°à®®à¯",base64url:"base64url-encoded à®à®°à®®à¯",json_string:"JSON à®à®°à®®à¯",e164:"E.164 à®à®£à¯",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"à®à®£à¯",array:"à®
ணி",null:"வà¯à®±à¯à®®à¯"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`தவறான à®à®³à¯à®³à¯à®à¯: à®à®¤à®¿à®°à¯à®ªà®¾à®°à¯à®à¯à®à®ªà¯à®ªà®à¯à®à®¤à¯ instanceof ${i.expected}, பà¯à®±à®ªà¯à®ªà®à¯à®à®¤à¯ ${n}`;return`தவறான à®à®³à¯à®³à¯à®à¯: à®à®¤à®¿à®°à¯à®ªà®¾à®°à¯à®à¯à®à®ªà¯à®ªà®à¯à®à®¤à¯ ${e}, பà¯à®±à®ªà¯à®ªà®à¯à®à®¤à¯ ${n}`}case"invalid_value":if(1===i.values.length)return`தவறான à®à®³à¯à®³à¯à®à¯: à®à®¤à®¿à®°à¯à®ªà®¾à®°à¯à®à¯à®à®ªà¯à®ªà®à¯à®à®¤à¯ ${rE(i.values[0])}`;return`தவறான விரà¯à®ªà¯à®ªà®®à¯: à®à®¤à®¿à®°à¯à®ªà®¾à®°à¯à®à¯à®à®ªà¯à®ªà®à¯à®à®¤à¯ ${rr(i.values,"|")} à®à®²à¯ à®à®©à¯à®±à¯`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`மி஠பà¯à®°à®¿à®¯à®¤à¯: à®à®¤à®¿à®°à¯à®ªà®¾à®°à¯à®à¯à®à®ªà¯à®ªà®à¯à®à®¤à¯ ${i.origin??"மதிபà¯à®ªà¯"} ${t}${i.maximum.toString()} ${r.unit??"à®à®±à¯à®ªà¯à®ªà¯à®à®³à¯"} à®à® à®à®°à¯à®à¯à® வà¯à®£à¯à®à¯à®®à¯`;return`மி஠பà¯à®°à®¿à®¯à®¤à¯: à®à®¤à®¿à®°à¯à®ªà®¾à®°à¯à®à¯à®à®ªà¯à®ªà®à¯à®à®¤à¯ ${i.origin??"மதிபà¯à®ªà¯"} ${t}${i.maximum.toString()} à®à® à®à®°à¯à®à¯à® வà¯à®£à¯à®à¯à®®à¯`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`மிà®à®à¯ à®à®¿à®±à®¿à®¯à®¤à¯: à®à®¤à®¿à®°à¯à®ªà®¾à®°à¯à®à¯à®à®ªà¯à®ªà®à¯à®à®¤à¯ ${i.origin} ${t}${i.minimum.toString()} ${r.unit} à®à® à®à®°à¯à®à¯à® வà¯à®£à¯à®à¯à®®à¯`;return`மிà®à®à¯ à®à®¿à®±à®¿à®¯à®¤à¯: à®à®¤à®¿à®°à¯à®ªà®¾à®°à¯à®à¯à®à®ªà¯à®ªà®à¯à®à®¤à¯ ${i.origin} ${t}${i.minimum.toString()} à®à® à®à®°à¯à®à¯à® வà¯à®£à¯à®à¯à®®à¯`}case"invalid_format":if("starts_with"===i.format)return`தவறான à®à®°à®®à¯: "${i.prefix}" à®à®²à¯ தà¯à®à®à¯à® வà¯à®£à¯à®à¯à®®à¯`;if("ends_with"===i.format)return`தவறான à®à®°à®®à¯: "${i.suffix}" à®à®²à¯ à®®à¯à®à®¿à®µà®à¯à®¯ வà¯à®£à¯à®à¯à®®à¯`;if("includes"===i.format)return`தவறான à®à®°à®®à¯: "${i.includes}" à® à®à®³à¯à®³à®à®à¯à® வà¯à®£à¯à®à¯à®®à¯`;if("regex"===i.format)return`தவறான à®à®°à®®à¯: ${i.pattern} à®®à¯à®±à¯à®ªà®¾à®à¯à®à¯à®à®©à¯ பà¯à®°à¯à®¨à¯à®¤ வà¯à®£à¯à®à¯à®®à¯`;return`தவறான ${t[i.format]??i.format}`;case"not_multiple_of":return`தவறான à®à®£à¯: ${i.divisor} à®à®©à¯ பலமா஠à®à®°à¯à®à¯à® வà¯à®£à¯à®à¯à®®à¯`;case"unrecognized_keys":return`à®
à®à¯à®¯à®¾à®³à®®à¯ தà¯à®°à®¿à®¯à®¾à®¤ விà®à¯${i.keys.length>1?"à®à®³à¯":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`${i.origin} à®à®²à¯ தவறான விà®à¯`;case"invalid_union":default:return"தவறான à®à®³à¯à®³à¯à®à¯";case"invalid_element":return`${i.origin} à®à®²à¯ தவறான மதிபà¯à®ªà¯`}})}},"th",0,function(){let e,t,r;return{localeError:(e={string:{unit:"à¸à¸±à¸§à¸à¸±à¸à¸©à¸£",verb:"à¸à¸§à¸£à¸¡à¸µ"},file:{unit:"à¹à¸à¸à¹",verb:"à¸à¸§à¸£à¸¡à¸µ"},array:{unit:"รายà¸à¸²à¸£",verb:"à¸à¸§à¸£à¸¡à¸µ"},set:{unit:"รายà¸à¸²à¸£",verb:"à¸à¸§à¸£à¸¡à¸µ"}},t={regex:"à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸µà¹à¸à¹à¸à¸",email:"à¸à¸µà¹à¸à¸¢à¸¹à¹à¸à¸µà¹à¸¡à¸¥",url:"URL",emoji:"à¸à¸´à¹à¸¡à¸à¸´",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วัà¸à¸à¸µà¹à¹à¸§à¸¥à¸²à¹à¸à¸ ISO",date:"วัà¸à¸à¸µà¹à¹à¸à¸ ISO",time:"à¹à¸§à¸¥à¸²à¹à¸à¸ ISO",duration:"à¸à¹à¸§à¸à¹à¸§à¸¥à¸²à¹à¸à¸ ISO",ipv4:"à¸à¸µà¹à¸à¸¢à¸¹à¹ IPv4",ipv6:"à¸à¸µà¹à¸à¸¢à¸¹à¹ IPv6",cidrv4:"à¸à¹à¸§à¸ IP à¹à¸à¸ IPv4",cidrv6:"à¸à¹à¸§à¸ IP à¹à¸à¸ IPv6",base64:"à¸à¹à¸à¸à¸§à¸²à¸¡à¹à¸à¸ Base64",base64url:"à¸à¹à¸à¸à¸§à¸²à¸¡à¹à¸à¸ Base64 สำหรัภURL",json_string:"à¸à¹à¸à¸à¸§à¸²à¸¡à¹à¸à¸ JSON",e164:"à¹à¸à¸à¸£à¹à¹à¸à¸£à¸¨à¸±à¸à¸à¹à¸£à¸°à¸«à¸§à¹à¸²à¸à¸à¸£à¸°à¹à¸à¸¨ (E.164)",jwt:"à¹à¸à¹à¸à¸ JWT",template_literal:"à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸µà¹à¸à¹à¸à¸"},r={nan:"NaN",number:"à¸à¸±à¸§à¹à¸¥à¸",array:"à¸à¸²à¸£à¹à¹à¸£à¸¢à¹ (Array)",null:"à¹à¸¡à¹à¸¡à¸µà¸à¹à¸² (null)"},i=>
77{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`à¸à¸£à¸°à¹à¸ à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸: à¸à¸§à¸£à¹à¸à¹à¸ instanceof ${i.expected} à¹à¸à¹à¹à¸à¹à¸£à¸±à¸ ${n}`;return`à¸à¸£à¸°à¹à¸ à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸: à¸à¸§à¸£à¹à¸à¹à¸ ${e} à¹à¸à¹à¹à¸à¹à¸£à¸±à¸ ${n}`}case"invalid_value":if(1===i.values.length)return`à¸à¹à¸²à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸: à¸à¸§à¸£à¹à¸à¹à¸ ${rE(i.values[0])}`;return`à¸à¸±à¸§à¹à¸¥à¸·à¸à¸à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸: à¸à¸§à¸£à¹à¸à¹à¸à¸«à¸à¸¶à¹à¸à¹à¸ ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"à¹à¸¡à¹à¹à¸à¸´à¸":"à¸à¹à¸à¸¢à¸à¸§à¹à¸²",r=e[i.origin]??null;if(r)return`à¹à¸à¸´à¸à¸à¸³à¸«à¸à¸: ${i.origin??"à¸à¹à¸²"} à¸à¸§à¸£à¸¡à¸µ${t} ${i.maximum.toString()} ${r.unit??"รายà¸à¸²à¸£"}`;return`à¹à¸à¸´à¸à¸à¸³à¸«à¸à¸: ${i.origin??"à¸à¹à¸²"} à¸à¸§à¸£à¸¡à¸µ${t} ${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?"à¸à¸¢à¹à¸²à¸à¸à¹à¸à¸¢":"มาà¸à¸à¸§à¹à¸²",r=e[i.origin]??null;if(r)return`à¸à¹à¸à¸¢à¸à¸§à¹à¸²à¸à¸³à¸«à¸à¸: ${i.origin} à¸à¸§à¸£à¸¡à¸µ${t} ${i.minimum.toString()} ${r.unit}`;return`à¸à¹à¸à¸¢à¸à¸§à¹à¸²à¸à¸³à¸«à¸à¸: ${i.origin} à¸à¸§à¸£à¸¡à¸µ${t} ${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`รูà¸à¹à¸à¸à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸: à¸à¹à¸à¸à¸§à¸²à¸¡à¸à¹à¸à¸à¸à¸¶à¹à¸à¸à¹à¸à¸à¹à¸§à¸¢ "${i.prefix}"`;if("ends_with"===i.format)return`รูà¸à¹à¸à¸à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸: à¸à¹à¸à¸à¸§à¸²à¸¡à¸à¹à¸à¸à¸¥à¸à¸à¹à¸²à¸¢à¸à¹à¸§à¸¢ "${i.suffix}"`;if("includes"===i.format)return`รูà¸à¹à¸à¸à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸: à¸à¹à¸à¸à¸§à¸²à¸¡à¸à¹à¸à¸à¸¡à¸µ "${i.includes}" à¸à¸¢à¸¹à¹à¹à¸à¸à¹à¸à¸à¸§à¸²à¸¡`;if("regex"===i.format)return`รูà¸à¹à¸à¸à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸: à¸à¹à¸à¸à¸à¸£à¸à¸à¸±à¸à¸£à¸¹à¸à¹à¸à¸à¸à¸µà¹à¸à¸³à¸«à¸à¸ ${i.pattern}`;return`รูà¸à¹à¸à¸à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸: ${t[i.format]??i.format}`;case"not_multiple_of":return`à¸à¸±à¸§à¹à¸¥à¸à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸: à¸à¹à¸à¸à¹à¸à¹à¸à¸à¸³à¸à¸§à¸à¸à¸µà¹à¸«à¸²à¸£à¸à¹à¸§à¸¢ ${i.divisor} à¹à¸à¹à¸¥à¸à¸à¸±à¸§`;case"unrecognized_keys":return`à¸à¸à¸à¸µà¸¢à¹à¸à¸µà¹à¹à¸¡à¹à¸£à¸¹à¹à¸à¸±à¸: ${rr(i.keys,", ")}`;case"invalid_key":return`à¸à¸µà¸¢à¹à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸à¹à¸ ${i.origin}`;case"invalid_union":return"à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸: à¹à¸¡à¹à¸à¸£à¸à¸à¸±à¸à¸£à¸¹à¸à¹à¸à¸à¸¢à¸¹à¹à¸à¸µà¸¢à¸à¸à¸µà¹à¸à¸³à¸«à¸à¸à¹à¸§à¹";case"invalid_element":return`à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸à¹à¸ ${i.origin}`;default:return"à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸"}})}},"tr",0,function(){let e,t,r;return{localeError:(e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öÄe",verb:"olmalı"},set:{unit:"öÄe",verb:"olmalı"}},t={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralıÄı",cidrv6:"IPv6 aralıÄı",base64:"base64 ile ÅifrelenmiÅ metin",base64url:"base64url ile ÅifrelenmiÅ metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Åablon dizesi"},r={nan:"NaN"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Ge\xe7ersiz deÄer: beklenen instanceof ${i.expected}, alınan ${n}`;return`Ge\xe7ersiz deÄer: beklenen ${e}, alınan ${n}`}case"invalid_value":if(1===i.values.length)return`Ge\xe7ersiz deÄer: beklenen ${rE(i.values[0])}`;return`Ge\xe7ersiz se\xe7enek: aÅaÄıdakilerden biri olmalı: ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`\xc7ok b\xfcy\xfck: beklenen ${i.origin??"deÄer"} ${t}${i.maximum.toString()} ${r.unit??"öÄe"}`;return`\xc7ok b\xfcy\xfck: beklenen ${i.origin??"deÄer"} ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`\xc7ok k\xfc\xe7\xfck: beklenen ${i.origin} ${t}${i.minimum.toString()} ${r.unit}`;return`\xc7ok k\xfc\xe7\xfck: beklenen ${i.origin} ${t}${i.minimum.toString()}`}
77case"invalid_format":if("starts_with"===i.format)return`Ge\xe7ersiz metin: "${i.prefix}" ile baÅlamalı`;if("ends_with"===i.format)return`Ge\xe7ersiz metin: "${i.suffix}" ile bitmeli`;if("includes"===i.format)return`Ge\xe7ersiz metin: "${i.includes}" i\xe7ermeli`;if("regex"===i.format)return`Ge\xe7ersiz metin: ${i.pattern} desenine uymalı`;return`Ge\xe7ersiz ${t[i.format]??i.format}`;case"not_multiple_of":return`Ge\xe7ersiz sayı: ${i.divisor} ile tam b\xf6l\xfcnebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xe7inde ge\xe7ersiz anahtar`;case"invalid_union":default:return"Geçersiz deÄer";case"invalid_element":return`${i.origin} i\xe7inde ge\xe7ersiz deÄer`}})}},"ua",0,function(){return se()},"uk",0,se,"ur",0,function(){let e,t,r;return{localeError:(e={string:{unit:"ØØ±ÙÙ",verb:"ÛÙÙØ§"},file:{unit:"بائٹس",verb:"ÛÙÙØ§"},array:{unit:"آئٹÙ
ز",verb:"ÛÙÙØ§"},set:{unit:"آئٹÙ
ز",verb:"ÛÙÙØ§"}},t={regex:"ا٠پٹ",email:"Ø§Û Ù
Û٠اÛÚØ±Ûس",url:"Û٠آر اÛÙ",emoji:"اÛÙ
ÙØ¬Û",uuid:"ÛÙ ÛÙ Ø¢Ø¦Û ÚÛ",uuidv4:"ÛÙ ÛÙ Ø¢Ø¦Û ÚÛ ÙÛ 4",uuidv6:"ÛÙ ÛÙ Ø¢Ø¦Û ÚÛ ÙÛ 6",nanoid:"ÙÛÙÙ Ø¢Ø¦Û ÚÛ",guid:"Ø¬Û ÛÙ Ø¢Ø¦Û ÚÛ",cuid:"Ø³Û ÛÙ Ø¢Ø¦Û ÚÛ",cuid2:"Ø³Û ÛÙ Ø¢Ø¦Û ÚÛ 2",ulid:"Û٠اÛÙ Ø¢Ø¦Û ÚÛ",xid:"اÛکس Ø¢Ø¦Û ÚÛ",ksuid:"Ú©Û Ø§ÛØ³ ÛÙ Ø¢Ø¦Û ÚÛ",datetime:"Ø¢Ø¦Û Ø§ÛØ³ ا٠ÚÛÙ¹ ٹائÙ
",date:"Ø¢Ø¦Û Ø§ÛØ³ Ø§Ù ØªØ§Ø±ÛØ®",time:"Ø¢Ø¦Û Ø§ÛØ³ ا٠ÙÙØª",duration:"Ø¢Ø¦Û Ø§ÛØ³ ا٠Ù
دت",ipv4:"Ø¢Ø¦Û Ù¾Û ÙÛ 4 اÛÚØ±Ûس",ipv6:"Ø¢Ø¦Û Ù¾Û ÙÛ 6 اÛÚØ±Ûس",cidrv4:"Ø¢Ø¦Û Ù¾Û ÙÛ 4 رÛÙØ¬",cidrv6:"Ø¢Ø¦Û Ù¾Û ÙÛ 6 رÛÙØ¬",base64:"Ø¨ÛØ³ 64 ا٠کÙÚÚ Ø³Ù¹Ø±ÙÚ¯",base64url:"Ø¨ÛØ³ 64 Û٠آر اÛ٠ا٠کÙÚÚ Ø³Ù¹Ø±ÙÚ¯",json_string:"Ø¬Û Ø§ÛØ³ ا٠اÛ٠سٹرÙÚ¯",e164:"Ø§Û 164 ÙÙ
بر",jwt:"Ø¬Û ÚØ¨ÙÛÙ Ù¹Û",template_literal:"ا٠پٹ"},r={nan:"NaN",number:"ÙÙ
بر",array:"آرÛ",null:"ÙÙ"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`ØºÙØ· ا٠پٹ: instanceof ${i.expected} Ù
تÙÙØ¹ ØªÚ¾Ø§Ø ${n} Ù
ÙØµÙÙ ÛÙØ§`;return`ØºÙØ· ا٠پٹ: ${e} Ù
تÙÙØ¹ ØªÚ¾Ø§Ø ${n} Ù
ÙØµÙÙ ÛÙØ§`}case"invalid_value":if(1===i.values.length)return`ØºÙØ· ا٠پٹ: ${rE(i.values[0])} Ù
تÙÙØ¹ تھا`;return`ØºÙØ· آپشÙ: ${rr(i.values,"|")} Ù
ÛÚº Ø³Û Ø§ÛÚ© Ù
تÙÙØ¹ تھا`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Ø¨ÛØª Ø¨ÚØ§: ${i.origin??"ÙÛÙÛÙ"} Ú©Û ${t}${i.maximum.toString()} ${r.unit??"Ø¹ÙØ§ØµØ±"} ÛÙÙÛ Ù
تÙÙØ¹ تھÛ`;return`Ø¨ÛØª Ø¨ÚØ§: ${i.origin??"ÙÛÙÛÙ"} کا ${t}${i.maximum.toString()} ÛÙÙØ§ Ù
تÙÙØ¹ تھا`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Ø¨ÛØª ÚÚ¾Ùٹا: ${i.origin} Ú©Û ${t}${i.minimum.toString()} ${r.unit} ÛÙÙÛ Ù
تÙÙØ¹ تھÛ`;return`Ø¨ÛØª ÚÚ¾Ùٹا: ${i.origin} کا ${t}${i.minimum.toString()} ÛÙÙØ§ Ù
تÙÙØ¹ تھا`}case"invalid_format":if("starts_with"===i.format)return`ØºÙØ· سٹرÙÚ¯: "${i.prefix}" Ø³Û Ø´Ø±ÙØ¹ ÛÙÙØ§ ÚØ§ÛÛÛ`;if("ends_with"===i.format)return`ØºÙØ· سٹرÙÚ¯: "${i.suffix}" پر ختÙ
ÛÙÙØ§ ÚØ§ÛÛÛ`;if("includes"===i.format)return`ØºÙØ· سٹرÙÚ¯: "${i.includes}" شاÙ
Ù ÛÙÙØ§ ÚØ§ÛÛÛ`;if("regex"===i.format)return`ØºÙØ· سٹرÙÚ¯: Ù¾Ûٹر٠${i.pattern} Ø³Û Ù
ÛÚ ÛÙÙØ§ ÚØ§ÛÛÛ`;return`ØºÙØ· ${t[i.format]??i.format}`;case"not_multiple_of":return`ØºÙØ· ÙÙ
بر: ${i.divisor} کا Ù
ضاع٠ÛÙÙØ§ ÚØ§ÛÛÛ`;case"unrecognized_keys":return`ØºÛØ± تسÙÛÙ
Ø´Ø¯Û Ú©Û${i.keys.length>1?"ز":""}: ${rr(i.keys,"Ø ")}`;case"invalid_key":return`${i.origin} Ù
ÛÚº ØºÙØ· Ú©Û`;case"invalid_union":default:return"ØºÙØ· ا٠پٹ";case"invalid_element":return`${i.origin} Ù
ÛÚº ØºÙØ· ÙÛÙÛÙ`}})}},"uz",0,function(){let e,t,r;return{localeError:(e={string:{unit:"belgi",verb:"boâlishi kerak"},file:{unit:"bayt",verb:"boâlishi kerak"},array:{unit:"element",verb:"boâlishi kerak"},set:{unit:"element",verb:"boâlishi kerak"},map:{unit:"yozuv",verb:"boâlishi kerak"}},t={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},r={nan:"NaN",number:"raqam",array:"massiv"},i=>
77{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Notoâgâri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${n}`;return`Notoâgâri kirish: kutilgan ${e}, qabul qilingan ${n}`}case"invalid_value":if(1===i.values.length)return`Notoâgâri kirish: kutilgan ${rE(i.values[0])}`;return`Notoâgâri variant: quyidagilardan biri kutilgan ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Juda katta: kutilgan ${i.origin??"qiymat"} ${t}${i.maximum.toString()} ${r.unit} ${r.verb}`;return`Juda katta: kutilgan ${i.origin??"qiymat"} ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Juda kichik: kutilgan ${i.origin} ${t}${i.minimum.toString()} ${r.unit} ${r.verb}`;return`Juda kichik: kutilgan ${i.origin} ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Notoâgâri satr: "${i.prefix}" bilan boshlanishi kerak`;if("ends_with"===i.format)return`Notoâgâri satr: "${i.suffix}" bilan tugashi kerak`;if("includes"===i.format)return`Notoâgâri satr: "${i.includes}" ni oâz ichiga olishi kerak`;if("regex"===i.format)return`Notoâgâri satr: ${i.pattern} shabloniga mos kelishi kerak`;return`Notoâgâri ${t[i.format]??i.format}`;case"not_multiple_of":return`Notoâgâri raqam: ${i.divisor} ning karralisi boâlishi kerak`;case"unrecognized_keys":return`Nomaâlum kalit${i.keys.length>1?"lar":""}: ${rr(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit notoâgâri`;case"invalid_union":default:return"Notoâgâri kirish";case"invalid_element":return`${i.origin} da notoâgâri qiymat`}})}},"vi",0,function(){let e,t,r;return{localeError:(e={string:{unit:"ký tá»±",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tá»",verb:"có"},set:{unit:"phần tá»",verb:"có"}},t={regex:"Äầu và o",email:"Äá»a chá» email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngà y giá» ISO",date:"ngà y ISO",time:"giá» ISO",duration:"khoảng thá»i gian ISO",ipv4:"Äá»a chá» IPv4",ipv6:"Äá»a chá» IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuá»i mã hóa base64",base64url:"chuá»i mã hóa base64url",json_string:"chuá»i JSON",e164:"sá» E.164",jwt:"JWT",template_literal:"Äầu và o"},r={nan:"NaN",number:"sá»",array:"mảng"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`Äầu v\xe0o kh\xf4ng hợp lá»: mong Äợi instanceof ${i.expected}, nháºn ÄÆ°á»£c ${n}`;return`Äầu v\xe0o kh\xf4ng hợp lá»: mong Äợi ${e}, nháºn ÄÆ°á»£c ${n}`}case"invalid_value":if(1===i.values.length)return`Äầu v\xe0o kh\xf4ng hợp lá»: mong Äợi ${rE(i.values[0])}`;return`T\xf9y chá»n kh\xf4ng hợp lá»: mong Äợi má»t trong c\xe1c gi\xe1 trá» ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`Qu\xe1 lá»n: mong Äợi ${i.origin??"giá trá»"} ${r.verb} ${t}${i.maximum.toString()} ${r.unit??"phần tá»"}`;return`Qu\xe1 lá»n: mong Äợi ${i.origin??"giá trá»"} ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`Qu\xe1 nhá»: mong Äợi ${i.origin} ${r.verb} ${t}${i.minimum.toString()} ${r.unit}`;return`Qu\xe1 nhá»: mong Äợi ${i.origin} ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Chuá»i kh\xf4ng hợp lá»: phải bắt Äầu bằng "${i.prefix}"`;if("ends_with"===i.format)return`Chuá»i kh\xf4ng hợp lá»: phải kết th\xfac bằng "${i.suffix}"`;if("includes"===i.format)return`Chuá»i kh\xf4ng hợp lá»: phải bao gá»m "${i.includes}"`;if("regex"===i.format)return`Chuá»i kh\xf4ng hợp lá»: phải khá»p vá»i mẫu ${i.pattern}`;return`${t[i.format]??i.format} kh\xf4ng hợp lá»`;case"not_multiple_of":return`Sá» kh\xf4ng hợp lá»: phải l\xe0 bá»i sá» cá»§a ${i.divisor}`;case"unrecognized_keys":return`Kh\xf3a kh\xf4ng ÄÆ°á»£c nháºn dạng: ${rr(i.keys,", ")}`;
77case"invalid_key":return`Kh\xf3a kh\xf4ng hợp lá» trong ${i.origin}`;case"invalid_union":default:return"Äầu và o không hợp lá»";case"invalid_element":return`Gi\xe1 trá» kh\xf4ng hợp lá» trong ${i.origin}`}})}},"yo",0,function(){let e,t,r;return{localeError:(e={string:{unit:"à mi",verb:"nÃ"},file:{unit:"bytes",verb:"nÃ"},array:{unit:"nkan",verb:"nÃ"},set:{unit:"nkan",verb:"nÃ"}},t={regex:"ẹÌrỠìbáwá»lé",email:"à dÃrẹÌsì ìmẹÌlì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"à kókò ISO",date:"á»já»Ì ISO",time:"à kókò ISO",duration:"à kókò tó pé ISO",ipv4:"à dÃrẹÌsì IPv4",ipv6:"à dÃrẹÌsì IPv6",cidrv4:"à gbègbè IPv4",cidrv6:"à gbègbè IPv6",base64:"á»Ìrá»Ì tà a ká»Ì nà base64",base64url:"á»Ìrá»Ì base64url",json_string:"á»Ìrá»Ì JSON",e164:"ná»Ìmbà E.164",jwt:"JWT",template_literal:"ẹÌrỠìbáwá»lé"},r={nan:"NaN",number:"ná»Ìmbà ",array:"akopá»"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`\xccb\xe1wá»l\xe9 aá¹£\xecá¹£e: a n\xed l\xe1ti fi instanceof ${i.expected}, \xe0má»Ì a r\xed ${n}`;return`\xccb\xe1wá»l\xe9 aá¹£\xecá¹£e: a n\xed l\xe1ti fi ${e}, \xe0má»Ì a r\xed ${n}`}case"invalid_value":if(1===i.values.length)return`\xccb\xe1wá»l\xe9 aá¹£\xecá¹£e: a n\xed l\xe1ti fi ${rE(i.values[0])}`;return`\xc0á¹£\xe0y\xe0n aá¹£\xecá¹£e: yan á»Ìkan l\xe1ra ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`T\xf3 pá»Ì j\xf9: a n\xed l\xe1ti jáº¹Ì p\xe9 ${i.origin??"iye"} ${r.verb} ${t}${i.maximum} ${r.unit}`;return`T\xf3 pá»Ì j\xf9: a n\xed l\xe1ti jáº¹Ì ${t}${i.maximum}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`K\xe9r\xe9 ju: a n\xed l\xe1ti jáº¹Ì p\xe9 ${i.origin} ${r.verb} ${t}${i.minimum} ${r.unit}`;return`K\xe9r\xe9 ju: a n\xed l\xe1ti jáº¹Ì ${t}${i.minimum}`}case"invalid_format":if("starts_with"===i.format)return`á»Ìrá»Ì aá¹£\xecá¹£e: gbá»Ìdá»Ì bẹÌráº¹Ì pẹÌl\xfa "${i.prefix}"`;if("ends_with"===i.format)return`á»Ìrá»Ì aá¹£\xecá¹£e: gbá»Ìdá»Ì par\xed pẹÌl\xfa "${i.suffix}"`;if("includes"===i.format)return`á»Ìrá»Ì aá¹£\xecá¹£e: gbá»Ìdá»Ì n\xed "${i.includes}"`;if("regex"===i.format)return`á»Ìrá»Ì aá¹£\xecá¹£e: gbá»Ìdá»Ì b\xe1 \xe0pẹẹrẹ mu ${i.pattern}`;return`Aá¹£\xecá¹£e: ${t[i.format]??i.format}`;case"not_multiple_of":return`Ná»Ìmb\xe0 aá¹£\xecá¹£e: gbá»Ìdá»Ì jáº¹Ì \xe8y\xe0 p\xedp\xedn ti ${i.divisor}`;case"unrecognized_keys":return`Bá»t\xecn\xec \xe0\xecmá»Ì: ${rr(i.keys,", ")}`;case"invalid_key":return`Bá»t\xecn\xec aá¹£\xecá¹£e n\xedn\xfa ${i.origin}`;case"invalid_union":default:return"Ãbáwá»lé aṣìṣe";case"invalid_element":return`Iye aá¹£\xecá¹£e n\xedn\xfa ${i.origin}`}})}},"zhCN",0,function(){let e,t,r;return{localeError:(e={string:{unit:"å符",verb:"å
å«"},file:{unit:"åè",verb:"å
å«"},array:{unit:"项",verb:"å
å«"},set:{unit:"项",verb:"å
å«"}},t={regex:"è¾å
¥",email:"çµåé®ä»¶",url:"URL",emoji:"表æ
符å·",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISOæ¥ææ¶é´",date:"ISOæ¥æ",time:"ISOæ¶é´",duration:"ISOæ¶é¿",ipv4:"IPv4å°å",ipv6:"IPv6å°å",cidrv4:"IPv4ç½æ®µ",cidrv6:"IPv6ç½æ®µ",base64:"base64ç¼ç å符串",base64url:"base64urlç¼ç å符串",json_string:"JSONå符串",e164:"E.164å·ç ",jwt:"JWT",template_literal:"è¾å
¥"},r={nan:"NaN",number:"æ°å",array:"æ°ç»",null:"空å¼(null)"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`æ æè¾å
¥ï¼ææ instanceof ${i.expected}ï¼å®é
æ¥æ¶ ${n}`;return`æ æè¾å
¥ï¼ææ ${e}ï¼å®é
æ¥æ¶ ${n}`}case"invalid_value":if(1===i.values.length)return`æ æè¾å
¥ï¼ææ ${rE(i.values[0])}`;return`æ æéé¡¹ï¼ææä»¥ä¸ä¹ä¸ ${rr(i.values,"|")}`;
77case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`æ°å¼è¿å¤§ï¼ææ ${i.origin??"å¼"} ${t}${i.maximum.toString()} ${r.unit??"个å
ç´ "}`;return`æ°å¼è¿å¤§ï¼ææ ${i.origin??"å¼"} ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`æ°å¼è¿å°ï¼ææ ${i.origin} ${t}${i.minimum.toString()} ${r.unit}`;return`æ°å¼è¿å°ï¼ææ ${i.origin} ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`æ æå符串ï¼å¿
须以 "${i.prefix}" å¼å¤´`;if("ends_with"===i.format)return`æ æå符串ï¼å¿
须以 "${i.suffix}" ç»å°¾`;if("includes"===i.format)return`æ æå符串ï¼å¿
é¡»å
å« "${i.includes}"`;if("regex"===i.format)return`æ æå符串ï¼å¿
须满足æ£åè¡¨è¾¾å¼ ${i.pattern}`;return`æ æ${t[i.format]??i.format}`;case"not_multiple_of":return`æ ææ°åï¼å¿
é¡»æ¯ ${i.divisor} çåæ°`;case"unrecognized_keys":return`åºç°æªç¥çé®(key): ${rr(i.keys,", ")}`;case"invalid_key":return`${i.origin} ä¸çé®(key)æ æ`;case"invalid_union":default:return"æ æè¾å
¥";case"invalid_element":return`${i.origin} ä¸å
嫿 æå¼(value)`}})}},"zhTW",0,function(){let e,t,r;return{localeError:(e={string:{unit:"åå
",verb:"ææ"},file:{unit:"ä½å
çµ",verb:"ææ"},array:{unit:"é
ç®",verb:"ææ"},set:{unit:"é
ç®",verb:"ææ"}},t={regex:"輸å
¥",email:"éµä»¶å°å",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO æ¥ææé",date:"ISO æ¥æ",time:"ISO æé",duration:"ISO æé",ipv4:"IPv4 ä½å",ipv6:"IPv6 ä½å",cidrv4:"IPv4 ç¯å",cidrv6:"IPv6 ç¯å",base64:"base64 編碼å串",base64url:"base64url 編碼å串",json_string:"JSON å串",e164:"E.164 æ¸å¼",jwt:"JWT",template_literal:"輸å
¥"},r={nan:"NaN"},i=>{switch(i.code){case"invalid_type":{let e=r[i.expected]??i.expected,t=r$(i.input),n=r[t]??t;if(/^[A-Z]/.test(i.expected))return`ç¡æç輸å
¥å¼ï¼é æçº instanceof ${i.expected}ï¼ä½æ¶å° ${n}`;return`ç¡æç輸å
¥å¼ï¼é æçº ${e}ï¼ä½æ¶å° ${n}`}case"invalid_value":if(1===i.values.length)return`ç¡æç輸å
¥å¼ï¼é æçº ${rE(i.values[0])}`;return`ç¡æçé¸é
ï¼é æçºä»¥ä¸å
¶ä¸ä¹ä¸ ${rr(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=e[i.origin]??null;if(r)return`æ¸å¼é大ï¼é æ ${i.origin??"å¼"} æçº ${t}${i.maximum.toString()} ${r.unit??"åå
ç´ "}`;return`æ¸å¼é大ï¼é æ ${i.origin??"å¼"} æçº ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=e[i.origin]??null;if(r)return`æ¸å¼éå°ï¼é æ ${i.origin} æçº ${t}${i.minimum.toString()} ${r.unit}`;return`æ¸å¼éå°ï¼é æ ${i.origin} æçº ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`ç¡æçå串ï¼å¿
é 以 "${i.prefix}" éé `;if("ends_with"===i.format)return`ç¡æçå串ï¼å¿
é 以 "${i.suffix}" çµå°¾`;if("includes"===i.format)return`ç¡æçå串ï¼å¿
é å
å« "${i.includes}"`;if("regex"===i.format)return`ç¡æçå串ï¼å¿
é ç¬¦åæ ¼å¼ ${i.pattern}`;return`ç¡æç ${t[i.format]??i.format}`;case"not_multiple_of":return`ç¡æçæ¸åï¼å¿
é çº ${i.divisor} ç忏`;case"unrecognized_keys":return`ç¡æ³èå¥çéµå¼${i.keys.length>1?"å":""}ï¼${rr(i.keys,"ã")}`;case"invalid_key":return`${i.origin} ä¸æç¡æçéµå¼`;case"invalid_union":default:return"ç¡æç輸å
¥å¼";case"invalid_element":return`${i.origin} ä¸æç¡æçå¼`}})}}],902580);var st=e.i(902580);let sr=Symbol("ZodOutput"),si=Symbol("ZodInput");class sn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let i={...r,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function sa(){return new sn}(M=globalThis).__zod_globalRegistry??(M.__zod_globalRegistry=sa());let ss=globalThis.__zod_globalRegistry;function so(e,t){return new e({type:"string",...rS(t)})}function sl(e,t){return new e({type:"string",coerce:!0,...rS(t)})}function su(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...rS(t)})}function sc(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...rS(t)})}function sd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...rS(t)})}function sf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...rS(t)})}function sh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...rS(t)})}function sp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...rS(t)})}function sg(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...rS(t)})}function sm(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...rS(t)})}function sy(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...rS(t)})}function sv(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...rS(t)})}
77function sb(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...rS(t)})}function sw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...rS(t)})}function s_(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...rS(t)})}function sA(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...rS(t)})}function sS(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...rS(t)})}function sE(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...rS(t)})}function sx(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...rS(t)})}function sT(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...rS(t)})}function sI(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...rS(t)})}function sk(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...rS(t)})}function sO(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...rS(t)})}function sC(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...rS(t)})}function sN(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...rS(t)})}e.s(["$ZodRegistry",0,sn,"$input",0,si,"$output",0,sr,"globalRegistry",0,ss,"registry",0,sa],742314),e.i(742314),e.i(353007);let sP={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function sD(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...rS(t)})}function sR(e,t){return new e({type:"string",format:"date",check:"string_format",...rS(t)})}function s$(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...rS(t)})}function sB(e,t){return new e({type:"string",format:"duration",check:"string_format",...rS(t)})}function sL(e,t){return new e({type:"number",checks:[],...rS(t)})}function sU(e,t){return new e({type:"number",coerce:!0,checks:[],...rS(t)})}function sF(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...rS(t)})}function sM(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...rS(t)})}function sj(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...rS(t)})}function sz(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...rS(t)})}function sV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...rS(t)})}function sH(e,t){return new e({type:"boolean",...rS(t)})}function sq(e,t){return new e({type:"boolean",coerce:!0,...rS(t)})}function sW(e,t){return new e({type:"bigint",...rS(t)})}function sK(e,t){return new e({type:"bigint",coerce:!0,...rS(t)})}function sG(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...rS(t)})}function sZ(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...rS(t)})}function sX(e,t){return new e({type:"symbol",...rS(t)})}function sJ(e,t){return new e({type:"undefined",...rS(t)})}function sY(e,t){return new e({type:"null",...rS(t)})}function sQ(e){return new e({type:"any"})}function s0(e){return new e({type:"unknown"})}function s1(e,t){return new e({type:"never",...rS(t)})}function s2(e,t){return new e({type:"void",...rS(t)})}function s6(e,t){return new e({type:"date",...rS(t)})}function s5(e,t){return new e({type:"date",coerce:!0,...rS(t)})}function s4(e,t){return new e({type:"nan",...rS(t)})}function s3(e,t){return new i7({check:"less_than",...rS(t),value:e,inclusive:!1})}function s8(e,t){return new i7({check:"less_than",...rS(t),value:e,inclusive:!0})}function s7(e,t){return new i9({check:"greater_than",...rS(t),value:e,inclusive:!1})}function s9(e,t){return new i9({check:"greater_than",...rS(t),value:e,inclusive:!0})}function oe(e){return s7(0,e)}function ot(e){return s3(0,e)}function or(e){return s8(0,e)}function oi(e){return s9(0,e)}function on(e,t){return new ne({check:"multiple_of",...rS(t),value:e})}function oa(e,t){return new ni({check:"max_size",...rS(t),maximum:e})}function os(e,t){return new nn({check:"min_size",...rS(t),minimum:e})}function oo(e,t){return new na({check:"size_equals",...rS(t),size:e})}function ol(e,t){return new ns({check:"max_length",...rS(t),maximum:e})}function ou(e,t){return new no({check:"min_length",...rS(t),minimum:e})}function oc(e,t){return new nl({check:"length_equals",...rS(t),length:e})}function od(e,t){return new nc({check:"string_format",format:"regex",...rS(t),pattern:e})}function of(e){return new nd({check:"string_format",format:"lowercase",...rS(e)})}
77function oh(e){return new nf({check:"string_format",format:"uppercase",...rS(e)})}function op(e,t){return new nh({check:"string_format",format:"includes",...rS(t),includes:e})}function og(e,t){return new np({check:"string_format",format:"starts_with",...rS(t),prefix:e})}function om(e,t){return new ng({check:"string_format",format:"ends_with",...rS(t),suffix:e})}function oy(e,t,r){return new ny({check:"property",property:e,schema:t,...rS(r)})}function ov(e,t){return new nv({check:"mime_type",mime:e,...rS(t)})}function ob(e){return new nb({check:"overwrite",tx:e})}function ow(e){return ob(t=>t.normalize(e))}function o_(){return ob(e=>e.trim())}function oA(){return ob(e=>e.toLowerCase())}function oS(){return ob(e=>e.toUpperCase())}function oE(){return ob(e=>rh(e))}function ox(e,t,r){return new e({type:"array",element:t,...rS(r)})}function oT(e,t,r){return new e({type:"union",options:t,...rS(r)})}function oI(e,t,r){return new e({type:"union",options:t,inclusive:!1,...rS(r)})}function ok(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...rS(i)})}function oO(e,t,r){return new e({type:"intersection",left:t,right:r})}function oC(e,t,r,i){let n=r instanceof nA,a=n?i:r;return new e({type:"tuple",items:t,rest:n?r:null,...rS(a)})}function oN(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...rS(i)})}function oP(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...rS(i)})}function oD(e,t,r){return new e({type:"set",valueType:t,...rS(r)})}function oR(e,t,r){return new e({type:"enum",entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...rS(r)})}function o$(e,t,r){return new e({type:"enum",entries:t,...rS(r)})}function oB(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...rS(r)})}function oL(e,t){return new e({type:"file",...rS(t)})}function oU(e,t){return new e({type:"transform",transform:t})}function oF(e,t){return new e({type:"optional",innerType:t})}function oM(e,t){return new e({type:"nullable",innerType:t})}function oj(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():rv(r)}})}function oz(e,t,r){return new e({type:"nonoptional",innerType:t,...rS(r)})}function oV(e,t){return new e({type:"success",innerType:t})}function oH(e,t,r){return new e({type:"catch",innerType:t,catchValue:"function"==typeof r?r:()=>r})}function oq(e,t,r){return new e({type:"pipe",in:t,out:r})}function oW(e,t){return new e({type:"readonly",innerType:t})}function oK(e,t,r){return new e({type:"template_literal",parts:t,...rS(r)})}function oG(e,t){return new e({type:"lazy",getter:t})}function oZ(e,t){return new e({type:"promise",innerType:t})}function oX(e,t,r){let i=rS(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function oJ(e,t,r){return new e({type:"custom",check:"custom",fn:t,...rS(r)})}function oY(e,t){let r=oQ(t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(rB(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(rB(e)))},e(t.value,t)),t);return r}function oQ(e,t){let r=new i3({check:"custom",...rS(t)});return r._zod.check=e,r}function o0(e){let t=new i3({check:"describe"});return t._zod.onattach=[t=>{let r=ss.get(t)??{};ss.add(t,{...r,description:e})}],t._zod.check=()=>{},t}function o1(e){let t=new i3({check:"meta"});return t._zod.onattach=[t=>{let r=ss.get(t)??{};ss.add(t,{...r,...e})}],t._zod.check=()=>{},t}function o2(e,t){let r=rS(t),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];"sensitive"!==r.case&&(i=i.map(e=>"string"==typeof e?e.toLowerCase():e),n=n.map(e=>"string"==typeof e?e.toLowerCase():e));let a=new Set(i),s=new Set(n),o=e.Codec??aV,l=e.Boolean??n1,u=new o({type:"pipe",in:new(e.String??nS)({type:"string",error:r.error}),out:new l({type:"boolean",error:r.error}),transform:(e,t)=>{let i=e;return"sensitive"!==r.case&&(i=i.toLowerCase()),!!a.has(i)||!s.has(i)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...s],input:t.value,inst:u,continue:!1}),{})},reverseTransform:(e,t)=>
77!0===e?i[0]||"true":n[0]||"false",error:r.error});return u}function o6(e,t,r,i={}){let n=rS(i),a={...rS(i),check:"string_format",type:"string",format:t,fn:"function"==typeof r?r:e=>r.test(e),...n};return r instanceof RegExp&&(a.pattern=r),new e(a)}function o5(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ss,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function o4(e,t,r={path:[],schemaPath:[]}){var i;let n=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let o=e._zod.toJSONSchema?.();if(o)s.schema=o;else{let i={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,i);else{let r=s.schema,a=t.processors[n.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);a(e,t,r,i)}let a=e._zod.parent;a&&(s.ref||(s.ref=a),o4(a,t,i),t.seen.get(a).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),"input"===t.io&&function e(t,r){let i=r??{seen:new Set};if(i.seen.has(t))return!1;i.seen.add(t);let n=t._zod.def;if("transform"===n.type)return!0;if("array"===n.type)return e(n.element,i);if("set"===n.type)return e(n.valueType,i);if("lazy"===n.type)return e(n.getter(),i);if("promise"===n.type||"optional"===n.type||"nonoptional"===n.type||"nullable"===n.type||"readonly"===n.type||"default"===n.type||"prefault"===n.type)return e(n.innerType,i);if("intersection"===n.type)return e(n.left,i)||e(n.right,i);if("record"===n.type||"map"===n.type)return e(n.keyType,i)||e(n.valueType,i);if("pipe"===n.type)return!!t._zod.traits.has("$ZodCodec")||e(n.in,i)||e(n.out,i);if("object"===n.type){for(let t in n.shape)if(e(n.shape[t],i))return!0;return!1}if("union"===n.type){for(let t of n.options)if(e(t,i))return!0;return!1}if("tuple"===n.type){for(let t of n.items)if(e(t,i))return!0;if(n.rest&&e(n.rest,i))return!0}return!1}(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function o3(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=i.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(r,t[0])}}let n=t=>{if(t[1].schema.$ref)return;let i=t[1],{ref:n,defId:a}=(t=>{let i="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,n=e.external.uri??(e=>e);if(r)return{ref:n(r)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${n("__shared")}#/${i}/${a}`}}if(t[1]===r)return{ref:"#"};let n=`#/${i}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:n+a}})(t);i.def={...i.schema},a&&(i.defId=a);let s=i.schema;for(let e in s)delete s[e];s.$ref=n};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root> 78 79Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let i=r[1];if(t===r[0]){n(r);continue}if(e.external){let i=e.external.registry.get(r[0])?.id;if(t!==r[0]&&i){n(r);continue}}if(e.metadataRegistry.get(r[0])?.id||i.cycle||i.count>1&&"ref"===e.reused){n(r);continue}}}function o8(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let i=t=>{let r=e.seen.get(t);if(null===r.ref)return;let n=r.def??r.schema,a={...n},s=r.ref;if(r.ref=null,s){i(s);let r=e.seen.get(s),o=r.schema;if(o.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(n.allOf=n.allOf??[],n.allOf.push(o)):Object.assign(n,o),Object.assign(n,a),t._zod.parent===s)for(let e in n)"$ref"!==e&&"allOf"!==e&&(e in a||delete n[e]);if(o.$ref&&r.def)for(let e in n)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(n[e])===JSON.stringify(r.def[e])&&delete n[e]}let o=t._zod.parent;if(o&&o!==s){i(o);let t=e.seen.get(o);if(t?.schema.$ref&&(n.$ref=t.schema.$ref,t.def))for(let e in n)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(n[e])===JSON.stringify(t.def[e])&&delete n[e]}e.override({zodSchema:t,jsonSchema:n,path:r.path??[]})};for(let t of[...e.seen.entries()].reverse())i(t[0]);let n={};
79if("draft-2020-12"===e.target?n.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?n.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(r)}Object.assign(n,r.def??r.schema);let a=e.metadataRegistry.get(t)?.id;void 0!==a&&n.id===a&&delete n.id;let s=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?n.$defs=s:n.definitions=s);try{let r=JSON.parse(JSON.stringify(n));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:o9(t,"input",e.processors),output:o9(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}e.s(["TimePrecision",0,sP,"_any",0,sQ,"_array",0,ox,"_base64",0,sk,"_base64url",0,sO,"_bigint",0,sW,"_boolean",0,sH,"_catch",0,oH,"_check",0,oQ,"_cidrv4",0,sT,"_cidrv6",0,sI,"_coercedBigint",0,sK,"_coercedBoolean",0,sq,"_coercedDate",0,s5,"_coercedNumber",0,sU,"_coercedString",0,sl,"_cuid",0,sv,"_cuid2",0,sb,"_custom",0,oX,"_date",0,s6,"_default",0,oj,"_discriminatedUnion",0,ok,"_e164",0,sC,"_email",0,su,"_emoji",0,sm,"_endsWith",0,om,"_enum",0,oR,"_file",0,oL,"_float32",0,sM,"_float64",0,sj,"_gt",0,s7,"_gte",0,s9,"_guid",0,sc,"_includes",0,op,"_int",0,sF,"_int32",0,sz,"_int64",0,sG,"_intersection",0,oO,"_ipv4",0,sS,"_ipv6",0,sE,"_isoDate",0,sR,"_isoDateTime",0,sD,"_isoDuration",0,sB,"_isoTime",0,s$,"_jwt",0,sN,"_ksuid",0,sA,"_lazy",0,oG,"_length",0,oc,"_literal",0,oB,"_lowercase",0,of,"_lt",0,s3,"_lte",0,s8,"_mac",0,sx,"_map",0,oP,"_max",0,s8,"_maxLength",0,ol,"_maxSize",0,oa,"_mime",0,ov,"_min",0,s9,"_minLength",0,ou,"_minSize",0,os,"_multipleOf",0,on,"_nan",0,s4,"_nanoid",0,sy,"_nativeEnum",0,o$,"_negative",0,ot,"_never",0,s1,"_nonnegative",0,oi,"_nonoptional",0,oz,"_nonpositive",0,or,"_normalize",0,ow,"_null",0,sY,"_nullable",0,oM,"_number",0,sL,"_optional",0,oF,"_overwrite",0,ob,"_pipe",0,oq,"_positive",0,oe,"_promise",0,oZ,"_property",0,oy,"_readonly",0,oW,"_record",0,oN,"_refine",0,oJ,"_regex",0,od,"_set",0,oD,"_size",0,oo,"_slugify",0,oE,"_startsWith",0,og,"_string",0,so,"_stringFormat",0,o6,"_stringbool",0,o2,"_success",0,oV,"_superRefine",0,oY,"_symbol",0,sX,"_templateLiteral",0,oK,"_toLowerCase",0,oA,"_toUpperCase",0,oS,"_transform",0,oU,"_trim",0,o_,"_tuple",0,oC,"_uint32",0,sV,"_uint64",0,sZ,"_ulid",0,sw,"_undefined",0,sJ,"_union",0,oT,"_unknown",0,s0,"_uppercase",0,oh,"_url",0,sg,"_uuid",0,sd,"_uuidv4",0,sf,"_uuidv6",0,sh,"_uuidv7",0,sp,"_void",0,s2,"_xid",0,s_,"_xor",0,oI,"describe",0,o0,"meta",0,o1],377819),e.i(377819);let o7=(e,t={})=>r=>{let i=o5({...r,processors:t});return o4(e,i),o3(i,e),o8(i,e)},o9=(e,t,r={})=>i=>{let{libraryOptions:n,target:a}=i??{},s=o5({...n??{},target:a,io:t,processors:r});return o4(e,s),o3(s,e),o8(s,e)};e.s(["createStandardJSONSchemaMethod",0,o9,"createToJSONSchemaMethod",0,o7,"extractDefs",0,o3,"finalize",0,o8,"initializeContext",0,o5,"process",0,o4],885401),e.i(885401);let le={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lt=(e,t,r,i)=>{r.type="string";let{minimum:n,maximum:a,format:s,patterns:o,contentEncoding:l}=e._zod.bag;if("number"==typeof n&&(r.minLength=n),"number"==typeof a&&(r.maxLength=a),s&&(r.format=le[s]??s,""===r.format&&delete r.format,"time"===s&&delete r.format),l&&(r.contentEncoding=l),o&&o.size>0){let e=[...o];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}},lr=(e,t,r,i)=>{let{minimum:n,maximum:a,format:s,multipleOf:o,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;"string"==typeof s&&s.includes("int")?r.type="integer":r.type="number";let c="number"==typeof u&&u>=(n??-1/0),d="number"==typeof l&&l<=(a??1/0),f="draft-04"===t.target||"openapi-3.0"===t.target;c?f?(r.minimum=u,r.exclusiveMinimum=!0):r.exclusiveMinimum=u:"number"==typeof n&&(r.minimum=n),d?f?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l:"number"==typeof a&&(r.maximum=a),"number"==typeof o&&(r.multipleOf=o)},li=(e,t,r,i)=>{r.type="boolean"},ln=(e,t,r,i)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")},la=(e,t,r,i)=>{if("throw"===t.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema")},ls=(e,t,r,i)=>{"openapi-3.0"===t.target?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},lo=(e,t,r,i)=>{if("throw"===t.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema")},ll=(e,t,r,i)=>{if("throw"===t.unrepresentable)throw Error("Void cannot be represented in JSON Schema")},lu=(e,t,r,i)=>{r.not={}},lc=(e,t,r,i)=>{},ld=(e,t,r,i)=>{},lf=(e,t,r,i)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")},lh=(e,t,r,i)=>{let n=rt(e._zod.def.entries);n.every(e=>"number"==typeof e)&&(r.type="number"),n.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=n},lp=(e,t,r,i)=>{let n=e._zod.def,a=[];for(let e of n.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else a.push(Number(e));else a.push(e);if(0===a.length);else if(1===a.length){let e=a[0];
79r.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?r.enum=[e]:r.const=e}else a.every(e=>"number"==typeof e)&&(r.type="number"),a.every(e=>"string"==typeof e)&&(r.type="string"),a.every(e=>"boolean"==typeof e)&&(r.type="boolean"),a.every(e=>null===e)&&(r.type="null"),r.enum=a},lg=(e,t,r,i)=>{if("throw"===t.unrepresentable)throw Error("NaN cannot be represented in JSON Schema")},lm=(e,t,r,i)=>{let n=e._zod.pattern;if(!n)throw Error("Pattern not found in template literal");r.type="string",r.pattern=n.source},ly=(e,t,r,i)=>{let n={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:o}=e._zod.bag;void 0!==a&&(n.minLength=a),void 0!==s&&(n.maxLength=s),o?1===o.length?(n.contentMediaType=o[0],Object.assign(r,n)):(Object.assign(r,n),r.anyOf=o.map(e=>({contentMediaType:e}))):Object.assign(r,n)},lv=(e,t,r,i)=>{r.type="boolean"},lb=(e,t,r,i)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")},lw=(e,t,r,i)=>{if("throw"===t.unrepresentable)throw Error("Function types cannot be represented in JSON Schema")},l_=(e,t,r,i)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")},lA=(e,t,r,i)=>{if("throw"===t.unrepresentable)throw Error("Map cannot be represented in JSON Schema")},lS=(e,t,r,i)=>{if("throw"===t.unrepresentable)throw Error("Set cannot be represented in JSON Schema")},lE=(e,t,r,i)=>{let n=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;"number"==typeof a&&(r.minItems=a),"number"==typeof s&&(r.maxItems=s),r.type="array",r.items=o4(n.element,t,{...i,path:[...i.path,"items"]})},lx=(e,t,r,i)=>{let n=e._zod.def;r.type="object",r.properties={};let a=n.shape;for(let e in a)r.properties[e]=o4(a[e],t,{...i,path:[...i.path,"properties",e]});let s=new Set([...new Set(Object.keys(a))].filter(e=>{let r=n.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));s.size>0&&(r.required=Array.from(s)),n.catchall?._zod.def.type==="never"?r.additionalProperties=!1:n.catchall?n.catchall&&(r.additionalProperties=o4(n.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)},lT=(e,t,r,i)=>{let n=e._zod.def,a=!1===n.inclusive,s=n.options.map((e,r)=>o4(e,t,{...i,path:[...i.path,a?"oneOf":"anyOf",r]}));a?r.oneOf=s:r.anyOf=s},lI=(e,t,r,i)=>{let n=e._zod.def,a=o4(n.left,t,{...i,path:[...i.path,"allOf",0]}),s=o4(n.right,t,{...i,path:[...i.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length;r.allOf=[...o(a)?a.allOf:[a],...o(s)?s.allOf:[s]]},lk=(e,t,r,i)=>{let n=e._zod.def;r.type="array";let a="draft-2020-12"===t.target?"prefixItems":"items",s="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",o=n.items.map((e,r)=>o4(e,t,{...i,path:[...i.path,a,r]})),l=n.rest?o4(n.rest,t,{...i,path:[...i.path,s,..."openapi-3.0"===t.target?[n.items.length]:[]]}):null;"draft-2020-12"===t.target?(r.prefixItems=o,l&&(r.items=l)):"open
79api-3.0"===t.target?(r.items={anyOf:o},l&&r.items.anyOf.push(l),r.minItems=o.length,l||(r.maxItems=o.length)):(r.items=o,l&&(r.additionalItems=l));let{minimum:u,maximum:c}=e._zod.bag;"number"==typeof u&&(r.minItems=u),"number"==typeof c&&(r.maxItems=c)},lO=(e,t,r,i)=>{let n=e._zod.def;r.type="object";let a=n.keyType,s=a._zod.bag,o=s?.patterns;if("loose"===n.mode&&o&&o.size>0){let e=o4(n.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});for(let t of(r.patternProperties={},o))r.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(r.propertyNames=o4(n.keyType,t,{...i,path:[...i.path,"propertyNames"]})),r.additionalProperties=o4(n.valueType,t,{...i,path:[...i.path,"additionalProperties"]});let l=a._zod.values;if(l){let e=[...l].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(r.required=e)}},lC=(e,t,r,i)=>{let n=e._zod.def,a=o4(n.innerType,t,i),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},lN=(e,t,r,i)=>{let n=e._zod.def;o4(n.innerType,t,i),t.seen.get(e).ref=n.innerType},lP=(e,t,r,i)=>{let n=e._zod.def;o4(n.innerType,t,i),t.seen.get(e).ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},lD=(e,t,r,i)=>{let n=e._zod.def;o4(n.innerType,t,i),t.seen.get(e).ref=n.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},lR=(e,t,r,i)=>{let n,a=e._zod.def;o4(a.innerType,t,i),t.seen.get(e).ref=a.innerType;try{n=a.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=n},l$=(e,t,r,i)=>{let n=e._zod.def,a=n.in._zod.traits.has("$ZodTransform"),s="input"===t.io?a?n.out:n.in:n.out;o4(s,t,i),t.seen.get(e).ref=s},lB=(e,t,r,i)=>{let n=e._zod.def;o4(n.innerType,t,i),t.seen.get(e).ref=n.innerType,r.readOnly=!0},lL=(e,t,r,i)=>{let n=e._zod.def;o4(n.innerType,t,i),t.seen.get(e).ref=n.innerType},lU=(e,t,r,i)=>{let n=e._zod.def;o4(n.innerType,t,i),t.seen.get(e).ref=n.innerType},lF=(e,t,r,i)=>{let n=e._zod.innerType;o4(n,t,i),t.seen.get(e).ref=n},lM={string:lt,number:lr,boolean:li,bigint:ln,symbol:la,null:ls,undefined:lo,void:ll,never:lu,any:lc,unknown:ld,date:lf,enum:lh,literal:lp,nan:lg,template_literal:lm,file:ly,success:lv,custom:lb,function:lw,transform:l_,map:lA,set:lS,array:lE,object:lx,union:lT,intersection:lI,tuple:lk,record:lO,nullable:lC,nonoptional:lN,default:lP,prefault:lD,catch:lR,pipe:l$,readonly:lB,promise:lL,optional:lU,lazy:lF};function lj(e,t){if("_idmap"in e){let r=o5({...t,processors:lM}),i={};
79for(let t of e._idmap.entries()){let[e,i]=t;o4(i,r)}let n={};for(let a of(r.external={registry:e,uri:t?.uri,defs:i},e._idmap.entries())){let[e,t]=a;o3(r,t),n[e]=o8(r,t)}return Object.keys(i).length>0&&(n.__shared={["draft-2020-12"===r.target?"$defs":"definitions"]:i}),{schemas:n}}let r=o5({...t,processors:lM});return o4(e,r),o3(r,e),o8(r,e)}e.s([],417125);var lz=e.i(417125);e.s(["$ZodAny",0,n8,"$ZodArray",0,ai,"$ZodAsyncError",0,t8,"$ZodBase64",0,nW,"$ZodBase64URL",0,nG,"$ZodBigInt",0,n2,"$ZodBigIntFormat",0,n6,"$ZodBoolean",0,n1,"$ZodCIDRv4",0,nV,"$ZodCIDRv6",0,nH,"$ZodCUID",0,nN,"$ZodCUID2",0,nP,"$ZodCatch",0,aF,"$ZodCheck",0,i3,"$ZodCheckBigIntFormat",0,nr,"$ZodCheckEndsWith",0,ng,"$ZodCheckGreaterThan",0,i9,"$ZodCheckIncludes",0,nh,"$ZodCheckLengthEquals",0,nl,"$ZodCheckLessThan",0,i7,"$ZodCheckLowerCase",0,nd,"$ZodCheckMaxLength",0,ns,"$ZodCheckMaxSize",0,ni,"$ZodCheckMimeType",0,nv,"$ZodCheckMinLength",0,no,"$ZodCheckMinSize",0,nn,"$ZodCheckMultipleOf",0,ne,"$ZodCheckNumberFormat",0,nt,"$ZodCheckOverwrite",0,nb,"$ZodCheckProperty",0,ny,"$ZodCheckRegex",0,nc,"$ZodCheckSizeEquals",0,na,"$ZodCheckStartsWith",0,np,"$ZodCheckStringFormat",0,nu,"$ZodCheckUpperCase",0,nf,"$ZodCodec",0,aV,"$ZodCustom",0,aQ,"$ZodCustomStringFormat",0,nY,"$ZodDate",0,at,"$ZodDefault",0,aD,"$ZodDiscriminatedUnion",0,ah,"$ZodE164",0,nZ,"$ZodEmail",0,nI,"$ZodEmoji",0,nO,"$ZodEncodeError",0,t7,"$ZodEnum",0,ax,"$ZodError",0,rj,"$ZodExactOptional",0,aN,"$ZodFile",0,aI,"$ZodFunction",0,aX,"$ZodGUID",0,nx,"$ZodIPv4",0,nM,"$ZodIPv6",0,nj,"$ZodISODate",0,nL,"$ZodISODateTime",0,nB,"$ZodISODuration",0,nF,"$ZodISOTime",0,nU,"$ZodIntersection",0,ap,"$ZodJWT",0,nJ,"$ZodKSUID",0,n$,"$ZodLazy",0,aY,"$ZodLiteral",0,aT,"$ZodMAC",0,nz,"$ZodMap",0,a_,"$ZodNaN",0,aM,"$ZodNanoID",0,nC,"$ZodNever",0,n9,"$ZodNonOptional",0,aB,"$ZodNull",0,n3,"$ZodNullable",0,aP,"$ZodNumber",0,nQ,"$ZodNumberFormat",0,n0,"$ZodObject",0,ao,"$ZodObjectJIT",0,al,"$ZodOptional",0,aC,"$ZodPipe",0,aj,"$ZodPrefault",0,a$,"$ZodPreprocess",0,aW,"$ZodPromise",0,aJ,"$ZodReadonly",0,aK,"$ZodRealError",0,rz,"$ZodRecord",0,aw,"$ZodRegistry",0,sn,"$ZodSet",0,aS,"$ZodString",0,nS,"$ZodStringFormat",0,nE,"$ZodSuccess",0,aU,"$ZodSymbol",0,n5,"$ZodTemplateLiteral",0,aZ,"$ZodTransform",0,ak,"$ZodTuple",0,am,"$ZodType",0,nA,"$ZodULID",0,nD,"$ZodURL",0,nk,"$ZodUUID",0,nT,"$ZodUndefined",0,n4,"$ZodUnion",0,ac,"$ZodUnknown",0,n7,"$ZodVoid",0,ae,"$ZodXID",0,nR,"$ZodXor",0,af,"$brand",0,t3,"$constructor",0,t4,"$input",0,si,"$output",0,sr,"Doc",0,nw,"JSONSchema",0,lz,"JSONSchemaGenerator",0,class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),this.ctx=o5({processors:lM,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return o4(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),o3(this.ctx,e);let{"~standard":r,...i}=o8(this.ctx,e);return i}},"NEVER",0,t5,"TimePrecision",0,sP,"_any",0,sQ,"_array",0,ox,"_base64",0,sk,"_base64url",0,sO,"_bigint",0,sW,"_boolean",0,sH,"_catch",0,oH,"_check",0,oQ,"_cidrv4",0,sT,"_cidrv6",0,sI,"_coercedBigint",0,sK,"_coercedBoolean",0,sq,"_coercedDate",0,s5,"_coercedNumber",0,sU,"_coercedString",0,sl,"_cuid",0,sv,"_cuid2",0,sb,"_custom",0,oX,"_date",0,s6,"_decode",0,r5,"_decodeAsync",0,r7,"_default",0,oj,"_discriminatedUnion",0,ok,"_e164",0,sC,"_email",0,su,"_emoji",0,sm,"_encode",0,r2,"_encodeAsync",0,r3,"_endsWith",0,om,"_enum",0,oR,"_file",0,oL,"_float32",0,sM,"_float64",0,sj,"_gt",0,s7,"_gte",0,s9,"_guid",0,sc,"_includes",0,op,"_int",0,sF,"_int32",0,sz,"_int64",0,sG,"_intersection",0,oO,"_ipv4",0,sS,"_ipv6",0,sE,"_isoDate",0,sR,"_isoDateTime",0,sD,"_isoDuration",0,sB,"_isoTime",0,s$,"_jwt",0,sN,"_ksuid",0,sA,"_lazy",0,oG,"_length",0,oc,"_literal",0,oB,"_lowercase",0,of,"_lt",0,s3,"_lte",0,s8,"_mac",0,sx,"_map",0,oP,"_max",0,s8,"_maxLength",0,ol,"_maxSize",0,oa,"_mime",0,ov,"_min",0,s9,"_minLength",0,ou,"_minSize",0,os,"_multipleOf",0,on,"_nan",0,s4,"_nanoid",0,sy,"_nativeEnum",0,o$,"_negative",0,ot,"_never",0,s1,"_nonnegative",0,oi,"_nonoptional",0,oz,"_nonpositive",0,or,"_normalize",0,ow,"_null",0,sY,"_nullable",0,oM,"_number",0,sL,"_optional",0,oF,"_overwrite",0,ob,"_parse",0,rG,"_parseAsync",0,rX,"_pipe",0,oq,"_positive",0,oe,"_promise",0,oZ,"_property",0,oy,"_readonly",0,oW,"_record",0,oN,"_refine",0,oJ,"_regex",0,od,"_safeDecode",0,ir,"_safeDecodeAsync",0,io,"_safeEncode",0,ie,"_safeEncodeAsync",0,ia,"_safeParse",0,rY,"_safeParseAsync",0,r0,"_set",0,oD,"_size",0,oo,"_slugify",0,oE,"_startsWith",0,og,"_string",0,so,"_stringFormat",0,o6,"_stringbool",0,o2,"_success",0,oV,"_superRefine",0,oY,"_symbol",0,sX,"_templateLiteral",0,oK,"_toLowerCase",0,oA,"_toUpperCase",0,oS,"_transform",0,oU,"_trim",0,o_,"_tuple",0,oC,"_uint32",0,sV,"_uint64",0,sZ,"_ulid",0,sw,"_undefined",0,sJ,"_union",0,oT,"_unknown",0,s0,"_uppercase",0,oh,"_url",0,sg,"_uuid",0,sd,"_uuidv4",0,sf,"_uuidv6",0,sh,"_uuidv7",0,sp,"_void",0,s2,"_xid",0,s_,"_xor",0,oI,"clone",0,rA,"config",0,re,"createStandardJSONSchemaMethod",0,o9,"createToJSONSchemaMethod",0,o7,"decode",0,r4,"decodeAsync",0,r9,"describe",0,o0,"encode",0,r6,"encodeAsync",0,r8,"extractDefs",0,o3,"finalize",0,o8,"flattenError",0,rV,"formatError",0,rH,"globalConfig",0,t9,"globalRegistry",0,ss,"initializeContext",0,o5,"isValidBase64",0,nq,"isValidBase64URL",0,nK,"isValidJWT",0,nX,"locales",0,st,"meta",0,o1,"parse",0,rZ,"parseAsync",0,rJ,"prettifyError",0,rK,"process",0,o4,"regexes",0,a2,"registry",0,sa,"safeDecode",0,ii,"safeDecodeAsync",0,il,"safeEncode",0,it,"safeEncodeAsync",0,is,"safeParse",0,rQ,"safeParseAsync",0,r1,"toDotPath",0,rW,"toJSONSchema",0,lj,"treeifyError",0,rq,"util",0,a1,"version",0,n_],844367);var lV=e.i(844367);e.s(["ZodAny",()=>cv,"ZodArray",()=>ck,"ZodBase64",()=>uG,"ZodBase64URL",()=>uX,"ZodBigInt",()=>co,"ZodBigIntFormat",()=>cu,"ZodBoolean",()=>ca,"ZodCIDRv4",()=>uH,"ZodCIDRv6",()=>uW,"ZodCUID",()=>uk,"ZodCUID2",()=>uC,"ZodCatch",()=>dp,"ZodCodec",()=>dw,"ZodCustom",()=>dR,"ZodCustomStringFormat",()=>u2,"ZodDate",()=>cT,"ZodDefault",()=>da,"ZodDiscriminatedUnion",()=>cF,"ZodE164",()=>uY,"ZodEmail",()=>uf,"ZodEmoji",()=>uE,"ZodEnum",()=>cQ,"ZodExactOptional",()=>de,"ZodFile",()=>c5,"ZodFunction",()=>dP,"ZodGUID",()=>up,"ZodIPv4",()=>uU,"ZodIPv6",()=>uz,"ZodIntersection",()=>cj,"ZodJWT",()=>u0,"ZodKSUID",()=>uB,"ZodLazy",()=>dk,"ZodLiteral",()=>c2,"ZodMAC",()=>uM,"ZodMap",()=>cZ,"ZodNaN",()=>dm,"ZodNanoID",()=>uT,"ZodNever",()=>cA,"ZodNonOptional",()=>dc,"ZodNull",()=>cm,"ZodNullable",()=>dr,"ZodNumber",()=>u8,"ZodNumberFormat",()=>u9,"ZodObject",()=>cN,"ZodOptional",()=>c7,"ZodPipe",()=>dv,"ZodPrefault",()=>dl,"ZodPreprocess",()=>dS,"ZodPromise",()=>dC,"ZodReadonly",()=>dE,"ZodRecord",()=>cq,"ZodSet",()=>cJ,"ZodString",()=>uu,"ZodStringFormat",()=>ud,"ZodSuccess",()=>df,"ZodSymbol",()=>cf,"ZodTemplateLiteral",()=>dT,"ZodTransform",()=>c3,"ZodTuple",()=>cV,"ZodType",()=>uo,"ZodULID",()=>uP,"ZodURL",()=>u_,"ZodUUID",()=>um,"ZodUndefined",()=>cp,"ZodUnion",()=>c$,"ZodUnknown",()=>cw,"ZodVoid",()=>cE,"ZodXID",()=>uR,"ZodXor",()=>cL,"_ZodString",()=>ul,"_default",()=>ds,"_function",()=>dD,"any",()=>cb,"array",()=>cO,"base64",()=>uZ,"base64url",()=>uJ,"bigint",()=>cl,"boolean",()=>cs,"catch",()=>dg,"check",()=>d$,"cidrv4",()=>uq,"cidrv6",()=>uK,"codec",()=>d_,"cuid",()=>uO,"cuid2",()=>uN,"custom",()=>dB,"date",()=>cI,"describe",()=>dF,"discriminatedUnion",()=>cM,"e164",()=>uQ,"email",()=>uh,"emoji",()=>ux,"enum",()=>c0,"exactOptional",()=>dt,"file",()=>c4,"float32",()=>ct,"float64",()=>cr,"function",()=>dD,"guid",()=>ug,"hash",()=>u3,"hex",()=>u4,"hostname",()=>u5,"httpUrl",()=>uS,"instanceof",()=>dj,"int",()=>ce,"int32",()=>ci,"int64",()=>cc,"intersection",()=>cz,"invertCodec",()=>dA,"ipv4",()=>uF,"ipv6",()=>uV,"json",()=>dV,"jwt",()=>u1,"keyof",()=>cC,"ksuid",()=>uL,"lazy",()=>dO,"literal",()=>c6,"looseObject",()=>cR,"looseRecord",()=>cG,"mac",()=>uj,"map",()=>cX,"meta",()=>dM,"nan",()=>dy,"nanoid",()=>uI,"nativeEnum",()=>c1,"never",()=>cS,"nonoptional",()=>dd,"null",()=>cy,"nullable",()=>di,"nullish",()=>dn,"number",()=>u7,"object",()=>cP,"optional",()=>c9,"partialRecord",()=>cK,"pipe",()=>db,"prefault",()=>du,"preprocess",()=>dH,"promise",()=>dN,"readonly",()=>dx,"record",()=>cW,"refine",()=>dL,"set",()=>cY,"strictObject",()=>cD,"string",()=>uc,"stringFormat",()=>u6,"stringbool",()=>dz,"success",()=>dh,"superRefine",()=>dU,"symbol",()=>ch,"templateLiteral",()=>dI,"transform",()=>c8,"tuple",()=>cH,"uint32",()=>cn,"uint64",()=>cd,"ulid",()=>uD,"undefined",()=>cg,"union",()=>cB,"unknown",()=>c_,"url",()=>uA,"uuid",()=>uy,"uuidv4",()=>uv,"uuidv6",()=>ub,"uuidv7",()=>uw,"void",()=>cx,"xid",()=>u$,"xor",()=>cU],168593);var lH=a2,lq=a1;e.s(["ZodISODate",()=>lG,"ZodISODateTime",()=>lW,"ZodISODuration",()=>lY,"ZodISOTime",()=>lX,"date",()=>lZ,"datetime",()=>lK,"duration",()=>lQ,"time",()=>lJ],201104);let lW=t4("ZodISODateTime",(e,t)=>{nB.init(e,t),ud.init(e,t)});function lK(e){return sD(lW,e)}let lG=t4("ZodISODate",(e,t)=>{nL.init(e,t),ud.init(e,t)});function lZ(e){return sR(lG,e)}let lX=t4("ZodISOTime",(e,t)=>{nU.init(e,t),ud.init(e,t)});function lJ(e){return s$(lX,e)}let lY=t4("ZodISODuration",(e,t)=>{nF.init(e,t),ud.init(e,t)});function lQ(e){return sB(lY,e)}let l0=(e,t)=>{rj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>rH(e,t)},flatten:{value:t=>rV(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ri,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ri,2)}},isEmpty:{get:()=>0===e.issues.length}})},l1=t4("ZodError",l0),l2=t4("ZodError",l0,{Parent:Error});e.s(["ZodError",0,l1,"ZodRealError",0,l2],307261);let l6=rG(l2),l5=rX(l2),l4=rY(l2),l3=r0(l2),l8=r2(l2),l7=r5(l2),l9=r3(l2),ue=r7(l2),ut=ie(l2),ur=ir(l2),ui=ia(l2),un=io(l2);e.s(["decode",0,l7,"decodeAsync",0,ue,"encode",0,l8,"encodeAsync",0,l9,"parse",0,l6,"parseAsync",0,l5,"safeDecode",0,ur,"safeDecodeAsync",0,un,"safeEncode",0,ut,"safeEncodeAsync",0,ui,"safeParse",0,l4,"safeParseAsync",0,l3],77461);let ua=new WeakMap;function us(e,t,r){let i=Object.getPrototypeOf(e),n=ua.get(i);if(n||(n=new Set,ua.set(i,n)),!n.has(t))for(let e in n.add(t),r){let t=r[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,get(){let r=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:r}),r},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let uo=t4("ZodType",(e,t)=>(nA.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:o9(e,"input"),output:o9(e,"output")}}),e.toJSONSchema=o7(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,r)=>l6(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>l4(e,t,r),e.parseAsync=async(t,r)=>l5(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>l3(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>l8(e,t,r),e.decode=(t,r)=>l7(e,t,r),e.encodeAsync=async(t,r)=>l9(e,t,r),e.decodeAsync=async(t,r)=>ue(e,t,r),e.safeEncode=(t,r)=>ut(e,t,r),e.safeDecode=(t,r)=>ur(e,t,r),e.safeEncodeAsync=async(t,r)=>ui(e,t,r),e.safeDecodeAsync=async(t,r)=>
79un(e,t,r),us(e,"ZodType",{check(...e){let t=this.def;return this.clone(lq.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return rA(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(dL(e,t))},superRefine(e,t){return this.check(dU(e,t))},overwrite(e){return this.check(ob(e))},optional(){return c9(this)},exactOptional(){return dt(this)},nullable(){return di(this)},nullish(){return c9(di(this))},nonoptional(e){return dd(this,e)},array(){return cO(this)},or(e){return cB([this,e])},and(e){return cz(this,e)},transform(e){return db(this,c8(e))},default(e){return ds(this,e)},prefault(e){return du(this,e)},catch(e){return dg(this,e)},pipe(e){return db(this,e)},readonly(){return dx(this)},describe(e){let t=this.clone();return ss.add(t,{description:e}),t},meta(...e){if(0===e.length)return ss.get(this);let t=this.clone();return ss.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>ss.get(e)?.description,configurable:!0}),e)),ul=t4("_ZodString",(e,t)=>{nS.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lt(e,t,r,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,us(e,"_ZodString",{regex(...e){return this.check(od(...e))},includes(...e){return this.check(op(...e))},startsWith(...e){return this.check(og(...e))},endsWith(...e){return this.check(om(...e))},min(...e){return this.check(ou(...e))},max(...e){return this.check(ol(...e))},length(...e){return this.check(oc(...e))},nonempty(...e){return this.check(ou(1,...e))},lowercase(e){return this.check(of(e))},uppercase(e){return this.check(oh(e))},trim(){return this.check(o_())},normalize(...e){return this.check(ow(...e))},toLowerCase(){return this.check(oA())},toUpperCase(){return this.check(oS())},slugify(){return this.check(oE())}})}),uu=t4("ZodString",(e,t)=>{nS.init(e,t),ul.init(e,t),e.email=t=>e.check(su(uf,t)),e.url=t=>e.check(sg(u_,t)),e.jwt=t=>e.check(sN(u0,t)),e.emoji=t=>e.check(sm(uE,t)),e.guid=t=>e.check(sc(up,t)),e.uuid=t=>e.check(sd(um,t)),e.uuidv4=t=>e.check(sf(um,t)),e.uuidv6=t=>e.check(sh(um,t)),e.uuidv7=t=>e.check(sp(um,t)),e.nanoid=t=>e.check(sy(uT,t)),e.guid=t=>e.check(sc(up,t)),e.cuid=t=>e.check(sv(uk,t)),e.cuid2=t=>e.check(sb(uC,t)),e.ulid=t=>e.check(sw(uP,t)),e.base64=t=>e.check(sk(uG,t)),e.base64url=t=>e.check(sO(uX,t)),e.xid=t=>e.check(s_(uR,t)),e.ksuid=t=>e.check(sA(uB,t)),e.ipv4=t=>e.check(sS(uU,t)),e.ipv6=t=>e.check(sE(uz,t)),e.cidrv4=t=>e.check(sT(uH,t)),e.cidrv6=t=>e.check(sI(uW,t)),e.e164=t=>e.check(sC(uY,t)),e.datetime=t=>e.check(lK(t)),e.date=t=>e.check(lZ(t)),e.time=t=>e.check(lJ(t)),e.duration=t=>e.check(lQ(t))});function uc(e){return so(uu,e)}let ud=t4("ZodStringFormat",(e,t)=>{nE.init(e,t),ul.init(e,t)}),uf=t4("ZodEmail",(e,t)=>{nI.init(e,t),ud.init(e,t)});function uh(e){return su(uf,e)}let up=t4("ZodGUID",(e,t)=>{nx.init(e,t),ud.init(e,t)});function ug(e){return sc(up,e)}let um=t4("ZodUUID",(e,t)=>{nT.init(e,t),ud.init(e,t)});function uy(e){return sd(um,e)}function uv(e){return sf(um,e)}function ub(e){return sh(um,e)}function uw(e){return sp(um,e)}let u_=t4("ZodURL",(e,t)=>{nk.init(e,t),ud.init(e,t)});function uA(e){return sg(u_,e)}function uS(e){return sg(u_,{protocol:lH.httpProtocol,hostname:lH.domain,...lq.normalizeParams(e)})}let uE=t4("ZodEmoji",(e,t)=>{nO.init(e,t),ud.init(e,t)});function ux(e){return sm(uE,e)}let uT=t4("ZodNanoID",(e,t)=>{nC.init(e,t),ud.init(e,t)});function uI(e){return sy(uT,e)}let uk=t4("ZodCUID",(e,t)=>{nN.init(e,t),ud.init(e,t)});function uO(e){return sv(uk,e)}let uC=t4("ZodCUID2",(e,t)=>{nP.init(e,t),ud.init(e,t)});function uN(e){return sb(uC,e)}let uP=t4("ZodULID",(e,t)=>{nD.init(e,t),ud.init(e,t)});function uD(e){return sw(uP,e)}let uR=t4("ZodXID",(e,t)=>{nR.init(e,t),ud.init(e,t)});function u$(e){return s_(uR,e)}let uB=t4("ZodKSUID",(e,t)=>{n$.init(e,t),ud.init(e,t)});function uL(e){return sA(uB,e)}let uU=t4("ZodIPv4",(e,t)=>{nM.init(e,t),ud.init(e,t)});function uF(e){return sS(uU,e)}let uM=t4("ZodMAC",(e,t)=>{nz.init(e,t),ud.init(e,t)});function uj(e){return sx(uM,e)}let uz=t4("ZodIPv6",(e,t)=>{nj.init(e,t),ud.init(e,t)});function uV(e){return sE(uz,e)}let uH=t4("ZodCIDRv4",(e,t)=>{nV.init(e,t),ud.init(e,t)});function uq(e){return sT(uH,e)}let uW=t4("ZodCIDRv6",(e,t)=>{nH.init(e,t),ud.init(e,t)});function uK(e){return sI(uW,e)}let uG=t4("ZodBase64",(e,t)=>{nW.init(e,t),ud.init(e,t)});function uZ(e){return sk(uG,e)}let uX=t4("ZodBase64URL",(e,t)=>{nG.init(e,t),ud.init(e,t)});function uJ(e){return sO(uX,e)}let uY=t4("ZodE164",(e,t)=>{nZ.init(e,t),ud.init(e,t)});function uQ(e){return sC(uY,e)}let u0=t4("ZodJWT",(e,t)=>{nJ.init(e,t),ud.init(e,t)});function u1(e){return sN(u0,e)}let u2=t4("ZodCustomStringFormat",(e,t)=>{nY.init(e,t),ud.init(e,t)});function u6(e,t,r={}){return o6(u2,e,t,r)}function u5(e){return o6(u2,"hostname",lH.hostname,e)}function u4(e){return o6(u2,"hex",lH.hex,e)}function u3(e,t){let r=t?.enc??"hex",i=`${e}_${r}`,n=lH[i];if(!n)throw Error(`Unrecognized hash format: ${i}`);return o6(u2,i,n,t)}let u8=t4("ZodNumber",(e,t)=>{nQ.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>
79lr(e,t,r,i),us(e,"ZodNumber",{gt(e,t){return this.check(s7(e,t))},gte(e,t){return this.check(s9(e,t))},min(e,t){return this.check(s9(e,t))},lt(e,t){return this.check(s3(e,t))},lte(e,t){return this.check(s8(e,t))},max(e,t){return this.check(s8(e,t))},int(e){return this.check(ce(e))},safe(e){return this.check(ce(e))},positive(e){return this.check(s7(0,e))},nonnegative(e){return this.check(s9(0,e))},negative(e){return this.check(s3(0,e))},nonpositive(e){return this.check(s8(0,e))},multipleOf(e,t){return this.check(on(e,t))},step(e,t){return this.check(on(e,t))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function u7(e){return sL(u8,e)}let u9=t4("ZodNumberFormat",(e,t)=>{n0.init(e,t),u8.init(e,t)});function ce(e){return sF(u9,e)}function ct(e){return sM(u9,e)}function cr(e){return sj(u9,e)}function ci(e){return sz(u9,e)}function cn(e){return sV(u9,e)}let ca=t4("ZodBoolean",(e,t)=>{n1.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>li(e,t,r,i)});function cs(e){return sH(ca,e)}let co=t4("ZodBigInt",(e,t)=>{n2.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>ln(e,t,r,i),e.gte=(t,r)=>e.check(s9(t,r)),e.min=(t,r)=>e.check(s9(t,r)),e.gt=(t,r)=>e.check(s7(t,r)),e.gte=(t,r)=>e.check(s9(t,r)),e.min=(t,r)=>e.check(s9(t,r)),e.lt=(t,r)=>e.check(s3(t,r)),e.lte=(t,r)=>e.check(s8(t,r)),e.max=(t,r)=>e.check(s8(t,r)),e.positive=t=>e.check(s7(BigInt(0),t)),e.negative=t=>e.check(s3(BigInt(0),t)),e.nonpositive=t=>e.check(s8(BigInt(0),t)),e.nonnegative=t=>e.check(s9(BigInt(0),t)),e.multipleOf=(t,r)=>e.check(on(t,r));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function cl(e){return sW(co,e)}let cu=t4("ZodBigIntFormat",(e,t)=>{n6.init(e,t),co.init(e,t)});function cc(e){return sG(cu,e)}function cd(e){return sZ(cu,e)}let cf=t4("ZodSymbol",(e,t)=>{n5.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>la(e,t,r,i)});function ch(e){return sX(cf,e)}let cp=t4("ZodUndefined",(e,t)=>{n4.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lo(e,t,r,i)});function cg(e){return sJ(cp,e)}let cm=t4("ZodNull",(e,t)=>{n3.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>ls(e,t,r,i)});function cy(e){return sY(cm,e)}let cv=t4("ZodAny",(e,t)=>{n8.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lc(e,t,r,i)});function cb(){return sQ(cv)}let cw=t4("ZodUnknown",(e,t)=>{n7.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>ld(e,t,r,i)});function c_(){return s0(cw)}let cA=t4("ZodNever",(e,t)=>{n9.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lu(e,t,r,i)});function cS(e){return s1(cA,e)}let cE=t4("ZodVoid",(e,t)=>{ae.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>ll(e,t,r,i)});function cx(e){return s2(cE,e)}let cT=t4("ZodDate",(e,t)=>{at.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lf(e,t,r,i),e.min=(t,r)=>e.check(s9(t,r)),e.max=(t,r)=>e.check(s8(t,r));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function cI(e){return s6(cT,e)}let ck=t4("ZodArray",(e,t)=>{ai.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lE(e,t,r,i),e.element=t.element,us(e,"ZodArray",{min(e,t){return this.check(ou(e,t))},nonempty(e){return this.check(ou(1,e))},max(e,t){return this.check(ol(e,t))},length(e,t){return this.check(oc(e,t))},unwrap(){return this.element}})});function cO(e,t){return ox(ck,e,t)}function cC(e){return c0(Object.keys(e._zod.def.shape))}let cN=t4("ZodObject",(e,t)=>{al.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lx(e,t,r,i),lq.defineLazy(e,"shape",()=>t.shape),us(e,"ZodObject",{keyof(){return c0(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:c_()})},loose(){return this.clone({...this._zod.def,catchall:c_()})},strict(){return this.clone({...this._zod.def,catchall:cS()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return lq.extend(this,e)},safeExtend(e){return lq.safeExtend(this,e)},merge(e){return lq.merge(this,e)},pick(e){return lq.pick(this,e)},omit(e){return lq.omit(this,e)},partial(...e){return lq.partial(c7,this,e[0])},required(...e){return lq.required(dc,this,e[0])}})});function cP(e,t){return new cN({type:"object",shape:e??{},...lq.normalizeParams(t)})}function cD(e,t){return new cN({type:"object",shape:e,catchall:cS(),...lq.normalizeParams(t)})}function cR(e,t){return new cN({type:"object",shape:e,catchall:c_(),...lq.normalizeParams(t)})}let c$=t4("ZodUnion",(e,t)=>{ac.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>
79lT(e,t,r,i),e.options=t.options});function cB(e,t){return new c$({type:"union",options:e,...lq.normalizeParams(t)})}let cL=t4("ZodXor",(e,t)=>{c$.init(e,t),af.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lT(e,t,r,i),e.options=t.options});function cU(e,t){return new cL({type:"union",options:e,inclusive:!1,...lq.normalizeParams(t)})}let cF=t4("ZodDiscriminatedUnion",(e,t)=>{c$.init(e,t),ah.init(e,t)});function cM(e,t,r){return new cF({type:"union",options:t,discriminator:e,...lq.normalizeParams(r)})}let cj=t4("ZodIntersection",(e,t)=>{ap.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lI(e,t,r,i)});function cz(e,t){return new cj({type:"intersection",left:e,right:t})}let cV=t4("ZodTuple",(e,t)=>{am.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lk(e,t,r,i),e.rest=t=>e.clone({...e._zod.def,rest:t})});function cH(e,t,r){let i=t instanceof nA,n=i?r:t;return new cV({type:"tuple",items:e,rest:i?t:null,...lq.normalizeParams(n)})}let cq=t4("ZodRecord",(e,t)=>{aw.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lO(e,t,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function cW(e,t,r){return new cq(t&&t._zod?{type:"record",keyType:e,valueType:t,...lq.normalizeParams(r)}:{type:"record",keyType:uc(),valueType:e,...lq.normalizeParams(t)})}function cK(e,t,r){let i=rA(e);return i._zod.values=void 0,new cq({type:"record",keyType:i,valueType:t,...lq.normalizeParams(r)})}function cG(e,t,r){return new cq({type:"record",keyType:e,valueType:t,mode:"loose",...lq.normalizeParams(r)})}let cZ=t4("ZodMap",(e,t)=>{a_.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lA(e,t,r,i),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(os(...t)),e.nonempty=t=>e.check(os(1,t)),e.max=(...t)=>e.check(oa(...t)),e.size=(...t)=>e.check(oo(...t))});function cX(e,t,r){return new cZ({type:"map",keyType:e,valueType:t,...lq.normalizeParams(r)})}let cJ=t4("ZodSet",(e,t)=>{aS.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lS(e,t,r,i),e.min=(...t)=>e.check(os(...t)),e.nonempty=t=>e.check(os(1,t)),e.max=(...t)=>e.check(oa(...t)),e.size=(...t)=>e.check(oo(...t))});function cY(e,t){return new cJ({type:"set",valueType:e,...lq.normalizeParams(t)})}let cQ=t4("ZodEnum",(e,t)=>{ax.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lh(e,t,r,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,i)=>{let n={};for(let i of e)if(r.has(i))n[i]=t.entries[i];else throw Error(`Key ${i} not found in enum`);return new cQ({...t,checks:[],...lq.normalizeParams(i),entries:n})},e.exclude=(e,i)=>{let n={...t.entries};for(let t of e)if(r.has(t))delete n[t];else throw Error(`Key ${t} not found in enum`);return new cQ({...t,checks:[],...lq.normalizeParams(i),entries:n})}});function c0(e,t){return new cQ({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...lq.normalizeParams(t)})}function c1(e,t){return new cQ({type:"enum",entries:e,...lq.normalizeParams(t)})}let c2=t4("ZodLiteral",(e,t)=>{aT.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lp(e,t,r,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if
79(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function c6(e,t){return new c2({type:"literal",values:Array.isArray(e)?e:[e],...lq.normalizeParams(t)})}let c5=t4("ZodFile",(e,t)=>{aI.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>ly(e,t,r,i),e.min=(t,r)=>e.check(os(t,r)),e.max=(t,r)=>e.check(oa(t,r)),e.mime=(t,r)=>e.check(ov(Array.isArray(t)?t:[t],r))});function c4(e){return oL(c5,e)}let c3=t4("ZodTransform",(e,t)=>{ak.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>l_(e,t,r,i),e._zod.parse=(r,i)=>{if("backward"===i.direction)throw new t7(e.constructor.name);r.addIssue=i=>{"string"==typeof i?r.issues.push(lq.issue(i,r.value,t)):(i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(lq.issue(i)))};let n=t.transform(r.value,r);return n instanceof Promise?n.then(e=>(r.value=e,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function c8(e){return new c3({type:"transform",transform:e})}let c7=t4("ZodOptional",(e,t)=>{aC.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lU(e,t,r,i),e.unwrap=()=>e._zod.def.innerType});function c9(e){return new c7({type:"optional",innerType:e})}let de=t4("ZodExactOptional",(e,t)=>{aN.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lU(e,t,r,i),e.unwrap=()=>e._zod.def.innerType});function dt(e){return new de({type:"optional",innerType:e})}let dr=t4("ZodNullable",(e,t)=>{aP.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lC(e,t,r,i),e.unwrap=()=>e._zod.def.innerType});function di(e){return new dr({type:"nullable",innerType:e})}function dn(e){return c9(di(e))}let da=t4("ZodDefault",(e,t)=>{aD.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lP(e,t,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ds(e,t){return new da({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():lq.shallowClone(t)}})}let dl=t4("ZodPrefault",(e,t)=>{a$.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lD(e,t,r,i),e.unwrap=()=>e._zod.def.innerType});function du(e,t){return new dl({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():lq.shallowClone(t)}})}let dc=t4("ZodNonOptional",(e,t)=>{aB.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lN(e,t,r,i),e.unwrap=()=>e._zod.def.innerType});function dd(e,t){return new dc({type:"nonoptional",innerType:e,...lq.normalizeParams(t)})}let df=t4("ZodSuccess",(e,t)=>{aU.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lv(e,t,r,i),e.unwrap=()=>e._zod.def.innerType});function dh(e){return new df({type:"success",innerType:e})}let dp=t4("ZodCatch",(e,t)=>{aF.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lR(e,t,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dg(e,t){return new dp({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}let dm=t4("ZodNaN",(e,t)=>{aM.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lg(e,t,r,i)});function dy(e){return s4(dm,e)}let dv=t4("ZodPipe",(e,t)=>{aj.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>l$(e,t,r,i),e.in=t.in,e.out=t.out});function db(e,t){return new dv({type:"pipe",in:e,out:t})}let dw=t4("ZodCodec",(e,t)=>{dv.init(e,t),aV.init(e,t)});function d_(e,t,r){return new dw({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function dA(e){let t=e._zod.def;return new dw({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}let dS=t4("ZodPreprocess",(e,t)=>{dv.init(e,t),aW.init(e,t)}),dE=t4("ZodReadonly",(e,t)=>{aK.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lB(e,t,r,i),e.unwrap=()=>e._zod.def.innerType});function dx(e){return new dE({type:"readonly",innerType:e})}let dT=t4("ZodTemplateLiteral",(e,t)=>{aZ.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lm(e,t,r,i)});function dI(e,t){return new dT({type:"template_literal",parts:e,...lq.normalizeParams(t)})}let dk=t4("ZodLazy",(e,t)=>{aY.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lF(e,t,r,i),e.unwrap=()=>e._zod.def.getter()});function dO(e){return new dk({type:"lazy",getter:e})}let dC=t4("ZodPromise",(e,t)=>{aJ.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lL(e,t,r,i),e.unwrap=()=>e._zod.def.innerType});function dN(e){return new dC({type:"promise",innerType:e})}let dP=t4("ZodFunction",(e,t)=>{aX.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>lw(e,t,r,i)});function dD(e){return new dP({type:"function",input:Array.isArray(e?.input)?cH(e?.input):e?.input??cO(c_()),output:e?.output??c_()})}let dR=t4("ZodCustom",(e,t)=>{aQ.init(e,t),uo.init(e,t),e._zod.processJSONSchema=(t,r,i)=>
79lb(e,t,r,i)});function d$(e){let t=new i3({check:"custom"});return t._zod.check=e,t}function dB(e,t){return oX(dR,e??(()=>!0),t)}function dL(e,t={}){return oJ(dR,e,t)}function dU(e,t){return oY(e,t)}let dF=o0,dM=o1;function dj(e,t={}){let r=new dR({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...lq.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:r,path:[...r._zod.def.path??[]]})},r}let dz=(...e)=>o2({Codec:dw,Boolean:ca,String:uu},...e);function dV(e){let t=dO(()=>cB([uc(e),u7(),cs(),cy(),cO(t),cW(uc(),t)]));return t}function dH(e,t){return new dS({type:"pipe",in:c8(e),out:t})}var dq=e.i(168593);e.s([],151345),e.i(151345),e.s(["endsWith",0,om,"gt",0,s7,"gte",0,s9,"includes",0,op,"length",0,oc,"lowercase",0,of,"lt",0,s3,"lte",0,s8,"maxLength",0,ol,"maxSize",0,oa,"mime",0,ov,"minLength",0,ou,"minSize",0,os,"multipleOf",0,on,"negative",0,ot,"nonnegative",0,oi,"nonpositive",0,or,"normalize",0,ow,"overwrite",0,ob,"positive",0,oe,"property",0,oy,"regex",0,od,"size",0,oo,"slugify",0,oE,"startsWith",0,og,"toLowerCase",0,oA,"toUpperCase",0,oS,"trim",0,o_,"uppercase",0,oh],111779);var dW=e.i(111779);e.i(307261),e.i(77461);let dK={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function dG(e){re({customError:e})}function dZ(){return re().customError}j||(j={}),e.s(["ZodFirstPartyTypeKind",0,j,"ZodIssueCode",0,dK,"getErrorMap",0,dZ,"setErrorMap",0,dG],925333),e.i(925333),e.s(["$brand",0,t3,"ZodFirstPartyTypeKind",0,j,"ZodIssueCode",0,dK,"config",0,re,"getErrorMap",0,dZ,"setErrorMap",0,dG],111555),e.i(111555);var lH=a2,lq=a1,dX=e.i(201104);let dJ={...dq,...dW,iso:dX},dY=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);e.s(["bigint",0,function(e){return sK(co,e)},"boolean",0,function(e){return sq(ca,e)},"date",0,function(e){return s5(cT,e)},"number",0,function(e){return sU(u8,e)},"string",0,function(e){return sl(uu,e)}],936948);var dQ=e.i(936948);e.s(["$brand",0,t3,"$input",0,si,"$output",0,sr,"NEVER",0,t5,"TimePrecision",0,sP,"ZodAny",0,cv,"ZodArray",0,ck,"ZodBase64",0,uG,"ZodBase64URL",0,uX,"ZodBigInt",0,co,"ZodBigIntFormat",0,cu,"ZodBoolean",0,ca,"ZodCIDRv4",0,uH,"ZodCIDRv6",0,uW,"ZodCUID",0,uk,"ZodCUID2",0,uC,"ZodCatch",0,dp,"ZodCodec",0,dw,"ZodCustom",0,dR,"ZodCustomStringFormat",0,u2,"ZodDate",0,cT,"ZodDefault",0,da,"ZodDiscriminatedUnion",0,cF,"ZodE164",0,uY,"ZodEmail",0,uf,"ZodEmoji",0,uE,"ZodEnum",0,cQ,"ZodError",0,l1,"ZodExactOptional",0,de,"ZodFile",0,c5,"ZodFirstPartyTypeKind",0,j,"ZodFunction",0,dP,"ZodGUID",0,up,"ZodIPv4",0,uU,"ZodIPv6",0,uz,"ZodISODate",0,lG,"ZodISODateTime",0,lW,"ZodISODuration",0,lY,"ZodISOTime",0,lX,"ZodIntersection",0,cj,"ZodIssueCode",0,dK,"ZodJWT",0,u0,"ZodKSUID",0,uB,"ZodLazy",0,dk,"ZodLiteral",0,c2,"ZodMAC",0,uM,"ZodMap",0,cZ,"ZodNaN",0,dm,"ZodNanoID",0,uT,"ZodNever",0,cA,"ZodNonOptional",0,dc,"ZodNull",0,cm,"ZodNullable",0,dr,"ZodNumber",0,u8,"ZodNumberFormat",0,u9,"ZodObject",0,cN,"ZodOptional",0,c7,"ZodPipe",0,dv,"ZodPrefault",0,dl,"ZodPreprocess",0,dS,"ZodPromise",0,dC,"ZodReadonly",0,dE,"ZodRealError",0,l2,"ZodRecord",0,cq,"ZodSet",0,cJ,"ZodString",0,uu,"ZodStringFormat",0,ud,"ZodSuccess",0,df,"ZodSymbol",0,cf,"ZodTemplateLiteral",0,dT,"ZodTransform",0,c3,"ZodTuple",0,cV,"ZodType",0,uo,"ZodULID",0,uP,"ZodURL",0,u_,"ZodUUID",0,um,"ZodUndefined",0,cp,"ZodUnion",0,c$,"ZodUnknown",0,cw,"ZodVoid",0,cE,"ZodXID",0,uR,"ZodXor",0,cL,"_ZodString",0,ul,"_default",0,ds,"_function",0,dD,"any",0,cb,"array",0,cO,"base64",0,uZ,"base64url",0,uJ,"bigint",0,cl,"boolean",0,cs,"catch",0,dg,"check",0,d$,"cidrv4",0,uq,"cidrv6",0,uK,"clone",0,rA,"codec",0,d_,"coerce",0,dQ,"config",0,re,"core",0,lV,"cuid",0,uO,"cuid2",0,uN,"custom",0,dB,"date",0,cI,"decode",0,l7,"decodeAsync",0,ue,"describe",0,dF,"discriminatedUnion",0,cM,"e164",0,uQ,"email",0,uh,"emoji",0,ux,"encode",0,l8,"encodeAsync",0,l9,"endsWith",0,om,"enum",0,c0,"exactOptional",0,dt,"file",0,c4,"flattenError",0,rV,"float32",0,ct,"float64",0,cr,"formatError",0,rH,"fromJSONSchema",0,function(e,t){var r,i;let n,a;if("boolean"==typeof e)return e?dJ.any():dJ.never();try{n=JSON.parse(JSON.stringify(e))}
79catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let s={version:(r=n,i=t?.defaultTarget,"https://json-schema.org/draft/2020-12/schema"===(a=r.$schema)?"draft-2020-12":"http://json-schema.org/draft-07/schema#"===a?"draft-7":"http://json-schema.org/draft-04/schema#"===a?"draft-4":i??"draft-2020-12"),defs:n.$defs||n.definitions||{},refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??ss};return function e(t,r){if("boolean"==typeof t)return t?dJ.any():dJ.never();let i=function t(r,i){let n;if(void 0!==r.not){if("object"==typeof r.not&&0===Object.keys(r.not).length)return dJ.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(void 0!==r.unevaluatedItems)throw Error("unevaluatedItems is not supported");if(void 0!==r.unevaluatedProperties)throw Error("unevaluatedProperties is not supported");if(void 0!==r.if||void 0!==r.then||void 0!==r.else)throw Error("Conditional schemas (if/then/else) are not supported");if(void 0!==r.dependentSchemas||void 0!==r.dependentRequired)throw Error("dependentSchemas and dependentRequired are not supported");if(r.$ref){let t=r.$ref;if(i.refs.has(t))return i.refs.get(t);if(i.processing.has(t))return dJ.lazy(()=>{if(!i.refs.has(t))throw Error(`Circular reference not resolved: ${t}`);return i.refs.get(t)});i.processing.add(t);let n=e(function(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(0===r.length)return t.rootSchema;let i="draft-2020-12"===t.version?"$defs":"definitions";if(r[0]===i){let i=r[1];if(!i||!t.defs[i])throw Error(`Reference not found: ${e}`);return t.defs[i]}throw Error(`Reference not found: ${e}`)}(t,i),i);return i.refs.set(t,n),i.processing.delete(t),n}if(void 0!==r.enum){let e=r.enum;if("openapi-3.0"===i.version&&!0===r.nullable&&1===e.length&&null===e[0])return dJ.null();if(0===e.length)return dJ.never();if(1===e.length)return dJ.literal(e[0]);if(e.every(e=>"string"==typeof e))return dJ.enum(e);let t=e.map(e=>dJ.literal(e));return t.length<2?t[0]:dJ.union([t[0],t[1],...t.slice(2)])}if(void 0!==r.const)return dJ.literal(r.const);let a=r.type;if(Array.isArray(a)){let e=a.map(e=>t({...r,type:e},i));return 0===e.length?dJ.never():1===e.length?e[0]:dJ.union(e)}if(!a)return dJ.any();switch(a){case"string":{let e=dJ.string();if(r.format){let t=r.format;"email"===t?e=e.check(dJ.email()):"uri"===t||"uri-reference"===t?e=e.check(dJ.url()):"uuid"===t||"guid"===t?e=e.check(dJ.uuid()):"date-time"===t?e=e.check(dJ.iso.datetime()):"date"===t?e=e.check(dJ.iso.date()):"time"===t?e=e.check(dJ.iso.time()):"duration"===t?e=e.check(dJ.iso.duration()):"ipv4"===t?e=e.check(dJ.ipv4()):"ipv6"===t?e=e.check(dJ.ipv6()):"mac"===t?e=e.check(dJ.mac()):"cidr"===t?e=e.check(dJ.cidrv4()):"cidr-v6"===t?e=e.check(dJ.cidrv6()):"base64"===t?e=e.check(dJ.base64()):"base64url"===t?e=e.check(dJ.base64url()):"e164"===t?e=e.check(dJ.e164()):"jwt"===t?e=e.check(dJ.jwt()):"emoji"===t?e=e.check(dJ.emoji()):"nanoid"===t?e=e.check(dJ.nanoid()):"cuid"===t?e=e.check(dJ.cuid()):"cuid2"===t?e=e.check(dJ.cuid2()):"ulid"===t?e=e.check(dJ.ulid()):"xid"===t?e=e.check(dJ.xid()):"ksuid"===t&&(e=e.check(dJ.ksuid()))}"number"==typeof r.minLength&&(e=e.min(r.minLength)),"number"==typeof r.maxLength&&(e=e.max(r.maxLength)),r.pattern&&(e=e.regex(new RegExp(r.pattern))),n=e;break}case"number":case"integer":{let e="integer"===a?dJ.number().int():dJ.number();"number"==typeof r.minimum&&(e=e.min(r.minimum)),"number"==typeof r.maximum&&(e=e.max(r.maximum)),"number"==typeof r.exclusiveMinimum?e=e.gt(r.exclusiveMinimum):!0===r.exclusiveMinimum&&"number"==typeof r.minimum&&(e=e.gt(r.minimum)),"number"==typeof r.exclusiveMaximum?e=e.lt(r.exclusiveMaximum):!0===r.exclusiveMaximum&&"number"==typeof r.maximum&&(e=e.lt(r.maximum)),"number"==typeof r.multipleOf&&(e=e.multipleOf(r.multipleOf)),n=e;break}case"boolean":n=dJ.boolean();break;case"null":n=dJ.null();break;case"object":{let t={},a=r.properties||{},s=new Set(r.required||[]);for(let[r,n]of Object.entries(a)){let a=e(n,i);t[r]=s.has(r)?a:a.optional()}if(r.propertyNames){let a=e(r.propertyNames,i),s=r.additionalProperties&&"object"==typeof r.additionalProperties?e(r.additionalProperties,i):dJ.any();if(0===Object.keys(t).length){n=dJ.record(a,s);break}let o=dJ.object(t).passthrough(),l=dJ.looseRecord(a,s);n=dJ.intersection(o,l);break}if(r.patternProperties){let a=r.patternProperties,s=Object.keys(a),o=[];for(let t of s){let r=e(a[t],i),n=dJ.string().regex(new RegExp(t));o.push(dJ.looseRecord(n,r))}let l=[];
79if(Object.keys(t).length>0&&l.push(dJ.object(t).passthrough()),l.push(...o),0===l.length)n=dJ.object({}).passthrough();else if(1===l.length)n=l[0];else{let e=dJ.intersection(l[0],l[1]);for(let t=2;t<l.length;t++)e=dJ.intersection(e,l[t]);n=e}break}let o=dJ.object(t);n=!1===r.additionalProperties?o.strict():"object"==typeof r.additionalProperties?o.catchall(e(r.additionalProperties,i)):o.passthrough();break}case"array":{let t=r.prefixItems,a=r.items;if(t&&Array.isArray(t)){let s=t.map(t=>e(t,i)),o=a&&"object"==typeof a&&!Array.isArray(a)?e(a,i):void 0;n=o?dJ.tuple(s).rest(o):dJ.tuple(s),"number"==typeof r.minItems&&(n=n.check(dJ.minLength(r.minItems))),"number"==typeof r.maxItems&&(n=n.check(dJ.maxLength(r.maxItems)))}else if(Array.isArray(a)){let t=a.map(t=>e(t,i)),s=r.additionalItems&&"object"==typeof r.additionalItems?e(r.additionalItems,i):void 0;n=s?dJ.tuple(t).rest(s):dJ.tuple(t),"number"==typeof r.minItems&&(n=n.check(dJ.minLength(r.minItems))),"number"==typeof r.maxItems&&(n=n.check(dJ.maxLength(r.maxItems)))}else if(void 0!==a){let t=e(a,i),s=dJ.array(t);"number"==typeof r.minItems&&(s=s.min(r.minItems)),"number"==typeof r.maxItems&&(s=s.max(r.maxItems)),n=s}else n=dJ.array(dJ.any());break}default:throw Error(`Unsupported type: ${a}`)}return n}(t,r),n=t.type||void 0!==t.enum||void 0!==t.const;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(t=>e(t,r)),s=dJ.union(a);i=n?dJ.intersection(i,s):s}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(t=>e(t,r)),s=dJ.xor(a);i=n?dJ.intersection(i,s):s}if(t.allOf&&Array.isArray(t.allOf))if(0===t.allOf.length)i=n?i:dJ.any();else{let a=n?i:e(t.allOf[0],r),s=+!n;for(let i=s;i<t.allOf.length;i++)a=dJ.intersection(a,e(t.allOf[i],r));i=a}!0===t.nullable&&"openapi-3.0"===r.version&&(i=dJ.nullable(i)),!0===t.readOnly&&(i=dJ.readonly(i)),void 0!==t.default&&(i=i.default(t.default));let a={};for(let e of["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"])e in t&&(a[e]=t[e]);for(let e of["contentEncoding","contentMediaType","contentSchema"])e in t&&(a[e]=t[e]);for(let e of Object.keys(t))dY.has(e)||(a[e]=t[e]);return Object.keys(a).length>0&&r.registry.add(i,a),t.description&&(i=i.describe(t.description)),i}(n,s)},"function",0,dD,"getErrorMap",0,dZ,"globalRegistry",0,ss,"gt",0,s7,"gte",0,s9,"guid",0,ug,"hash",0,u3,"hex",0,u4,"hostname",0,u5,"httpUrl",0,uS,"includes",0,op,"instanceof",0,dj,"int",0,ce,"int32",0,ci,"int64",0,cc,"intersection",0,cz,"invertCodec",0,dA,"ipv4",0,uF,"ipv6",0,uV,"iso",0,dX,"json",0,dV,"jwt",0,u1,"keyof",0,cC,"ksuid",0,uL,"lazy",0,dO,"length",0,oc,"literal",0,c6,"locales",0,st,"looseObject",0,cR,"looseRecord",0,cG,"lowercase",0,of,"lt",0,s3,"lte",0,s8,"mac",0,uj,"map",0,cX,"maxLength",0,ol,"maxSize",0,oa,"meta",0,dM,"mime",0,ov,"minLength",0,ou,"minSize",0,os,"multipleOf",0,on,"nan",0,dy,"nanoid",0,uI,"nativeEnum",0,c1,"negative",0,ot,"never",0,cS,"nonnegative",0,oi,"nonoptional",0,dd,"nonpositive",0,or,"normalize",0,ow,"null",0,cy,"nullable",0,di,"nullish",0,dn,"number",0,u7,"object",0,cP,"optional",0,c9,"overwrite",0,ob,"parse",0,l6,"parseAsync",0,l5,"partialRecord",0,cK,"pipe",0,db,"positive",0,oe,"prefault",0,du,"preprocess",0,dH,"prettifyError",0,rK,"promise",0,dN,"property",0,oy,"readonly",0,dx,"record",0,cW,"refine",0,dL,"regex",0,od,"regexes",()=>lH,"registry",0,sa,"safeDecode",0,ur,"safeDecodeAsync",0,un,"safeEncode",0,ut,"safeEncodeAsync",0,ui,"safeParse",0,l4,"safeParseAsync",0,l3,"set",0,cY,"setErrorMap",0,dG,"size",0,oo,"slugify",0,oE,"startsWith",0,og,"strictObject",0,cD,"string",0,uc,"stringFormat",0,u6,"stringbool",0,dz,"success",0,dh,"superRefine",0,dU,"symbol",0,ch,"templateLiteral",0,dI,"toJSONSchema",0,lj,"toLowerCase",0,oA,"toUpperCase",0,oS,"transform",0,c8,"treeifyError",0,rq,"trim",0,o_,"tuple",0,cH,"uint32",0,cn,"uint64",0,cd,"ulid",0,uD,"undefined",0,cg,"union",0,cB,"unknown",0,c_,"uppercase",0,oh,"url",0,uA,"util",()=>lq,"uuid",0,uy,"uuidv4",0,uv,"uuidv6",0,ub,"uuidv7",0,uw,"void",0,cx,"xid",0,u$,"xor",0,cU],465362);var d0=e.i(465362),d0=d0;let d1={mainnet:"https://mainnet.api.bridge.nearone.org",testnet:"https://testnet.api.bridge.nearone.org"};
79class d2 extends Error{code;details;constructor(e,t,r){super(e),this.code=t,this.details=r,this.name="OmniBridgeError"}}class d6 extends d2{constructor(e,t,r){super(e,t,r),this.name="ValidationError"}}let d5=d0.enum(["Eth","Near","Sol","Arb","Base","Bnb","Btc","Zcash","Pol","Abs","HlEvm","Strk","Fogo"]),d4=d0.enum(["Initialized","Signed","FastFinalisedOnNear","FinalisedOnNear","FastFinalised","Finalised","Claimed"]),d3=(e=!1)=>d0.preprocess(t=>{if(null===t&&e)return null;try{if("number"==typeof t)return BigInt(t.toLocaleString("fullwide",{useGrouping:!1}));if("string"==typeof t)try{return BigInt(t)}catch{let e=Number(t);if(!Number.isNaN(e))return BigInt(e.toLocaleString("fullwide",{useGrouping:!1}));throw Error(`Cannot convert ${t} to BigInt`)}return t}catch{throw Error(`Invalid BigInt value: ${t}`)}},e?d0.bigint().min(0n).nullable():d0.bigint().min(0n)),d8=d0.object({block_height:d0.number().int().min(0),block_timestamp_seconds:d0.number().int().min(0),transaction_hash:d0.string()}),d7=d0.object({block_height:d0.number().int().min(0),block_timestamp_seconds:d0.number().int().min(0),transaction_hash:d0.string()}),d9=d0.object({slot:d0.number().int().min(0).optional(),block_timestamp_seconds:d0.number().int().min(0).optional(),signature:d0.string().optional()}),fe=d0.object({transaction_hash:d0.string(),block_height:d0.number().int().min(0).nullable(),block_time:d0.number().int().min(0).nullable()}),ft=d0.object({block_number:d0.number().int().min(0),block_timestamp:d0.number().int().min(0),transaction_hash:d0.string()}),fr=d0.object({NearReceipt:d8.optional(),EVMLog:d7.optional(),Solana:d9.optional(),UtxoLog:fe.optional(),Starknet:ft.optional()}).refine(e=>1===[e.NearReceipt,e.EVMLog,e.Solana,e.UtxoLog,e.Starknet].filter(e=>void 0!==e).length,{message:"Exactly one transaction type must be present"}),fi=d0.object({token:d0.string(),amount:d0.string(),sender:d0.string(),recipient:d0.string(),fee:d0.object({fee:d0.string(),native_fee:d0.string()}),msg:d0.string().nullable()}),fn=d0.object({chain:d0.string(),amount:d0.string(),recipient:d0.string(),relayer_fee:d0.string(),protocol_fee:d0.string(),relayer_account_id:d0.string(),sender:d0.union([d0.string(),d0.null()]),btc_pending_id:d0.string().optional()}),fa=d0.object({id:d0.object({origin_chain:d5,kind:d0.union([d0.object({Nonce:d0.number().int().min(0)}),d0.object({Utxo:d0.object({tx_hash:d0.string(),vout:d0.number().int()})})])}).optional().nullable(),initialized:d0.union([d0.null(),fr]),signed:d0.union([d0.null(),fr]),fast_finalised_on_near:d0.union([d0.null(),fr]),finalised_on_near:d0.union([d0.null(),fr]),fast_finalised:d0.union([d0.null(),fr]),finalised:d0.union([d0.null(),fr]),claimed:d0.union([d0.null(),fr]),transfer_message:d0.union([d0.null(),fi]),updated_fee:d0.array(fr),utxo_transfer:d0.union([d0.null(),fn])}),fs=d0.object({native_token_fee:d3(),gas_fee:d3(!0).nullable().optional(),protocol_fee:d3(!0).nullable().optional(),usd_fee:d0.number(),transferred_token_fee:d0.string().nullable().optional(),min_amount:d0.string().nullable().optional(),insufficient_utxo:d0.boolean()}),fo=d0.object({allowlisted_tokens:d0.record(d0.string(),d0.string())});d0.object({receiver_id:d0.string(),amount:d0.string(),msg:d0.string(),gas:d0.string().optional(),memo:d0.string().nullable().optional()});let fl=d0.object({address:d0.string()});class fu extends d2{status;statusText;constructor(e,t,r){super(e,"API_ERROR",{status:t,statusText:r}),this.status=t,this.statusText=r,this.name="ApiError"}}class fc{baseUrl;constructor(e,t={}){this.baseUrl=t.baseUrl??d1[e]}async fetchWithValidation(e,t,r){let i=await fetch(e,r);if(404===i.status)throw new fu(await i.text()||"Resource not found",i.status,i.statusText);if(!i.ok)throw new fu(await i.text()||"API request failed",i.status,i.statusText);let n=await i.json();return t.parse(n)}buildUrl(e,t={}){let r=new URL(`${this.baseUrl}${e}`);for(let[e,i]of Object.entries(t))void 0!==i&&r.searchParams.set(e,i);return r}async getTransferStatus(e){let t={};"originChain"in e?(t.origin_chain=e.originChain,t.origin_nonce=e.originNonce.toString()):t.transaction_hash=e.transactionHash;let r=this.buildUrl("/api/v3/transfers/transfer/status",t);return this.fetchWithValidation(r,d0.array(d4))}
79async getFee(e,t,r,i){let n=this.buildUrl("/api/v3/transfer-fee",{sender:e,recipient:t,token:r,amount:"bigint"==typeof i?i.toString():i});return this.fetchWithValidation(n,fs)}async getTransfer(e){let t={};"originChain"in e?(t.origin_chain=e.originChain,t.origin_nonce=e.originNonce.toString()):t.transaction_hash=e.transactionHash;let r=this.buildUrl("/api/v3/transfers/transfer",t);return this.fetchWithValidation(r,d0.array(fa))}async findTransfers(e){if(!e.sender&&!e.transactionId)throw new d2("Either sender or transactionId must be provided","VALIDATION_ERROR");let t={offset:(e.offset??0).toString(),limit:(e.limit??10).toString(),sender:e.sender,transaction_id:e.transactionId},r=this.buildUrl("/api/v3/transfers",t);return this.fetchWithValidation(r,d0.array(fa))}async getAllowlistedTokens(){let e=this.buildUrl("/api/v3/transfer-fee/allowlisted-tokens");return(await this.fetchWithValidation(e,fo)).allowlisted_tokens}async getUtxoDepositAddress(e,t,r,i,n){let a={chain:e,recipient:t};null!=r&&(a.safe_deposit=r),null!=i&&(a.refund_address=i),null!=n&&(a.skip_tx=n);let s=this.buildUrl("/api/v3/utxo/get_user_deposit_address");return this.fetchWithValidation(s,fl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}async findOmniTransfers(e){return this.findTransfers(e)}async getUtxoUserDepositAddress(e,t,r){return this.getUtxoDepositAddress(e,t,r)}}var fd=e.i(37755),ff=e.i(748720),fh=e.i(695443);function fp(e){let t;if("string"==typeof e)try{t=fd.base58.decode(e)}catch{throw Error(`Invalid base58 code hash: ${e}`)}else t=e;if(32!==t.length)throw Error(`Code hash must be 32 bytes, got ${t.length} bytes`);return t}let fg=fh.b.enum({CodeHash:fh.b.array(fh.b.u8(),32),AccountId:fh.b.string()}),fm=fh.b.struct({code:fg,data:fh.b.hashMap(fh.b.bytes(),fh.b.bytes())}),fy=fh.b.enum({V1:fm}),fv=fh.b.struct({data:fh.b.array(fh.b.u8(),32)}),fb=fh.b.struct({data:fh.b.array(fh.b.u8(),64)}),fw=fh.b.enum({ed25519Key:fv,secp256k1Key:fb}),f_=fh.b.struct({data:fh.b.array(fh.b.u8(),64)}),fA=fh.b.struct({data:fh.b.array(fh.b.u8(),65)}),fS=fh.b.enum({ed25519Signature:f_,secp256k1Signature:fA}),fE=fh.b.struct({allowance:fh.b.option(fh.b.u128()),receiverId:fh.b.string(),methodNames:fh.b.vec(fh.b.string())}),fx=fh.b.struct({}),fT=fh.b.enum({functionCall:fE,fullAccess:fx}),fI=fh.b.struct({nonce:fh.b.u64(),permission:fT}),fk=fh.b.struct({}),fO=fh.b.struct({code:fh.b.vec(fh.b.u8())}),fC=fh.b.struct({methodName:fh.b.string(),args:fh.b.vec(fh.b.u8()),gas:fh.b.u64(),deposit:fh.b.u128()}),fN=fh.b.struct({deposit:fh.b.u128()}),fP=fh.b.struct({stake:fh.b.u128(),publicKey:fw}),fD=fh.b.struct({publicKey:fw,accessKey:fI}),fR=fh.b.struct({publicKey:fw}),f$=fh.b.struct({beneficiaryId:fh.b.string()}),fB=fh.b.enum({CodeHash:fh.b.struct({}),AccountId:fh.b.struct({})}),fL=fh.b.enum({CodeHash:fh.b.array(fh.b.u8(),32),AccountId:fh.b.string()}),fU=fh.b.struct({code:fh.b.vec(fh.b.u8()),deployMode:fB}),fF=fh.b.struct({contractIdentifier:fL}),fM=fh.b.struct({code:fL,data:fh.b.hashMap(fh.b.bytes(),fh.b.bytes())}),fj=fh.b.enum({V1:fM}),fz=fh.b.struct({stateInit:fj,deposit:fh.b.u128()}),fV=fh.b.enum({createAccount:fk,deployContract:fO,functionCall:fC,transfer:fN,stake:fP,addKey:fD,deleteKey:fR,deleteAccount:f$,deployGlobalContract:fU,useGlobalContract:fF,deterministicStateInit:fz}),fH=fh.b.struct({senderId:fh.b.string(),receiverId:fh.b.string(),actions:fh.b.vec(fV),nonce:fh.b.u64(),maxBlockHeight:fh.b.u64(),publicKey:fw}),fq=fh.b.struct({delegateAction:fH,signature:fS}),fW=fh.b.enum({createAccount:fk,deployContract:fO,functionCall:fC,transfer:fN,stake:fP,addKey:fD,deleteKey:fR,deleteAccount:f$,signedDelegate:fq,deployGlobalContract:fU,useGlobalContract:fF,deterministicStateInit:fz}),fK=fh.b.struct({signerId:fh.b.string(),publicKey:fw,nonce:fh.b.u64(),receiverId:fh.b.string(),blockHash:fh.b.array(fh.b.u8(),32),actions:fh.b.vec(fW)}),fG=fh.b.struct({transaction:fK,signature:fS});function fZ(e){return 0===e.keyType?{ed25519Key:{data:Array.from(e.data)}}:{secp256k1Key:{data:Array.from(e.data)}}}function fX(e){return 0===e.keyType?{ed25519Signature:{data:Array.from(e.data)}}:{secp256k1Signature:{data:Array.from(e.data)}}}function fJ(e){return"signedDelegate"in e?{signedDelegate:{delegateAction:{senderId:e.signedDelegate.delegateAction.senderId,receiverId:e.signedDelegate.delegateAction.receiverId,actions:e.signedDelegate.delegateAction.actions.map(e=>fJ(e)),nonce:e.signedDelegate.delegateAction.nonce,maxBlockHeight:e.signedDelegate.delegateAction.maxBlockHeight,publicKey:e.signedDelegate.delegateAction.publicKey},signature:e.signedDelegate.signature}}:e}function fY(e){return fG.serialize({transaction:{signerId:e.transaction.signerId,publicKey:fZ(e.transaction.publicKey),nonce:e.transaction.nonce,receiverId:e.transaction.receiverId,blockHash:Array.from(e.transaction.blockHash),actions:e.transaction.actions.map(fJ)},signature:fX(e.signature)})}class fQ{constructor(e,t,r,i,n,a){this.senderId=e,this.receiverId=t,this.actions=r,this.nonce=i,this.maxBlockHeight=n,this.publicKey=a}}
79class f0 extends Error{constructor(e,t,r){super(e),this.name="NearError",this.code=t,this.data=r,Object.setPrototypeOf(this,f0.prototype)}}class f1 extends f0{constructor(e){super(e,"INVALID_KEY"),this.name="InvalidKeyError",Object.setPrototypeOf(this,f1.prototype)}}class f2 extends f0{constructor(e,t){super(`Invalid transaction nonce: transaction nonce ${e} must be greater than access key nonce ${t}`,"INVALID_NONCE"),this.retryable=!0,this.name="InvalidNonceError",this.txNonce=e,this.akNonce=t,Object.setPrototypeOf(this,f2.prototype)}}var d0=d0;d0.object({account_id:d0.string().optional(),public_key:d0.string(),private_key:d0.string(),seed_phrase_hd_path:d0.string().optional(),master_seed_phrase:d0.string().optional(),implicit_account_id:d0.string().optional()}),d0.object({account_id:d0.string().optional(),public_key:d0.string(),secret_key:d0.string(),seed_phrase_hd_path:d0.string().optional(),master_seed_phrase:d0.string().optional(),implicit_account_id:d0.string().optional()}),d0.enum(["mainnet","testnet","betanet","localnet"]);var f6=e.i(993882),f5=e.i(922543);let f4=(e,t,r)=>(0,f5.abytes)(e,t,r),f3=f5.anumber,f8=f5.bytesToHex,f7=(...e)=>(0,f5.concatBytes)(...e),f9=e=>(0,f5.hexToBytes)(e),he=f5.isBytes,ht=e=>(0,f5.randomBytes)(e),hr=BigInt(0),hi=BigInt(1);function hn(e,t=""){if("boolean"!=typeof e)throw TypeError((t&&`"${t}" `)+"expected boolean, got type="+typeof e);return e}function ha(e){if("bigint"==typeof e){if(!hg(e))throw RangeError("positive bigint expected, got "+e)}else f3(e);return e}function hs(e,t=""){if("number"!=typeof e)throw TypeError((t&&`"${t}" `)+"expected number, got type="+typeof e);if(!Number.isSafeInteger(e))throw RangeError((t&&`"${t}" `)+"expected safe integer, got "+e)}function ho(e){let t=ha(e).toString(16);return 1&t.length?"0"+t:t}function hl(e){if("string"!=typeof e)throw TypeError("hex string expected, got "+typeof e);return""===e?hr:BigInt("0x"+e)}function hu(e){return hl((0,f5.bytesToHex)(e))}function hc(e){return hl((0,f5.bytesToHex)(hh((0,f5.abytes)(e)).reverse()))}function hd(e,t){if((0,f5.anumber)(t),0===t)throw RangeError("zero length");let r=(e=ha(e)).toString(16);if(r.length>2*t)throw RangeError("number too large");return(0,f5.hexToBytes)(r.padStart(2*t,"0"))}function hf(e,t){return hd(e,t).reverse()}function hh(e){return Uint8Array.from(f4(e))}function hp(e){if("string"!=typeof e)throw TypeError("ascii string expected, got "+typeof e);return Uint8Array.from(e,(t,r)=>{let i=t.charCodeAt(0);if(1!==t.length||i>127)throw RangeError(`string contains non-ASCII character "${e[r]}" with code ${i} at position ${r}`);return i})}let hg=e=>"bigint"==typeof e&&hr<=e;function hm(e,t,r,i){if(!(hg(t)&&hg(r)&&hg(i))||!(r<=t)||!(t<i))throw RangeError("expected valid "+e+": "+r+" <= n < "+i+", got "+t)}function hy(e){let t;if(e<hr)throw Error("expected non-negative bigint, got "+e);for(t=0;e>hr;e>>=hi,t+=1);return t}let hv=e=>(hi<<BigInt(e))-hi;function hb(e,t={},r={}){if("[object Object]"!==Object.prototype.toString.call(e))throw TypeError("expected valid options object");let i=(t,r)=>Object.entries(t).forEach(([t,i])=>(function(t,r,i){if(!i&&"function"!==r&&!Object.hasOwn(e,t))throw TypeError(`param "${t}" is invalid: expected own property`);let n=e[t];if(i&&void 0===n)return;let a=typeof n;if(a!==r||null===n)throw TypeError(`param "${t}" is invalid: expected ${r}, got ${a}`)})(t,i,r));i(t,!1),i(r,!0)}let hw=()=>{throw Error("not implemented")},h_=BigInt(0),hA=BigInt(1),hS=BigInt(2),hE=BigInt(3),hx=BigInt(4),hT=BigInt(5),hI=BigInt(7),hk=BigInt(8),hO=BigInt(9),hC=BigInt(16);function hN(e,t){if(t<=h_)throw Error("mod: expected positive modulus, got "+t);let r=e%t;return r>=h_?r:t+r}function hP(e,t,r){if(t<h_)throw Error("pow2: expected non-negative exponent, got "+t);let i=e;for(;t-- >h_;)i*=i,i%=r;return i}function hD(e,t){if(e===h_)throw Error("invert: expected non-zero number");if(t<=h_)throw Error("invert: expected positive modulus, got "+t);let r=hN(e,t),i=t,n=h_,a=hA,s=hA,o=h_;for(;r!==h_;){let e=i/r,t=i-r*e,l=n-s*e,u=a-o*e;i=r,r=t,n=s,a=o,s=l,o=u}if(i!==hA)throw Error("invert: does not exist");return hN(n,t)}function hR(e,t,r){if(!e.eql(e.sqr(t),r))throw Error("Cannot find square root")}function h$(e,t){let r=(e.ORDER+hA)/hx,i=e.pow(t,r);return hR(e,i,t),i}function hB(e,t){let r=(e.ORDER-hT)/hk,i=e.mul(t,hS),n=e.pow(i,r),a=e.mul(t,n),s=e.mul(e.mul(a,hS),n),o=e.mul(a,e.sub(s,e.ONE));return hR(e,o,t),o}function hL(e){if(e<hE)throw Error("sqrt is not defined for small field");let t=e-hA,r=0;for(;t%hS===h_;)t/=hS,r++;let i=hS,n=hq(e);for(;1===hz(n,i);)if(i++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return h$;let a=n.pow(i,t),s=(t+hA)/hS;return function(e,i){if(e.is0(i))return i;if(1!==hz(e,i))throw Error("Cannot find square root");let n=r,o=e.mul(e.ONE,a),l=e.pow(i,t),u=e.pow(i,s);for(;!e.eql(l,e.ONE);){if(e.is0(l))return e.ZERO;let t=1,r=e.sqr(l);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===n)throw Error("Cannot find square root");let i=hA<<BigInt(n-t-1),a=e.pow(o,i);n=t,o=e.sqr(a),l=e.mul(l,o),u=e.mul(u,a)}return u}}let hU=(e,t)=>(hN(e,t)&hA)===hA,hF=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function hM(e){if(hb(e,hF.reduce((e,t)=>
79(e[t]="function",e),{ORDER:"bigint",BYTES:"number",BITS:"number"})),hs(e.BYTES,"BYTES"),hs(e.BITS,"BITS"),e.BYTES<1||e.BITS<1)throw Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=hA)throw Error("invalid field: expected ORDER > 1, got "+e.ORDER);return e}function hj(e,t,r=!1){let i=Array(t.length).fill(r?e.ZERO:void 0),n=t.reduce((t,r,n)=>e.is0(r)?t:(i[n]=t,e.mul(t,r)),e.ONE),a=e.inv(n);return t.reduceRight((t,r,n)=>e.is0(r)?t:(i[n]=e.mul(t,i[n]),e.mul(t,r)),a),i}function hz(e,t){let r=(e.ORDER-hA)/hS,i=e.pow(t,r),n=e.eql(i,e.ONE),a=e.eql(i,e.ZERO),s=e.eql(i,e.neg(e.ONE));if(!n&&!a&&!s)throw Error("invalid Legendre symbol result");return n?1:a?0:-1}let hV=new WeakMap;class hH{ORDER;BITS;BYTES;isLE;ZERO=h_;ONE=hA;_lengths;_mod;constructor(e,t={}){let r;if(e<=hA)throw Error("invalid field: expected ORDER > 1, got "+e);this.isLE=!1,null!=t&&"object"==typeof t&&("number"==typeof t.BITS&&(r=t.BITS),"function"==typeof t.sqrt&&Object.defineProperty(this,"sqrt",{value:t.sqrt,enumerable:!0}),"boolean"==typeof t.isLE&&(this.isLE=t.isLE),t.allowedLengths&&(this._lengths=Object.freeze(t.allowedLengths.slice())),"boolean"==typeof t.modFromBytes&&(this._mod=t.modFromBytes));const{nBitLength:i,nByteLength:n}=function(e,t){if(void 0!==t&&f3(t),e<=h_)throw Error("invalid n length: expected positive n, got "+e);if(void 0!==t&&t<1)throw Error("invalid n length: expected positive bit length, got "+t);let r=hy(e);if(void 0!==t&&t<r)throw Error(`invalid n length: expected bit length (${r}) >= n.length (${t})`);let i=void 0!==t?t:r,n=Math.ceil(i/8);return{nBitLength:i,nByteLength:n}}(e,r);if(n>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=i,this.BYTES=n,Object.freeze(this)}create(e){return hN(e,this.ORDER)}isValid(e){if("bigint"!=typeof e)throw TypeError("invalid field element: expected bigint, got "+typeof e);return h_<=e&&e<this.ORDER}is0(e){return e===h_}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&hA)===hA}neg(e){return hN(-e,this.ORDER)}eql(e,t){return e===t}sqr(e){return hN(e*e,this.ORDER)}add(e,t){return hN(e+t,this.ORDER)}sub(e,t){return hN(e-t,this.ORDER)}mul(e,t){return hN(e*t,this.ORDER)}pow(e,t){var r=t;if(r<h_)throw Error("invalid exponent, negatives unsupported");if(r===h_)return this.ONE;if(r===hA)return e;let i=this.ONE,n=e;for(;r>h_;)r&hA&&(i=this.mul(i,n)),n=this.sqr(n),r>>=hA;return i}div(e,t){return hN(e*hD(t,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,t){return e+t}subN(e,t){return e-t}mulN(e,t){return e*t}inv(e){return hD(e,this.ORDER)}sqrt(e){let t=hV.get(this);return t||hV.set(this,t=function(e){if(e%hx===hE)return h$;if(e%hk===hT)return hB;if(e%hC===hO){let t,r,i,n,a,s;return t=hq(e),i=(r=hL(e))(t,t.neg(t.ONE)),n=r(t,i),a=r(t,t.neg(i)),s=(e+hI)/hC,(e,t)=>{let r=e.pow(t,s),o=e.mul(r,i),l=e.mul(r,n),u=e.mul(r,a),c=e.eql(e.sqr(o),t),d=e.eql(e.sqr(l),t);r=e.cmov(r,o,c),o=e.cmov(u,l,d);let f=e.eql(e.sqr(o),t),h=e.cmov(r,o,f);return hR(e,h,t),h}}return hL(e)}(this.ORDER)),t(this,e)}toBytes(e){return this.isLE?hf(e,this.BYTES):hd(e,this.BYTES)}fromBytes(e,t=!1){f4(e);let{_lengths:r,BYTES:i,isLE:n,ORDER:a,_mod:s}=this;if(r){if(e.length<1||!r.includes(e.length)||e.length>i)throw Error("Field.fromBytes: expected "+r+" bytes, got "+e.length);let t=new Uint8Array(i);t.set(e,n?0:t.length-e.length),e=t}if(e.length!==i)throw Error("Field.fromBytes: expected "+i+" bytes, got "+e.length);let o=n?hc(e):hu(e);if(s&&(o=hN(o,a)),!t&&!this.isValid(o))throw Error("invalid field element: outside of range 0..ORDER");return o}invertBatch(e){return hj(this,e)}cmov(e,t,r){return hn(r,"condition"),r?t:e}}function hq(e,t={}){return new hH(e,t)}function hW(e){if("bigint"!=typeof e)throw Error("field order must be bigint");if(e<=hA)throw Error("field order must be greater than 1");return Math.ceil(hy(e-hA)/8)}function hK(e){let t=hW(e);return t+Math.ceil(t/2)}Object.freeze(hH.prototype);let hG=BigInt(0),hZ=BigInt(1);function hX(e,t){let r=t.negate();return e?r:t}function hJ(e,t){let r=hj(e.Fp,t.map(e=>e.Z));return t.map((t,i)=>e.fromAffine(t.toAffine(r[i])))}function hY(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function hQ(e,t){hY(e,t);let r=Math.ceil(t/e)+1,i=2**(e-1),n=2**e;return{windows:r,windowSize:i,mask:hv(e),maxNumber:n,shiftBy:BigInt(e)}}function h0(e,t,r){let{windowSize:i,mask:n,maxNumber:a,shiftBy:s}=r,o=Number(e&n),l=e>>s;o>i&&(o-=a,l+=hZ);let u=t*i,c=u+Math.abs(o)-1,d=0===o;return{nextN:l,offset:c,isZero:d,isNeg:o<0,isNegF:t%2!=0,offsetF:u}}let h1=new WeakMap,h2=new WeakMap;function h6(e){return h2.get(e)||1}function h5(e){if(e!==hG)throw Error("invalid wNAF")}class h4{BASE;ZERO;Fn;bits;constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let i=e;for(;t>hG;)t&hZ&&(r=r.add(i)),i=i.double(),t>>=hZ;return r}precomputeWindow(e,t){let{windows:r,windowSize:i}=hQ(t,this.bits),n=[],a=e,s=a;for(let e=0;e<r;e++){s=a,n.push(s);for(let e=1;e<i;e++)s=s.add(a),n.push(s);a=s.double()}return n}wNAF(e,t,r){if(!this.Fn.isValid(r))throw Error("invalid scalar");let i=this.ZERO,n=this.BASE,a=hQ(e,this.bits);for(let e=0;e<a.windows;e++){let{nextN:s,offset:o,isZero:l,isNeg:u,isNegF:c,offsetF:d}=h0(r,e,a);r=s,l?n=n.add(hX(c,t[d])):i=i.add(hX(u,t[o]))}return h5(r),{p:i,f:n}}wNAFUnsafe(e,t,r,i=this.ZERO){let n=hQ(e,this.bits);for(let e=0;e<n.windows&&r!==hG;e++){let{nextN:a,offset:s,isZero:o,isNeg:l}=h0(r,e,n);if(r=a,!o){let e=t[s];i=i.add(l?e.negate():e)}}return h5(r),i}getPrecomputes(e,t,r){let i=h1.get(t);
79return i||(i=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(i=r(i)),h1.set(t,i))),i}cached(e,t,r){let i=h6(e);return this.wNAF(i,this.getPrecomputes(i,e,r),t)}unsafe(e,t,r,i){let n=h6(e);return 1===n?this._unsafeLadder(e,t,i):this.wNAFUnsafe(n,this.getPrecomputes(n,e,r),t,i)}createCache(e,t){hY(t,this.bits),h2.set(e,t),h1.delete(e)}hasCache(e){return 1!==h6(e)}}function h3(e,t,r){if(!t)return hq(e,{isLE:r});if(t.ORDER!==e)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return hM(t),t}function h8(e,t,r={},i){if(void 0===i&&(i="edwards"===e),!t||"object"!=typeof t)throw Error(`expected valid ${e} CURVE object`);for(let e of["p","n","h"]){let r=t[e];if(!("bigint"==typeof r&&r>hG))throw Error(`CURVE.${e} must be positive bigint`)}let n=h3(t.p,r.Fp,i),a=h3(t.n,r.Fn,i);for(let r of["Gx","Gy","a","weierstrass"===e?"b":"d"])if(!n.isValid(t[r]))throw Error(`CURVE.${r} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:n,Fn:a}}function h7(e,t){return function(r){let i=e(r);return{secretKey:i,publicKey:t(i)}}}let h9=BigInt(0),pe=BigInt(1),pt=BigInt(2),pr=BigInt(8);class pi{static BASE;static ZERO;static Fp;static Fn;ep;constructor(e){this.ep=e}static fromBytes(e){hw()}static fromHex(e){hw()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return f8(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.ep.precompute(e,t),this}}function pn(e,t){if(hs(e),hs(t),t<0||t>4)throw Error("invalid I2OSP length: "+t);if(e<0||e>2**(8*t)-1)throw Error("invalid I2OSP input: "+e);let r=Array.from({length:t}).fill(0);for(let i=t-1;i>=0;i--)r[i]=255&e,e>>>=8;return new Uint8Array(r)}function pa(e){if(!he(e)&&"string"!=typeof e)throw Error("DST must be Uint8Array or ascii string");let t="string"==typeof e?hp(e):e;if(0===t.length)throw Error("DST must be non-empty");return t}function ps(e,t,r,i){f4(e),hs(r),(t=pa(t)).length>255&&(t=i(f7(hp("H2C-OVERSIZE-DST-"),t)));let{outputLen:n,blockLen:a}=i,s=Math.ceil(r/n);if(r>65535||s>255)throw Error("expand_message_xmd: invalid lenInBytes");let o=f7(t,pn(t.length,1)),l=new Uint8Array(a),u=pn(r,2),c=Array(s),d=i(f7(l,e,u,pn(0,1),o));c[0]=i(f7(d,pn(1,1),o));for(let e=1;e<s;e++){let t=[function(e,t){let r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e[i]^t[i];return r}(d,c[e-1]),pn(e+1,1),o];c[e]=i(f7(...t))}return f7(...c).slice(0,r)}function po(e,t,r){let i;hb(r,{p:"bigint",m:"number",k:"number",hash:"function"});let{p:n,k:a,m:s,hash:o,expand:l,DST:u}=r;if(hs(o.outputLen,"valid hash"),f4(e),hs(t),t<1)throw Error("hash_to_field: expected count >= 1");if(s<1)throw Error("hash_to_field: expected m >= 1");let c=Math.ceil((n.toString(2).length+a)/8),d=t*s*c;if("xmd"===l)i=ps(e,u,d,o);else if("xof"===l)i=function(e,t,r,i,n){if(f4(e),hs(r),(t=pa(t)).length>255){let e=Math.ceil(2*i/8);t=n.create({dkLen:e}).update(hp("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw Error("expand_message_xof: invalid lenInBytes");return n.create({dkLen:r}).update(e).update(pn(r,2)).update(t).update(pn(t.length,1)).digest()}(e,u,d,a,o);else if("_internal_pass"===l)i=e;else throw Error('expand must be "xmd" or "xof"');let f=Array(t);for(let e=0;e<t;e++){let t=Array(s);for(let r=0;r<s;r++){let a=c*(r+e*s),o=i.subarray(a,a+c);t[r]=hN(hu(o),n)}f[e]=t}return f}let pl="HashToScalar-",pu=(BigInt(0),BigInt(1),BigInt(2),BigInt(0)),pc=BigInt(1),pd=BigInt(2),pf=BigInt(3),ph=BigInt(5),pp=BigInt(8),pg=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),pm={p:pg,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:pp,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")},py=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function pv(e,t){var r;let i,n,a,s,o,l,u,c,d,f,h,p,g,m,y=hN(t*t*t,pg),v=(r=e*hN(y*y*t,pg),i=BigInt(10),n=BigInt(20),a=BigInt(40),s=BigInt(80),l=hP(o=r*r%pg*r%pg,pd,pg)*o%pg,u=hP(l,pc,pg)*r%pg,c=hP(u,ph,pg)*u%pg,d=hP(c,i,pg)*c%pg,f=hP(d,n,pg)*d%pg,h=hP(f,a,pg)*f%pg,p=hP(h,s,pg)*h%
79pg,g=hP(p,s,pg)*h%pg,m=hP(g,i,pg)*c%pg,{pow_p_5_8:hP(m,pd,pg)*r%pg,b2:o}).pow_p_5_8,b=hN(e*y*v,pg),w=hN(t*b*b,pg),_=b,A=hN(b*py,pg),S=w===e,E=w===hN(-e,pg),x=w===hN(-e*py,pg);return S&&(b=_),(E||x)&&(b=A),hU(b,pg)&&(b=hN(-b,pg)),{isValid:S||E,value:b}}let pb=function(e,t={}){var r,i;let n,a,s,o,l=h8("edwards",e,t,t.FpFnLE),{Fp:u,Fn:c}=l,d=l.CURVE,{h:f}=d;hb(t,{},{uvRatio:"function"});let h=pt<<BigInt(8*c.BYTES)-pe,p=void 0===t.uvRatio?(e,t)=>{try{return{isValid:!0,value:u.sqrt(u.div(e,t))}}catch(e){return{isValid:!1,value:h9}}}:t.uvRatio;if(r=d.Gx,i=d.Gy,n=u.sqr(r),a=u.sqr(i),s=u.add(u.mul(d.a,n),a),o=u.add(u.ONE,u.mul(d.d,u.mul(n,a))),!u.eql(s,o))throw Error("bad curve params: generator point");function g(e,t,r=!1){return hm("coordinate "+e,t,r?pe:h9,h),t}function m(e){if(!(e instanceof y))throw Error("EdwardsPoint expected")}class y{static BASE=new y(d.Gx,d.Gy,pe,(e=>u.create(e))(d.Gx*d.Gy));static ZERO=new y(h9,pe,pe,h9);static Fp=u;static Fn=c;X;Y;Z;T;constructor(e,t,r,i){this.X=g("x",e),this.Y=g("y",t),this.Z=g("z",r,!0),this.T=g("t",i),Object.freeze(this)}static CURVE(){return d}static fromAffine(e){let t;if(e instanceof y)throw Error("extended point not allowed");let{x:r,y:i}=e||{};return g("x",r),g("y",i),new y(r,i,pe,(t=r*i,u.create(t)))}static fromBytes(e,t=!1){let r,i,n,a,s=u.BYTES,{a:o,d:l}=d;e=hh(f4(e,s,"point")),hn(t,"zip215");let c=hh(e),f=e[s-1];c[s-1]=-129&f;let g=hc(c);hm("point.y",g,h9,t?h:u.ORDER);let m=(r=g*g,u.create(r)),{isValid:v,value:b}=p((i=m-pe,u.create(i)),(n=l*m-o,u.create(n)));if(!v)throw Error("bad point: invalid y coordinate");let w=(b&pe)===pe,_=(128&f)!=0;if(!t&&b===h9&&_)throw Error("bad point: x=0 and x_0=1");return _!==w&&(a=-b,b=u.create(a)),y.fromAffine({x:b,y:g})}static fromHex(e,t=!1){return y.fromBytes(f9(e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return v.createCache(this,e),t||this.multiply(pt),this}assertValidity(){let e,t,r,i,n,a,s,o,l,c,f,h,{a:p,d:g}=d;if(this.is0())throw Error("bad point: ZERO");let{X:m,Y:y,Z:v,T:b}=this,w=(e=m*m,u.create(e)),_=(t=y*y,u.create(t)),A=(r=v*v,u.create(r)),S=(i=A*A,u.create(i));if(s=A*(n=w*p,a=u.create(n)+_,u.create(a)),u.create(s)!==(c=S+(l=g*(o=w*_,u.create(o)),u.create(l)),u.create(c)))throw Error("bad point: equation left != right (1)");if(f=m*y,u.create(f)!==(h=v*b,u.create(h)))throw Error("bad point: equation left != right (2)")}equals(e){let t,r,i,n;m(e);let{X:a,Y:s,Z:o}=this,{X:l,Y:c,Z:d}=e,f=(t=a*d,u.create(t)),h=(r=l*o,u.create(r)),p=(i=s*d,u.create(i)),g=(n=c*o,u.create(n));return f===h&&p===g}is0(){return this.equals(y.ZERO)}negate(){let e,t;return new y((e=-this.X,u.create(e)),this.Y,this.Z,(t=-this.T,u.create(t)))}double(){let e,t,r,i,n,a,s,o,l,c,f,{a:h}=d,{X:p,Y:g,Z:m}=this,v=(e=p*p,u.create(e)),b=(t=g*g,u.create(t)),w=(i=pt*(r=m*m,u.create(r)),u.create(i)),_=(n=h*v,u.create(n)),A=p+g,S=(a=A*A,s=u.create(a)-v-b,u.create(s)),E=_+b,x=E-w,T=_-b,I=(o=S*x,u.create(o)),k=(l=E*T,u.create(l)),O=(c=S*T,u.create(c));return new y(I,k,(f=x*E,u.create(f)),O)}add(e){let t,r,i,n,a,s,o,l,c,f;m(e);let{a:h,d:p}=d,{X:g,Y:v,Z:b,T:w}=this,{X:_,Y:A,Z:S,T:E}=e,x=(t=g*_,u.create(t)),T=(r=v*A,u.create(r)),I=(i=w*p*E,u.create(i)),k=(n=b*S,u.create(n)),O=(a=(g+v)*(_+A)-x-T,u.create(a)),C=k-I,N=k+I,P=(s=T-h*x,u.create(s)),D=(o=O*C,u.create(o)),R=(l=N*P,u.create(l)),$=(c=O*P,u.create(c));return new y(D,R,(f=C*N,u.create(f)),$)}subtract(e){return m(e),this.add(e.negate())}multiply(e){if(!c.isValidNot0(e))throw RangeError("invalid scalar: expected 1 <= sc < curve.n");let{p:t,f:r}=v.cached(this,e,e=>hJ(y,e));return hJ(y,[t,r])[0]}multiplyUnsafe(e){if(!c.isValid(e))throw RangeError("invalid scalar: expected 0 <= sc < curve.n");return e===h9?y.ZERO:this.is0()||e===pe?this:v.unsafe(this,e,e=>hJ(y,e))}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return v.unsafe(this,d.n).is0()}toAffine(e){let t,r,i=e,{X:n,Y:a,Z:s}=this,o=this.is0();null==i&&(i=o?pr:u.inv(s));let l=(t=n*i,u.create(t)),c=(r=a*i,u.create(r)),d=u.mul(s,i);if(o)return{x:h9,y:pe};if(d!==pe)throw Error("invZ was invalid");return{x:l,y:c}}clearCofactor(){return f===pe?this:this.multiplyUnsafe(f)}toBytes(){let{x:e,y:t}=this.toAffine(),r=u.toBytes(t);return r[r.length-1]|=e&pe?128:0,r}toHex(){return f8(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}let v=new h4(y,c.BITS);return c.BITS>=8&&y.BASE.precompute(8),Object.freeze(y.prototype),Object.freeze(y),y}(pm,{uvRatio:pv}),pw=pb.Fp,p_=pb.Fn,pA=(s={},function(e,t,r={}){if("function"!=typeof t)throw Error('"hash" function param is required');hb(r,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",zip215:"boolean",mapToCurve:"function"});let{prehash:i}=r,{BASE:n,Fp:a,Fn:s}=e,o=t.outputLen,l=2*a.BYTES;if(void 0!==o&&(hs(o,"hash.outputLen"),o!==l))throw Error(`hash.outputLen must be ${l}, got ${o}`);let u=void 0===r.randomBytes?ht:r.randomBytes,c=void 0===r.adjustScalarBytes?e=>e:r.adjustScalarBytes,d=void 0===r.domain?(e,t,r)=>{if(hn(r,"phflag"),t.length||r)throw Error("Contexts/pre-hash are not supported");return e}:r.domain;function f(e){return s.create(hc(e))}function h(e){let r,i,a,s,o,{head:l,prefix:u,scalar:d}=(r=v.secretKey,f4(e,v.secretKey,"secretKey"),a=c((i=f4(t(e),2*r,"hashedSecretKey")).slice(0,r)),s=i.slice(r,2*r),o=f(a),{head:a,prefix:s,scalar:o}),h=n.multiply(d),p=h.toBytes();return{head:l,prefix:u,scalar:d,point:h,pointBytes:p}}function p(e){return h(e).pointBytes}function g(e=Uint8Array.of(),...r){return f(t(d(f7(...r),f4(e,void 0,"context"),!!i)))}let m={zip215:r.zip215},y=a.BYTES,v={secretKey:y,publicKey:y,signature:2*y,seed:y};function b(e){return f4(e=void 0===e?u(v.seed):e,v.seed,"seed")}let w={getExtendedPublicKey:h,randomSecretKey:b,isValidSecretKey:function(e){return he(e)&&e.length===v.secretKey},isValidPublicKey:function(t,r){try{return!!e.fromBytes(t,void 0===r?m.zip215:r)}catch(e){return!1}},toMontgomery(t){let{y:r}=e.fromBytes(t),i=v.publicKey,n=32===i;if(!n&&57!==i)throw Error("only defined for 25519 and 448");let s=n?a.div(pe+r,pe-r):a.div(r-pe,r+pe);return a.toBytes(s)},toMontgomerySecret(e){let r=v.secretKey;return f4(e,r),c(t(e.subarray(0,r))).subarray(0,r)}};return Object.freeze(v),Object.freeze(w),Object.freeze({keygen:h7(b,p),getPublicKey:p,sign:function(e,t,r={}){e=f4(e,void 0,"message"),i&&(e=i(e));let{prefix:a,scalar:o,pointBytes:l}=h(t),u=g(r.context,a,e),c=n.multiply(u).toBytes(),d=g(r.context,c,l,e),f=s.create(u+d*o);
79if(!s.isValid(f))throw Error("sign failed: invalid s");return f4(f7(c,s.toBytes(f)),v.signature,"result")},verify:function(t,r,a,s=m){let o,l,u,{context:c}=s,d=void 0===s.zip215?!!m.zip215:s.zip215,f=v.signature;t=f4(t,f,"signature"),r=f4(r,void 0,"message"),a=f4(a,v.publicKey,"publicKey"),void 0!==d&&hn(d,"zip215"),i&&(r=i(r));let h=f/2,p=t.subarray(0,h),y=hc(t.subarray(h,f));try{o=e.fromBytes(a,d),l=e.fromBytes(p,d),u=n.multiplyUnsafe(y)}catch(e){return!1}if(!d&&o.isSmallOrder())return!1;let b=g(c,p,a,r);return l.add(o.multiplyUnsafe(b)).subtract(u).clearCofactor().is0()},utils:w,Point:e,lengths:v})}(pb,f6.sha512,Object.assign({adjustScalarBytes:function(e){return e[0]&=248,e[31]&=127,e[31]|=64,e},zip215:!0},s)));f6.sha512;let pS=(pg+pf)/pp,pE=(pw.pow(pd,pS),pw.sqrt(pw.neg(pw.ONE)),function(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let r=e.sqrt(t);e.isOdd(r)&&e.neg(r)}(pw,pw.neg(BigInt(486664))),BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235")),px=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),pT=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),pI=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),pk=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),pO=e=>pw.create(hc(e)&pk);function pC(e){let t,r,i,n,a,s,o,l,u,c,d,f,h,p,g,{d:m}=pm,y=(t=py*e*e,pw.create(t)),v=(r=(y+pc)*pT,pw.create(r)),b=BigInt(-1),w=(n=(b-m*y)*(i=y+m,pw.create(i)),pw.create(n)),{isValid:_,value:A}=pv(v,w),S=(a=A*e,pw.create(a));hU(S,pg)||(s=-S,S=pw.create(s)),_||(A=S),_||(b=y);let E=(o=b*(y-pc)*pI-w,pw.create(o)),x=A*A,T=(l=(A+A)*w,pw.create(l)),I=(u=E*pE,pw.create(u)),k=(c=pc-x,pw.create(c)),O=(d=pc+x,pw.create(d));return new pb((f=T*O,pw.create(f)),(h=k*I,pw.create(h)),(p=I*O,pw.create(p)),(g=T*k,pw.create(g)))}class pN extends pi{static BASE=new pN(pb.BASE);static ZERO=new pN(pb.ZERO);static Fp=pw;static Fn=p_;constructor(e){super(e)}static fromAffine(e){return new pN(pb.fromAffine(e))}assertSame(e){if(!(e instanceof pN))throw Error("RistrettoPoint expected")}init(e){return new pN(e)}static fromBytes(e){let t,r,i,n,a,s,o,l,u,c,d,f,h;(0,f5.abytes)(e,32);let{a:p,d:g}=pm,m=pO(e);if(!function(e,t){if(e=f4(e),t=f4(t),e.length!==t.length)return!1;let r=0;for(let i=0;i<e.length;i++)r|=e[i]^t[i];return 0===r}(pw.toBytes(m),e)||hU(m,pg))throw Error("invalid ristretto255 encoding 1");let y=(t=m*m,pw.create(t)),v=(r=pc+p*y,pw.create(r)),b=(i=pc-p*y,pw.create(i)),w=(n=v*v,pw.create(n)),_=(a=b*b,pw.create(a)),A=(s=p*g*w-_,pw.create(s)),{isValid:S,value:E}=(o=A*_,pv(pc,pw.create(o))),x=(l=E*b,pw.create(l)),T=(u=E*x*A,pw.create(u)),I=(c=(m+m)*x,pw.create(c));hU(I,pg)&&(d=-I,I=pw.create(d));let k=(f=v*T,pw.create(f)),O=(h=I*k,pw.create(h));if(!S||hU(O,pg)||k===pu)throw Error("invalid ristretto255 encoding 2");return new pN(new pb(I,k,pc,O))}static fromHex(e){return pN.fromBytes((0,f5.hexToBytes)(e))}toBytes(){let e,t,r,i,n,a,s,o,l,u,c,d,f,{X:h,Y:p,Z:g,T:m}=this.ep,y=(e=g+p,r=pw.create(e)*(t=g-p,pw.create(t)),pw.create(r)),v=(i=h*p,pw.create(i)),{value:b}=(a=y*(n=v*v,pw.create(n)),pv(pc,pw.create(a))),w=(s=b*y,pw.create(s)),_=(o=b*v,pw.create(o)),A=(l=w*_*m,pw.create(l));if(hU(m*A,pg)){let e,t,r=(e=p*py,pw.create(e)),i=(t=h*py,pw.create(t));h=r,p=i,f=pw.create(w*px)}else f=_;hU(h*A,pg)&&(u=-p,p=pw.create(u));let S=(c=(g-p)*f,pw.create(c));return hU(S,pg)&&(d=-S,S=pw.create(d)),pw.toBytes(S)}equals(e){let t,r,i,n;this.assertSame(e);let{X:a,Y:s}=this.ep,{X:o,Y:l}=e.ep,u=(t=a*l,pw.create(t)===(r=s*o,pw.create(r))),c=(i=s*l,pw.create(i)===(n=a*o,pw.create(n)));return u||c}is0(){return this.equals(pN.ZERO)}}Object.freeze(pN.BASE),Object.freeze(pN.ZERO),Object.freeze(pN.prototype),Object.freeze(pN);let pP=Object.freeze({Point:pN,hashToCurve(e,t){let r=ps(e,t?.DST===void 0?"ristretto255_XMD:SHA-512_R255MAP_RO_":t.DST,64,f6.sha512);return pP.deriveToCurve(r)},hashToScalar(e,t={DST:pl}){let r=ps(e,t.DST,64,f6.sha512);return p_.create(hc(r))},deriveToCurve(e){(0,f5.abytes)(e,64);let t=pC(pO(e.subarray(0,32))),r=pC(pO(e.subarray(32,64)));return new pN(t.add(r))}});class pD{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(e,t){if((0,f5.ahash)(e),(0,f5.abytes)(t,void 0,"key"),this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(t.length>r?e.create().update(t).digest():t);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),(0,f5.clean)(i)}update(e){return(0,f5.aexists)(this),this.iHash.update(e),this}digestInto(e){(0,f5.aexists)(this),(0,f5.aoutput)(e,this),this.finished=!0;let t=e.subarray(0,this.outputLen);this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:r,finished:i,destroyed:n,blockLen:a,outputLen:s}=this;return e.finished=i,e.destroyed=n,e.blockLen=a,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let pR=((n=(e,t,r)=>new pD(e,t).update(r).digest()).create=(e,t)=>
79new pD(e,t),n),p$=(e,t)=>(e+(e>=0?t:-t)/pj)/t;function pB(e){if(!["compact","recovered","der"].includes(e))throw Error('Signature format must be "compact", "recovered", or "der"');return e}function pL(e,t){hb(e);let r={};for(let i of Object.keys(t))r[i]=void 0===e[i]?t[i]:e[i];return hn(r.lowS,"lowS"),hn(r.prehash,"prehash"),void 0!==r.format&&pB(r.format),r}let pU={Err:class extends Error{constructor(e=""){super(e)}},_tlv:{encode:(e,t)=>{let{Err:r}=pU;if(hs(e,"tag"),e<0||e>255)throw new r("tlv.encode: wrong tag");if("string"!=typeof t)throw TypeError('"data" expected string, got type='+typeof t);if(1&t.length)throw new r("tlv.encode: unpadded data");let i=t.length/2,n=ho(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let a=i>127?ho(n.length/2|128):"";return ho(e)+a+n+t},decode(e,t){let{Err:r}=pU;t=f4(t,void 0,"DER data");let i=0;if(e<0||e>255)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");let n=t[i++],a=0;if(128&n){let e=127&n;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let s=t.subarray(i,i+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of s)a=a<<8|e;if(i+=e,a<128)throw new r("tlv.decode(long): not minimal encoding")}else a=n;let s=t.subarray(i,i+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(i+a)}}},_int:{encode(e){let{Err:t}=pU;if(ha(e),e<pF)throw new t("integer: negative integers are not allowed");let r=ho(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=pU;if(e.length<1)throw new t("invalid signature integer: empty");if(128&e[0])throw new t("invalid signature integer: negative");if(e.length>1&&0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return hu(e)}},toSig(e){let{Err:t,_int:r,_tlv:i}=pU,n=f4(e,void 0,"signature"),{v:a,l:s}=i.decode(48,n);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:o,l:l}=i.decode(2,a),{v:u,l:c}=i.decode(2,l);if(c.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(o),s:r.decode(u)}},hexFromSig(e){let{_tlv:t,_int:r}=pU,i=t.encode(2,r.encode(e.r)),n=t.encode(2,r.encode(e.s));return t.encode(48,i+n)}};Object.freeze(pU._tlv),Object.freeze(pU._int),Object.freeze(pU);let pF=BigInt(0),pM=BigInt(1),pj=BigInt(2),pz=BigInt(3),pV=BigInt(4);function pH(e){return Uint8Array.of(e?2:3)}function pq(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}let pW={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},pK={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},pG=BigInt(0),pZ=BigInt(2),pX=hq(pW.p,{sqrt:function(e){let t=pW.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),a=BigInt(22),s=BigInt(23),o=BigInt(44),l=BigInt(88),u=e*e*e%t,c=u*u*e%t,d=hP(c,r,t)*c%t,f=hP(d,r,t)*c%t,h=hP(f,pZ,t)*u%t,p=hP(h,n,t)*h%t,g=hP(p,a,t)*p%t,m=hP(g,o,t)*g%t,y=hP(m,l,t)*m%t,v=hP(y,o,t)*g%t,b=hP(v,r,t)*c%t,w=hP(b,s,t)*p%t,_=hP(w,i,t)*u%t,A=hP(_,pZ,t);if(!pX.eql(pX.sqr(A),e))throw Error("Cannot find square root");return A}}),pJ=function(e,t={}){let r=h8("weierstrass",e,t),i=r.Fp,n=r.Fn,a=r.CURVE,{h:s,n:o}=a;hb(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object"});let{endo:l,allowInfinityPoint:u}=t;if(l&&(!i.is0(a.a)||"bigint"!=typeof l.beta||!Array.isArray(l.basises)))throw Error('invalid endo: expected "beta": bigint and "basises": array');let c=pq(i,n);function d(){if(!i.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}let f=void 0===t.toBytes?function(e,t,r){if(u&&t.is0())return Uint8Array.of(0);let{x:n,y:a}=t.toAffine(),s=i.toBytes(n);
79return(hn(r,"isCompressed"),r)?(d(),f7(pH(!i.isOdd(a)),s)):f7(Uint8Array.of(4),s,i.toBytes(a))}:t.toBytes,h=void 0===t.fromBytes?function(e){f4(e,void 0,"Point");let{publicKey:t,publicKeyUncompressed:r}=c,n=e.length,a=e[0],s=e.subarray(1);if(u&&1===n&&0===a)return{x:i.ZERO,y:i.ZERO};if(n===t&&(2===a||3===a)){let e,t=i.fromBytes(s);if(!i.isValid(t))throw Error("bad point: is not on curve, wrong x");let r=p(t);try{e=i.sqrt(r)}catch(e){throw Error("bad point: is not on curve, sqrt error"+(e instanceof Error?": "+e.message:""))}return d(),(1&a)==1!==i.isOdd(e)&&(e=i.neg(e)),{x:t,y:e}}if(n===r&&4===a){let e=i.BYTES,t=i.fromBytes(s.subarray(0,e)),r=i.fromBytes(s.subarray(e,2*e));if(!g(t,r))throw Error("bad point: is not on curve");return{x:t,y:r}}throw Error(`bad point: got length ${n}, expected compressed=${t} or uncompressed=${r}`)}:t.fromBytes;function p(e){let t=i.sqr(e),r=i.mul(t,e);return i.add(i.add(r,i.mul(e,a.a)),a.b)}function g(e,t){let r=i.sqr(t),n=p(e);return i.eql(r,n)}if(!g(a.Gx,a.Gy))throw Error("bad curve params: generator point");let m=i.mul(i.pow(a.a,pz),pV),y=i.mul(i.sqr(a.b),BigInt(27));if(i.is0(i.add(m,y)))throw Error("bad curve params: a or b");function v(e,t,r=!1){if(!i.isValid(t)||r&&i.is0(t))throw Error(`bad point coordinate ${e}`);return t}function b(e){if(!(e instanceof A))throw Error("Weierstrass Point expected")}function w(e){if(!l||!l.basises)throw Error("no endo");return function(e,t,r){hm("scalar",e,pF,r);let[[i,n],[a,s]]=t,o=p$(s*e,r),l=p$(-n*e,r),u=e-o*i-l*a,c=-o*n-l*s,d=u<pF,f=c<pF;d&&(u=-u),f&&(c=-c);let h=hv(Math.ceil(hy(r)/2))+pM;if(u<pF||u>=h||c<pF||c>=h)throw Error("splitScalar (endomorphism): failed for k");return{k1neg:d,k1:u,k2neg:f,k2:c}}(e,l.basises,n.ORDER)}function _(e,t,r,n,a){return r=new A(i.mul(r.X,e),r.Y,r.Z),t=hX(n,t),r=hX(a,r),t.add(r)}class A{static BASE=new A(a.Gx,a.Gy,i.ONE);static ZERO=new A(i.ZERO,i.ONE,i.ZERO);static Fp=i;static Fn=n;X;Y;Z;constructor(e,t,r){this.X=v("x",e),this.Y=v("y",t,!0),this.Z=v("z",r),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!i.isValid(t)||!i.isValid(r))throw Error("invalid affine point");if(e instanceof A)throw Error("projective point not allowed");return i.is0(t)&&i.is0(r)?A.ZERO:new A(t,r,i.ONE)}static fromBytes(e){let t=A.fromAffine(h(f4(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return A.fromBytes(f9(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return E.createCache(this,e),t||this.multiply(pz),this}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&i.is0(this.X)&&i.eql(this.Y,i.ONE)&&i.is0(this.Z))return;throw Error("bad point: ZERO")}let{x:e,y:r}=this.toAffine();if(!i.isValid(e)||!i.isValid(r))throw Error("bad point: x or y not field elements");if(!g(e,r))throw Error("bad point: equation left != right");if(!this.isTorsionFree())throw Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:e}=this.toAffine();if(!i.isOdd)throw Error("Field doesn't support isOdd");return!i.isOdd(e)}equals(e){b(e);let{X:t,Y:r,Z:n}=this,{X:a,Y:s,Z:o}=e,l=i.eql(i.mul(t,o),i.mul(a,n)),u=i.eql(i.mul(r,o),i.mul(s,n));return l&&u}negate(){return new A(this.X,i.neg(this.Y),this.Z)}double(){let{a:e,b:t}=a,r=i.mul(t,pz),{X:n,Y:s,Z:o}=this,l=i.ZERO,u=i.ZERO,c=i.ZERO,d=i.mul(n,n),f=i.mul(s,s),h=i.mul(o,o),p=i.mul(n,s);return p=i.add(p,p),c=i.mul(n,o),c=i.add(c,c),l=i.mul(e,c),u=i.mul(r,h),u=i.add(l,u),l=i.sub(f,u),u=i.add(f,u),u=i.mul(l,u),l=i.mul(p,l),c=i.mul(r,c),h=i.mul(e,h),p=i.sub(d,h),p=i.mul(e,p),p=i.add(p,c),c=i.add(d,d),d=i.add(c,d),d=i.add(d,h),d=i.mul(d,p),u=i.add(u,d),h=i.mul(s,o),h=i.add(h,h),d=i.mul(h,p),l=i.sub(l,d),c=i.mul(h,f),c=i.add(c,c),new A(l,u,c=i.add(c,c))}add(e){b(e);let{X:t,Y:r,Z:n}=this,{X:s,Y:o,Z:l}=e,u=i.ZERO,c=i.ZERO,d=i.ZERO,f=a.a,h=i.mul(a.b,pz),p=i.mul(t,s),g=i.mul(r,o),m=i.mul(n,l),y=i.add(t,r),v=i.add(s,o);y=i.mul(y,v),v=i.add(p,g),y=i.sub(y,v),v=i.add(t,n);let w=i.add(s,l);return v=i.mul(v,w),w=i.add(p,m),v=i.sub(v,w),w=i.add(r,n),u=i.add(o,l),w=i.mul(w,u),u=i.add(g,m),w=i.sub(w,u),d=i.mul(f,v),u=i.mul(h,m),d=i.add(u,d),u=i.sub(g,d),d=i.add(g,d),c=i.mul(u,d),g=i.add(p,p),g=i.add(g,p),m=i.mul(f,m),v=i.mul(h,v),g=i.add(g,m),m=i.sub(p,m),m=i.mul(f,m),v=i.add(v,m),p=i.mul(g,v),c=i.add(c,p),p=i.mul(w,v),u=i.mul(y,u),u=i.sub(u,p),p=i.mul(y,g),d=i.mul(w,d),new A(u,c,d=i.add(d,p))}subtract(e){return b(e),this.add(e.negate())}is0(){return this.equals(A.ZERO)}multiply(e){let r,i,{endo:a}=t;if(!n.isValidNot0(e))throw RangeError("invalid scalar: out of range");let s=e=>E.cached(this,e,e=>hJ(A,e));
79if(a){let{k1neg:t,k1:n,k2neg:o,k2:l}=w(e),{p:u,f:c}=s(n),{p:d,f:f}=s(l);i=c.add(f),r=_(a.beta,u,d,t,o)}else{let{p:t,f:n}=s(e);r=t,i=n}return hJ(A,[r,i])[0]}multiplyUnsafe(e){let{endo:r}=t;if(!n.isValid(e))throw RangeError("invalid scalar: out of range");if(e===pF||this.is0())return A.ZERO;if(e===pM)return this;if(E.hasCache(this))return this.multiply(e);if(!r)return E.unsafe(this,e);{let{k1neg:t,k1:i,k2neg:n,k2:a}=w(e),{p1:s,p2:o}=function(e,t,r,i){let n=t,a=e.ZERO,s=e.ZERO;for(;r>hG||i>hG;)r&hZ&&(a=a.add(n)),i&hZ&&(s=s.add(n)),n=n.double(),r>>=hZ,i>>=hZ;return{p1:a,p2:s}}(A,this,i,a);return _(r.beta,s,o,t,n)}}toAffine(e){let t=e,{X:r,Y:n,Z:a}=this;if(i.eql(a,i.ONE))return{x:r,y:n};let s=this.is0();null==t&&(t=s?i.ONE:i.inv(a));let o=i.mul(r,t),l=i.mul(n,t),u=i.mul(a,t);if(s)return{x:i.ZERO,y:i.ZERO};if(!i.eql(u,i.ONE))throw Error("invZ was invalid");return{x:o,y:l}}isTorsionFree(){let{isTorsionFree:e}=t;return s===pM||(e?e(A,this):E.unsafe(this,o).is0())}clearCofactor(){let{clearCofactor:e}=t;return s===pM?this:e?e(A,this):this.multiplyUnsafe(s)}isSmallOrder(){return s===pM?this.is0():this.clearCofactor().is0()}toBytes(e=!0){return hn(e,"isCompressed"),this.assertValidity(),f(A,this,e)}toHex(e=!0){return f8(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}let S=n.BITS,E=new h4(A,t.endo?Math.ceil(S/2):S);return S>=8&&A.BASE.precompute(8),Object.freeze(A.prototype),Object.freeze(A),A}(pW,{Fp:pX,endo:pK}),pY=function(e,t,r={}){(0,f5.ahash)(t),hb(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let i=void 0===(r=Object.assign({},r)).randomBytes?ht:r.randomBytes,n=void 0===r.hmac?(e,r)=>pR(t,e,r):r.hmac,{Fp:a,Fn:s}=e,{ORDER:o,BITS:l}=s,{keygen:u,getPublicKey:c,getSharedSecret:d,utils:f,lengths:h}=function(e,t={}){let{Fn:r}=e,i=void 0===t.randomBytes?ht:t.randomBytes,n=Object.assign(pq(e.Fp,r),{seed:Math.max(hK(r.ORDER),16)});function a(e){return function(e,t,r=!1){f4(e);let i=e.length,n=hW(t),a=Math.max(hK(t),16);if(i<a||i>1024)throw Error("expected "+a+"-1024 bytes of input, got "+i);let s=hN(r?hc(e):hu(e),t-hA)+hA;return r?hf(s,n):hd(s,n)}(f4(e=void 0===e?i(n.seed):e,n.seed,"seed"),r.ORDER)}function s(t,i=!0){return e.BASE.multiply(r.fromBytes(t)).toBytes(i)}function o(e){let{secretKey:t,publicKey:i,publicKeyUncompressed:a}=n,s=r._lengths;if(!he(e))return;let o=f4(e,void 0,"key").length,l=o===i||o===a,u=o===t||!!s?.includes(o);if(!l||!u)return l}let l={isValidSecretKey:function(e){try{let t=r.fromBytes(e);return r.isValidNot0(t)}catch(e){return!1}},isValidPublicKey:function(t,r){let{publicKey:i,publicKeyUncompressed:a}=n;try{let n=t.length;if(!0===r&&n!==i||!1===r&&n!==a)return!1;return!!e.fromBytes(t)}catch(e){return!1}},randomSecretKey:a},u=h7(a,s);return Object.freeze(l),Object.freeze(n),Object.freeze({getPublicKey:s,getSharedSecret:function(t,i,n=!0){if(!0===o(t))throw Error("first arg must be private key");if(!1===o(i))throw Error("second arg must be public key");let a=r.fromBytes(t);return e.fromBytes(i).multiply(a).toBytes(n)},keygen:u,Point:e,utils:l,lengths:n})}(e,r),p={prehash:!0,lowS:"boolean"!=typeof r.lowS||r.lowS,format:"compact",extraEntropy:!1},g=o*pj+pM<a.ORDER;function m(e,t){if(!s.isValidNot0(t))throw Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}function y(){if(g)throw Error('"recovered" sig type is not supported for cofactor >2 curves')}function v(e,t){pB(t);let r=h.signature;return f4(e,"compact"===t?r:"recovered"===t?r+1:void 0)}class b{r;s;recovery;constructor(e,t,r){if(this.r=m("r",e),this.s=m("s",t),null!=r){if(y(),![0,1,2,3].includes(r))throw Error("invalid recovery id");this.recovery=r}Object.freeze(this)}static fromBytes(e,t=p.format){let r;if(v(e,t),"der"===t){let{r:t,s:r}=pU.toSig(f4(e));return new b(t,r)}"recovered"===t&&(r=e[0],t="compact",e=e.subarray(1));let i=h.signature/2,n=e.subarray(0,i),a=e.subarray(i,2*i);return new b(s.fromBytes(n),s.fromBytes(a),r)}static fromHex(e,t){return this.fromBytes(f9(e),t)}assertRecovery(){let{recovery:e}=this;if(null==e)throw Error("invalid recovery id: must be present");return e}addRecoveryBit(e){return new b(this.r,this.s,e)}recoverPublicKey(t){let{r,s:i}=this,n=this.assertRecovery(),l=2===n||3===n?r+o:r;if(!a.isValid(l))throw Error("invalid recovery id: sig.r+curve.n != R.x");let u=a.toBytes(l),c=e.fromBytes(f7(pH((1&n)==0),u)),d=s.inv(l),f=_(f4(t,void 0,"msgHash")),h=s.create(-f*d),p=s.create(i*d),g=e.BASE.multiplyUnsafe(h).add(c.multiplyUnsafe(p));if(g.is0())throw Error("invalid recovery: point at infinify");return g.assertValidity(),g}
79hasHighS(){return this.s>o>>pM}toBytes(e=p.format){if(pB(e),"der"===e)return f9(pU.hexFromSig(this));let{r:t,s:r}=this,i=s.toBytes(t),n=s.toBytes(r);return"recovered"===e?(y(),f7(Uint8Array.of(this.assertRecovery()),i,n)):f7(i,n)}toHex(e){return f8(this.toBytes(e))}}Object.freeze(b.prototype),Object.freeze(b);let w=void 0===r.bits2int?function(e){if(e.length>8192)throw Error("input is too large");let t=hu(e),r=8*e.length-l;return r>0?t>>BigInt(r):t}:r.bits2int,_=void 0===r.bits2int_modN?function(e){return s.create(w(e))}:r.bits2int_modN,A=hv(l);function S(e){return hm("num < 2^"+l,e,pF,A),s.toBytes(e)}function E(e,r){return f4(e,void 0,"message"),r?f4(t(e),void 0,"prehashed message"):e}return Object.freeze({keygen:u,getPublicKey:c,getSharedSecret:d,utils:f,lengths:h,Point:e,sign:function(r,a,l={}){let{seed:u,k2sig:c}=function(t,r,n){let{lowS:a,prehash:l,extraEntropy:u}=pL(n,p),c=_(t=E(t,l)),d=s.fromBytes(r);if(!s.isValidNot0(d))throw Error("invalid private key");let f=[S(d),S(c)];if(null!=u&&!1!==u){let e=!0===u?i(h.secretKey):u;f.push(f4(e,void 0,"extraEntropy"))}return{seed:f7(...f),k2sig:function(t){let r=w(t);if(!s.isValidNot0(r))return;let i=s.inv(r),n=e.BASE.multiply(r).toAffine(),l=s.create(n.x);if(l===pF)return;let u=s.create(i*s.create(c+l*d));if(u===pF)return;let f=2*(n.x!==l)|Number(n.y&pM),h=u;return a&&u>o>>pM&&(h=s.neg(u),f^=1),new b(l,h,g?void 0:f)}}}(r,a,l);return(function(e,t,r){if((0,f5.anumber)(e,"hashLen"),(0,f5.anumber)(t,"qByteLen"),"function"!=typeof r)throw TypeError("hmacFn must be a function");let i=e=>new Uint8Array(e),n=Uint8Array.of(),a=Uint8Array.of(0),s=Uint8Array.of(1),o=i(e),l=i(e),u=0,c=()=>{o.fill(1),l.fill(0),u=0},d=(...e)=>r(l,f7(o,...e)),f=(e=n)=>{l=d(a,e),o=d(),0!==e.length&&(l=d(s,e),o=d())},h=()=>{if(u++>=1e3)throw Error("drbg: tried max amount of iterations");let e=0,r=[];for(;e<t;){let t=(o=d()).slice();r.push(t),e+=o.length}return f7(...r)};return(e,t)=>{let r;for(c(),f(e);void 0===(r=t(h()));)f();return c(),r}})(t.outputLen,s.BYTES,n)(u,c).toBytes(l.format)},verify:function(t,r,i,n={}){let{lowS:a,prehash:o,format:l}=pL(n,p);if(i=f4(i,void 0,"publicKey"),r=E(r,o),!he(t))throw Error("verify expects Uint8Array signature"+(t instanceof b?", use sig.toBytes()":""));v(t,l);try{let n=b.fromBytes(t,l),o=e.fromBytes(i);if(a&&n.hasHighS())return!1;let{r:u,s:c}=n,d=_(r),f=s.inv(c),h=s.create(d*f),p=s.create(u*f),g=e.BASE.multiplyUnsafe(h).add(o.multiplyUnsafe(p));if(g.is0())return!1;return s.create(g.x)===u}catch(e){return!1}},recoverPublicKey:function(e,t,r={}){let{prehash:i}=pL(r,p);return t=E(t,i),b.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:b,hash:t})}(pJ,f6.sha256),pQ=(a=[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(e=>BigInt(e))).map(e=>Array.from(e).reverse()),(e,t)=>{let[r,i,n,s]=a.map(t=>t.reduce((t,r)=>pX.add(pX.mul(t,e),r))),[o,l]=hj(pX,[i,s],!0);return e=pX.mul(r,o),t=pX.mul(t,pX.mul(n,l)),{x:e,y:t}});!function(e,t,r){if("function"!=typeof t)throw Error("mapToCurve() must be defined");let i=e=>Object.freeze({...e,DST:he(e.DST)?hh(e.DST):e.DST,...void 0===e.encodeDST?{}:{encodeDST:he(e.encodeDST)?hh(e.encodeDST):e.encodeDST}}),n=i(r);function a(r){return e.fromAffine(t(r))}function s(t){let r=t.clearCofactor();return r.equals(e.ZERO)?e.ZERO:(r.assertValidity(),r)}Object.freeze({get defaults(){return i(n)},Point:e,hashToCurve(e,t){let r=po(e,2,Object.assign({},n,t)),i=a(r[0]),o=a(r[1]);return s(i.add(o))},encodeToCurve(e,t){let r=n.encodeDST?{DST:n.encodeDST}:{};return s(a(po(e,1,Object.assign({},n,r,t))[0]))},mapToCurve(e){if(1===n.m){if("bigint"!=typeof e)throw Error("expected bigint (m=1)");return s(a([e]))}if(!Array.isArray(e))throw Error("expected array of bigints");for(let t of e)if("bigint"!=typeof t)throw Error("expected array of bigints");return s(a(e))},hashToScalar:(t,r)=>
79po(t,1,Object.assign({},n,{p:e.Fn.ORDER,m:1,DST:pl},r))[0][0]})}(pJ,e=>{let{x:r,y:i}=(t||(t=function(e,t){let r=hM(e),{A:i,B:n,Z:a}=t;if(!r.isValidNot0(i)||!r.isValidNot0(n)||!r.isValid(a)||r.eql(a,r.neg(r.ONE))||-1!==hz(r,a))throw Error("mapToCurveSimpleSWU: invalid opts");let s=r.mul(n,r.inv(r.mul(a,i))),o=r.add(r.add(r.mul(r.sqr(s),s),r.mul(i,s)),n);if(-1===hz(r,o))throw Error("mapToCurveSimpleSWU: invalid opts");let l=function(e,t){let r=hM(e),i=r.ORDER,n=pF;for(let e=i-pM;e%pj===pF;e/=pj)n+=pM;let a=n,s=pj<<a-pM-pM,o=s*pj,l=(i-pM)/o,u=(l-pM)/pj,c=o-pM,d=r.pow(t,l),f=r.pow(t,(l+pM)/pj),h=(e,t)=>{let i=d,n=r.pow(t,c),o=r.sqr(n);o=r.mul(o,t);let l=r.mul(e,o);l=r.pow(l,u),l=r.mul(l,n),n=r.mul(l,t),o=r.mul(l,e);let h=r.mul(o,n);l=r.pow(h,s);let p=r.eql(l,r.ONE);n=r.mul(o,f),l=r.mul(h,i),o=r.cmov(n,o,p),h=r.cmov(l,h,p);for(let e=a;e>pM;e--){let t=e-pj;t=pj<<t-pM;let a=r.pow(h,t),s=r.eql(a,r.ONE);n=r.mul(o,i),i=r.mul(i,i),a=r.mul(h,i),o=r.cmov(n,o,s),h=r.cmov(a,h,s)}return{isValid:!r.is0(t)&&(p||r.is0(e)),value:o}};if(r.ORDER%pV===pz){let e=(r.ORDER-pz)/pV,i=r.sqrt(r.neg(t));h=(t,n)=>{let a=r.sqr(n),s=r.mul(t,n);a=r.mul(a,s);let o=r.pow(a,e);o=r.mul(o,s);let l=r.mul(o,i),u=r.mul(r.sqr(o),n),c=r.eql(u,t),d=r.cmov(l,o,c);return{isValid:!r.is0(n)&&c,value:d}}}return h}(r,a);if(!r.isOdd)throw Error("Field does not have .isOdd()");return e=>{let t,s,o,u,c,d,f,h;t=r.sqr(e),t=r.mul(t,a),s=r.sqr(t),s=r.add(s,t),o=r.add(s,r.ONE),o=r.mul(
79o,n),u=r.cmov(a,r.neg(s),!r.eql(s,r.ZERO)),u=r.mul(u,i),s=r.sqr(o),d=r.sqr(u),c=r.mul(d,i),s=r.add(s,c),s=r.mul(s,o),d=r.mul(d,u),c=r.mul(d,n),s=r.add(s,c),f=r.mul(t,o);let{isValid:p,value:g}=l(s,d);h=r.mul(t,e),h=r.mul(h,g),f=r.cmov(f,o,p),h=r.cmov(h,g,p);let m=r.isOdd(e)===r.isOdd(h);h=r.cmov(r.neg(h),h,m);let y=hj(r,[u],!0)[0];return{x:f=r.mul(f,y),y:h}}}(pX,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:pX.create(BigInt("-11"))})))(pX.create(e[0]));return pQ(r,i)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:pX.ORDER,m:1,k:128,expand:"xmd",hash:f6.sha256});let p0=BigInt("1000000000000000000000000"),p1=BigInt("1000000000000"),p2="ed25519:",p6="secp256k1:";(o=z||(z={}))[o.ED25519=0]="ED25519",o[o.SECP256K1=1]="SECP256K1";let p5=fh.b.struct({message:fh.b.string(),nonce:fh.b.array(fh.b.u8(),32),recipient:fh.b.string(),callbackUrl:fh.b.option(fh.b.string())});function p4(e){if(32!==e.nonce.length)throw Error("Nonce must be exactly 32 bytes");let t=fh.b.u32().serialize(0x8000019d),r=p5.serialize({message:e.message,nonce:Array.from(e.nonce),recipient:e.recipient,callbackUrl:e.callbackUrl??null}),i=new Uint8Array(t.length+r.length);return i.set(t,0),i.set(r,t.length),(0,f6.sha256)(i)}class p3{constructor(e){this.privateKey=e.slice(0,32);const t=e.slice(32);this.publicKey={keyType:z.ED25519,data:t,toString:()=>p2+fd.base58.encode(t)},this.secretKey=p2+fd.base58.encode(e)}sign(e){let t=pA.sign(e,this.privateKey);return{keyType:z.ED25519,data:t}}signNep413Message(e,t){let r=p4(t),i=pA.sign(r,this.privateKey);return{accountId:e,publicKey:this.publicKey.toString(),signature:fd.base64.encode(i)}}static fromRandom(){let e=pA.utils.randomSecretKey(),t=pA.getPublicKey(e),r=new Uint8Array(64);return r.set(e,0),r.set(t,32),new p3(r)}static fromString(e){let t=e.replace(p2,"");return new p3(fd.base58.decode(t))}}class p8{constructor(e){this.privateKey=e.slice(0,32);const t=e.slice(32);this.publicKey={keyType:z.SECP256K1,data:t,toString:()=>p6+fd.base58.encode(t)},this.secretKey=p6+fd.base58.encode(e)}sign(e){let t=pY.sign(e,this.privateKey,{format:"recovered"});return{keyType:z.SECP256K1,data:t}}signNep413Message(e,t){let r=p4(t),i=pY.sign(r,this.privateKey,{format:"recovered"});return{accountId:e,publicKey:this.publicKey.toString(),signature:fd.base64.encode(i)}}static fromRandom(){let e=new Uint8Array(32);crypto.getRandomValues(e);let t=pY.getPublicKey(e,!1).slice(1),r=new Uint8Array(96);return r.set(e,0),r.set(t,32),new p8(r)}static fromString(e){let t=e.replace(p6,"");return new p8(fd.base58.decode(t))}}function p7(e){if(e.startsWith(p2)){let t=e.replace(p2,""),r=fd.base58.decode(t);return{keyType:z.ED25519,data:r,toString:()=>e}}if(e.startsWith(p6)){let t=e.replace(p6,""),r=fd.base58.decode(t);return{keyType:z.SECP256K1,data:r,toString:()=>e}}throw new f1(`Unsupported public key type: ${e}`)}function p9(e){if("bigint"==typeof e)return e.toString();let t=e.trim(),r=t.match(/^([\d.]+)\s+NEAR$/i);if(r)return function(e){let t=e.split("."),r=t[0]||"0",i=(t[1]||"").padEnd(24,"0").substring(0,24);if(r.startsWith("-"))throw Error("NEAR amount must be non-negative");return(BigInt(r)*p0+BigInt(i)).toString()}(r[1]);let i=t.match(/^(\d+)\s+yocto$/i);if(i)return i[1];if(/^[\d.]+$/.test(t))throw Error(`Ambiguous amount: "${e}". Did you mean "${e} NEAR"? 80 - Use Amount.NEAR(${e}) for NEAR 81 - Use Amount.yocto(${e}n) for yoctoNEAR 82 - Or write "${e} NEAR" or "${e} yocto" 83 - Or pass ${e}n as bigint for yoctoNEAR 84 85ð¡ TypeScript tip: Use 'as const' for variables: 86 const amount = "10 NEAR" as const`);throw Error(`Invalid amount format: "${e}" 87Expected formats: 88 - "10 NEAR" or Amount.NEAR(10) 89 - "1000000 yocto" or Amount.yocto(1000000n) 90 - 1000000n (bigint, treated as yoctoNEAR)`)}var d0=d0;function ge(e){let t=("number"==typeof e?e.toString():e).trim(),r=t.match(/^([\d.]+)\s+Tgas$/i);if(r)return function(e){if(!/^\d*\.?\d+$/.test(e))throw Error(`Invalid Tgas value: ${e}`);let t=e.split("."),r=t[0]||"0",i=(t[1]||"").padEnd(12,"0").substring(0,12);return(BigInt(r)*p1+BigInt(i)).toString()}(r[1]);if(/^\d+$/.test(t))return t;throw Error(`Invalid gas format: "${e}" 91Expected: "30 Tgas" or Gas.Tgas(30) 92Or provide raw gas units as a number string`)}function gt(e){return/^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/.test(e)}d0.string().min(2,"Account ID must be at least 2 characters").max(64,"Account ID must be at most 64 characters").regex(/^(([a-z\d]+[-_])*[a-z\d]+\.)*([a-z\d]+[-_])*[a-z\d]+$/,"Account ID must contain only lowercase alphanumeric characters, hyphens, underscores, and dots"),d0.string().refine(e=>e.startsWith(p2)||e.startsWith(p6),"Public key must start with 'ed25519:' or 'secp256k1:'").refine(e=>gt(e.startsWith(p2)?e.slice(p2.length):e.slice(p6.length)),"Public key must be valid base58 encoding");let gr=d0.string().refine(e=>e.startsWith(p2)||e.startsWith(p6),"Private key must start with 'ed25519:' or 'secp256k1:'").refine(e=>{let t=e.startsWith(p2)?e.slice(p2.length):e.slice(p6.length);return t.length>0&>(t)},"Private key must be valid base58 encoding"),gi=d0.union([d0.string(),d0.bigint()]).transform(e=>p9(e)),gn=d0.string().transform(e=>ge(e));function ga(e){return gi.parse(e)}var d0=d0;let gs=d0.enum(["mainnet","testnet","localnet","betanet"]),go=d0.object({rpcUrl:d0.string().url("RPC URL must be a valid URL"),networkId:d0.string().min(1,"Network ID is required")}),gl=d0.union([gs,go]),gu=d0.enum(["NONE","INCLUDED","EXECUTED_OPTIMISTIC","INCLUDED_FINAL","EXECUTED","FINAL"]);d0.object({gas:d0.string().optional(),attachedDeposit:d0.union([d0.string(),d0.bigint()]).optional(),signerId:d0.string().optional(),waitUntil:gu.optional()}),d0.object({finality:d0.enum(["optimistic","near-final","final"]).optional(),blockId:d0.union([d0.number(),d0.string()]).optional()});let gc=d0.union([d0.string(),d0.record(d0.string(),d0.string()),d0.any()]),gd=d0.any(),gf=d0.object({maxRetries:d0.number().int().min(0),initialDelayMs:d0.number().int().min(0)}).partial();d0.object({network:gl.optional(),rpcUrl:d0.string().url("RPC URL must be a valid URL").optional(),headers:d0.record(d0.string(),d0.string()).optional(),keyStore:gc.optional(),signer:gd.optional(),privateKey:d0.union([gr,d0.instanceof(Uint8Array)]).optional(),wallet:d0.any().optional(),defaultSignerId:d0.string().optional(),defaultWaitUntil:gu.optional(),retryConfig:gf.optional()});var d0=d0;let gh=d0.object({receiver_id:d0.string(),method_names:d0.array(d0.string()),allowance:d0.string().nullable().optional()}),gp=d0.union([d0.literal("FullAccess"),d0.object({FunctionCall:gh}
92)]);d0.object({result:d0.array(d0.number()),logs:d0.array(d0.string()),block_height:d0.number(),block_hash:d0.string()}),d0.object({amount:d0.string(),locked:d0.string(),code_hash:d0.string(),storage_usage:d0.number(),storage_paid_at:d0.number(),block_height:d0.number(),block_hash:d0.string()});let gg=d0.object({nonce:d0.number(),permission:gp,block_height:d0.number(),block_hash:d0.string()});d0.object({public_key:d0.string(),access_key:gg}),d0.object({version:d0.object({version:d0.string(),build:d0.string(),commit:d0.string().optional(),rustc_version:d0.string().optional()}),chain_id:d0.string(),genesis_hash:d0.string(),protocol_version:d0.number(),latest_protocol_version:d0.number(),rpc_addr:d0.string(),node_public_key:d0.string(),node_key:d0.string().nullable(),validator_account_id:d0.string().nullable(),validator_public_key:d0.string().nullable(),validators:d0.array(d0.object({account_id:d0.string()})),sync_info:d0.object({latest_block_hash:d0.string(),latest_block_height:d0.number(),latest_state_root:d0.string(),latest_block_time:d0.string(),syncing:d0.boolean(),earliest_block_hash:d0.string().optional(),earliest_block_height:d0.number().optional(),earliest_block_time:d0.string().optional(),epoch_id:d0.string().optional(),epoch_start_height:d0.number().optional()}),uptime_sec:d0.number().optional()}),d0.object({gas_price:d0.string()}),d0.object({block_hash:d0.string(),block_height:d0.number(),keys:d0.array(d0.object({public_key:d0.string(),access_key:d0.object({nonce:d0.number(),permission:gp})}))}),d0.object({name:d0.string(),code:d0.number(),message:d0.string(),data:d0.any().optional(),cause:d0.object({name:d0.string(),info:d0.object({requested_account_id:d0.string().optional(),contract_id:d0.string().optional(),method_name:d0.string().optional(),ShardCongested:d0.boolean().optional(),ShardStuck:d0.boolean().optional()}).catchall(d0.any()).optional()}).optional()}),d0.enum(["NONE","INCLUDED","EXECUTED_OPTIMISTIC","INCLUDED_FINAL","EXECUTED","FINAL"]);let gm=d0.union([d0.literal("Unknown"),d0.literal("Pending"),d0.object({SuccessValue:d0.string()}),d0.object({SuccessReceiptId:d0.string()}),d0.object({Failure:d0.object({error_message:d0.string().optional(),error_type:d0.string().optional()}).catchall(d0.any())})]),gy=d0.object({cost:d0.string().optional(),cost_category:d0.string().optional(),gas_used:d0.string().optional()}).catchall(d0.any()),gv=d0.object({version:d0.number(),gas_profile:d0.array(gy).nullable().optional()}),gb=d0.object({logs:d0.array(d0.string()),receipt_ids:d0.array(d0.string()),gas_burnt:d0.number(),tokens_burnt:d0.string(),executor_id:d0.string(),status:gm,metadata:gv.optional()}),gw=d0.object({hash:d0.string(),direction:d0.enum(["Left","Right"])}),g_=d0.object({id:d0.string(),outcome:gb,block_hash:d0.string(),proof:d0.array(gw)}),gA=d0.union([d0.literal("CreateAccount"),d0.object({CreateAccount:d0.object({})}),d0.object({Transfer:d0.object({deposit:d0.string()})}),d0.object({FunctionCall:d0.object({method_name:d0.string(),args:d0.string(),gas:d0.number(),deposit:d0.string()})}),d0.object({DeployContract:d0.object({code:d0.string()})}),d0.object({DeployGlobalContractByAccountId:d0.object({code:d0.string()})}),d0.object({DeployGlobalContractByCodeHash:d0.object({code:d0.string()})}),d0.object({Stake:d0.object({stake:d0.string(),public_key:d0.string()})}),d0.object({AddKey:d0.object({public_key:d0.string(),access_key:d0.object({nonce:d0.number(),permission:gp})})}),d0.object({DeleteKey:d0.object({public_key:d0.string()})}),d0.object({DeleteAccount:d0.object({beneficiary_id:d0.string()})}),d0.object({UseGlobalContractByAccountId:d0.object({account_id:d0.string()})}),d0.object({UseGlobalContractByCodeHash:d0.object({code_hash:d0.string()})}),d0.object({Delegate:d0.object({delegate_action:d0.object({sender_id:d0.string(),receiver_id:d0.string(),actions:d0.array(d0.any()),nonce:d0.number(),max_block_height:d0.number(),public_key:d0.string()}),signature:d0.string()})}),d0.object({DeterministicStateInit:d0.object({deposit:d0.string()})})]),gS=d0.object({signer_id:d0.string(),public_key:d0.string(),nonce:
92d0.number(),receiver_id:d0.string(),actions:d0.array(gA),signature:d0.string(),hash:d0.string(),priority_fee:d0.number().optional()}),gE=d0.object({hash:d0.string(),signer_id:d0.string(),receiver_id:d0.string(),nonce:d0.number()}),gx=d0.discriminatedUnion("final_execution_status",[d0.object({final_execution_status:d0.literal("NONE"),transaction:gE.optional()}),d0.object({final_execution_status:d0.literal("INCLUDED"),transaction:gE.optional()}),d0.object({final_execution_status:d0.literal("INCLUDED_FINAL"),transaction:gE.optional()}),d0.object({final_execution_status:d0.literal("EXECUTED_OPTIMISTIC"),status:gm,transaction:gS,transaction_outcome:g_,receipts_outcome:d0.array(g_)}),d0.object({final_execution_status:d0.literal("EXECUTED"),status:gm,transaction:gS,transaction_outcome:g_,receipts_outcome:d0.array(g_)}),d0.object({final_execution_status:d0.literal("FINAL"),status:gm,transaction:gS,transaction_outcome:g_,receipts_outcome:d0.array(g_)})]),gT=d0.object({predecessor_id:d0.string(),receiver_id:d0.string(),receipt_id:d0.string(),receipt:d0.union([d0.object({Action:d0.object({signer_id:d0.string(),signer_public_key:d0.string(),gas_price:d0.string(),output_data_receivers:d0.array(d0.any()),input_data_ids:d0.array(d0.string()),actions:d0.array(gA),is_promise_yield:d0.boolean().optional()})}),d0.object({Data:d0.object({data_id:d0.string(),data:d0.string().nullable().optional()})})]),priority:d0.number().optional()});d0.intersection(gx,d0.object({receipts:d0.array(gT)}));class gI{constructor(e,t,r,i,n="EXECUTED_OPTIMISTIC",a,s){this.signerId=e,this.actions=[],this.rpc=t,this.keyStore=r,void 0!==s&&(this.ensureKeyStoreReady=s),void 0!==i&&(this.signer=i),this.defaultWaitUntil=n,void 0!==a&&(this.wallet=a)}invalidateCache(){return delete this.cachedSignedTx,this}async resolveKeyPair(){if(this.keyPair)return this.keyPair;this.ensureKeyStoreReady&&await this.ensureKeyStoreReady();let e=await this.keyStore.get(this.signerId);if(!e)throw new f1(`No key found for account: ${this.signerId}`);return this.keyPair=e,e}transfer(e,t){let r=ga(t);return this.actions.push({transfer:{deposit:BigInt(r)}}),this.receiverId||(this.receiverId=e),this.invalidateCache()}functionCall(e,t,r={},i={}){var n;let a=r instanceof Uint8Array?r:new TextEncoder().encode(JSON.stringify(r)),s=i.gas?(n=i.gas,gn.parse(n)):"30000000000000",o=i.attachedDeposit?ga(i.attachedDeposit):"0";return this.actions.push({functionCall:{methodName:t,args:a,gas:BigInt(s),deposit:BigInt(o)}}),this.receiverId||(this.receiverId=e),this.invalidateCache()}createAccount(e){return this.actions.push({createAccount:{}}),this.receiverId||(this.receiverId=e),this.invalidateCache()}deleteAccount(e){return this.actions.push({deleteAccount:{beneficiaryId:e.beneficiary}}),this.receiverId||(this.receiverId=this.signerId),this.invalidateCache()}deployContract(e,t){return this.actions.push({deployContract:{code:t}}),this.receiverId||(this.receiverId=e),this.invalidateCache()}publishContract(e,t){return this.actions.push({deployGlobalContract:{code:e,deployMode:t?.identifiedBy==="hash"?{CodeHash:{}}:{AccountId:{}}}}),this.receiverId||(this.receiverId=this.signerId),this.invalidateCache()}deployFromPublished(e){return this.actions.push(function(e){let t;if("accountId"in e)t={AccountId:e.accountId};else{let r="string"==typeof e.codeHash?fd.base58.decode(e.codeHash):e.codeHash;if(32!==r.length)throw Error(`Code hash must be 32 bytes, got ${r.length} bytes`);t={CodeHash:Array.from(r)}}return{useGlobalContract:{contractIdentifier:t}}}(e)),this.receiverId||(this.receiverId=this.signerId),this.invalidateCache()}stateInit(e){var t;let r=ga(e.deposit),i={code:e.code,deposit:BigInt(r)};if(void 0!==e.data&&(i.data=e.data),this.actions.push({deterministicStateInit:{stateInit:{V1:{code:"accountId"in i.code?{AccountId:i.code.accountId}:{CodeHash:Array.from(fp(i.code.codeHash))},data:i.data??new Map}},deposit:i.deposit}}),!this.receiverId){let r,i,n,a,s={code:e.code};void 0!==e.data&&(s.data=e.data),this.receiverId=(r="accountId"===(t={code:"accountId"in s.code?{type:"accountId",accountId:s.code.accountId}:{type:"codeHash",hash:fp(s.code.codeHash)},data:s.data??new Map}).code.type?{AccountId:t.code.accountId}:{CodeHash:Array.from(t.code.hash)},i=new Map(Array.from(t.data.entries()).sort((e,t)=>
92{let[r]=e,[i]=t;for(let e=0;e<Math.min(r.length,i.length);e++){let t=r[e],n=i[e];if(void 0!==t&&void 0!==n&&t!==n)return t-n}return r.length-i.length})),n=fy.serialize({V1:{code:r,data:i}}),a=(0,ff.keccak_256)(n).slice(12,32),`0s${fd.hex.encode(a)}`)}return this.invalidateCache()}stake(e,t){let r=ga(t),i=p7(e);return this.actions.push({stake:{stake:BigInt(r),publicKey:fZ(i)}}),this.receiverId||(this.receiverId=this.signerId),this.invalidateCache()}addKey(e,t){let r=p7(e),i="fullAccess"===t.type?{fullAccess:{}}:{functionCall:{receiverId:t.receiverId,methodNames:t.methodNames||[],allowance:t.allowance?BigInt(ga(t.allowance)):null}};return this.actions.push({addKey:{publicKey:fZ(r),accessKey:{nonce:BigInt(0),permission:i}}}),this.receiverId||(this.receiverId=this.signerId),this.invalidateCache()}deleteKey(e,t){let r=p7(t);return this.actions.push({deleteKey:{publicKey:fZ(r)}}),this.receiverId||(this.receiverId=e),this.invalidateCache()}signedDelegateAction(e){return this.actions.push(e),this.receiverId=e.signedDelegate.delegateAction.senderId,this.invalidateCache()}async delegate(e){let t,r,i,n,a,s,o=e??{};if(0===this.actions.length)throw new f0("Delegate action requires at least one action to perform","INVALID_TRANSACTION");if(this.actions.some(e=>"signedDelegate"in e))throw new f0("Delegate actions cannot contain nested signed delegate actions","INVALID_TRANSACTION");let l=o.receiverId??this.receiverId;if(!l)throw new f0("Delegate action requires a receiver. Set receiverId via the first action or provide it explicitly.","INVALID_TRANSACTION");let u=await this.resolveKeyPair();if(!function(e,t){if(e.keyType!==t.keyType||e.data.length!==t.data.length)return!1;for(let r=0;r<e.data.length;r+=1)if(e.data[r]!==t.data[r])return!1;return!0}(t=void 0===o.publicKey?u.publicKey:"string"==typeof o.publicKey?p7(o.publicKey):o.publicKey,u.publicKey))throw new f1("Delegate action public key must match the signer key. Use signWith() when you need a different key.");if(r=void 0!==o.nonce?o.nonce:BigInt((await this.rpc.getAccessKey(this.signerId,t.toString())).nonce)+1n,void 0!==o.maxBlockHeight)i=o.maxBlockHeight;else{let e=await this.rpc.getStatus(),t=BigInt(o.blockHeightOffset??200);i=BigInt(e.sync_info.latest_block_height)+t}let c=this.actions.map(e=>e),d=new fQ(this.signerId,l,c,r,i,t),f=(0,f6.sha256)((n=fh.b.u32().serialize(0x4000016e),a=fH.serialize({senderId:d.senderId,receiverId:d.receiverId,actions:d.actions,nonce:d.nonce,maxBlockHeight:d.maxBlockHeight,publicKey:fZ(d.publicKey)}),(s=new Uint8Array(n.length+a.length)).set(n,0),s.set(a,n.length),s)),h=u.sign(f),p={signedDelegate:{delegateAction:{senderId:d.senderId,receiverId:d.receiverId,actions:d.actions,nonce:d.nonce,maxBlockHeight:d.maxBlockHeight,publicKey:fZ(d.publicKey)},signature:fX(h)}},g=o.payloadFormat??"base64",m=function(e,t="base64"){let r=fq.serialize(e.signedDelegate);return"base64"===t?fd.base64.encode(r):r}(p,g);return{signedDelegateAction:p,payload:m,format:g}}signWith(e){if("string"==typeof e){let t=function(e){if(e.startsWith(p2))return p3.fromString(e);if(e.startsWith(p6))return p8.fromString(e);throw new f1(`Unsupported key type: ${e}`)}(e);this.keyPair=t,this.signer=async e=>t.sign(e)}else delete this.keyPair,this.signer=e;return this.invalidateCache()}async build(){if(!this.receiverId)throw new f0("No receiver ID set for transaction","INVALID_TRANSACTION");let e=(await this.resolveKeyPair()).publicKey,t=await gI.nonceManager.getNextNonce(this.signerId,e.toString(),async()=>BigInt((await this.rpc.getAccessKey(this.signerId,e.toString())).nonce)),r=await this.rpc.getStatus(),i=fd.base58.decode(r.sync_info.latest_block_hash);return{signerId:this.signerId,publicKey:e,nonce:t,receiverId:this.receiverId,actions:this.actions,blockHash:i}}async sign(){if(this.cachedSignedTx)return this;if(!this.receiverId)throw new f0("No receiver ID set for transaction","INVALID_TRANSACTION");let e=await this.build(),t=fK.serialize({signerId:e.signerId,publicKey:fZ(e.publicKey),nonce:e.nonce,receiverId:e.receiverId,blockHash:Array.from(e.blockHash),actions:e.actions.map(fJ)}
92),r=new Uint8Array(await crypto.subtle.digest("SHA-256",t)),i=fd.base58.encode(r),n=this.signer?await this.signer(r):(await this.resolveKeyPair()).sign(r);return this.cachedSignedTx={signedTx:{transaction:e,signature:n},hash:i},this}getHash(){return this.cachedSignedTx?.hash??null}serialize(){if(!this.cachedSignedTx)throw new f0("Transaction must be signed before serializing. Call .sign() first.","INVALID_STATE");return fY(this.cachedSignedTx.signedTx)}async send(e){if(!this.receiverId)throw new f0("No receiver ID set for transaction","INVALID_TRANSACTION");if(this.wallet)return await this.wallet.signAndSendTransaction({signerId:this.signerId,receiverId:this.receiverId,actions:this.actions});let t=e?.waitUntil??this.defaultWaitUntil,r=null;for(let e=0;e<3;e++)try{if((!this.cachedSignedTx||e>0)&&(delete this.cachedSignedTx,await this.sign()),!this.cachedSignedTx)throw new f0("Failed to sign transaction","TRANSACTION_SIGNING_FAILED");let{signedTx:r,hash:i}=this.cachedSignedTx,n=fY(r),a=await this.rpc.sendTransaction(n,t);return"transaction"in a&&a.transaction||(a.transaction={hash:i,signer_id:r.transaction.signerId,receiver_id:this.receiverId,nonce:Number(r.transaction.nonce)}),a}catch(t){if(r=t,t instanceof f2&&(this.cachedSignedTx&&gI.nonceManager.invalidate(this.signerId,this.cachedSignedTx.signedTx.transaction.publicKey.toString()),e<2))continue;throw t}throw r||new f0("Unknown error during transaction send","UNKNOWN_TRANSACTION_ERROR")}}gI.nonceManager=new class{constructor(){this.nonces=new Map,this.fetching=new Map}async getNextNonce(e,t,r){let i=`${e}:${t}`,n=this.fetching.get(i);if(n&&await n,!this.nonces.has(i)){let e=r().then(e=>{this.nonces.set(i,e+1n),this.fetching.delete(i)}).catch(e=>{throw this.fetching.delete(i),e});this.fetching.set(i,e),await e}let a=this.nonces.get(i);if(void 0===a)throw Error(`Nonce not found for ${i} after fetch`);return this.nonces.set(i,a+1n),a}invalidate(e,t){this.nonces.delete(`${e}:${t}`)}clear(){this.nonces.clear()}},(l=V||(V={}))[l.Eth=0]="Eth",l[l.Near=1]="Near",l[l.Sol=2]="Sol",l[l.Arb=3]="Arb",l[l.Base=4]="Base",l[l.Bnb=5]="Bnb",l[l.Btc=6]="Btc",l[l.Zcash=7]="Zcash",l[l.Pol=8]="Pol",l[l.HyperEvm=9]="HyperEvm",l[l.Strk=10]="Strk",l[l.Abs=11]="Abs",l[l.Fogo=12]="Fogo";let gk={eth:V.Eth,near:V.Near,sol:V.Sol,arb:V.Arb,base:V.Base,bnb:V.Bnb,btc:V.Btc,zcash:V.Zcash,pol:V.Pol,hlevm:V.HyperEvm,abs:V.Abs,strk:V.Strk,fogo:V.Fogo},gO={[V.Eth]:"eth",[V.Near]:"near",[V.Sol]:"sol",[V.Arb]:"arb",[V.Base]:"base",[V.Bnb]:"bnb",[V.Btc]:"btc",[V.Zcash]:"zcash",[V.Pol]:"pol",[V.HyperEvm]:"hlevm",[V.Abs]:"abs",[V.Strk]:"strk",[V.Fogo]:"fogo"},gC=new Set(Object.keys(gk));function gN(e){let t=e.indexOf(":");if(-1===t)throw new d6(`Invalid OmniAddress format: ${e}`,"INVALID_ADDRESS",{address:e});let r=e.slice(0,t);if(!gC.has(r))throw new d6(`Unknown chain prefix: ${r}`,"INVALID_CHAIN",{prefix:r,address:e});return gk[r]}function gP(e,t){let r=gO[e];return`${r}:${t}`}let gD={"nbtc.bridge.near":V.Btc,"nzec.bridge.near":V.Zcash,"eth.bridge.near":V.Eth,"sol.omft.near":V.Sol,"base.omdep.near":V.Base,"arb.omdep.near":V.Arb,"bnb.omdep.near":V.Bnb,"pol.omdep.near":V.Pol,"abs.omdep.near":V.Abs,"strk.omdep.near":V.Strk,"fogo.omdep.near":V.Fogo,"nbtc.n-bridge.testnet":V.Btc,"nzcash.n-bridge.testnet":V.Zcash,"eth.sepolia.testnet":V.Eth,"sol.omnidep.testnet":V.Sol,"base.omnidep.testnet":V.Base,"arb.omnidep.testnet":V.Arb,"bnb.omnidep.testnet":V.Bnb,"pol.omnidep.testnet":V.Pol,"abs.omnidep.testnet":V.Abs,"strk.omnidep.testnet":V.Strk},gR=/\.(omdep\.near|omnidep\.testnet|factory\.bridge\.near|factory\.sepolia\.testnet)$/,g$={"sol-":V.Sol,"base-":V.Base,"arb-":V.Arb,"bnb-":V.Bnb,"pol-":V.Pol,"abs-":V.Abs,"strk-":V.Strk,"fogo-":V.Fogo};function gB(e){let t=gD[e];if(void 0!==t)return t;if(gR.test(e)){for(let[t,r]of Object.entries(g$))if(e.startsWith(t))return r;if(e.includes("factory.bridge")||e.includes("factory.sepolia"))return V.Eth}return null}var gL=e.i(424243);e.i(567636),e.i(28593);var gU=e.i(204082),gF=e.i(532785),gM=e.i(829256),gj=e.i(956376),gz=e.i(800453),gV=e.i(390778),gH=e.i(885641);(u=H||(H={})).DEFAULT="default",u.SAFE="safe",u.MIXED="mixed",u.BIGINT="bigint";let gq=H,gW=(0,gH.default)({useNativeBigInt:!0,strict:!0});function gK(e,t){return e.length===t.length&&Array.from(e).every((e,r)=>e===t[r])}function gG(...e){let t=new Uint8Array(e.reduce((e,t)=>
92e+t.length,0)),r=0;for(let i=0;i<e.length;i++)t.set(e[i],r),r+=e[i].length;return t}function gZ(e){return gV.default.sha512_256.array(e)}function gX(e){return gz.default.sign.keyPair.fromSeed(e)}function gJ(e){return e===gz.default.sign.signatureLength}function gY(e){return gz.default.sign.keyPair.fromSecretKey(e)}function gQ(e,t){return gz.default.sign.detached(e,t)}function g0(e,t){return gz.default.verify(e,t)}function g1(e,t,r){return gz.default.sign.detached.verify(e,t,r)}let g2=gz.default.sign.publicKeyLength;gz.default.sign.secretKeyLength;var g6=e.i(798651);function g5(e){if(!("bigint"==typeof e||Number.isInteger(e))||e<0||e>BigInt("0xffffffffffffffff"))throw Error("Input is not a 64-bit unsigned integer");let t=new Uint8Array(8);return new DataView(t.buffer).setBigUint64(0,BigInt(e)),t}let g4=new Uint8Array([77,117,108,116,105,115,105,103,65,100,100,114]),g3=gj.Buffer.from("appID"),g8="address seems to be malformed";function g7(e){if("string"!=typeof e||58!==e.length)throw Error(g8);let t=g6.default.decode.asBytes(e.toString());if(36!==t.length)throw Error(g8);let r=new Uint8Array(t.slice(0,32)),i=new Uint8Array(t.slice(g2,36));if(!gK(gZ(r).slice(28,32),i))throw Error("wrong checksum for address");return{publicKey:r,checksum:i}}function g9(e){try{g7(e)}catch(e){return!1}return!0}function me(e){let t=gZ(e).slice(g2-4,g2);return g6.default.encode(gG(e,t)).toString().slice(0,58)}function mt({version:e,threshold:t,pks:r}){if(1!==e||e>255||e<0)throw Error("invalid multisig version");if(0===t||0===r.length||t>r.length||t>255)throw Error("bad multisig threshold");if(32!==g2)throw Error("nacl public key length is not 32 bytes");let i=new Uint8Array(g4.length+2+32*r.length);i.set(g4,0),i.set([e],g4.length),i.set([t],g4.length+1);for(let e=0;e<r.length;e++){if(32!==r[e].length)throw Error("bad multisig public key - wrong length");i.set(r[e],g4.length+2+32*e)}return new Uint8Array(gZ(i))}function mr({version:e,threshold:t,addrs:r}){return me(mt({version:e,threshold:t,pks:r.map(e=>g7(e).publicKey)}))}function mi(e){return me(new Uint8Array(gZ(gG(g3,g5(e)))))}var mn=e.i(42570);function ma(e){return mn.encode(e,{sortKeys:!0})}function ms(e){let t=function(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(!e[t]||0===e[t].length))return{containsEmpty:!0,firstEmptyKey:t};return{containsEmpty:!1,firstEmptyKey:void 0}}(e);if(t.containsEmpty)throw Error("The object contains empty or 0 values. First empty or 0 value encountered during encoding: "+t.firstEmptyKey);return ma(e)}function mo(e){return mn.decode(e)}function ml(e,t,r){let i;if(null!=e){if("string"==typeof e?i=gj.Buffer.from(e,"base64"):e.constructor===Uint8Array?i=gj.Buffer.from(e):gj.Buffer.isBuffer(e)&&(i=e),null==i||i.byteLength!==r)throw Error(`${t} must be a ${r} byte Uint8Array or Buffer or base64 string.`);return i}}(c=q||(q={})).pay="pay",c.keyreg="keyreg",c.acfg="acfg",c.axfer="axfer",c.afrz="afrz",c.appl="appl",c.stpf="stpf",(d=W||(W={}))[d.NoOpOC=0]="NoOpOC",d[d.OptInOC=1]="OptInOC",d[d.CloseOutOC=2]="CloseOutOC",d[d.ClearStateOC=3]="ClearStateOC",d[d.UpdateApplicationOC=4]="UpdateApplicationOC",d[d.DeleteApplicationOC=5]="DeleteApplicationOC";class mu{constructor({...e}){this.name="Transaction",this.tag=gj.Buffer.from("TX");const t={type:q.pay,flatFee:!1,nonParticipation:!1};if(void 0===e.type&&(e.type=t.type),void 0===e.flatFee&&(e.flatFee=t.flatFee),e.type===q.keyreg&&void 0!==e.voteKey&&void 0===e.nonParticipation&&(e.nonParticipation=t.nonParticipation),void 0!==e.suggestedParams&&(e.genesisHash=e.suggestedParams.genesisHash,e.fee=e.suggestedParams.fee,void 0!==e.suggestedParams.flatFee&&(e.flatFee=e.suggestedParams.flatFee),e.firstRound=e.suggestedParams.firstRound,e.lastRound=e.suggestedParams.lastRound,e.genesisID=e.suggestedParams.genesisID),e.from=g7(e.from),void 0!==e.to&&(e.to=g7(e.to)),void 0!==e.closeRemainderTo&&(e.closeRemainderTo=g7(e.closeRemainderTo)),void 0!==e.assetManager&&(e.assetManager=g7(e.assetManager)),void 0!==e.assetReserve&&(e.assetReserve=g7(e.assetReserve)),void 0!==e.assetFreeze&&(e.assetFreeze=g7(e.assetFreeze)),void 0!==e.assetClawback&&(e.assetClawback=g7(e.assetClawback)),void 0!==e.assetRevocationTarget&&(e.assetRevocationTarget=g7(e.assetRevocationTarget)),void 0!==e.freezeAccount&&(e.freezeAccount=g7(e.freezeAccount)),void 0!==e.reKeyTo&&(e.reKeyTo=g7(e.reKeyTo)),void 0===e.genesisHash)throw Error("genesis hash must be specified and in a base64 string.");if(e.genesisHash=gj.Buffer.from(e.genesisHash,"base64"),void 0!==e.amount&&(!(Number.isSafeInteger(e.amount)||"bigint"==typeof e.amount&&e.amount<=BigInt("0xffffffffffffffff"))||e.amount<0))throw Error("Amount must be a positive number and smaller than 2^64-1. If the number is larger than 2^53-1, use bigint.");if(!Number.isSafeInteger(e.fee)||e.fee<0)throw Error("fee must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(e.firstRound)||e.firstRound<0)throw Error("firstRound must be a positive number");if(!Number.isSafeInteger(e.lastRound)||e.lastRound<0)throw Error("lastRound must be a positive number");if(void 0!==e.extraPages&&(!Number.isInteger(e.extraPages)||e.extraPages<0||e.extraPages>3))throw Error("extraPages must be an Integer between and including 0 to 3");
92if(void 0!==e.assetTotal&&(!(Number.isSafeInteger(e.assetTotal)||"bigint"==typeof e.assetTotal&&e.assetTotal<=BigInt("0xffffffffffffffff"))||e.assetTotal<0))throw Error("Total asset issuance must be a positive number and smaller than 2^64-1. If the number is larger than 2^53-1, use bigint.");if(void 0!==e.assetDecimals&&(!Number.isSafeInteger(e.assetDecimals)||e.assetDecimals<0||e.assetDecimals>19))throw Error("assetDecimals must be a positive number and smaller than 19");if(void 0!==e.assetIndex&&(!Number.isSafeInteger(e.assetIndex)||e.assetIndex<0))throw Error("Asset index must be a positive number and smaller than 2^53-1");if(void 0!==e.appIndex&&(!Number.isSafeInteger(e.appIndex)||e.appIndex<0))throw Error("Application index must be a positive number and smaller than 2^53-1");if(void 0!==e.appLocalInts&&(!Number.isSafeInteger(e.appLocalInts)||e.appLocalInts<0))throw Error("Application local ints count must be a positive number and smaller than 2^53-1");if(void 0!==e.appLocalByteSlices&&(!Number.isSafeInteger(e.appLocalByteSlices)||e.appLocalByteSlices<0))throw Error("Application local byte slices count must be a positive number and smaller than 2^53-1");if(void 0!==e.appGlobalInts&&(!Number.isSafeInteger(e.appGlobalInts)||e.appGlobalInts<0))throw Error("Application global ints count must be a positive number and smaller than 2^53-1");if(void 0!==e.appGlobalByteSlices&&(!Number.isSafeInteger(e.appGlobalByteSlices)||e.appGlobalByteSlices<0))throw Error("Application global byte slices count must be a positive number and smaller than 2^53-1");if(void 0!==e.appApprovalProgram&&e.appApprovalProgram.constructor!==Uint8Array)throw Error("appApprovalProgram must be a Uint8Array.");if(void 0!==e.appClearProgram&&e.appClearProgram.constructor!==Uint8Array)throw Error("appClearProgram must be a Uint8Array.");if(void 0!==e.appArgs){if(!Array.isArray(e.appArgs))throw Error("appArgs must be an Array of Uint8Array.");e.appArgs=e.appArgs.slice(),e.appArgs.forEach(e=>{if(e.constructor!==Uint8Array)throw Error("each element of AppArgs must be a Uint8Array.")})}else e.appArgs=[];if(void 0!==e.appAccounts){if(!Array.isArray(e.appAccounts))throw Error("appAccounts must be an Array of addresses.");e.appAccounts=e.appAccounts.map(e=>g7(e))}if(void 0!==e.appForeignApps){if(!Array.isArray(e.appForeignApps))throw Error("appForeignApps must be an Array of integers.");e.appForeignApps=e.appForeignApps.slice(),e.appForeignApps.forEach(e=>{if(!Number.isSafeInteger(e)||e<0)throw Error("each foreign application index must be a positive number and smaller than 2^53-1")})}if(void 0!==e.appForeignAssets){if(!Array.isArray(e.appForeignAssets))throw Error("appForeignAssets must be an Array of integers.");e.appForeignAssets=e.appForeignAssets.slice(),e.appForeignAssets.forEach(e=>{if(!Number.isSafeInteger(e)||e<0)throw Error("each foreign asset index must be a positive number and smaller than 2^53-1")})}if(void 0!==e.boxes){if(!Array.isArray(e.boxes))throw Error("boxes must be an Array of BoxReference.");e.boxes=e.boxes.slice(),e.boxes.forEach(e=>{if(!Number.isSafeInteger(e.appIndex)||e.name.constructor!==Uint8Array)throw Error("box app index must be a number and name must be an Uint8Array.")})}if(void 0!==e.assetMetadataHash&&0!==e.assetMetadataHash.length){if("string"==typeof e.assetMetadataHash&&(e.assetMetadataHash=new Uint8Array(gj.Buffer.from(e.assetMetadataHash))),e.assetMetadataHash.constructor!==Uint8Array||32!==e.assetMetadataHash.byteLength)throw Error("assetMetadataHash must be a 32 byte Uint8Array or string.");e.assetMetadataHash.every(e=>0===e)&&(e.assetMetadataHash=void 0)}else e.assetMetadataHash=void 0;if(void 0!==e.note){if(e.note.constructor!==Uint8Array)throw Error("note must be a Uint8Array.")}else e.note=new Uint8Array(0);if(void 0!==e.lease){if(e.lease.constructor!==Uint8Array)throw Error("lease must be a Uint8Array.");if(32!==e.lease.length)throw Error("lease must be of length 32.");e.lease.every(e=>0===e)&&(e.lease=new Uint8Array(0))}else e.lease=new Uint8Array(0);if(e.voteKey=ml(e.voteKey,"voteKey",32),e.selectionKey=ml(e.selectionKey,"selectionKey",32),e.stateProofKey=ml(e.stateProofKey,"stateProofKey",64),e.nonParticipation&&(e.voteKey||e.selectionKey||e.voteFirst||e.stateProofKey||e.voteLast||e.voteKeyDilution))throw Error("nonParticipation is true but participation params are present.");if(!e.nonParticipation&&(e.voteKey||e.selectionKey||e.stateProofKey||e.voteFirst||e.voteLast||e.voteKeyDilution)&&!(e.voteKey&&e.selectionKey&&e.voteFirst&&e.voteLast&&e.voteKeyDilution))throw Error("online key registration missing at least one of the following fields: voteKey, selectionKey, voteFirst, voteLast, voteKeyDilution");if(delete e.suggestedParams,Object.assign(this,function(e){let t={...e};
92return Object.keys(t).forEach(e=>{void 0===t[e]&&delete t[e]}),t}(e)),!e.flatFee&&(this.fee*=this.estimateSize(),this.fee<1e3&&(this.fee=1e3)),this.group=void 0,void 0!==e.stateProofType&&(!Number.isSafeInteger(e.stateProofType)||e.stateProofType<0))throw Error("State Proof type must be a positive number and smaller than 2^53-1");if(void 0!==e.stateProofMessage){if(e.stateProofMessage.constructor!==Uint8Array)throw Error("stateProofMessage must be a Uint8Array.")}else e.stateProofMessage=new Uint8Array(0);if(void 0!==e.stateProof){if(e.stateProof.constructor!==Uint8Array)throw Error("stateProof must be a Uint8Array.")}else e.stateProof=new Uint8Array(0)}get_obj_for_encoding(){if("pay"===this.type){let e={amt:this.amount,fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:gj.Buffer.from(this.note),snd:gj.Buffer.from(this.from.publicKey),type:"pay",gen:this.genesisID,gh:this.genesisHash,lx:gj.Buffer.from(this.lease),grp:this.group};return void 0!==this.closeRemainderTo&&"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ"!==me(this.closeRemainderTo.publicKey)&&(e.close=gj.Buffer.from(this.closeRemainderTo.publicKey)),void 0!==this.reKeyTo&&(e.rekey=gj.Buffer.from(this.reKeyTo.publicKey)),void 0!==this.to&&(e.rcv=gj.Buffer.from(this.to.publicKey)),e.note.length||delete e.note,e.amt||delete e.amt,e.fee||delete e.fee,e.fv||delete e.fv,e.gen||delete e.gen,void 0===e.grp&&delete e.grp,e.lx.length||delete e.lx,e.rekey||delete e.rekey,e}if("keyreg"===this.type){let e={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:gj.Buffer.from(this.note),snd:gj.Buffer.from(this.from.publicKey),type:this.t
92ype,gen:this.genesisID,gh:this.genesisHash,lx:gj.Buffer.from(this.lease),grp:this.group,votekey:this.voteKey,selkey:this.selectionKey,sprfkey:this.stateProofKey,votefst:this.voteFirst,votelst:this.voteLast,votekd:this.voteKeyDilution};return e.note.length||delete e.note,e.lx.length||delete e.lx,e.fee||delete e.fee,e.fv||delete e.fv,e.gen||delete e.gen,void 0===e.grp&&delete e.grp,void 0!==this.reKeyTo&&(e.rekey=gj.Buffer.from(this.reKeyTo.publicKey)),this.nonParticipation&&(e.nonpart=!0),e.selkey||delete e.selkey,e.votekey||delete e.votekey,e.sprfkey||delete e.sprfkey,e.votefst||delete e.votefst,e.votelst||delete e.votelst,e.votekd||delete e.votekd,e}if("acfg"===this.type){let e={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:gj.Buffer.from(this.note),snd:gj.Buffer.from(this.from.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:gj.Buffer.from(this.lease),grp:this.group,caid:this.assetIndex,apar:{t:this.assetTotal,df:this.assetDefaultFrozen,dc:this.assetDecimals}};return void 0!==this.assetManager&&(e.apar.m=gj.Buffer.from(this.assetManager.publicKey)),void 0!==this.assetReserve&&(e.apar.r=gj.Buffer.from(this.assetReserve.publicKey)),void 0!==this.assetFreeze&&(e.apar.f=gj.Buffer.from(this.assetFreeze.publicKey)),void 0!==this.assetClawback&&(e.apar.c=gj.Buffer.from(this.assetClawback.publicKey)),void 0!==this.assetName&&(e.apar.an=this.assetName),void 0!==this.assetUnitName&&(e.apar.un=this.assetUnitName),void 0!==this.assetURL&&(e.apar.au=this.assetURL),void 0!==this.assetMetadataHash&&(e.apar.am=gj.Buffer.from(this.assetMetadataHash)),e.note.length||delete e.note,e.lx.length||delete e.lx,e.amt||delete e.amt,e.fee||delete e.fee,e.fv||delete e.fv,e.gen||delete e.gen,void 0!==this.reKeyTo&&(e.rekey=gj.Buffer.from(this.reKeyTo.publicKey)),e.caid||delete e.caid,e.apar.t||e.apar.un||e.apar.an||e.apar.df||e.apar.m||e.apar.r||e.apar.f||e.apar.c||e.apar.au||e.apar.am||e.apar.dc?(e.apar.t||delete e.apar.t,e.apar.dc||delete e.apar.dc,e.apar.un||delete e.apar.un,e.apar.an||delete e.apar.an,e.apar.df||delete e.apar.df,e.apar.m||delete e.apar.m,e.apar.r||delete e.apar.r,e.apar.f||delete e.apar.f,e.apar.c||delete e.apar.c,e.apar.au||delete e.apar.au,e.apar.am||delete e.apar.am):delete e.apar,void 0===e.grp&&delete e.grp,e}if("axfer"===this.type){let e={aamt:this.amount,fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:gj.Buffer.from(this.note),snd:gj.Buffer.from(this.from.publicKey),arcv:gj.Buffer.from(this.to.publicKey),type:this.t
92ype,gen:this.genesisID,gh:this.genesisHash,lx:gj.Buffer.from(this.lease),grp:this.group,xaid:this.assetIndex};return void 0!==this.closeRemainderTo&&(e.aclose=gj.Buffer.from(this.closeRemainderTo.publicKey)),void 0!==this.assetRevocationTarget&&(e.asnd=gj.Buffer.from(this.assetRevocationTarget.publicKey)),e.note.length||delete e.note,e.lx.length||delete e.lx,e.aamt||delete e.aamt,e.amt||delete e.amt,e.fee||delete e.fee,e.fv||delete e.fv,e.gen||delete e.gen,void 0===e.grp&&delete e.grp,e.aclose||delete e.aclose,e.asnd||delete e.asnd,e.rekey||delete e.rekey,void 0!==this.reKeyTo&&(e.rekey=gj.Buffer.from(this.reKeyTo.publicKey)),e}if("afrz"===this.type){let e={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:gj.Buffer.from(this.note),snd:gj.Buffer.from(this.from.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:gj.Buffer.from(this.lease),grp:this.group,faid:this.assetIndex,afrz:this.freezeState};return void 0!==this.freezeAccount&&(e.fadd=gj.Buffer.from(this.freezeAccount.publicKey)),e.note.length||delete e.note,e.lx.length||delete e.lx,e.amt||delete e.amt,e.fee||delete e.fee,e.fv||delete e.fv,e.gen||delete e.gen,e.afrz||delete e.afrz,void 0===e.grp&&delete e.grp,void 0!==this.reKeyTo&&(e.rekey=gj.Buffer.from(this.reKeyTo.publicKey)),e}if("appl"===this.type){var e,t,r;let i={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:gj.Buffer.from(this.note),snd:gj.Buffer.from(this.from.publicKey),type:this.t
92ype,gen:this.genesisID,gh:this.genesisHash,lx:gj.Buffer.from(this.lease),grp:this.group,apid:this.appIndex,apan:this.appOnComplete,apls:{nui:this.appLocalInts,nbs:this.appLocalByteSlices},apgs:{nui:this.appGlobalInts,nbs:this.appGlobalByteSlices},apfa:this.appForeignApps,apas:this.appForeignAssets,apep:this.extraPages,apbx:(e=this.boxes,t=this.appForeignApps,r=this.appIndex,null==e?[]:e.map(e=>(function(e,t,r){let i=e.appIndex,n=e.name,a=0===i||i===r,s=0;if(null!=t&&(s=t.indexOf(i)+1),0===s&&!a)throw Error(`Box ref with appId ${i} not in foreign-apps`);return{i:s,n:n}})(e,t,r)))};for(let e of(void 0!==this.reKeyTo&&(i.rekey=gj.Buffer.from(this.reKeyTo.publicKey)),void 0!==this.appApprovalProgram&&(i.apap=gj.Buffer.from(this.appApprovalProgram)),void 0!==this.appClearProgram&&(i.apsu=gj.Buffer.from(this.appClearProgram)),void 0!==this.appArgs&&(i.apaa=this.appArgs.map(e=>gj.Buffer.from(e))),void 0!==this.appAccounts&&(i.apat=this.appAccounts.map(e=>gj.Buffer.from(e.publicKey))),i.note.length||delete i.note,i.lx.length||delete i.lx,i.amt||delete i.amt,i.fee||delete i.fee,i.fv||delete i.fv,i.gen||delete i.gen,i.apid||delete i.apid,i.apls.nui||delete i.apls.nui,i.apls.nbs||delete i.apls.nbs,i.apls.nui||i.apls.nbs||delete i.apls,i.apgs.nui||delete i.apgs.nui,i.apgs.nbs||delete i.apgs.nbs,i.apaa&&i.apaa.length||delete i.apaa,i.apgs.nui||i.apgs.nbs||delete i.apgs,i.apap||delete i.apap,i.apsu||delete i.apsu,i.apan||delete i.apan,i.apfa&&i.apfa.length||delete i.apfa,i.apas&&i.apas.length||delete i.apas,i.apbx))e.i||delete e.i,e.n&&e.n.length||delete e.n;return i.apbx&&i.apbx.length||delete i.apbx,i.apat&&i.apat.length||delete i.apat,i.apep||delete i.apep,void 0===i.grp&&delete i.grp,i}if("stpf"===this.type){let e={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:gj.Buffer.from(this.note),snd:gj.Buffer.from(this.from.publicKey),type:this.t
92ype,gen:this.genesisID,gh:this.genesisHash,lx:gj.Buffer.from(this.lease),sptype:this.stateProofType,spmsg:gj.Buffer.from(this.stateProofMessage),sp:gj.Buffer.from(this.stateProof)};return e.sptype||delete e.sptype,e.note.length||delete e.note,e.lx.length||delete e.lx,e.amt||delete e.amt,e.fee||delete e.fee,e.fv||delete e.fv,e.gen||delete e.gen,e.apid||delete e.apid,e.apaa&&e.apaa.length||delete e.apaa,e.apap||delete e.apap,e.apsu||delete e.apsu,e.apan||delete e.apan,e.apfa&&e.apfa.length||delete e.apfa,e.apas&&e.apas.length||delete e.apas,e.apat&&e.apat.length||delete e.apat,e.apep||delete e.apep,void 0===e.grp&&delete e.grp,e}}static from_obj_for_encoding(e){var t;let r=Object.create(this.prototype);if(r.name="Transaction",r.tag=gj.Buffer.from("TX"),r.genesisID=e.gen,r.genesisHash=gj.Buffer.from(e.gh),(t=e.type)!==q.pay&&t!==q.keyreg&&t!==q.acfg&&t!==q.axfer&&t!==q.afrz&&t!==q.appl&&t!==q.stpf)throw Error(`Unrecognized transaction type: ${e.type}`);return r.type=e.type,r.fee=e.fee,r.firstRound=e.fv,r.lastRound=e.lv,r.note=new Uint8Array(e.note),r.lease=new Uint8Array(e.lx),r.from=g7(me(new Uint8Array(e.snd))),void 0!==e.grp&&(r.group=gj.Buffer.from(e.grp)),void 0!==e.rekey&&(r.reKeyTo=g7(me(new Uint8Array(e.rekey)))),"pay"===e.type?(r.amount=e.amt,r.to=g7(me(new Uint8Array(e.rcv))),void 0!==e.close&&(r.closeRemainderTo=g7(me(e.close)))):"keyreg"===e.type?(void 0!==e.votekey&&(r.voteKey=gj.Buffer.from(e.votekey)),void 0!==e.selkey&&(r.selectionKey=gj.Buffer.from(e.selkey)),void 0!==e.sprfkey&&(r.stateProofKey=gj.Buffer.from(e.sprfkey)),void 0!==e.votekd&&(r.voteKeyDilution=e.votekd),void 0!==e.votefst&&(r.voteFirst=e.votefst),void 0!==e.votelst&&(r.voteLast=e.votelst),void 0!==e.nonpart&&(r.nonParticipation=e.nonpart)):"acfg"===e.type?(void 0!==e.caid&&(r.assetIndex=e.caid),void 0!==e.apar&&(r.assetTotal=e.apar.t,r.assetDefaultFrozen=e.apar.df,void 0!==e.apar.dc&&(r.assetDecimals=e.apar.dc),void 0!==e.apar.m&&(r.assetManager=g7(me(new Uint8Array(e.apar.m)))),void 0!==e.apar.r&&(r.assetReserve=g7(me(new Uint8Array(e.apar.r)))),void 0!==e.apar.f&&(r.assetFreeze=g7(me(new Uint8Array(e.apar.f)))),void 0!==e.apar.c&&(r.assetClawback=g7(me(new Uint8Array(e.apar.c)))),void 0!==e.apar.un&&(r.assetUnitName=e.apar.un),void 0!==e.apar.an&&(r.assetName=e.apar.an),void 0!==e.apar.au&&(r.assetURL=e.apar.au),void 0!==e.apar.am&&(r.assetMetadataHash=e.apar.am))):"axfer"===e.type?(void 0!==e.xaid&&(r.assetIndex=e.xaid),void 0!==e.aamt&&(r.amount=e.aamt),void 0!==e.aclose&&(r.closeRemainderTo=g7(me(new Uint8Array(e.aclose)))),void 0!==e.asnd&&(r.assetRevocationTarget=g7(me(new Uint8Array(e.asnd)))),r.to=g7(me(new Uint8Array(e.arcv)))):"afrz"===e.type?(void 0!==e.afrz&&(r.freezeState=e.afrz),void 0!==e.faid&&(r.assetIndex=e.faid),r.freezeAccount=g7(me(new Uint8Array(e.fadd)))):"appl"===e.type?(void 0!==e.apid&&(r.appIndex=e.apid),void 0!==e.apan&&(r.appOnComplete=e.apan),void 0!==e.apls&&(void 0!==e.apls.nui&&(r.appLocalInts=e.apls.nui),void 0!==e.apls.nbs&&(r.appLocalByteSlices=e.apls.nbs)),void 0!==e.apgs&&(void 0!==e.apgs.nui&&(r.appGlobalInts=e.apgs.nui),void 0!==e.apgs.nbs&&(r.appGlobalByteSlices=e.apgs.nbs)),void 0!==e.apep&&(r.extraPages=e.apep),void 0!==e.apap&&(r.appApprovalProgram=new Uint8Array(e.apap)),void 0!==e.apsu&&(r.appClearProgram=new Uint8Array(e.apsu)),void 0!==e.apaa&&(r.appArgs=e.apaa.map(e=>new Uint8Array(e))),void 0!==e.apat&&(r.appAccounts=e.apat.map(e=>g7(me(new Uint8Array(e))))),void 0!==e.apfa&&(r.appForeignApps=e.apfa),void 0!==e.apas&&(r.appForeignAssets=e.apas),void 0!==e.apbx&&(r.boxes=e.apbx.map(e=>({appIndex:e.i?r.appForeignApps[e.i-1]:0,name:e.n})))):"stpf"===e.type&&(void 0!==e.sptype&&(r.stateProofType=e.sptype),void 0!==e.sp&&(r.stateProof=e.sp),void 0!==e.spmsg&&(r.stateProofMessage=e.spmsg)),r}estimateSize(){return this.toByte().length+75}bytesToSign(){let e=this.toByte();return gj.Buffer.from(gG(this.tag,e))}toByte(){return ms(this.get_obj_for_encoding())}rawSignTxn(e){let t=gQ(this.bytesToSign(),e);return gj.Buffer.from(t)}signTxn(e){let t={sig:this.rawSignTxn(e),txn:this.get_obj_for_encoding()},r=gY(e).publicKey;return me(r)!==me(this.from.publicKey)&&(t.sgnr=gj.Buffer.from(r)),new Uint8Array(ms(t))}attachSignature(e,t){if(!gJ(t.length))throw Error("Invalid signature length");let r={sig:gj.Buffer.from(t),txn:this.get_obj_for_encoding()};if(e!==me(this.from.publicKey)){let t=g7(e).publicKey;r.sgnr=gj.Buffer.from(t)}return new Uint8Array(ms(r))}rawTxID(){let e=this.toByte(),t=gj.Buffer.from(gG(this.tag,e));return gj.Buffer.from(gZ(t))}txID(){let e=this.rawTxID();return g6.default.encode(e).slice(0,52)}addLease(e,t=0){let r;if(void 0!==e){if(e.constructor!==Uint8Array)throw Error("lease must be a Uint8Array.");if(32!==e.length)throw Error("lease must be of length 32.");r=new Uint8Array(e)}else r=new Uint8Array(0);this.lease=r,0!==t&&(this.fee+=37*t)}addRekey(e,t=0){void 0!==e&&(this.reKeyTo=g7(e)),0!==t&&(this.fee+=37*t)}_getDictForDisplay(){let e={...this};return e.tag=e.tag.toString(),e.from=me(e.from.publicKey),void 0!==e.to&&(e.to=me(e.to.publicKey)),void 0!==e.freezeAccount&&(e.freezeAccount=me(e.freezeAccount.publicKey)),void 0!==e.closeRemainderTo&&(e.closeRemainderTo=me(e.closeRemainderTo.publicKey)),void 0!==e.assetManager&&(e.assetManager=me(e.assetManager.publicKey)),void 0!==e.assetReserve&&(e.assetReserve=me(e.assetReserve.publicKey)),void 0!==e.assetFreeze&&(e.assetFreeze=me(e.assetFreeze.publicKey)),void 0!==e.assetClawback&&(e.assetClawback=me(e.assetClawback.publicKey)),void 0!==e.assetRevocationTarget&&(e.assetRevocationTarget=me(e.assetRevocationTarget.publicKey)),void 0!==e.reKeyTo&&(e.reKeyTo=me(e.reKeyTo.publicKey)),e.genesisHash=e.genesisHash.toString("base64"),e}prettyPrint(){console.log(this._getDictForDisplay())}toString(){return JSON.stringify(this._getDictForDisplay())}}function mc(e){return ms({txn:e.get_obj_for_encoding()})}function md(e){return ms(e.get_obj_for_encoding())}function mf(e){let t=mo(e);return mu.from_obj_for_encoding(t)}
92function mh(e){let t=mo(e);return{...t,txn:mu.from_obj_for_encoding(t.txn)}}function mp(e){return e instanceof mu?e:new mu(e)}e.s(["ALGORAND_MIN_TX_FEE",0,1e3,"Transaction",0,mu,"decodeSignedTransaction",0,mh,"decodeUnsignedTransaction",0,mf,"default",0,mu,"encodeUnsignedSimulateTransaction",0,mc,"encodeUnsignedTransaction",0,md,"instantiateTxnIfNeeded",0,mp],36651);class mg{constructor({bidderKey:e,bidAmount:t,bidID:r,auctionKey:i,auctionID:n,maxPrice:a}){this.name="Bid",this.tag=gj.Buffer.from([97,66]);const s=g7(e),o=g7(i);if(!Number.isSafeInteger(t)||t<0)throw Error("Bid amount must be positive and 2^53-1");if(!Number.isSafeInteger(r)||r<0)throw Error("BidID must be positive and 2^53-1");if(!Number.isSafeInteger(n)||n<0)throw Error("auctionID must be positive");Object.assign(this,{bidderKey:s,bidAmount:t,bidID:r,auctionKey:o,auctionID:n,maxPrice:a})}get_obj_for_encoding(){return{bidder:gj.Buffer.from(this.bidderKey.publicKey),cur:this.bidAmount,price:this.maxPrice,id:this.bidID,auc:gj.Buffer.from(this.auctionKey.publicKey),aid:this.auctionID}}signBid(e){let t=ms(this.get_obj_for_encoding()),r=gQ(gj.Buffer.from(gG(this.tag,t)),e);return new Uint8Array(ms({t:"b",b:{sig:gj.Buffer.from(r),bid:this.get_obj_for_encoding()}}))}}let mm="Microalgos should be positive and less than 2^53 - 1.";class my extends Error{constructor(e,t){super(e),this.response=t,this.name="URLTokenBaseHTTPError",this.response=t}}class mv{constructor(e,t,r,i={}){this.defaultHeaders=i;const n=new URL(t.endsWith("/")?t:`${t}/`);if(void 0!==r&&(n.port=r.toString()),0===n.protocol.length)throw Error("Invalid base server URL, protocol must be defined.");this.baseURL=n,this.tokenHeader=e}getURL(e,t){let r=new URL(e.startsWith("./")?e:e.startsWith("/")?`.${e}`:`./${e}`,this.baseURL);if(t)for(let[e,i]of Object.entries(t))r.searchParams.set(e,i);return r.toString()}static formatFetchResponseHeaders(e){let t={};return e.forEach((e,r)=>{t[e]=r}),t}static async checkHttpError(e){if(e.ok)return;let t=null,r=null;try{t=new Uint8Array(await e.arrayBuffer());let i=JSON.parse(gj.Buffer.from(t).toString());i.message&&(r=i.message)}catch(e){}let i=`Network request error. Received status ${e.status} (${e.statusText})`;throw r&&(i+=`: ${r}`),new my(i,{body:t,status:e.status,headers:mv.formatFetchResponseHeaders(e.headers)})}static async formatFetchResponse(e){return await this.checkHttpError(e),{body:new Uint8Array(await e.arrayBuffer()),status:e.status,headers:mv.formatFetchResponseHeaders(e.headers)}}async get(e,t,r={}){let i={...this.tokenHeader,...this.defaultHeaders,...r},n=await fetch(this.getURL(e,t),{headers:i});return mv.formatFetchResponse(n)}async post(e,t,r,i={}){let n={...this.tokenHeader,...this.defaultHeaders,...i},a=await fetch(this.getURL(e,r),{method:"POST",body:t,headers:n});return mv.formatFetchResponse(a)}async delete(e,t,r,i={}){let n={...this.tokenHeader,...this.defaultHeaders,...i},a=await fetch(this.getURL(e,r),{method:"DELETE",body:t,headers:n});return mv.formatFetchResponse(a)}}function mb(e){return Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{})}class mw{constructor(e,t,r,i={}){void 0!==t?this.bc=new mv(e,t,r,i):this.bc=e}static parseJSON(e,t,r={}){try{let t;if(0===Object.keys(r).length)return e&&JSON.parse(e);return e&&(t=r&&r.intDecoding?r.intDecoding:gq.DEFAULT,gW.parse(e,(e,r)=>{if(null!=r&&"object"==typeof r&&null==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,Object.prototype),"bigint"==typeof r){if("safe"===t&&r>Number.MAX_SAFE_INTEGER)throw Error(`Integer exceeds maximum safe integer: ${r.toString()}. Try parsing with a different intDecoding option.`);return"bigint"===t||"mixed"===t&&r>Number.MAX_SAFE_INTEGER?r:Number(r)}return"number"==typeof r&&"bigint"===t&&Number.isInteger(r)?BigInt(r):r}))}catch(r){throw r.rawResponse=e||null,r.statusCode=t,r}}static serializeData(e,t){if(!e)return new Uint8Array(0);if("application/json"===t["content-type"])return new Uint8Array(gj.Buffer.from(JSON.stringify(e)));if("string"==typeof e)return new Uint8Array(gj.Buffer.from(e));if(e instanceof Uint8Array)return e;throw Error("provided data is neither a string nor a Uint8Array and content-type is not application/json")}static prepareResponse(e,t,r,i={}){let n,{body:a}=e;return"application/msgpack"!==t&&(n=a&&gj.Buffer.from(a).toString()||""),r&&"application/json"===t&&(
92a=mw.parseJSON(n,e.status,i)),{...e,body:a,text:n,ok:2===Math.trunc(e.status/100)}}static prepareResponseError(e){return e.response&&(e.response=mw.prepareResponse(e.response,"application/json",!0),e.status=e.response.status),e}async get(e,t,r={},i={},n=!0){let a=void 0!==t&&Object.prototype.hasOwnProperty.call(t,"format")&&"msgpack"===t.format?"application/msgpack":"application/json",s={...r,accept:a};try{let r=await this.bc.get(e,function(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(!e[t]||0===e[t].length)&&delete e[t];return e}(t),s);return mw.prepareResponse(r,a,n,i)}catch(e){throw mw.prepareResponseError(e)}}async post(e,t,r={},i,n=!0){let a={"content-type":"application/json",...mb(r)};try{let r=await this.bc.post(e,mw.serializeData(t,a),i,a);return mw.prepareResponse(r,"application/json",n)}catch(e){throw mw.prepareResponseError(e)}}async delete(e,t,r={},i=!0){let n={"content-type":"application/json",...mb(r)},a=await this.bc.delete(e,mw.serializeData(t,n),void 0,n);return mw.prepareResponse(a,"application/json",i)}}class m_{constructor(e,t,r,i,n={}){if(function(e){return"function"==typeof e.get}(t))this.c=new mw(t);else{let a;a="string"==typeof t?function(e="",t){let r={};return""===e||(r[t]=e),r}(t,e):t,this.c=new mw(a,r,i,n)}this.intDecoding=gq.DEFAULT}setIntEncoding(e){this.intDecoding=e}getIntEncoding(){return this.intDecoding}}class mA{get_obj_for_encoding(e=!1){let t={};for(let r of Object.keys(this.attribute_map)){let i=this.attribute_map[r],n=this[r];void 0!==n&&(t[i]=null===n?null:function e(t,r){let i;if(t instanceof Uint8Array)i=r?t:gj.Buffer.from(t).toString("base64");else if("function"==typeof t.get_obj_for_encoding)i=t.get_obj_for_encoding(r);else if(Array.isArray(t))for(let n of(i=[],t))i.push(e(n,r));else if("object"==typeof t){let n={};for(let i of Object.keys(t))n[i]=e(t[i],r);i=n}else if(void 0===t||null==t||"object"!=typeof t&&"function"!=typeof t)i=t;else throw Error(`Unsupported value: ${String(t)}`);return i}(n,e))}return t}}class mS extends mA{constructor({address:e,amount:t,amountWithoutPendingRewards:r,minBalance:i,pendingRewards:n,rewards:a,round:s,status:o,totalAppsOptedIn:l,totalAssetsOptedIn:u,totalCreatedApps:c,totalCreatedAssets:d,appsLocalState:f,appsTotalExtraPages:h,appsTotalSchema:p,assets:g,authAddr:m,createdApps:y,createdAssets:v,participation:b,rewardBase:w,sigType:_,totalBoxBytes:A,totalBoxes:S}){super(),this.address=e,this.amount=t,this.amountWithoutPendingRewards=r,this.minBalance=i,this.pendingRewards=n,this.rewards=a,this.round=s,this.status=o,this.totalAppsOptedIn=l,this.totalAssetsOptedIn=u,this.totalCreatedApps=c,this.totalCreatedAssets=d,this.appsLocalState=f,this.appsTotalExtraPages=h,this.appsTotalSchema=p,this.assets=g,this.authAddr=m,this.createdApps=y,this.createdAssets=v,this.participation=b,this.rewardBase=w,this.sigType=_,this.totalBoxBytes=A,this.totalBoxes=S,this.attribute_map={address:"address",amount:"amount",amountWithoutPendingRewards:"amount-without-pending-rewards",minBalance:"min-balance",pendingRewards:"pending-rewards",rewards:"rewards",round:"round",status:"status",totalAppsOptedIn:"total-apps-opted-in",totalAssetsOptedIn:"total-assets-opted-in",totalCreatedApps:"total-created-apps",totalCreatedAssets:"total-created-assets",appsLocalState:"apps-local-state",appsTotalExtraPages:"apps-total-extra-pages",appsTotalSchema:"apps-total-schema",assets:"assets",authAddr:"auth-addr",createdApps:"created-apps",createdAssets:"created-assets",participation:"participation",rewardBase:"reward-base",sigType:"sig-type",totalBoxBytes:"total-box-bytes",totalBoxes:"total-boxes"}}static from_obj_for_encoding(e){if(void 0===e.address)throw Error(`Response is missing required field 'address': ${e}`);if(void 0===e.amount)throw Error(`Response is missing required field 'amount': ${e}`);if(void 0===e["amount-without-pending-rewards"])throw Error(`Response is missing required field 'amount-without-pending-rewards': ${e}`);if(void 0===e["min-balance"])throw Error(`Response is missing required field 'min-balance': ${e}`);if(void 0===e["pending-rewards"])throw Error(`Response is missing required field 'pending-rewards': ${e}`);if(void 0===e.rewards)throw Error(`Response is missing required field 'rewards': ${e}`);if(void 0===e.round)throw Error(`Response is missing required field 'round': ${e}`);if(void 0===e.status)throw Error(`Response is missing required field 'status': ${e}`);if(void 0===e["total-apps-opted-in"])throw Error(`Response is missing required field 'total-apps-opted-in': ${e}`);if(void 0===e["total-assets-opted-in"])throw Error(`Response is missing required field 'total-assets-opted-in': ${e}`);if(void 0===e["total-created-apps"])throw Error(`Response is missing required field 'total-created-apps': ${e}`);if(void 0===e["total-created-assets"])throw Error(`Response is missing required field 'total-created-assets': ${e}`);return new mS({address:e.address,amount:e.amount,amountWithoutPendingRewards:e["amount-without-pending-rewards"],minBalance:e["min-balance"],pendingRewards:e["pending-rewards"],rewards:e.rewards,round:e.round,status:e.status,totalAppsOptedIn:e["total-apps-opted-in"],totalAssetsOptedIn:e["total-assets-opted-in"],totalCreatedApps:e["total-created-apps"],totalCreatedAssets:e["total-created-assets"],appsLocalState:void 0!==e["apps-local-state"]?e["apps-local-state"].map(mP.from_obj_for_encoding):void 0,appsTotalExtraPages:e["apps-total-extra-pages"],appsTotalSchema:void 0!==e["apps-total-schema"]?m$.from_obj_for_encoding(e["apps-total-schema"]):void 0,assets:void 0!==e.assets?e.assets.map(mL.from_obj_for_encoding):void 0,authAddr:e["auth-addr"],createdApps:void 0!==e["created-apps"]?e["created-apps"].map(mk.from_obj_for_encoding):void 0,createdAssets:void 0!==e["created-assets"]?e["created-assets"].map(mB.from_obj_for_encoding):void 0,participation:void 0!==e.participation?mT.from_obj_for_encoding(e.participation):void 0,rewardBase:e["reward-base"],sigType:e["sig-type"],totalBoxBytes:e["total-box-bytes"],totalBoxes:e["total-boxes"]})}}class mE extends mA{constructor({round:e,appLocalState:t,createdApp:r}){super(),this.round=e,this.appLocalState=t,this.createdApp=r,this.attribute_map={round:"roun
92d",appLocalState:"app-local-state",createdApp:"created-app"}}static from_obj_for_encoding(e){if(void 0===e.round)throw Error(`Response is missing required field 'round': ${e}`);return new mE({round:e.round,appLocalState:void 0!==e["app-local-state"]?mP.from_obj_for_encoding(e["app-local-state"]):void 0,createdApp:void 0!==e["created-app"]?mD.from_obj_for_encoding(e["created-app"]):void 0})}}class mx extends mA{constructor({round:e,assetHolding:t,createdAsset:r}){super(),this.round=e,this.assetHolding=t,this.createdAsset=r,this.attribute_map={round:"round",assetHolding:"asset-holding",createdAsset:"created-asset"}}static from_obj_for_encoding(e){if(void 0===e.round)throw Error(`Response is missing required field 'round': ${e}`);return new mx({round:e.round,assetHolding:void 0!==e["asset-holding"]?mL.from_obj_for_encoding(e["asset-holding"]):void 0,createdAsset:void 0!==e["created-asset"]?mF.from_obj_for_encoding(e["created-asset"]):void 0})}}class mT extends mA{constructor({selectionParticipationKey:e,voteFirstValid:t,voteKeyDilution:r,voteLastValid:i,voteParticipationKey:n,stateProofKey:a}){super(),this.selectionParticipationKey="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.voteFirstValid=t,this.voteKeyDilution=r,this.voteLastValid=i,this.voteParticipationKey="string"==typeof n?new Uint8Array(gj.Buffer.from(n,"base64")):n,this.stateProofKey="string"==typeof a?new Uint8Array(gj.Buffer.from(a,"base64")):a,this.attribute_map={selectionParticipationKey:"selection-participation-key",voteFirstValid:"vote-first-valid",voteKeyDilution:"vote-key-dilution",voteLastValid:"vote-last-valid",voteParticipationKey:"vote-participation-key",stateProofKey:"state-proof-key"}}static from_obj_for_encoding(e){if(void 0===e["selection-participation-key"])throw Error(`Response is missing required field 'selection-participation-key': ${e}`);if(void 0===e["vote-first-valid"])throw Error(`Response is missing required field 'vote-first-valid': ${e}`);if(void 0===e["vote-key-dilution"])throw Error(`Response is missing required field 'vote-key-dilution': ${e}`);if(void 0===e["vote-last-valid"])throw Error(`Response is missing required field 'vote-last-valid': ${e}`);if(void 0===e["vote-participation-key"])throw Error(`Response is missing required field 'vote-participation-key': ${e}`);return new mT({selectionParticipationKey:e["selection-participation-key"],voteFirstValid:e["vote-first-valid"],voteKeyDilution:e["vote-key-dilution"],voteLastValid:e["vote-last-valid"],voteParticipationKey:e["vote-participation-key"],stateProofKey:e["state-proof-key"]})}}class mI extends mA{constructor({address:e,delta:t}){super(),this.address=e,this.delta=t,this.attribute_map={address:"address",delta:"delta"}}static from_obj_for_encoding(e){if(void 0===e.address)throw Error(`Response is missing required field 'address': ${e}`);if(!Array.isArray(e.delta))throw Error(`Response is missing required array field 'delta': ${e}`);return new mI({address:e.address,delta:e.delta.map(m4.from_obj_for_encoding)})}}class mk extends mA{constructor({id:e,params:t}){super(),this.id=e,this.params=t,this.attribute_map={id:"id",params:"params"}}static from_obj_for_encoding(e){if(void 0===e.id)throw Error(`Response is missing required field 'id': ${e}`);if(void 0===e.params)throw Error(`Response is missing required field 'params': ${e}`);return new mk({id:e.id,params:mD.from_obj_for_encoding(e.params)})}}class mO extends mA{constructor({id:e,appBoxes:t,appGlobals:r,appLocals:i}){super(),this.id=e,this.appBoxes=t,this.appGlobals=r,this.appLocals=i,this.attribute_map={id:"id",appBoxes:"app-boxes",appGlobals:"app-globals",appLocals:"app-locals"}}static from_obj_for_encoding(e){if(void 0===e.id)throw Error(`Response is missing required field 'id': ${e}`);return new mO({id:e.id,appBoxes:void 0!==e["app-boxes"]?mC.from_obj_for_encoding(e["app-boxes"]):void 0,appGlobals:void 0!==e["app-globals"]?mC.from_obj_for_encoding(e["app-globals"]):void 0,appLocals:void 0!==e["app-locals"]?e["app-locals"].map(mC.from_obj_for_encoding):void 0})}}class mC extends mA{constructor({kvs:e,account:t}){super(),this.kvs=e,this.account=t,this.attribute_map={kvs:"kvs",account:"account"}}static from_obj_for_encoding(e){if(!Array.isArray(e.kvs))throw Error(`Response is missing required array field 'kvs': ${e}`);return new mC({kvs:e.kvs.map(mM.from_obj_for_encoding),account:e.account})}}class mN extends mA{constructor({account:e,app:t}){super(),this.account=e,this.app=t,this.attribute_map={account:"account",app:"app"}}static from_obj_for_encoding(e){if(void 0===e.account)throw Error(`Response is missing required field 'account': ${e}`);if(void 0===e.app)throw Error(`Response is missing required field 'app': ${e}`);return new mN({account:e.account,app:e.app})}}class mP extends mA{constructor({id:e,schema:t,keyValue:r}){super(),this.id=e,this.schema=t,this.keyValue=r,this.attribute_map={id:"id",schema:"schema",keyValue:"key-value"}}static from_obj_for_encoding(e){if(void 0===e.id)throw Error(`Response is missing required field 'id': ${e}`);if(void 0===e.schema)throw Error(`Response is missing required field 'schema': ${e}`);return new mP({id:e.id,schema:m$.from_obj_for_encoding(e.schema),keyValue:void 0!==e["key-value"]?e["key-value"].map(yw.from_obj_for_encoding):void 0})}}class mD extends mA{constructor({approvalProgram:e,clearStateProgram:t,creator:r,extraProgramPages:i,globalState:n,globalStateSchema:a,localStateSchema:s}){super(),this.approvalProgram="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.clearStateProgram="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.creator=r,this.extraProgramPages=i,this.globalState=n,this.globalStateSchema=a,this.localStateSchema=s,this.attribute_map={approvalProgram:"approval-program",clearStateProgram:"clear-state-program",creator:"creator",extraProgramPages:"extra-program-pages",globalState:"global-state",globalStateSchema:"global-state-schema",localStateSchema:"local-state-schema"}}static from_obj_for_encoding(e){if(void 0===e["approval-program"])throw Error(`Response is missing required field 'approval-program': ${e}`);if(void 0===e["clear-state-program"])throw Error(`Response is missing required field 'clear-state-program': ${e}`);if(void 0===e.creator)throw Error(`Response is missing required field 'creator': ${e}`);return new mD({approvalProgram:e["approval-program"],clearStateProgram:e["clear-state-program"],creator:e.creator,extraProgramPages:e["extra-program-pages"],globalState:void 0!==e["global-state"]?e["global-state"].map(yw.from_obj_for_encoding):void 0,globalStateSchema:void 0!==e["global-state-schema"]?m$.from_obj_for_encoding(e["global-state-schema"]):void 0,localStateSchema:void 0!==e["local-state-schema"]?m$.from_obj_for_encoding(e["local-state-schema"]):void 0})}}class mR extends mA{constructor({appStateType:e,key:t,operation:r,account:i,newValue:n}){super(),this.appStateType=e,this.key="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.operation=r,this.account=i,this.newValue=n,this.attribute_map={appStateType:"app-state-type",key:"key",operation:"operation",account:"account",newValue:"new-value"}}static from_obj_for_encoding(e){if(void 0===e["app-state-type"])throw Error(`Response is missing required field 'app-state-type': ${e}`);if(void 0===e.key)throw Error(`Response is missing required field 'key': ${e}`);if(void 0===e.operation)throw Error(`Response is missing required field 'operation': ${e}`);return new mR({appStateType:e["app-state-type"],key:e.key,operation:e.operation,account:e.account,newValue:void 0!==e["new-value"]?mj.from_obj_for_encoding(e["new-value"]):void 0})}}class m$ extends mA{constructor({numUint:e,numByteSlice:t}
92){super(),this.numUint=e,this.numByteSlice=t,this.attribute_map={numUint:"num-uint",numByteSlice:"num-byte-slice"}}static from_obj_for_encoding(e){if(void 0===e["num-uint"])throw Error(`Response is missing required field 'num-uint': ${e}`);if(void 0===e["num-byte-slice"])throw Error(`Response is missing required field 'num-byte-slice': ${e}`);return new m$({numUint:e["num-uint"],numByteSlice:e["num-byte-slice"]})}}class mB extends mA{constructor({index:e,params:t}){super(),this.index=e,this.params=t,this.attribute_map={index:"index",params:"params"}}static from_obj_for_encoding(e){if(void 0===e.index)throw Error(`Response is missing required field 'index': ${e}`);if(void 0===e.params)throw Error(`Response is missing required field 'params': ${e}`);return new mB({index:e.index,params:mF.from_obj_for_encoding(e.params)})}}class mL extends mA{constructor({amount:e,assetId:t,isFrozen:r}){super(),this.amount=e,this.assetId=t,this.isFrozen=r,this.attribute_map={amount:"amount",assetId:"asset-id",isFrozen:"is-frozen"}}static from_obj_for_encoding(e){if(void 0===e.amount)throw Error(`Response is missing required field 'amount': ${e}`);if(void 0===e["asset-id"])throw Error(`Response is missing required field 'asset-id': ${e}`);if(void 0===e["is-frozen"])throw Error(`Response is missing required field 'is-frozen': ${e}`);return new mL({amount:e.amount,assetId:e["asset-id"],isFrozen:e["is-frozen"]})}}class mU extends mA{constructor({account:e,asset:t}){super(),this.account=e,this.asset=t,this.attribute_map={account:"account",asset:"asset"}}static from_obj_for_encoding(e){if(void 0===e.account)throw Error(`Response is missing required field 'account': ${e}`);if(void 0===e.asset)throw Error(`Response is missing required field 'asset': ${e}`);return new mU({account:e.account,asset:e.asset})}}class mF extends mA{constructor({creator:e,decimals:t,total:r,clawback:i,defaultFrozen:n,freeze:a,manager:s,metadataHash:o,name:l,nameB64:u,reserve:c,unitName:d,unitNameB64:f,url:h,urlB64:p}){super(),this.creator=e,this.decimals=t,this.total=r,this.clawback=i,this.defaultFrozen=n,this.freeze=a,this.manager=s,this.metadataHash="string"==typeof o?new Uint8Array(gj.Buffer.from(o,"base64")):o,this.name=l,this.nameB64="string"==typeof u?new Uint8Array(gj.Buffer.from(u,"base64")):u,this.reserve=c,this.unitName=d,this.unitNameB64="string"==typeof f?new Uint8Array(gj.Buffer.from(f,"base64")):f,this.url=h,this.urlB64="string"==typeof p?new Uint8Array(gj.Buffer.from(p,"base64")):p,this.attribute_map={creator:"creator",decimals:"decimals",total:"total",clawback:"clawback",defaultFrozen:"default-frozen",freeze:"freeze",manager:"manager",metadataHash:"metadata-hash",name:"name",nameB64:"name-b64",reserve:"reserve",unitName:"unit-name",unitNameB64:"unit-name-b64",url:"url",urlB64:"url-b64"}}static from_obj_for_encoding(e){if(void 0===e.creator)throw Error(`Response is missing required field 'creator': ${e}`);if(void 0===e.decimals)throw Error(`Response is missing required field 'decimals': ${e}`);if(void 0===e.total)throw Error(`Response is missing required field 'total': ${e}`);return new mF({creator:e.creator,decimals:e.decimals,total:e.total,clawback:e.clawback,defaultFrozen:e["default-frozen"],freeze:e.freeze,manager:e.manager,metadataHash:e["metadata-hash"],name:e.name,nameB64:e["name-b64"],reserve:e.reserve,unitName:e["unit-name"],unitNameB64:e["unit-name-b64"],url:e.url,urlB64:e["url-b64"]})}}class mM extends mA{constructor({key:e,value:t}){super(),this.key="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.value=t,this.attribute_map={key:"key",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.key)throw Error(`Response is missing required field 'key': ${e}`);if(void 0===e.value)throw Error(`Response is missing required field 'value': ${e}`);return new mM({key:e.key,value:mj.from_obj_for_encoding(e.value)})}}class mj extends mA{constructor({type:e,bytes:t,uint:r}){super(),this.type=e,this.bytes="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.uint=r,this.attribute_map={type:"type",bytes:"bytes",uint:"uint"}}static from_obj_for_encoding(e){if(void 0===e.type)throw Error(`Response is missing required field 'type': ${e}`);return new mj({type:e.type,bytes:e.bytes,uint:e.uint})}}class mz extends mA{constructor({blockhash:e}){super(),this.blockhash=e,this.attribute_map={blockhash:"blockHash"}}static from_obj_for_encoding(e){if(void 0===e.blockHash)throw Error(`Response is missing required field 'blockHash': ${e}`);return new mz({blockhash:e.blockHash})}}class mV extends mA{constructor({block:e,cert:t}){super(),this.block=e,this.cert=t,this.attribute_map={block:"block",cert:"cert"}}static from_obj_for_encoding(e){if(void 0===e.block)throw Error(`Response is missing required field 'block': ${e}`);return new mV({block:e.block,cert:e.cert})}}class mH extends mA{constructor({blocktxids:e}){super(),this.blocktxids=e,this.attribute_map={blocktxids:"blockTxids"}}static from_obj_for_encoding(e){if(!Array.isArray(e.blockTxids))throw Error(`Response is missing required array field 'blockTxids': ${e}`);return new mH({blocktxids:e.blockTxids})}}class mq extends mA{constructor({name:e,round:t,value:r}){super(),this.name="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.round=t,this.value="string"==typeof r?new Uint8Array(gj.Buffer.from(r,"base64")):r,this.attribute_map={name:"name",round:"roun
92d",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.name)throw Error(`Response is missing required field 'name': ${e}`);if(void 0===e.round)throw Error(`Response is missing required field 'round': ${e}`);if(void 0===e.value)throw Error(`Response is missing required field 'value': ${e}`);return new mq({name:e.name,round:e.round,value:e.value})}}class mW extends mA{constructor({name:e}){super(),this.name="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.attribute_map={name:"name"}}static from_obj_for_encoding(e){if(void 0===e.name)throw Error(`Response is missing required field 'name': ${e}`);return new mW({name:e.name})}}class mK extends mA{constructor({app:e,name:t}){super(),this.app=e,this.name="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.attribute_map={app:"app",name:"name"}}static from_obj_for_encoding(e){if(void 0===e.app)throw Error(`Response is missing required field 'app': ${e}`);if(void 0===e.name)throw Error(`Response is missing required field 'name': ${e}`);return new mK({app:e.app,name:e.name})}}class mG extends mA{constructor({boxes:e}){super(),this.boxes=e,this.attribute_map={boxes:"boxes"}}static from_obj_for_encoding(e){if(!Array.isArray(e.boxes))throw Error(`Response is missing required array field 'boxes': ${e}`);return new mG({boxes:e.boxes.map(mW.from_obj_for_encoding)})}}class mZ extends mA{constructor({branch:e,buildNumber:t,channel:r,commitHash:i,major:n,minor:a}){super(),this.branch=e,this.buildNumber=t,this.channel=r,this.commitHash=i,this.major=n,this.minor=a,this.attribute_map={branch:"branch",buildNumber:"build_number",channel:"channel",commitHash:"commit_hash",major:"major",minor:"minor"}}static from_obj_for_encoding(e){if(void 0===e.branch)throw Error(`Response is missing required field 'branch': ${e}`);if(void 0===e.build_number)throw Error(`Response is missing required field 'build_number': ${e}`);if(void 0===e.channel)throw Error(`Response is missing required field 'channel': ${e}`);if(void 0===e.commit_hash)throw Error(`Response is missing required field 'commit_hash': ${e}`);if(void 0===e.major)throw Error(`Response is missing required field 'major': ${e}`);if(void 0===e.minor)throw Error(`Response is missing required field 'minor': ${e}`);return new mZ({branch:e.branch,buildNumber:e.build_number,channel:e.channel,commitHash:e.commit_hash,major:e.major,minor:e.minor})}}class mX extends mA{constructor({hash:e,result:t,sourcemap:r}){super(),this.hash=e,this.result=t,this.sourcemap=r,this.attribute_map={hash:"hash",result:"result",sourcemap:"sourcemap"}}static from_obj_for_encoding(e){if(void 0===e.hash)throw Error(`Response is missing required field 'hash': ${e}`);if(void 0===e.result)throw Error(`Response is missing required field 'result': ${e}`);return new mX({hash:e.hash,result:e.result,sourcemap:e.sourcemap})}}class mJ extends mA{constructor({result:e}){super(),this.result=e,this.attribute_map={result:"result"}}static from_obj_for_encoding(e){if(void 0===e.result)throw Error(`Response is missing required field 'result': ${e}`);return new mJ({result:e.result})}}class mY extends mA{constructor({accounts:e,apps:t,latestTimestamp:r,protocolVersion:i,round:n,sources:a,txns:s}){super(),this.accounts=e,this.apps=t,this.latestTimestamp=r,this.protocolVersion=i,this.round=n,this.sources=a,this.txns=s,this.attribute_map={accounts:"accounts",apps:"apps",latestTimestamp:"latest-timestamp",protocolVersion:"protocol-version",round:"round",sources:"sources",txns:"txns"}}static from_obj_for_encoding(e){if(!Array.isArray(e.accounts))throw Error(`Response is missing required array field 'accounts': ${e}`);if(!Array.isArray(e.apps))throw Error(`Response is missing required array field 'apps': ${e}`);if(void 0===e["latest-timestamp"])throw Error(`Response is missing required field 'latest-timestamp': ${e}`);if(void 0===e["protocol-version"])throw Error(`Response is missing required field 'protocol-version': ${e}`);if(void 0===e.round)throw Error(`Response is missing required field 'round': ${e}`);if(!Array.isArray(e.sources))throw Error(`Response is missing required array field 'sources': ${e}`);if(!Array.isArray(e.txns))throw Error(`Response is missing required array field 'txns': ${e}`);return new mY({accounts:e.accounts.map(mS.from_obj_for_encoding),apps:e.apps.map(mk.from_obj_for_encoding),latestTimestamp:e["latest-timestamp"],protocolVersion:e["protocol-version"],round:e.round,sources:e.sources.map(m0.from_obj_for_encoding),txns:e.txns})}}class mQ extends mA{constructor({error:e,protocolVersion:t,txns:r}){super(),this.error=e,this.protocolVersion=t,this.txns=r,this.attribute_map={error:"error",protocolVersion:"protocol-version",txns:"txns"}}static from_obj_for_encoding(e){if(void 0===e.error)throw Error(`Response is missing required field 'error': ${e}`);if(void 0===e["protocol-version"])throw Error(`Response is missing required field 'protocol-version': ${e}`);if(!Array.isArray(e.txns))throw Error(`Response is missing required array field 'txns': ${e}`);return new mQ({error:e.error,protocolVersion:e["protocol-version"],txns:e.txns.map(m2.from_obj_for_encoding)})}}
92class m0 extends mA{constructor({fieldName:e,source:t,txnIndex:r,appIndex:i}){super(),this.fieldName=e,this.source=t,this.txnIndex=r,this.appIndex=i,this.attribute_map={fieldName:"field-name",source:"source",txnIndex:"txn-index",appIndex:"app-index"}}static from_obj_for_encoding(e){if(void 0===e["field-name"])throw Error(`Response is missing required field 'field-name': ${e}`);if(void 0===e.source)throw Error(`Response is missing required field 'source': ${e}`);if(void 0===e["txn-index"])throw Error(`Response is missing required field 'txn-index': ${e}`);if(void 0===e["app-index"])throw Error(`Response is missing required field 'app-index': ${e}`);return new m0({fieldName:e["field-name"],source:e.source,txnIndex:e["txn-index"],appIndex:e["app-index"]})}}class m1 extends mA{constructor({line:e,pc:t,stack:r,error:i,scratch:n}){super(),this.line=e,this.pc=t,this.stack=r,this.error=i,this.scratch=n,this.attribute_map={line:"line",pc:"pc",stack:"stack",error:"error",scratch:"scratch"}}static from_obj_for_encoding(e){if(void 0===e.line)throw Error(`Response is missing required field 'line': ${e}`);if(void 0===e.pc)throw Error(`Response is missing required field 'pc': ${e}`);if(!Array.isArray(e.stack))throw Error(`Response is missing required array field 'stack': ${e}`);return new m1({line:e.line,pc:e.pc,stack:e.stack.map(y_.from_obj_for_encoding),error:e.error,scratch:void 0!==e.scratch?e.scratch.map(y_.from_obj_for_encoding):void 0})}}class m2 extends mA{constructor({disassembly:e,appCallMessages:t,appCallTrace:r,budgetAdded:i,budgetConsumed:n,globalDelta:a,localDeltas:s,logicSigDisassembly:o,logicSigMessages:l,logicSigTrace:u,logs:c}){super(),this.disassembly=e,this.appCallMessages=t,this.appCallTrace=r,this.budgetAdded=i,this.budgetConsumed=n,this.globalDelta=a,this.localDeltas=s,this.logicSigDisassembly=o,this.logicSigMessages=l,this.logicSigTrace=u,this.logs=c,this.attribute_map={disassembly:"disassembly",appCallMessages:"app-call-messages",appCallTrace:"app-call-trace",budgetAdded:"budget-added",budgetConsumed:"budget-consumed",globalDelta:"global-delta",localDeltas:"local-deltas",logicSigDisassembly:"logic-sig-disassembly",logicSigMessages:"logic-sig-messages",logicSigTrace:"logic-sig-trace",logs:"logs"}}static from_obj_for_encoding(e){if(!Array.isArray(e.disassembly))throw Error(`Response is missing required array field 'disassembly': ${e}`);return new m2({disassembly:e.disassembly,appCallMessages:e["app-call-messages"],appCallTrace:void 0!==e["app-call-trace"]?e["app-call-trace"].map(m1.from_obj_for_encoding):void 0,budgetAdded:e["budget-added"],budgetConsumed:e["budget-consumed"],globalDelta:void 0!==e["global-delta"]?e["global-delta"].map(m4.from_obj_for_encoding):void 0,localDeltas:void 0!==e["local-deltas"]?e["local-deltas"].map(mI.from_obj_for_encoding):void 0,logicSigDisassembly:e["logic-sig-disassembly"],logicSigMessages:e["logic-sig-messages"],logicSigTrace:void 0!==e["logic-sig-trace"]?e["logic-sig-trace"].map(m1.from_obj_for_encoding):void 0,logs:e.logs})}}class m6 extends mA{constructor({message:e,data:t}){super(),this.message=e,this.data=t,this.attribute_map={message:"message",data:"data"}}static from_obj_for_encoding(e){if(void 0===e.message)throw Error(`Response is missing required field 'message': ${e}`);return new m6({message:e.message,data:e.data})}}class m5 extends mA{constructor({action:e,bytes:t,uint:r}){super(),this.action=e,this.bytes=t,this.uint=r,this.attribute_map={action:"action",bytes:"bytes",uint:"uint"}}static from_obj_for_encoding(e){if(void 0===e.action)throw Error(`Response is missing required field 'action': ${e}`);return new m5({action:e.action,bytes:e.bytes,uint:e.uint})}}class m4 extends mA{constructor({key:e,value:t}){super(),this.key=e,this.value=t,this.attribute_map={key:"key",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.key)throw Error(`Response is missing required field 'key': ${e}`);if(void 0===e.value)throw Error(`Response is missing required field 'value': ${e}`);return new m4({key:e.key,value:m5.from_obj_for_encoding(e.value)})}}class m3 extends mA{constructor({offset:e}){super(),this.offset=e,this.attribute_map={offset:"offset"}}static from_obj_for_encoding(e){if(void 0===e.offset)throw Error(`Response is missing required field 'offset': ${e}`);return new m3({offset:e.offset})}}class m8 extends mA{constructor({round:e}
92){super(),this.round=e,this.attribute_map={round:"round"}}static from_obj_for_encoding(e){if(void 0===e.round)throw Error(`Response is missing required field 'round': ${e}`);return new m8({round:e.round})}}class m7 extends mA{constructor({key:e,value:t}){super(),this.key="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.value="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.attribute_map={key:"key",value:"value"}}static from_obj_for_encoding(e){return new m7({key:e.key,value:e.value})}}class m9 extends mA{constructor({delta:e,ids:t}){super(),this.delta=e,this.ids=t,this.attribute_map={delta:"Delta",ids:"Ids"}}static from_obj_for_encoding(e){if(void 0===e.Delta)throw Error(`Response is missing required field 'Delta': ${e}`);if(!Array.isArray(e.Ids))throw Error(`Response is missing required array field 'Ids': ${e}`);return new m9({delta:e.Delta,ids:e.Ids})}}class ye extends mA{constructor({index:e,proof:t,treedepth:r}){super(),this.index=e,this.proof="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.treedepth=r,this.attribute_map={index:"index",proof:"proof",treedepth:"treedepth"}}static from_obj_for_encoding(e){if(void 0===e.index)throw Error(`Response is missing required field 'index': ${e}`);if(void 0===e.proof)throw Error(`Response is missing required field 'proof': ${e}`);if(void 0===e.treedepth)throw Error(`Response is missing required field 'treedepth': ${e}`);return new ye({index:e.index,proof:e.proof,treedepth:e.treedepth})}}class yt extends mA{constructor({catchupTime:e,lastRound:t,lastVersion:r,nextVersion:i,nextVersionRound:n,nextVersionSupported:a,stoppedAtUnsupportedRound:s,timeSinceLastRound:o,catchpoint:l,catchpointAcquiredBlocks:u,catchpointProcessedAccounts:c,catchpointProcessedKvs:d,catchpointTotalAccounts:f,catchpointTotalBlocks:h,catchpointTotalKvs:p,catchpointVerifiedAccounts:g,catchpointVerifiedKvs:m,lastCatchpoint:y,upgradeDelay:v,upgradeNextProtocolVoteBefore:b,upgradeNoVotes:w,upgradeNodeVote:_,upgradeVoteRounds:A,upgradeVotes:S,upgradeVotesRequired:E,upgradeYesVotes:x}){super(),this.catchupTime=e,this.lastRound=t,this.lastVersion=r,this.nextVersion=i,this.nextVersionRound=n,this.nextVersionSupported=a,this.stoppedAtUnsupportedRound=s,this.timeSinceLastRound=o,this.catchpoint=l,this.catchpointAcquiredBlocks=u,this.catchpointProcessedAccounts=c,this.catchpointProcessedKvs=d,this.catchpointTotalAccounts=f,this.catchpointTotalBlocks=h,this.catchpointTotalKvs=p,this.catchpointVerifiedAccounts=g,this.catchpointVerifiedKvs=m,this.lastCatchpoint=y,this.upgradeDelay=v,this.upgradeNextProtocolVoteBefore=b,this.upgradeNoVotes=w,this.upgradeNodeVote=_,this.upgradeVoteRounds=A,this.upgradeVotes=S,this.upgradeVotesRequired=E,this.upgradeYesVotes=x,this.attribute_map={catchupTime:"catchup-time",lastRound:"last-round",lastVersion:"last-version",nextVersion:"next-version",nextVersionRound:"next-version-round",nextVersionSupported:"next-version-supported",stoppedAtUnsupportedRound:"stopped-at-unsupported-round",timeSinceLastRound:"time-since-last-round",catchpoint:"catchpoint",catchpointAcquiredBlocks:"catchpoint-acquired-blocks",catchpointProcessedAccounts:"catchpoint-processed-accounts",catchpointProcessedKvs:"catchpoint-processed-kvs",catchpointTotalAccounts:"catchpoint-total-accounts",catchpointTotalBlocks:"catchpoint-total-blocks",catchpointTotalKvs:"catchpoint-total-kvs",catchpointVerifiedAccounts:"catchpoint-verified-accounts",catchpointVerifiedKvs:"catchpoint-verified-kvs",lastCatchpoint:"last-catchpoint",upgradeDelay:"upgrade-delay",upgradeNextProtocolVoteBefore:"upgrade-next-protocol-vote-before",upgradeNoVotes:"upgrade-no-votes",upgradeNodeVote:"upgrade-node-vote",upgradeVoteRounds:"upgrade-vote-rounds",upgradeVotes:"upgrade-votes",upgradeVotesRequired:"upgrade-votes-required",upgradeYesVotes:"upgrade-yes-votes"}}static from_obj_for_encoding(e){if(void 0===e["catchup-time"])throw Error(`Response is missing required field 'catchup-time': ${e}`);if(void 0===e["last-round"])throw Error(`Response is missing required field 'last-round': ${e}`);if(void 0===e["last-version"])throw Error(`Response is missing required field 'last-version': ${e}`);if(void 0===e["next-version"])throw Error(`Response is missing required field 'next-version': ${e}`);if(void 0===e["next-version-round"])throw Error(`Response is missing required field 'next-version-round': ${e}`);if(void 0===e["next-version-supported"])throw Error(`Response is missing required field 'next-version-supported': ${e}`);if(void 0===e["stopped-at-unsupported-round"])throw Error(`Response is missing required field 'stopped-at-unsupported-round': ${e}`);if(void 0===e["time-since-last-round"])throw Error(`Response is missing required field 'time-since-last-round': ${e}`);return new yt({catchupTime:e["catchup-time"],lastRound:e["last-round"],lastVersion:e["last-version"],nextVersion:e["next-version"],nextVersionRound:e["next-version-round"],nextVersionSupported:e["next-version-supported"],stoppedAtUnsupportedRound:e["stopped-at-unsupported-round"],timeSinceLastRound:e["time-since-last-round"],catchpoint:e.catchpoint,catchpointAcquiredBlocks:e["catchpoint-acquired-blocks"],cat
92chpointProcessedAccounts:e["catchpoint-processed-accounts"],catchpointProcessedKvs:e["catchpoint-processed-kvs"],catchpointTotalAccounts:e["catchpoint-total-accounts"],catchpointTotalBlocks:e["catchpoint-total-blocks"],catchpointTotalKvs:e["catchpoint-total-kvs"],catchpointVerifiedAccounts:e["catchpoint-verified-accounts"],catchpointVerifiedKvs:e["catchpoint-verified-kvs"],lastCatchpoint:e["last-catchpoint"],upgradeDelay:e["upgrade-delay"],upgradeNextProtocolVoteBefore:e["upgrade-next-protocol-vote-before"],upgradeNoVotes:e["upgrade-no-votes"],upgradeNodeVote:e["upgrade-node-vote"],upgradeVoteRounds:e["upgrade-vote-rounds"],upgradeVotes:e["upgrade-votes"],upgradeVotesRequired:e["upgrade-votes-required"],upgradeYesVotes:e["upgrade-yes-votes"]})}}class yr extends mA{constructor({poolError:e,txn:t,applicationIndex:r,assetClosingAmount:i,assetIndex:n,closeRewards:a,closingAmount:s,confirmedRound:o,globalStateDelta:l,innerTxns:u,localStateDelta:c,logs:d,receiverRewards:f,senderRewards:h}){super(),this.poolError=e,this.txn=t,this.applicationIndex=r,this.assetClosingAmount=i,this.assetIndex=n,this.closeRewards=a,this.closingAmount=s,this.confirmedRound=o,this.globalStateDelta=l,this.innerTxns=u,this.localStateDelta=c,this.logs=d,this.receiverRewards=f,this.senderRewards=h,this.attribute_map={poolError:"pool-error",txn:"txn",applicationIndex:"application-index",assetClosingAmount:"asset-closing-amount",assetIndex:"asset-index",closeRewards:"close-rewards",closingAmount:"closing-amount",confirmedRound:"confirmed-round",globalStateDelta:"global-state-delta",innerTxns:"inner-txns",localStateDelta:"local-state-delta",logs:"logs",receiverRewards:"receiver-rewards",senderRewards:"sender-rewards"}}static from_obj_for_encoding(e){if(void 0===e["pool-error"])throw Error(`Response is missing required field 'pool-error': ${e}`);if(void 0===e.txn)throw Error(`Response is missing required field 'txn': ${e}`);return new yr({poolError:e["pool-error"],txn:e.txn,applicationIndex:e["application-index"],assetClosingAmount:e["asset-closing-amount"],assetIndex:e["asset-index"],closeRewards:e["close-rewards"],closingAmount:e["closing-amount"],confirmedRound:e["confirmed-round"],globalStateDelta:void 0!==e["global-state-delta"]?e["global-state-delta"].map(m4.from_obj_for_encoding):void 0,innerTxns:void 0!==e["inner-txns"]?e["inner-txns"].map(yr.from_obj_for_encoding):void 0,localStateDelta:void 0!==e["local-state-delta"]?e["local-state-delta"].map(mI.from_obj_for_encoding):void 0,logs:e.logs,receiverRewards:e["receiver-rewards"],senderRewards:e["sender-rewards"]})}}class yi extends mA{constructor({topTransactions:e,totalTransactions:t}){super(),this.topTransactions=e,this.totalTransactions=t,this.attribute_map={topTransactions:"top-transactions",totalTransactions:"total-transactions"}}static from_obj_for_encoding(e){if(!Array.isArray(e["top-transactions"]))throw Error(`Response is missing required array field 'top-transactions': ${e}`);if(void 0===e["total-transactions"])throw Error(`Response is missing required field 'total-transactions': ${e}`);return new yi({topTransactions:e["top-transactions"],totalTransactions:e["total-transactions"]})}}class yn extends mA{constructor({txid:e}){super(),this.txid=e,this.attribute_map={txid:"txId"}}static from_obj_for_encoding(e){if(void 0===e.txId)throw Error(`Response is missing required field 'txId': ${e}`);return new yn({txid:e.txId})}}class ya extends mA{constructor({newValue:e,slot:t}){super(),this.newValue=e,this.slot=t,this.attribute_map={newValue:"new-value",slot:"slot"}}static from_obj_for_encoding(e){if(void 0===e["new-value"])throw Error(`Response is missing required field 'new-value': ${e}`);if(void 0===e.slot)throw Error(`Response is missing required field 'slot': ${e}`);return new ya({newValue:mj.from_obj_for_encoding(e["new-value"]),slot:e.slot})}}class ys extends mA{constructor({appInitialStates:e}){super(),this.appInitialStates=e,this.attribute_map={appInitialStates:"app-initial-states"}}static from_obj_for_encoding(e){return new ys({appInitialStates:void 0!==e["app-initial-states"]?e["app-initial-states"].map(mO.from_obj_for_encoding):void 0})}}class yo extends mA{constructor({txnGroups:e,allowEmptySignatures:t,allowMoreLogging:r,allowUnnamedResources:i,execTraceConfig:n,extraOpcodeBudget:a,round:s}){super(),this.txnGroups=e,this.allowEmptySignatures=t,this.allowMoreLogging=r,this.allowUnnamedResources=i,this.execTraceConfig=n,this.extraOpcodeBudget=a,this.round=s,this.attribute_map={txnGroups:"txn-groups",allowEmptySignatures:"allow-empty-signatures",allowMoreLogging:"allow-more-logging",allowUnnamedResources:"allow-unnamed-resources",execTraceConfig:"exec-trace-config",extraOpcodeBudget:"extra-opcode-budget",round:"roun
vendor: 10,399 bytes, line 92
92d"}}static from_obj_for_encoding(e){if(!Array.isArray(e["txn-groups"]))throw Error(`Response is missing required array field 'txn-groups': ${e}`);return new yo({txnGroups:e["txn-groups"].map(yl.from_obj_for_encoding),allowEmptySignatures:e["allow-empty-signatures"],allowMoreLogging:e["allow-more-logging"],allowUnnamedResources:e["allow-unnamed-resources"],execTraceConfig:void 0!==e["exec-trace-config"]?yc.from_obj_for_encoding(e["exec-trace-config"]):void 0,extraOpcodeBudget:e["extra-opcode-budget"],round:e.round})}}class yl extends mA{constructor({txns:e}){super(),this.txns=e,this.attribute_map={txns:"txns"}}static from_obj_for_encoding(e){if(!Array.isArray(e.txns))throw Error(`Response is missing required array field 'txns': ${e}`);return new yl({txns:e.txns})}}class yu extends mA{constructor({lastRound:e,txnGroups:t,version:r,evalOverrides:i,execTraceConfig:n,initialStates:a}){super(),this.lastRound=e,this.txnGroups=t,this.version=r,this.evalOverrides=i,this.execTraceConfig=n,this.initialStates=a,this.attribute_map={lastRound:"last-round",txnGroups:"txn-groups",version:"version",evalOverrides:"eval-overrides",execTraceConfig:"exec-trace-config",initialStates:"initial-states"}}static from_obj_for_encoding(e){if(void 0===e["last-round"])throw Error(`Response is missing required field 'last-round': ${e}`);if(!Array.isArray(e["txn-groups"]))throw Error(`Response is missing required array field 'txn-groups': ${e}`);if(void 0===e.version)throw Error(`Response is missing required field 'version': ${e}`);return new yu({lastRound:e["last-round"],txnGroups:e["txn-groups"].map(yd.from_obj_for_encoding),version:e.version,evalOverrides:void 0!==e["eval-overrides"]?yp.from_obj_for_encoding(e["eval-overrides"]):void 0,execTraceConfig:void 0!==e["exec-trace-config"]?yc.from_obj_for_encoding(e["exec-trace-config"]):void 0,initialStates:void 0!==e["initial-states"]?ys.from_obj_for_encoding(e["initial-states"]):void 0})}}class yc extends mA{constructor({enable:e,scratchChange:t,stackChange:r,stateChange:i}){super(),this.enable=e,this.scratchChange=t,this.stackChange=r,this.stateChange=i,this.attribute_map={enable:"enable",scratchChange:"scratch-change",stackChange:"stack-change",stateChange:"state-change"}}static from_obj_for_encoding(e){return new yc({enable:e.enable,scratchChange:e["scratch-change"],stackChange:e["stack-change"],stateChange:e["state-change"]})}}class yd extends mA{constructor({txnResults:e,appBudgetAdded:t,appBudgetConsumed:r,failedAt:i,failureMessage:n,unnamedResourcesAccessed:a}){super(),this.txnResults=e,this.appBudgetAdded=t,this.appBudgetConsumed=r,this.failedAt=i,this.failureMessage=n,this.unnamedResourcesAccessed=a,this.attribute_map={txnResults:"txn-results",appBudgetAdded:"app-budget-added",appBudgetConsumed:"app-budget-consumed",failedAt:"failed-at",failureMessage:"failure-message",unnamedResourcesAccessed:"unnamed-resources-accessed"}}static from_obj_for_encoding(e){if(!Array.isArray(e["txn-results"]))throw Error(`Response is missing required array field 'txn-results': ${e}`);return new yd({txnResults:e["txn-results"].map(yf.from_obj_for_encoding),appBudgetAdded:e["app-budget-added"],appBudgetConsumed:e["app-budget-consumed"],failedAt:e["failed-at"],failureMessage:e["failure-message"],unnamedResourcesAccessed:void 0!==e["unnamed-resources-accessed"]?yh.from_obj_for_encoding(e["unnamed-resources-accessed"]):void 0})}}class yf extends mA{constructor({txnResult:e,appBudgetConsumed:t,execTrace:r,logicSigBudgetConsumed:i,unnamedResourcesAccessed:n}){super(),this.txnResult=e,this.appBudgetConsumed=t,this.execTrace=r,this.logicSigBudgetConsumed=i,this.unnamedResourcesAccessed=n,this.attribute_map={txnResult:"txn-result",appBudgetConsumed:"app-budget-consumed",execTrace:"exec-trace",logicSigBudgetConsumed:"logic-sig-budget-consumed",unnamedResourcesAccessed:"unnamed-resources-accessed"}}static from_obj_for_encoding(e){if(void 0===e["txn-result"])throw Error(`Response is missing required field 'txn-result': ${e}`);return new yf({txnResult:yr.from_obj_for_encoding(e["txn-result"]),appBudgetConsumed:e["app-budget-consumed"],execTrace:void 0!==e["exec-trace"]?ym.from_obj_for_encoding(e["exec-trace"]):void 0,logicSigBudgetConsumed:e["logic-sig-budget-consumed"],unnamedResourcesAccessed:void 0!==e["unnamed-resources-accessed"]?yh.from_obj_for_encoding(e["unnamed-resources-accessed"]):void 0})}}class yh extends mA{constructor({accounts:e,appLocals:t,apps:r,assetHoldings:i,assets:n,boxes:a,extraBoxRefs:s}){super(),this.accounts=e,this.appLocals=t,this.apps=r,this.assetHoldings=i,this.assets=n,this.boxes=a,this.extraBoxRefs=s,this.attribute_map={accounts:"accounts",appLocals:"app-locals",apps:"apps",assetHoldings:"asset-holdings",assets:"assets",boxes:"boxes",extraBoxRefs:"extra-box-refs"}}static from_obj_for_encoding(e){return new yh({accounts:e.accounts,appLocals:void 0!==e["app-locals"]?e["app-locals"].map(mN.from_obj_for_encoding):void 0,apps:e.apps,assetHoldings:void 0!==e["asset-holdings"]?e["asset-holdings"].map(mU.from_obj_for_encoding):void 0,assets:e.assets,boxes:void 0!==e.boxes?e.boxes.map(mK.from_obj_for_encoding):void 0,extraBoxRefs:e["extra-box-refs"]})}}class yp extends mA{constructor({allowEmptySignatures:e,allowUnnamedResources:t,extraOpcodeBudget:r,maxLogCalls:i,maxLogSize:n}){super(),this.allowEmptySignatures=e,this.allowUnnamedResources=t,this.extraOpcodeBudget=r,this.maxLogCalls=i,this.maxLogSize=n,this.attribute_map={allowEmptySignatures:"allow-empty-signatures",allowUnnamedResources:"allow-unnamed-resources",extraOpcodeBudget:"extra-opcode-budget",maxLogCalls:"max-log-calls",maxLogSize:"max-log-size"}}static from_obj_for_encoding(e){return new yp({allowEmptySignatures:e["allow-empty-signatures"],allowUnnamedResources:e["allow-unnamed-resources"],extraOpcodeBudget:e["extra-opcode-budget"],maxLogCalls:e["max-log-calls"],maxLogSize:e["max-log-size"]})}}class yg extends mA{constructor({pc:e,scratchChanges:t,spawnedInners:r,stackAdditions:i,stackPopCount:n,stateChanges:a}){super(),this.pc=e,this.scratchChanges=t,this.spawnedInners=r,this.stackAdditions=i,this.stackPopCount=n,this.stateChanges=a,this.attribute_map={pc:"pc",scratchChanges:"scratch-changes",spawnedInners:"spawned-inners",stackAdditions:"stack-additions",stackPopCount:"stack-pop-count",stateChanges:"state-changes"}}static from_obj_for_encoding(e){if(void 0===e.pc)throw Error(`Response is missing required field 'pc': ${e}`);return new yg({pc:e.pc,scratchChanges:void 0!==e["scratch-changes"]?e["scratch-changes"].map(ya.from_obj_for_encoding):void 0,spawnedInners:e["spawned-inners"],stackAdditions:void 0!==e["stack-additions"]?e["stack-additions"].map(mj.from_obj_for_encoding):void 0,stackPopCount:e["stack-pop-count"],stateChanges:void 0!==e["state-changes"]?e["state-changes"].map(mR.from_obj_for_encoding):void 0})}}class ym extends mA{constructor({approvalProgramHash:e,approvalProgramTrace:t,clearStateProgramHash:r,clearStateProgramTrace:i,innerTrace:n,logicSigHash:a,logicSigTrace:s}){super(),this.approvalProgramHash="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.approvalProgramTrace=t,this.clearStateProgramHash="string"==typeof r?new Uint8Array(gj.Buffer.from(r,"base64")):r,this.clearStateProgramTrace=i,this.innerTrace=n,this.logicSigHash="string"==typeof a?new Uint8Array(gj.Buffer.from(a,"base64")):a,this.logicSigTrace=s,this.attribute_map={approvalProgramHash:"approval-program-hash",approvalProgramTrace:"approval-program-trace",clearStateProgramHash:"clear-state-program-hash",clearStateProgramTrace:"clear-state-program-trace",innerTrace:"inner-trace",logicSigHash:"logic-sig-hash",logicSigTrace:"logic-sig-trace"}}static from_obj_for_encoding(e){return new ym({approvalProgramHash:e["approval-program-hash"],approvalProgramTrace:void 0!==e["approval-program-trace"]?e["approval-program-trace"].map(yg.from_obj_for_encoding):void 0,clearStateProgramHash:e["clear-state-program-hash"],clearStateProgramTrace:void 0!==e["clear-state-program-trace"]?e["clear-state-program-trace"].map(yg.from_obj_for_encoding):void 0,innerTrace:void 0!==e["inner-trace"]?e["inner-trace"].map(ym.from_obj_for_encoding):void 0,logicSigHash:e["logic-sig-hash"],logicSigTrace:void 0!==e["logic-sig-trace"]?e["logic-sig-trace"].map(yg.from_obj_for_encoding):void 0})}}class yy extends mA{constructor({message:e,stateproof:t}){super(),this.message=e,this.stateproof="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.attribute_map={message:"Message",stateproof:"StateProof"}}static from_obj_for_encoding(e){if(void 0===e.Message)throw Error(`Response is missing required field 'Message': ${e}`);if(void 0===e.StateProof)throw Error(`Response is missing required field 'StateProof': ${e}`);return new yy({message:yv.from_obj_for_encoding(e.Message),stateproof:e.StateProof})}}class yv extends mA{constructor({blockheaderscommitment:e,firstattestedround:t,lastattestedround:r,lnprovenweight:i,voterscommitment:n}){super(),this.blockheaderscommitment="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.firstattestedround=t,this.lastattestedround=r,this.lnprovenweight=i,this.voterscommitment="string"==typeof n?new Uint8Array(gj.Buffer.from(n,"base64")):n,this.attribute_map={blockheaderscommitment:"BlockHeadersCommitment",firstattestedround:"FirstAttestedRound",lastattestedround:"LastAttestedRound",lnprovenweight:"LnProvenWeight",voterscommitment:"VotersCommitment"}}static from_obj_for_encoding(e){if(void 0===e.BlockHeadersCommitment)throw Error(`Response is missing required field 'BlockHeadersCommitment': ${e}`);if(void 0===e.FirstAttestedRound)throw Error(`Response is missing required field 'FirstAttestedRound': ${e}`);if(void 0===e.LastAttestedRound)throw Error(`Response is missing required field 'LastAttestedRound': ${e}`);if(void 0===e.LnProvenWeight)throw Error(`Response is missing required field 'LnProvenWeight': ${e}`);if(void 0===e.VotersCommitment)throw Error(`Response is missing required field 'VotersCommitment': ${e}`);return new yv({blockheaderscommitment:e.BlockHeadersCommitment,firstattestedround:e.FirstAttestedRound,lastattestedround:e.LastAttestedRound,lnprovenweight:e.LnProvenWeight,voterscommitment:e.VotersCommitment})}}class yb extends mA{constructor({currentRound:e,onlineMoney:t,totalMoney:r}){super(),this.currentRound=e,this.onlineMoney=t,this.totalMoney=r,this.attribute_map={currentRound:"current_roun
92d",onlineMoney:"online-money",totalMoney:"total-money"}}static from_obj_for_encoding(e){if(void 0===e.current_round)throw Error(`Response is missing required field 'current_round': ${e}`);if(void 0===e["online-money"])throw Error(`Response is missing required field 'online-money': ${e}`);if(void 0===e["total-money"])throw Error(`Response is missing required field 'total-money': ${e}`);return new yb({currentRound:e.current_round,onlineMoney:e["online-money"],totalMoney:e["total-money"]})}}class yw extends mA{constructor({key:e,value:t}){super(),this.key=e,this.value=t,this.attribute_map={key:"key",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.key)throw Error(`Response is missing required field 'key': ${e}`);if(void 0===e.value)throw Error(`Response is missing required field 'value': ${e}`);return new yw({key:e.key,value:y_.from_obj_for_encoding(e.value)})}}class y_ extends mA{constructor({type:e,bytes:t,uint:r}){super(),this.type=e,this.bytes=t,this.uint=r,this.attribute_map={type:"type",bytes:"bytes",uint:"uint"}}static from_obj_for_encoding(e){if(void 0===e.type)throw Error(`Response is missing required field 'type': ${e}`);if(void 0===e.bytes)throw Error(`Response is missing required field 'bytes': ${e}`);if(void 0===e.uint)throw Error(`Response is missing required field 'uint': ${e}`);return new y_({type:e.type,bytes:e.bytes,uint:e.uint})}}class yA extends mA{constructor({deltas:e}){super(),this.deltas=e,this.attribute_map={deltas:"Deltas"}}static from_obj_for_encoding(e){if(!Array.isArray(e.Deltas))throw Error(`Response is missing required array field 'Deltas': ${e}`);return new yA({deltas:e.Deltas.map(m9.from_obj_for_encoding)})}}class yS extends mA{constructor({consensusVersion:e,fee:t,genesisHash:r,genesisId:i,lastRound:n,minFee:a}){super(),this.consensusVersion=e,this.fee=t,this.genesisHash="string"==typeof r?new Uint8Array(gj.Buffer.from(r,"base64")):r,this.genesisId=i,this.lastRound=n,this.minFee=a,this.attribute_map={consensusVersion:"consensus-version",fee:"fee",genesisHash:"genesis-hash",genesisId:"genesis-id",lastRound:"last-round",minFee:"min-fee"}}static from_obj_for_encoding(e){if(void 0===e["consensus-version"])throw Error(`Response is missing required field 'consensus-version': ${e}`);if(void 0===e.fee)throw Error(`Response is missing required field 'fee': ${e}`);if(void 0===e["genesis-hash"])throw Error(`Response is missing required field 'genesis-hash': ${e}`);if(void 0===e["genesis-id"])throw Error(`Response is missing required field 'genesis-id': ${e}`);if(void 0===e["last-round"])throw Error(`Response is missing required field 'last-round': ${e}`);if(void 0===e["min-fee"])throw Error(`Response is missing required field 'min-fee': ${e}`);return new yS({consensusVersion:e["consensus-version"],fee:e.fee,genesisHash:e["genesis-hash"],genesisId:e["genesis-id"],lastRound:e["last-round"],minFee:e["min-fee"]})}}class yE extends mA{constructor({idx:e,proof:t,stibhash:r,treedepth:i,hashtype:n}){super(),this.idx=e,this.proof="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.stibhash="string"==typeof r?new Uint8Array(gj.Buffer.from(r,"base64")):r,this.treedepth=i,this.hashtype=n,this.attribute_map={idx:"idx",proof:"proof",stibhash:"stibhash",treedepth:"treedepth",hashtype:"hashtype"}}static from_obj_for_encoding(e){if(void 0===e.idx)throw Error(`Response is missing required field 'idx': ${e}`);if(void 0===e.proof)throw Error(`Response is missing required field 'proof': ${e}`);if(void 0===e.stibhash)throw Error(`Response is missing required field 'stibhash': ${e}`);if(void 0===e.treedepth)throw Error(`Response is missing required field 'treedepth': ${e}`);return new yE({idx:e.idx,proof:e.proof,stibhash:e.stibhash,treedepth:e.treedepth,hashtype:e.hashtype})}}class yx extends mA{constructor({build:e,genesisHashB64:t,genesisId:r,versions:i}){super(),this.build=e,this.genesisHashB64="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.genesisId=r,this.versions=i,this.attribute_map={build:"build",genesisHashB64:"genesis_hash_b64",genesisId:"genesis_id",versions:"versions"}}static from_obj_for_encoding(e){if(void 0===e.build)throw Error(`Response is missing required field 'build': ${e}`);if(void 0===e.genesis_hash_b64)throw Error(`Response is missing required field 'genesis_hash_b64': ${e}`);if(void 0===e.genesis_id)throw Error(`Response is missing required field 'genesis_id': ${e}`);if(!Array.isArray(e.versions))throw Error(`Response is missing required array field 'versions': ${e}`);return new yx({build:mZ.from_obj_for_encoding(e.build),genesisHashB64:e.genesis_hash_b64,genesisId:e.genesis_id,versions:e.versions})}}e.s(["Account",0,mS,"AccountApplicationResponse",0,mE,"AccountAssetResponse",0,mx,"AccountParticipation",0,mT,"AccountStateDelta",0,mI,"Application",0,mk,"ApplicationInitialStates",0,mO,"ApplicationKVStorage",0,mC,"ApplicationLocalReference",0,mN,"ApplicationLocalState",0,mP,"ApplicationParams",0,mD,"ApplicationStateOperation",0,mR,"ApplicationStateSchema",0,m$,"Asset",0,mB,"AssetHolding",0,mL,"AssetHoldingReference",0,mU,"AssetParams",0,mF,"AvmKeyValue",0,mM,"AvmValue",0,mj,"BlockHashResponse",0,mz,"BlockResponse",0,mV,"BlockTxidsResponse",0,mH,"Box",0,mq,"BoxDescriptor",0,mW,"BoxReference",0,mK,"BoxesResponse",0,mG,"BuildVersion",0,mZ,"CompileResponse",0,mX,"DisassembleResponse",0,mJ,"DryrunRequest",0,mY,"DryrunResponse",0,mQ,"DryrunSource",0,m0,"DryrunState",0,m1,"DryrunTxnResult",0,m2,"ErrorResponse",0,m6,"EvalDelta",0,m5,"EvalDeltaKeyValue",0,m4,"GetBlockTimeStampOffsetResponse",0,m3,"GetSyncRoundResponse",0,m8,"KvDelta",0,m7,"LedgerStateDeltaForTransactionGroup",0,m9,"LightBlockHeaderProof",0,ye,"NodeStatusResponse",0,yt,"PendingTransactionResponse",0,yr,"PendingTransactionsResponse",0,yi,"PostTransactionsResponse",0,yn,"ScratchChange",0,ya,"SimulateInitialStates",0,ys,"SimulateRequest",0,yo,"SimulateRequestTransactionGroup",0,yl,"SimulateResponse",0,yu,"SimulateTraceConfig",0,yc,"SimulateTransactionGroupResult",0,yd,"SimulateTransactionResult",0,yf,"SimulateUnnamedResourcesAccessed",0,yh,"SimulationEvalOverrides",0,yp,"SimulationOpcodeTraceUnit",0,yg,"SimulationTransactionExecTrace",0,ym,"StateProof",0,yy,"StateProofMessage",0,yv,"SupplyResponse",0,yb,"TealKeyValue",0,yw,"TealValue",0,y_,"TransactionGroupLedgerStateDeltasForRoundResponse",0,yA,"TransactionParametersResponse",0,yS,"TransactionProofResponse",0,yE,"Version",0,yx],157433);class yT{constructor(e,t){this.c=e,this.query={},this.intDecoding=t||gq.DEFAULT}prepare(e){return e}async do(e={}){let t={};"default"!==this.intDecoding&&(t.intDecoding=this.intDecoding);let r=await this.c.get(this.path(),this.query,e,t);return this.prepare(r.body)}async doRaw(e={}){return(await this.c.get(this.path(),this.query,e,{},!1)).body}setIntDecoding(e){if("default"!==e&&"safe"!==e&&"mixed"!==e&&"bigint"!==e)throw Error(`Invalid method for int decoding: ${e}`);return this.intDecoding=e,this}}class yI extends yT{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}`}exclude(e){return this.query.exclude=e,this}}
92class yk extends yT{constructor(e,t,r,i){super(e,t),this.account=r,this.assetID=i,this.account=r,this.assetID=i}path(){return`/v2/accounts/${this.account}/assets/${this.assetID}`}}class yO extends yT{constructor(e,t,r,i){super(e,t),this.account=r,this.applicationID=i,this.account=r,this.applicationID=i}path(){return`/v2/accounts/${this.account}/applications/${this.applicationID}`}}class yC extends yT{constructor(e,t){if(super(e),!Number.isInteger(t))throw Error("roundNumber should be an integer");this.round=t,this.query={format:"msgpack"}}path(){return`/v2/blocks/${this.round}`}prepare(e){if(e&&e.byteLength>0)return mo(e)}}function yN(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&((t={...e})["Content-Type"]="text/plain"),t}class yP extends yT{constructor(e,t){super(e),this.source=t,this.source=t}path(){return"/v2/teal/compile"}sourcemap(e=!0){return this.query.sourcemap=e,this}async do(e={}){let t=yN(e);return(await this.c.post(this.path(),gj.Buffer.from(this.source),t,this.query)).body}}class yD extends yT{constructor(e,t){super(e),this.blob=ms(t.get_obj_for_encoding(!0))}path(){return"/v2/teal/dryrun"}async do(e={}){let t=yN(e);return(await this.c.post(this.path(),gj.Buffer.from(this.blob),t)).body}}class yR extends yT{path(){return"/genesis"}}class y$ extends yT{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/assets/${this.index}`}}class yB extends yT{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/applications/${this.index}`}}class yL extends yT{constructor(e,t,r){if(super(e,t),!Number.isInteger(r))throw Error("roundNumber should be an integer");this.round=r}path(){return`/v2/blocks/${this.round}/hash`}}class yU extends yT{constructor(e,t,r){if(super(e,t),!Number.isInteger(r))throw Error("roundNumber should be an integer");this.round=r}path(){return`/v2/blocks/${this.round}/txids`}}
92class yF extends yT{constructor(e,t,r,i){super(e,t),this.index=r,this.index=r;const n=gj.Buffer.from(i).toString("base64");this.query.name=encodeURI(`b64:${n}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return mq.from_obj_for_encoding(e)}}class yM extends yT{constructor(e,t,r){super(e,t),this.index=r,this.index=r,this.query.max=0}path(){return`/v2/applications/${this.index}/boxes`}max(e){return this.query.max=e,this}prepare(e){return mG.from_obj_for_encoding(e)}}class yj extends yT{path(){return"/health"}async do(e={}){let t=await this.c.get(this.path(),{},e);if(!t.ok)throw Error(`Health response: ${t.status}`);return{}}}class yz extends yT{constructor(e,t){super(e),this.txid=t,this.txid=t,this.query.format="msgpack"}prepare(e){if(e&&e.byteLength>0)return mo(e)}path(){return`/v2/transactions/pending/${this.txid}`}max(e){return this.query.max=e,this}}class yV extends yT{constructor(e){super(e),this.query.format="msgpack"}path(){return"/v2/transactions/pending"}prepare(e){if(e&&e.byteLength>0)return mo(e)}max(e){return this.query.max=e,this}}class yH extends yT{constructor(e,t){super(e),this.address=t,this.address=t,this.query.format="msgpack"}prepare(e){if(e&&e.byteLength>0)return mo(e)}path(){return`/v2/accounts/${this.address}/transactions/pending`}max(e){return this.query.max=e,this}}
92class yq extends yT{constructor(e,t,r,i){super(e,t),this.round=r,this.txID=i,this.round=r,this.txID=i}path(){return`/v2/blocks/${this.round}/transactions/${this.txID}/proof`}hashType(e){return this.query.hashtype=e,this}}function yW(e){return e&&void 0!==e.byteLength}class yK extends yT{constructor(e,t){super(e);let r=t;if(Array.isArray(t)){if(!t.every(yW))throw TypeError("Array elements must be byte arrays");r=gG(...t)}else if(!yW(r))throw TypeError("Argument must be byte array");this.txnBytesToPost=r}path(){return"/v2/transactions"}async do(e={}){let t=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&((t={...e})["Content-Type"]="application/x-binary"),t}(e);return(await this.c.post(this.path(),gj.Buffer.from(this.txnBytesToPost),t)).body}}class yG extends yT{path(){return"/v2/status"}}class yZ extends yT{constructor(e,t,r){if(super(e,t),this.round=r,!Number.isInteger(r))throw Error("round should be an integer");this.round=r}path(){return`/v2/status/wait-for-block-after/${this.round}`}}class yX extends yT{path(){return"/v2/transactions/params"}prepare(e){return{flatFee:!1,fee:e.fee,firstRound:e["last-round"],lastRound:e["last-round"]+1e3,genesisID:e["genesis-id"],genesisHash:e["genesis-hash"],minFee:e["min-fee"]}}}class yJ extends yT{path(){return"/v2/ledger/supply"}}class yY extends yT{path(){return"/versions"}}class yQ extends yT{constructor(e,t,r){super(e,t),this.round=r,this.round=r}path(){return`/v2/blocks/${this.round}/lightheader/proof`}}class y0 extends yT{constructor(e,t,r){super(e,t),this.round=r,this.round=r}path(){return`/v2/stateproofs/${this.round}`}}class y1 extends yT{constructor(e,t,r){super(e,t),this.round=r,this.round=r}path(){return`/v2/ledger/sync/${this.round}`}async do(e={}){return(await this.c.post(this.path(),e)).body}}class y2 extends yT{path(){return"/v2/ledger/sync"}prepare(e){return m8.from_obj_for_encoding(e)}}class y6 extends yT{constructor(e,t,r){super(e,t),this.offset=r,this.offset=r}path(){return`/v2/devmode/blocks/offset/${this.offset}`}async do(e={}){return(await this.c.post(this.path(),e)).body}}class y5 extends yT{path(){return"/v2/devmode/blocks/offset"}prepare(e){return m3.from_obj_for_encoding(e)}}class y4 extends yT{constructor(e,t){super(e),this.source=t,this.source=t}path(){return"/v2/teal/disassemble"}async do(e={}){let t=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&((t={...e})["Content-Type"]="text/plain"),t}(e);return(await this.c.post(this.path(),gj.Buffer.from(this.source),t,this.query)).body}}class y3 extends yT{constructor(e,t){super(e),this.query.format="msgpack",this.requestBytes=ma(t.get_obj_for_encoding(!0))}path(){return"/v2/transactions/simulate"}async do(e={}){let t=function(e={}){let t=e;return Object.keys(t).every(e=>"content-type"!==e.toLowerCase())&&((t={...e})["Content-Type"]="application/msgpack"),t}(e),r=await this.c.post(this.path(),gj.Buffer.from(this.requestBytes),t,this.query,!1);return this.prepare(r.body)}prepare(e){let t=mo(e);return yu.from_obj_for_encoding(t)}}class y8 extends yT{path(){return"/ready"}}class y7 extends yT{path(){return"/v2/ledger/sync"}async do(e={}){return(await this.c.delete(this.path(),e)).body}}class y9 extends yT{constructor(e,t,r){super(e,t),this.id=r,this.id=r,this.query={format:"json"}}path(){return`/v2/deltas/txn/group/${this.id}`}}class ve extends yT{constructor(e,t,r){super(e,t),this.round=r,this.round=r,this.query={format:"json"}}path(){return`/v2/deltas/${this.round}`}}class vt extends yT{constructor(e,t,r){super(e,t),this.round=r,this.round=r,this.query={format:"json"}}path(){return`/v2/deltas/${this.round}/txn/group`}prepare(e){return yA.from_obj_for_encoding(e)}}class vr extends m_{constructor(e,t,r,i={}){super("X-Algo-API-Token",e,t,r,i)}healthCheck(){return new yj(this.c)}versionsCheck(){return new yY(this.c)}sendRawTransaction(e){return new yK(this.c,e)}accountInformation(e){return new yI(this.c,this.intDecoding,e)}accountAssetInformation(e,t){return new yk(this.c,this.intDecoding,e,t)}accountApplicationInformation(e,t){return new yO(this.c,this.intDecoding,e,t)}block(e){return new yC(this.c,e)}getBlockHash(e){return new yL(this.c,this.intDecoding,e)}getBlockTxids(e){return new yU(this.c,this.intDecoding,e)}
92pendingTransactionInformation(e){return new yz(this.c,e)}pendingTransactionsInformation(){return new yV(this.c)}pendingTransactionByAddress(e){return new yH(this.c,e)}status(){return new yG(this.c,this.intDecoding)}statusAfterBlock(e){return new yZ(this.c,this.intDecoding,e)}getTransactionParams(){return new yX(this.c)}supply(){return new yJ(this.c,this.intDecoding)}compile(e){return new yP(this.c,e)}disassemble(e){return new y4(this.c,e)}dryrun(e){return new yD(this.c,e)}getAssetByID(e){return new y$(this.c,this.intDecoding,e)}getApplicationByID(e){return new yB(this.c,this.intDecoding,e)}getApplicationBoxByName(e,t){return new yF(this.c,this.intDecoding,e,t)}getApplicationBoxes(e){return new yM(this.c,this.intDecoding,e)}genesis(){return new yR(this.c,this.intDecoding)}getTransactionProof(e,t){return new yq(this.c,this.intDecoding,e,t)}getLightBlockHeaderProof(e){return new yQ(this.c,this.intDecoding,e)}getStateProof(e){return new y0(this.c,this.intDecoding,e)}simulateRawTransactions(e){let t=[];if(Array.isArray(e))for(let r of e)t.push(mo(r));else t.push(mo(e));let r=new yo({txnGroups:[new yl({txns:t})]});return this.simulateTransactions(r)}simulateTransactions(e){return new y3(this.c,e)}setBlockOffsetTimestamp(e){return new y6(this.c,this.intDecoding,e)}getBlockOffsetTimestamp(){return new y5(this.c,this.intDecoding)}setSyncRound(e){return new y1(this.c,this.intDecoding,e)}unsetSyncRound(){return new y7(this.c,this.intDecoding)}getSyncRound(){return new y2(this.c,this.intDecoding)}ready(){return new y8(this.c,this.intDecoding)}getLedgerStateDeltaForTransactionGroup(e){return new y9(this.c,this.intDecoding,e)}getLedgerStateDelta(e){return new ve(this.c,this.intDecoding,e)}getTransactionGroupLedgerStateDeltasForRound(e){return new vt(this.c,this.intDecoding,e)}}class vi extends m_{constructor(e,t="http://127.0.0.1",r=7833,i={}){super("X-KMD-API-Token",e,t,r,i)}async versions(){return(await this.c.get("/versions")).body}async listWallets(){return(await this.c.get("/v1/wallets")).body}async createWallet(e,t,r=new Uint8Array,i="sqlite"){let n={wallet_name:e,wallet_driver_name:i,wallet_password:t,master_derivation_key:gj.Buffer.from(r).toString("base64")};return(await this.c.post("/v1/wallet",n)).body}async initWalletHandle(e,t){return(await this.c.post("/v1/wallet/init",{wallet_id:e,wallet_password:t})).body}async releaseWalletHandle(e){return(await this.c.post("/v1/wallet/release",{wallet_handle_token:e})).body}async renewWalletHandle(e){return(await this.c.post("/v1/wallet/renew",{wallet_handle_token:e})).body}async renameWallet(e,t,r){return(await this.c.post("/v1/wallet/rename",{wallet_id:e,wallet_password:t,wallet_name:r})).body}async getWallet(e){return(await this.c.post("/v1/wallet/info",{wallet_handle_token:e})).body}async exportMasterDerivationKey(e,t){let r=await this.c.post("/v1/master-key/export",{wallet_handle_token:e,wallet_password:t});return{master_derivation_key:gj.Buffer.from(r.body.master_derivation_key,"base64")}}async importKey(e,t){let r={wallet_handle_token:e,private_key:gj.Buffer.from(t).toString("base64")};return(await this.c.post("/v1/key/import",r)).body}async exportKey(e,t,r){let i=await this.c.post("/v1/key/export",{wallet_handle_token:e,address:r,wallet_password:t});return{private_key:gj.Buffer.from(i.body.private_key,"base64")}}async generateKey(e){return(await this.c.post("/v1/key",{wallet_handle_token:e,dis
92play_mnemonic:!1})).body}async deleteKey(e,t,r){return(await this.c.delete("/v1/key",{wallet_handle_token:e,address:r,wallet_password:t})).body}async listKeys(e){return(await this.c.post("/v1/key/list",{wallet_handle_token:e})).body}async signTransaction(e,t,r){let i=mp(r),n={wallet_handle_token:e,wallet_password:t,transaction:gj.Buffer.from(i.toByte()).toString("base64")},a=await this.c.post("/v1/transaction/sign",n);return 200===a.status?gj.Buffer.from(a.body.signed_transaction,"base64"):a.body}async signTransactionWithSpecificPublicKey(e,t,r,i){let n=mp(r),a={wallet_handle_token:e,wallet_password:t,transaction:gj.Buffer.from(n.toByte()).toString("base64"),public_key:gj.Buffer.from(i).toString("base64")},s=await this.c.post("/v1/transaction/sign",a);return 200===s.status?gj.Buffer.from(s.body.signed_transaction,"base64"):s.body}async listMultisig(e){return(await this.c.post("/v1/multisig/list",{wallet_handle_token:e})).body}async importMultisig(e,t,r,i){return(await this.c.post("/v1/multisig/import",{wallet_handle_token:e,multisig_version:t,threshold:r,pks:i})).body}async exportMultisig(e,t){return(await this.c.post("/v1/multisig/export",{wallet_handle_token:e,address:t})).body}async signMultisigTransaction(e,t,r,i,n){let a=mp(r),s={wallet_handle_token:e,transaction:gj.Buffer.from(a.toByte()).toString("base64"),public_key:gj.Buffer.from(i).toString("base64"),partial_multisig:n,wallet_password:t};return(await this.c.post("/v1/multisig/sign",s)).body}async deleteMultisig(e,t,r){return(await this.c.delete("/v1/multisig",{wallet_handle_token:e,address:r,wallet_password:t})).body}}class vn extends yT{path(){return"/health"}}class va extends yT{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/assets/${this.index}/balances`}limit(e){return this.query.limit=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}}function vs(e){return"string"==typeof e?e:gj.Buffer.from(e).toString("base64")}class vo extends yT{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/transactions`}notePrefix(e){return this.query["note-prefix"]=vs(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}assetID(e){return this.query["asset-id"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e,this}afterTime(e){return this.query["after-time"]=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}}class vl extends yT{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/assets/${this.index}/transactions`}notePrefix(e){return this.query["note-prefix"]=vs(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e,this}afterTime(e){return this.query["after-time"]=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}addressRole(e){return this.query["address-role"]=e,this}address(e){return this.query.address=e,this}excludeCloseTo(e){return this.query["exclude-close-to"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}}class vu extends yT{constructor(e,t,r){super(e,t),this.round=r,this.round=r}path(){return`/v2/blocks/${this.round}`}headerOnly(e){return this.query["header-only"]=e,this}}class vc extends yT{constructor(e,t,r){super(e,t),this.txID=r,this.txID=r}path(){return`/v2/transactions/${this.txID}`}}class vd extends yT{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}`}round(e){return this.query.round=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}exclude(e){return this.query.exclude=e,this}}class vf extends yT{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/assets`}limit(e){return this.query.limit=e,this}
92round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}assetId(e){return this.query["asset-id"]=e,this}}class vh extends yT{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/created-assets`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}assetID(e){return this.query["asset-id"]=e,this}}class vp extends yT{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/apps-local-state`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}applicationID(e){return this.query["application-id"]=e,this}}class vg extends yT{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/created-applications`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}applicationID(e){return this.query["application-id"]=e,this}}class vm extends yT{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/assets/${this.index}`}includeAll(e=!0){return this.query["include-all"]=e,this}}class vy extends yT{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/applications/${this.index}`}includeAll(e=!0){return this.query["include-all"]=e,this}}class vv extends yT{constructor(e,t,r){super(e,t),this.appID=r,this.appID=r}path(){return`/v2/applications/${this.appID}/logs`}limit(e){return this.query.limit=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}nextToken(e){return this.query.next=e,this}sender(e){return this.query["sender-address"]=e,this}txid(e){return this.query.txid=e,this}}class vb extends mA{constructor({address:e,amount:t,amountWithoutPendingRewards:r,pendingRewards:i,rewards:n,round:a,status:s,totalAppsOptedIn:o,totalAssetsOptedIn:l,totalBoxBytes:u,totalBoxes:c,totalCreatedApps:d,totalCreatedAssets:f,appsLocalState:h,appsTotalExtraPages:p,appsTotalSchema:g,assets:m,authAddr:y,closedAtRound:v,createdApps:b,createdAssets:w,createdAtRound:_,deleted:A,participation:S,rewardBase:E,sigType:x}){super(),this.address=e,this.amount=t,this.amountWithoutPendingRewards=r,this.pendingRewards=i,this.rewards=n,this.round=a,this.status=s,this.totalAppsOptedIn=o,this.totalAssetsOptedIn=l,this.totalBoxBytes=u,this.totalBoxes=c,this.totalCreatedApps=d,this.totalCreatedAssets=f,this.appsLocalState=h,this.appsTotalExtraPages=p,this.appsTotalSchema=g,this.assets=m,this.authAddr=y,this.closedAtRound=v,this.createdApps=b,this.createdAssets=w,this.createdAtRound=_,this.deleted=A,this.participation=S,this.rewardBase=E,this.sigType=x,this.attribute_map={address:"address",amount:"amount",amountWithoutPendingRewards:"amount-without-pending-rewards",pendingRewards:"pending-rewards",rewards:"rewards",round:"round",status:"status",totalAppsOptedIn:"total-apps-opted-in",totalAssetsOptedIn:"total-assets-opted-in",totalBoxBytes:"total-box-bytes",totalBoxes:"total-boxes",totalCreatedApps:"total-created-apps",totalCreatedAssets:"total-created-assets",appsLocalState:"apps-local-state",appsTotalExtraPages:"apps-total-extra-pages",appsTotalSchema:"apps-total-schema",assets:"assets",authAddr:"auth-addr",closedAtRound:"closed-at-round",createdApps:"created-apps",createdAssets:"created-assets",createdAtRound:"created-at-round",deleted:"deleted",participation:"participation",rewardBase:"reward-base",sigType:"sig-type"}}static from_obj_for_encoding(e){if(void 0===e.address)throw Error(`Response is missing required field 'address': ${e}`);if(void 0===e.amount)throw Error(`Response is missing required field 'amount': ${e}`);if(void 0===e["amount-without-pending-rewards"])throw Error(`Response is missing required field 'amount-without-pending-rewards': ${e}`);if(void 0===e["pending-rewards"])throw Error(`Response is missing required field 'pending-rewards': ${e}`);if(void 0===e.rewards)throw Error(`Response is missing required field 'rewards': ${e}`);if(void 0===e.round)throw Error(`Response is missing required field 'round': ${e}`);if(void 0===e.status)throw Error(`Response is missing required field 'status': ${e}`);if(void 0===e["total-apps-opted-in"])throw Error(`Response is missing required field 'total-apps-opted-in': ${e}`);if(void 0===e["total-assets-opted-in"])throw Error(`Response is missing required field 'total-assets-opted-in': ${e}`);if(void 0===e["total-box-bytes"])throw Error(`Response is missing required field 'total-box-bytes': ${e}`);if(void 0===e["total-boxes"])throw Error(`Response is missing required field 'total-boxes': ${e}`);if(void 0===e["total-created-apps"])throw Error(`Response is missing required field 'total-created-apps': ${e}`);if(void 0===e["total-created-assets"])throw Error(`Response is missing required field 'total-created-assets': ${e}`);return new vb({address:e.address,amount:e.amount,amountWithoutPendingRewards:e["amount-without-pending-rewards"],pendingRewards:e["pending-rewards"],rewards:e.rewards,round:e.round,status:e.status,totalAppsOptedIn:e["total-apps-opted-in"],totalAssetsOptedIn:e["total-assets-opted-in"],totalBoxBytes:e["total-box-bytes"],totalBoxes:e["total-boxes"],totalCreatedApps:e["total-created-apps"],totalCreatedAssets:e["total-created-assets"],appsLocalState:void 0!==e["apps-local-state"]?e["apps-local-state"].map(vx.from_obj_for_encoding):void 0,appsTotalExtraPages:e["apps-total-extra-pages"],appsTotalSchema:void 0!==e["apps-total-schema"]?vN.from_obj_for_encoding(e["apps-total-schema"]):void 0,assets:void 0!==e.assets?e.assets.map(v$.from_obj_for_encoding):void 0,authAddr:e["auth-addr"],closedAtRound:e["closed-at-round"],createdApps:void 0!==e["created-apps"]?e["created-apps"].map(vE.from_obj_for_encoding):void 0,createdAssets:void 0!==e["created-assets"]?e["created-assets"].map(vD.from_obj_for_encoding):void 0,createdAtRound:e["created-at-round"],deleted:e.deleted,participation:void 0!==e.participation?vw.from_obj_for_encoding(e.participation):void 0,rewardBase:e["reward-base"],sigType:e["sig-type"]})}}class vw extends mA{constructor({selectionParticipationKey:e,voteFirstValid:t,voteKeyDilution:r,voteLastValid:i,voteParticipationKey:n,stateProofKey:a}){super(),this.selectionParticipationKey="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.voteFirstValid=t,this.voteKeyDilution=r,this.voteLastValid=i,this.voteParticipationKey="string"==typeof n?new Uint8Array(gj.Buffer.from(n,"base64")):n,this.stateProofKey="string"==typeof a?new Uint8Array(gj.Buffer.from(a,"base64")):a,this.attribute_map={selectionParticipationKey:"selection-
92participation-key",voteFirstValid:"vote-first-valid",voteKeyDilution:"vote-key-dilution",voteLastValid:"vote-last-valid",voteParticipationKey:"vote-participation-key",stateProofKey:"state-proof-key"}}static from_obj_for_encoding(e){if(void 0===e["selection-participation-key"])throw Error(`Response is missing required field 'selection-participation-key': ${e}`);if(void 0===e["vote-first-valid"])throw Error(`Response is missing required field 'vote-first-valid': ${e}`);if(void 0===e["vote-key-dilution"])throw Error(`Response is missing required field 'vote-key-dilution': ${e}`);if(void 0===e["vote-last-valid"])throw Error(`Response is missing required field 'vote-last-valid': ${e}`);if(void 0===e["vote-participation-key"])throw Error(`Response is missing required field 'vote-participation-key': ${e}`);return new vw({selectionParticipationKey:e["selection-participation-key"],voteFirstValid:e["vote-first-valid"],voteKeyDilution:e["vote-key-dilution"],voteLastValid:e["vote-last-valid"],voteParticipationKey:e["vote-participation-key"],stateProofKey:e["state-proof-key"]})}}class v_ extends mA{constructor({account:e,currentRound:t}){super(),this.account=e,this.currentRound=t,this.attribute_map={account:"account",currentRound:"current-round"}}static from_obj_for_encoding(e){if(void 0===e.account)throw Error(`Response is missing required field 'account': ${e}`);if(void 0===e["current-round"])throw Error(`Response is missing required field 'current-round': ${e}`);return new v_({account:vb.from_obj_for_encoding(e.account),currentRound:e["current-round"]})}}class vA extends mA{constructor({address:e,delta:t}){super(),this.address=e,this.delta=t,this.attribute_map={address:"address",delta:"delta"}}static from_obj_for_encoding(e){if(void 0===e.address)throw Error(`Response is missing required field 'address': ${e}`);if(!Array.isArray(e.delta))throw Error(`Response is missing required array field 'delta': ${e}`);return new vA({address:e.address,delta:e.delta.map(vZ.from_obj_for_encoding)})}}class vS extends mA{constructor({accounts:e,currentRound:t,nextToken:r}){super(),this.accounts=e,this.currentRound=t,this.nextToken=r,this.attribute_map={accounts:"accounts",currentRound:"current-round",nextToken:"next-token"}}static from_obj_for_encoding(e){if(!Array.isArray(e.accounts))throw Error(`Response is missing required array field 'accounts': ${e}`);if(void 0===e["current-round"])throw Error(`Response is missing required field 'current-round': ${e}`);return new vS({accounts:e.accounts.map(vb.from_obj_for_encoding),currentRound:e["current-round"],nextToken:e["next-token"]})}}class vE extends mA{constructor({id:e,params:t,createdAtRound:r,deleted:i,deletedAtRound:n}){super(),this.id=e,this.params=t,this.createdAtRound=r,this.deleted=i,this.deletedAtRound=n,this.attribute_map={id:"id",params:"params",createdAtRound:"created-at-round",deleted:"deleted",deletedAtRound:"deleted-at-round"}}static from_obj_for_encoding(e){if(void 0===e.id)throw Error(`Response is missing required field 'id': ${e}`);if(void 0===e.params)throw Error(`Response is missing required field 'params': ${e}`);return new vE({id:e.id,params:vO.from_obj_for_encoding(e.params),createdAtRound:e["created-at-round"],deleted:e.deleted,deletedAtRound:e["deleted-at-round"]})}}class vx extends mA{constructor({id:e,schema:t,closedOutAtRound:r,deleted:i,keyValue:n,optedInAtRound:a}){super(),this.id=e,this.schema=t,this.closedOutAtRound=r,this.deleted=i,this.keyValue=n,this.optedInAtRound=a,this.attribute_map={id:"id",schema:"schema",closedOutAtRound:"closed-out-at-round",deleted:"deleted",keyValue:"key-value",optedInAtRound:"opted-in-at-round"}}static from_obj_for_encoding(e){if(void 0===e.id)throw Error(`Response is missing required field 'id': ${e}`);if(void 0===e.schema)throw Error(`Response is missing required field 'schema': ${e}`);return new vx({id:e.id,schema:vN.from_obj_for_encoding(e.schema),closedOutAtRound:e["closed-out-at-round"],deleted:e.deleted,keyValue:void 0!==e["key-value"]?e["key-value"].map(be.from_obj_for_encoding):void 0,optedInAtRound:e["opted-in-at-round"]})}}class vT extends mA{constructor({appsLocalStates:e,currentRound:t,nextToken:r}){super(),this.appsLocalStates=e,this.currentRound=t,this.nextToken=r,this.attribute_map={appsLocalStates:"apps-local-states",currentRound:"current-round",nextToken:"next-token"}}static from_obj_for_encoding(e){if(!Array.isArray(e["apps-local-states"]))throw Error(`Response is missing required array field 'apps-local-states': ${e}`);if(void 0===e["current-round"])throw Error(`Response is missing required field 'current-round': ${e}`);return new vT({appsLocalStates:e["apps-local-states"].map(vx.from_obj_for_encoding),currentRound:e["current-round"],nextToken:e["next-token"]})}}class vI extends mA{constructor({logs:e,txid:t}){super(),this.logs=e,this.txid=t,this.attribute_map={logs:"logs",txid:"txid"}}static from_obj_for_encoding(e){if(!Array.isArray(e.logs))throw Error(`Response is missing required array field 'logs': ${e}`);if(void 0===e.txid)throw Error(`Response is missing required field 'txid': ${e}`);return new vI({logs:e.logs,txid:e.txid})}}class vk extends mA{constructor({applicationId:e,currentRound:t,logData:r,nextToken:i}){super(),this.applicationId=e,this.currentRound=t,this.logData=r,this.nextToken=i,this.attribute_map={applicationId:"application-id",currentRound:"current-round",logData:"log-data",nextToken:"next-token"}}static from_obj_for_encoding(e){if(void 0===e["application-id"])throw Error(`Response is missing required field 'application-id': ${e}`);if(void 0===e["current-round"])throw Error(`Response is missing required field 'current-round': ${e}`);return new vk({applicationId:e["application-id"],currentRound:e["current-round"],logData:void 0!==e["log-data"]?e["log-data"].map(vI.from_obj_for_encoding):void 0,nextToken:e["next-token"]})}}class vO extends mA{constructor({approvalProgram:e,clearStateProgram:t,creator:r,extraProgramPages:i,globalState:n,globalStateSchema:a,localStateSchema:s}){super(),this.approvalProgram="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.clearStateProgram="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.creator=r,this.extraProgramPages=i,this.globalState=n,this.globalStateSchema=a,this.localStateSchema=s,this.attribute_map={approvalProgram:"approval-program",clearStateProgram:"clear-state-program",creator:"creator",extraProgramPages:"extra-program-pages",globalState:"global-state",globalStateSchema:"global-state-schema",localStateSchema:"local-state-schema"}}static from_obj_for_encoding(e){if(void 0===e["approval-program"])throw Error(`Response is missing required field 'approval-program': ${e}`);if(void 0===e["clear-state-program"])throw Error(`Response is missing required field 'clear-state-program': ${e}`);return new vO({approvalProgram:e["approval-program"],clearStateProgram:e["clear-state-program"],creator:e.creator,extraProgramPages:e["extra-program-pages"],globalState:void 0!==e["global-state"]?e["global-state"].map(be.from_obj_for_encoding):void 0,globalStateSchema:void 0!==e["global-state-schema"]?vN.from_obj_for_encoding(e["global-state-schema"]):void 0,localStateSchema:void 0!==e["local-state-schema"]?vN.from_obj_for_encoding(e["local-state-schema"]):void 0})}}class vC extends mA{constructor({currentRound:e,application:t}){super(),this.currentRound=e,this.application=t,this.attribute_map={currentRound:"current-round",application:"application"}}static from_obj_for_encoding(e){if(void 0===e["current-round"])throw Error(`Response is missing required field 'current-round': ${e}`);return new vC({currentRound:e["current-round"],application:void 0!==e.application?vE.from_obj_for_encoding(e.application):void 0})}}class vN extends mA{constructor({numByteSlice:e,numUint:t}
92){super(),this.numByteSlice=e,this.numUint=t,this.attribute_map={numByteSlice:"num-byte-slice",numUint:"num-uint"}}static from_obj_for_encoding(e){if(void 0===e["num-byte-slice"])throw Error(`Response is missing required field 'num-byte-slice': ${e}`);if(void 0===e["num-uint"])throw Error(`Response is missing required field 'num-uint': ${e}`);return new vN({numByteSlice:e["num-byte-slice"],numUint:e["num-uint"]})}}class vP extends mA{constructor({applications:e,currentRound:t,nextToken:r}){super(),this.applications=e,this.currentRound=t,this.nextToken=r,this.attribute_map={applications:"applications",currentRound:"current-round",nextToken:"next-token"}}static from_obj_for_encoding(e){if(!Array.isArray(e.applications))throw Error(`Response is missing required array field 'applications': ${e}`);if(void 0===e["current-round"])throw Error(`Response is missing required field 'current-round': ${e}`);return new vP({applications:e.applications.map(vE.from_obj_for_encoding),currentRound:e["current-round"],nextToken:e["next-token"]})}}class vD extends mA{constructor({index:e,params:t,createdAtRound:r,deleted:i,destroyedAtRound:n}){super(),this.index=e,this.params=t,this.createdAtRound=r,this.deleted=i,this.destroyedAtRound=n,this.attribute_map={index:"index",params:"params",createdAtRound:"created-at-round",deleted:"deleted",destroyedAtRound:"destroyed-at-round"}}static from_obj_for_encoding(e){if(void 0===e.index)throw Error(`Response is missing required field 'index': ${e}`);if(void 0===e.params)throw Error(`Response is missing required field 'params': ${e}`);return new vD({index:e.index,params:vL.from_obj_for_encoding(e.params),createdAtRound:e["created-at-round"],deleted:e.deleted,destroyedAtRound:e["destroyed-at-round"]})}}class vR extends mA{constructor({balances:e,currentRound:t,nextToken:r}){super(),this.balances=e,this.currentRound=t,this.nextToken=r,this.attribute_map={balances:"balances",currentRound:"current-round",nextToken:"next-token"}}static from_obj_for_encoding(e){if(!Array.isArray(e.balances))throw Error(`Response is missing required array field 'balances': ${e}`);if(void 0===e["current-round"])throw Error(`Response is missing required field 'current-round': ${e}`);return new vR({balances:e.balances.map(v0.from_obj_for_encoding),currentRound:e["current-round"],nextToken:e["next-token"]})}}class v$ extends mA{constructor({amount:e,assetId:t,isFrozen:r,deleted:i,optedInAtRound:n,optedOutAtRound:a}){super(),this.amount=e,this.assetId=t,this.isFrozen=r,this.deleted=i,this.optedInAtRound=n,this.optedOutAtRound=a,this.attribute_map={amount:"amount",assetId:"asset-id",isFrozen:"is-frozen",deleted:"deleted",optedInAtRound:"opted-in-at-round",optedOutAtRound:"opted-out-at-round"}}static from_obj_for_encoding(e){if(void 0===e.amount)throw Error(`Response is missing required field 'amount': ${e}`);if(void 0===e["asset-id"])throw Error(`Response is missing required field 'asset-id': ${e}`);if(void 0===e["is-frozen"])throw Error(`Response is missing required field 'is-frozen': ${e}`);return new v$({amount:e.amount,assetId:e["asset-id"],isFrozen:e["is-frozen"],deleted:e.deleted,optedInAtRound:e["opted-in-at-round"],optedOutAtRound:e["opted-out-at-round"]})}}class vB extends mA{constructor({assets:e,currentRound:t,nextToken:r}){super(),this.assets=e,this.currentRound=t,this.nextToken=r,this.attribute_map={assets:"assets",currentRound:"current-round",nextToken:"next-token"}}static from_obj_for_encoding(e){if(!Array.isArray(e.assets))throw Error(`Response is missing required array field 'assets': ${e}`);if(void 0===e["current-round"])throw Error(`Response is missing required field 'current-round': ${e}`);return new vB({assets:e.assets.map(v$.from_obj_for_encoding),currentRound:e["current-round"],nextToken:e["next-token"]})}}class vL extends mA{constructor({creator:e,decimals:t,total:r,clawback:i,defaultFrozen:n,freeze:a,manager:s,metadataHash:o,name:l,nameB64:u,reserve:c,unitName:d,unitNameB64:f,url:h,urlB64:p}){super(),this.creator=e,this.decimals=t,this.total=r,this.clawback=i,this.defaultFrozen=n,this.freeze=a,this.manager=s,this.metadataHash="string"==typeof o?new Uint8Array(gj.Buffer.from(o,"base64")):o,this.name=l,this.nameB64="string"==typeof u?new Uint8Array(gj.Buffer.from(u,"base64")):u,this.reserve=c,this.unitName=d,this.unitNameB64="string"==typeof f?new Uint8Array(gj.Buffer.from(f,"base64")):f,this.url=h,this.urlB64="string"==typeof p?new Uint8Array(gj.Buffer.from(p,"base64")):p,this.attribute_map={creator:"creator",decimals:"decimals",total:"total",clawback:"clawback",defaultFrozen:"default-frozen",freeze:"freeze",manager:"manager",metadataHash:"metadata-hash",name:"name",nameB64:"name-b64",reserve:"reserve",unitName:"unit-name",unitNameB64:"unit-name-b64",url:"url",urlB64:"url-b64"}}static from_obj_for_encoding(e){if(void 0===e.creator)throw Error(`Response is missing required field 'creator': ${e}`);if(void 0===e.decimals)throw Error(`Response is missing required field 'decimals': ${e}`);if(void 0===e.total)throw Error(`Response is missing required field 'total': ${e}`);return new vL({creator:e.creator,decimals:e.decimals,total:e.total,clawback:e.clawback,defaultFrozen:e["default-frozen"],freeze:e.freeze,manager:e.manager,metadataHash:e["metadata-hash"],name:e.name,nameB64:e["name-b64"],reserve:e.reserve,unitName:e["unit-name"],unitNameB64:e["unit-name-b64"],url:e.url,urlB64:e["url-b64"]})}}class vU extends mA{constructor({asset:e,currentRound:t}){super(),this.asset=e,this.currentRound=t,this.attribute_map={asset:"asset",currentRound:"current-round"}}static from_obj_for_encoding(e){if(void 0===e.asset)throw Error(`Response is missing required field 'asset': ${e}`);if(void 0===e["current-round"])throw Error(`Response is missing required field 'current-round': ${e}`);return new vU({asset:vD.from_obj_for_encoding(e.asset),currentRound:e["current-round"]})}}class vF extends mA{constructor({assets:e,currentRound:t,nextToken:r}){super(),this.assets=e,this.currentRound=t,this.nextToken=r,this.attribute_map={assets:"assets",currentRound:"current-round",nextToken:"next-token"}}static from_obj_for_encoding(e){if(!Array.isArray(e.assets))throw Error(`Response is missing required array field 'assets': ${e}`);if(void 0===e["current-round"])throw Error(`Response is missing required field 'current-round': ${e}`);return new vF({assets:e.assets.map(vD.from_obj_for_encoding),currentRound:e["current-round"],nextToken:e["next-token"]})}}class vM extends mA{constructor({genesisHash:e,genesisId:t,previousBlockHash:r,round:i,seed:n,timestamp:a,transactionsRoot:s,transactionsRootSha256:o,participationUpdates:l,rewards:u,stateProofTracking:c,transactions:d,txnCounter:f,upgradeState:h,upgradeVote:p}){super(),this.genesisHash="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.genesisId=t,this.previousBlockHash="string"==typeof r?new Uint8Array(gj.Buffer.from(r,"base64")):r,this.round=i,this.seed="string"==typeof n?new Uint8Array(gj.Buffer.from(n,"base64")):n,this.timestamp=a,this.transactionsRoot="string"==typeof s?new Uint8Array(gj.Buffer.from(s,"base64")):s,this.transactionsRootSha256="string"==typeof o?new Uint8Array(gj.Buffer.from(o,"base64")):o,this.participationUpdates=l,this.rewards=u,this.stateProofTracking=c,this.transactions=d,this.txnCounter=f,this.upgradeState=h,this.upgradeVote=p,this.attribute_map={genesisHash:"genesis-hash",genesisId:"genesis-id",previousBlockHash:"previous-block-hash",round:"roun
92d",seed:"seed",timestamp:"timestamp",transactionsRoot:"transactions-root",transactionsRootSha256:"transactions-root-sha256",participationUpdates:"participation-updates",rewards:"rewards",stateProofTracking:"state-proof-tracking",transactions:"transactions",txnCounter:"txn-counter",upgradeState:"upgrade-state",upgradeVote:"upgrade-vote"}}static from_obj_for_encoding(e){if(void 0===e["genesis-hash"])throw Error(`Response is missing required field 'genesis-hash': ${e}`);if(void 0===e["genesis-id"])throw Error(`Response is missing required field 'genesis-id': ${e}`);if(void 0===e["previous-block-hash"])throw Error(`Response is missing required field 'previous-block-hash': ${e}`);if(void 0===e.round)throw Error(`Response is missing required field 'round': ${e}`);if(void 0===e.seed)throw Error(`Response is missing required field 'seed': ${e}`);if(void 0===e.timestamp)throw Error(`Response is missing required field 'timestamp': ${e}`);if(void 0===e["transactions-root"])throw Error(`Response is missing required field 'transactions-root': ${e}`);if(void 0===e["transactions-root-sha256"])throw Error(`Response is missing required field 'transactions-root-sha256': ${e}`);return new vM({genesisHash:e["genesis-hash"],genesisId:e["genesis-id"],previousBlockHash:e["previous-block-hash"],round:e.round,seed:e.seed,timestamp:e.timestamp,transactionsRoot:e["transactions-root"],transactionsRootSha256:e["transactions-root-sha256"],participationUpdates:void 0!==e["participation-updates"]?v1.from_obj_for_encoding(e["participation-updates"]):void 0,rewards:void 0!==e.rewards?vj.from_obj_for_encoding(e.rewards):void 0,stateProofTracking:void 0!==e["state-proof-tracking"]?e["state-proof-tracking"].map(v8.from_obj_for_encoding):void 0,transactions:void 0!==e.transactions?e.transactions.map(br.from_obj_for_encoding):void 0,txnCounter:e["txn-counter"],upgradeState:void 0!==e["upgrade-state"]?vz.from_obj_for_encoding(e["upgrade-state"]):void 0,upgradeVote:void 0!==e["upgrade-vote"]?vV.from_obj_for_encoding(e["upgrade-vote"]):void 0})}}class vj extends mA{constructor({feeSink:e,rewardsCalculationRound:t,rewardsLevel:r,rewardsPool:i,rewardsRate:n,rewardsResidue:a}){super(),this.feeSink=e,this.rewardsCalculationRound=t,this.rewardsLevel=r,this.rewardsPool=i,this.rewardsRate=n,this.rewardsResidue=a,this.attribute_map={feeSink:"fee-sink",rewardsCalculationRound:"rewards-calculation-round",rewardsLevel:"rewards-level",rewardsPool:"rewards-pool",rewardsRate:"rewards-rate",rewardsResidue:"rewards-residue"}}static from_obj_for_encoding(e){if(void 0===e["fee-sink"])throw Error(`Response is missing required field 'fee-sink': ${e}`);if(void 0===e["rewards-calculation-round"])throw Error(`Response is missing required field 'rewards-calculation-round': ${e}`);if(void 0===e["rewards-level"])throw Error(`Response is missing required field 'rewards-level': ${e}`);if(void 0===e["rewards-pool"])throw Error(`Response is missing required field 'rewards-pool': ${e}`);if(void 0===e["rewards-rate"])throw Error(`Response is missing required field 'rewards-rate': ${e}`);if(void 0===e["rewards-residue"])throw Error(`Response is missing required field 'rewards-residue': ${e}`);return new vj({feeSink:e["fee-sink"],rewardsCalculationRound:e["rewards-calculation-round"],rewardsLevel:e["rewards-level"],rewardsPool:e["rewards-pool"],rewardsRate:e["rewards-rate"],rewardsResidue:e["rewards-residue"]})}}class vz extends mA{constructor({currentProtocol:e,nextProtocol:t,nextProtocolApprovals:r,nextProtocolSwitchOn:i,nextProtocolVoteBefore:n}){super(),this.currentProtocol=e,this.nextProtocol=t,this.nextProtocolApprovals=r,this.nextProtocolSwitchOn=i,this.nextProtocolVoteBefore=n,this.attribute_map={currentProtocol:"current-protocol",nextProtocol:"next-protocol",nextProtocolApprovals:"next-protocol-approvals",nextProtocolSwitchOn:"next-protocol-switch-on",nextProtocolVoteBefore:"next-protocol-vote-before"}}static from_obj_for_encoding(e){if(void 0===e["current-protocol"])throw Error(`Response is missing required field 'current-protocol': ${e}`);return new vz({currentProtocol:e["current-protocol"],nextProtocol:e["next-protocol"],nextProtocolApprovals:e["next-protocol-approvals"],nextProtocolSwitchOn:e["next-protocol-switch-on"],nextProtocolVoteBefore:e["next-protocol-vote-before"]})}}class vV extends mA{constructor({upgradeApprove:e,upgradeDelay:t,upgradePropose:r}){super(),this.upgradeApprove=e,this.upgradeDelay=t,this.upgradePropose=r,this.attribute_map={upgradeApprove:"upgrade-approve",upgradeDelay:"upgrade-delay",upgradePropose:"upgrade-propose"}}static from_obj_for_encoding(e){return new vV({upgradeApprove:e["upgrade-approve"],upgradeDelay:e["upgrade-delay"],upgradePropose:e["upgrade-propose"]})}}class vH extends mA{constructor({name:e,value:t}){super(),this.name="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.value="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.attribute_map={name:"name",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.name)throw Error(`Response is missing required field 'name': ${e}`);if(void 0===e.value)throw Error(`Response is missing required field 'value': ${e}`);return new vH({name:e.name,value:e.value})}}class vq extends mA{constructor({name:e}){super(),this.name="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.attribute_map={name:"name"}}static from_obj_for_encoding(e){if(void 0===e.name)throw Error(`Response is missing required field 'name': ${e}`);return new vq({name:e.name})}}class vW extends mA{constructor({applicationId:e,boxes:t,nextToken:r}){super(),this.applicationId=e,this.boxes=t,this.nextToken=r,this.attribute_map={applicationId:"application-id",boxes:"boxes",nextToken:"next-token"}}static from_obj_for_encoding(e){if(void 0===e["application-id"])throw Error(`Response is missing required field 'application-id': ${e}`);if(!Array.isArray(e.boxes))throw Error(`Response is missing required array field 'boxes': ${e}`);return new vW({applicationId:e["application-id"],boxes:e.boxes.map(vq.from_obj_for_encoding),nextToken:e["next-token"]})}}class vK extends mA{constructor({message:e,data:t}){super(),this.message=e,this.data=t,this.attribute_map={message:"message",data:"data"}}static from_obj_for_encoding(e){if(void 0===e.message)throw Error(`Response is missing required field 'message': ${e}`);return new vK({message:e.message,data:e.data})}}class vG extends mA{constructor({action:e,bytes:t,uint:r}){super(),this.action=e,this.bytes=t,this.uint=r,this.attribute_map={action:"action",bytes:"bytes",uint:"uint"}}static from_obj_for_encoding(e){if(void 0===e.action)throw Error(`Response is missing required field 'action': ${e}`);return new vG({action:e.action,bytes:e.bytes,uint:e.uint})}}class vZ extends mA{constructor({key:e,value:t}){super(),this.key=e,this.value=t,this.attribute_map={key:"key",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.key)throw Error(`Response is missing required field 'key': ${e}`);if(void 0===e.value)throw Error(`Response is missing required field 'value': ${e}`);return new vZ({key:e.key,value:vG.from_obj_for_encoding(e.value)})}}class vX extends mA{constructor({hashType:e}){super(),this.hashType=e,this.attribute_map={hashType:"hash-type"}}static from_obj_for_encoding(e){return new vX({hashType:e["hash-type"]})}}class vJ extends mA{constructor({dbAvailable:e,isMigrating:t,message:r,round:i,version:n,data:a,errors:s}){super(),this.dbAvailable=e,this.isMigrating=t,this.message=r,this.round=i,this.version=n,this.data=a,this.errors=s,this.attribute_map={dbAvailable:"db-available",isMigrating:"is-migrating",message:"message",round:"roun
92d",version:"version",data:"data",errors:"errors"}}static from_obj_for_encoding(e){if(void 0===e["db-available"])throw Error(`Response is missing required field 'db-available': ${e}`);if(void 0===e["is-migrating"])throw Error(`Response is missing required field 'is-migrating': ${e}`);if(void 0===e.message)throw Error(`Response is missing required field 'message': ${e}`);if(void 0===e.round)throw Error(`Response is missing required field 'round': ${e}`);if(void 0===e.version)throw Error(`Response is missing required field 'version': ${e}`);return new vJ({dbAvailable:e["db-available"],isMigrating:e["is-migrating"],message:e.message,round:e.round,version:e.version,data:e.data,errors:e.errors})}}class vY extends mA{constructor({blockHeadersCommitment:e,firstAttestedRound:t,latestAttestedRound:r,lnProvenWeight:i,votersCommitment:n}){super(),this.blockHeadersCommitment="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.firstAttestedRound=t,this.latestAttestedRound=r,this.lnProvenWeight=i,this.votersCommitment="string"==typeof n?new Uint8Array(gj.Buffer.from(n,"base64")):n,this.attribute_map={blockHeadersCommitment:"block-headers-commitment",firstAttestedRound:"first-attested-round",latestAttestedRound:"latest-attested-round",lnProvenWeight:"ln-proven-weight",votersCommitment:"voters-commitment"}}static from_obj_for_encoding(e){return new vY({blockHeadersCommitment:e["block-headers-commitment"],firstAttestedRound:e["first-attested-round"],latestAttestedRound:e["latest-attested-round"],lnProvenWeight:e["ln-proven-weight"],votersCommitment:e["voters-commitment"]})}}class vQ extends mA{constructor({hashFactory:e,path:t,treeDepth:r}){super(),this.hashFactory=e,this.path=t,this.treeDepth=r,this.attribute_map={hashFactory:"hash-factory",path:"path",treeDepth:"tree-depth"}}static from_obj_for_encoding(e){return new vQ({hashFactory:void 0!==e["hash-factory"]?vX.from_obj_for_encoding(e["hash-factory"]):void 0,path:e.path,treeDepth:e["tree-depth"]})}}class v0 extends mA{constructor({address:e,amount:t,isFrozen:r,deleted:i,optedInAtRound:n,optedOutAtRound:a}){super(),this.address=e,this.amount=t,this.isFrozen=r,this.deleted=i,this.optedInAtRound=n,this.optedOutAtRound=a,this.attribute_map={address:"address",amount:"amount",isFrozen:"is-frozen",deleted:"deleted",optedInAtRound:"opted-in-at-round",optedOutAtRound:"opted-out-at-round"}}static from_obj_for_encoding(e){if(void 0===e.address)throw Error(`Response is missing required field 'address': ${e}`);if(void 0===e.amount)throw Error(`Response is missing required field 'amount': ${e}`);if(void 0===e["is-frozen"])throw Error(`Response is missing required field 'is-frozen': ${e}`);return new v0({address:e.address,amount:e.amount,isFrozen:e["is-frozen"],deleted:e.deleted,optedInAtRound:e["opted-in-at-round"],optedOutAtRound:e["opted-out-at-round"]})}}class v1 extends mA{constructor({expiredParticipationAccounts:e}){super(),this.expiredParticipationAccounts=e,this.attribute_map={expiredParticipationAccounts:"expired-participation-accounts"}}static from_obj_for_encoding(e){return new v1({expiredParticipationAccounts:e["expired-participation-accounts"]})}}class v2 extends mA{constructor({partProofs:e,positionsToReveal:t,reveals:r,saltVersion:i,sigCommit:n,sigProofs:a,signedWeight:s}){super(),this.partProofs=e,this.positionsToReveal=t,this.reveals=r,this.saltVersion=i,this.sigCommit="string"==typeof n?new Uint8Array(gj.Buffer.from(n,"base64")):n,this.sigProofs=a,this.signedWeight=s,this.attribute_map={partProofs:"part-proofs",positionsToReveal:"positions-to-reveal",reveals:"reveals",saltVersion:"salt-version",sigCommit:"sig-commit",sigProofs:"sig-proofs",signedWeight:"signed-weight"}}static from_obj_for_encoding(e){return new v2({partProofs:void 0!==e["part-proofs"]?vQ.from_obj_for_encoding(e["part-proofs"]):void 0,positionsToReveal:e["positions-to-reveal"],reveals:void 0!==e.reveals?e.reveals.map(v5.from_obj_for_encoding):void 0,saltVersion:e["salt-version"],sigCommit:e["sig-commit"],sigProofs:void 0!==e["sig-proofs"]?vQ.from_obj_for_encoding(e["sig-proofs"]):void 0,signedWeight:e["signed-weight"]})}}class v6 extends mA{constructor({verifier:e,weight:t}){super(),this.verifier=e,this.weight=t,this.attribute_map={verifier:"verifier",weight:"weight"}}static from_obj_for_encoding(e){return new v6({verifier:void 0!==e.verifier?v7.from_obj_for_encoding(e.verifier):void 0,weight:e.weight})}}class v5 extends mA{constructor({participant:e,position:t,sigSlot:r}){super(),this.participant=e,this.position=t,this.sigSlot=r,this.attribute_map={participant:"participant",position:"position",sigSlot:"sig-slot"}}static from_obj_for_encoding(e){return new v5({participant:void 0!==e.participant?v6.from_obj_for_encoding(e.participant):void 0,position:e.position,sigSlot:void 0!==e["sig-slot"]?v4.from_obj_for_encoding(e["sig-slot"]):void 0})}}class v4 extends mA{constructor({lowerSigWeight:e,signature:t}){super(),this.lowerSigWeight=e,this.signature=t,this.attribute_map={lowerSigWeight:"lower-sig-weight",signature:"signature"}}static from_obj_for_encoding(e){return new v4({lowerSigWeight:e["lower-sig-weight"],signature:void 0!==e.signature?v3.from_obj_for_encoding(e.signature):void 0})}}class v3 extends mA{constructor({falconSignature:e,merkleArrayIndex:t,proof:r,verifyingKey:i}){super(),this.falconSignature="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.merkleArrayIndex=t,this.proof=r,this.verifyingKey="string"==typeof i?new Uint8Array(gj.Buffer.from(i,"base64")):i,this.attribute_map={falconSignature:"falcon-signature",merkleArrayIndex:"merkle-array-index",proof:"proof",verifyingKey:"verifying-key"}}static from_obj_for_encoding(e){return new v3({falconSignature:e["falcon-signature"],merkleArrayIndex:e["merkle-array-index"],proof:void 0!==e.proof?vQ.from_obj_for_encoding(e.proof):void 0,verifyingKey:e["verifying-key"]})}}class v8 extends mA{constructor({nextRound:e,onlineTotalWeight:t,type:r,votersCommitment:i}){super(),this.nextRound=e,this.onlineTotalWeight=t,this.type=r,this.votersCommitment="string"==typeof i?new Uint8Array(gj.Buffer.from(i,"base64")):i,this.attribute_map={nextRound:"next-round",onlineTotalWeight:"online-total-weight",type:"type",votersCommitment:"voters-commitment"}}static from_obj_for_encoding(e){return new v8({nextRound:e["next-round"],onlineTotalWeight:e["online-total-weight"],type:e.type,votersCommitment:e["voters-commitment"]})}}class v7 extends mA{constructor({commitment:e,keyLifetime:t}){super(),this.commitment="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.keyLifetime=t,this.attribute_map={commitment:"commitment",keyLifetime:"key-lifetime"}}static from_obj_for_encoding(e){return new v7({commitment:e.commitment,keyLifetime:e["key-lifetime"]})}}class v9 extends mA{constructor({numByteSlice:e,numUint:t}
92){super(),this.numByteSlice=e,this.numUint=t,this.attribute_map={numByteSlice:"num-byte-slice",numUint:"num-uint"}}static from_obj_for_encoding(e){if(void 0===e["num-byte-slice"])throw Error(`Response is missing required field 'num-byte-slice': ${e}`);if(void 0===e["num-uint"])throw Error(`Response is missing required field 'num-uint': ${e}`);return new v9({numByteSlice:e["num-byte-slice"],numUint:e["num-uint"]})}}class be extends mA{constructor({key:e,value:t}){super(),this.key=e,this.value=t,this.attribute_map={key:"key",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.key)throw Error(`Response is missing required field 'key': ${e}`);if(void 0===e.value)throw Error(`Response is missing required field 'value': ${e}`);return new be({key:e.key,value:bt.from_obj_for_encoding(e.value)})}}class bt extends mA{constructor({bytes:e,type:t,uint:r}){super(),this.bytes=e,this.type=t,this.uint=r,this.attribute_map={bytes:"bytes",type:"type",uint:"uint"}}static from_obj_for_encoding(e){if(void 0===e.bytes)throw Error(`Response is missing required field 'bytes': ${e}`);if(void 0===e.type)throw Error(`Response is missing required field 'type': ${e}`);if(void 0===e.uint)throw Error(`Response is missing required field 'uint': ${e}`);return new bt({bytes:e.bytes,type:e.type,uint:e.uint})}}class br extends mA{constructor({fee:e,firstValid:t,lastValid:r,sender:i,applicationTransaction:n,assetConfigTransaction:a,assetFreezeTransaction:s,assetTransferTransaction:o,authAddr:l,closeRewards:u,closingAmount:c,confirmedRound:d,createdApplicationIndex:f,createdAssetIndex:h,genesisHash:p,genesisId:g,globalStateDelta:m,group:y,id:v,innerTxns:b,intraRoundOffset:w,keyregTransaction:_,lease:A,localStateDelta:S,logs:E,note:x,paymentTransaction:T,receiverRewards:I,rekeyTo:k,roundTime:O,senderRewards:C,signature:N,stateProofTransaction:P,txType:D}){super(),this.fee=e,this.firstValid=t,this.lastValid=r,this.sender=i,this.applicationTransaction=n,this.assetConfigTransaction=a,this.assetFreezeTransaction=s,this.assetTransferTransaction=o,this.authAddr=l,this.closeRewards=u,this.closingAmount=c,this.confirmedRound=d,this.createdApplicationIndex=f,this.createdAssetIndex=h,this.genesisHash="string"==typeof p?new Uint8Array(gj.Buffer.from(p,"base64")):p,this.genesisId=g,this.globalStateDelta=m,this.group="string"==typeof y?new Uint8Array(gj.Buffer.from(y,"base64")):y,this.id=v,this.innerTxns=b,this.intraRoundOffset=w,this.keyregTransaction=_,this.lease="string"==typeof A?new Uint8Array(gj.Buffer.from(A,"base64")):A,this.localStateDelta=S,this.logs=E,this.note="string"==typeof x?new Uint8Array(gj.Buffer.from(x,"base64")):x,this.paymentTransaction=T,this.receiverRewards=I,this.rekeyTo=k,this.roundTime=O,this.senderRewards=C,this.signature=N,this.stateProofTransaction=P,this.txType=D,this.attribute_map={fee:"fee",firstValid:"first-valid",lastValid:"last-valid",sender:"sender",applicationTransaction:"application-transaction",assetConfigTransaction:"asset-config-transaction",assetFreezeTransaction:"asset-freeze-transaction",assetTransferTransaction:"asset-transfer-transaction",authAddr:"auth-addr",closeRewards:"close-rewards",closingAmount:"closing-amount",confirmedRound:"confirmed-round",createdApplicationIndex:"created-application-index",createdAssetIndex:"created-asset-index",genesisHash:"genesis-hash",genesisId:"genesis-id",globalStateDelta:"global-state-delta",group:"group",id:"id",innerTxns:"inner-txns",intraRoundOffset:"intra-round-offset",keyregTransaction:"keyreg-transaction",lease:"lease",localStateDelta:"local-state-delta",logs:"logs",note:"note",paymentTransaction:"payment-transaction",receiverRewards:"receiver-rewards",rekeyTo:"rekey-to",roundTime:"round-time",senderRewards:"sender-rewards",signature:"signature",stateProofTransaction:"state-proof-transaction",txType:"tx-type"}}static from_obj_for_encoding(e){if(void 0===e.fee)throw Error(`Response is missing required field 'fee': ${e}`);if(void 0===e["first-valid"])throw Error(`Response is missing required field 'first-valid': ${e}`);if(void 0===e["last-valid"])throw Error(`Response is missing required field 'last-valid': ${e}`);if(void 0===e.sender)throw Error(`Response is missing required field 'sender': ${e}`);return new br({fee:e.fee,firstValid:e["first-valid"],lastValid:e["last-valid"],sender:e.sender,applicationTransaction:void 0!==e["application-transaction"]?bi.from_obj_for_encoding(e["application-transaction"]):void 0,assetConfigTransaction:void 0!==e["asset-config-transaction"]?bn.from_obj_for_encoding(e["asset-config-transaction"]):void 0,assetFreezeTransaction:void 0!==e["asset-freeze-transaction"]?ba.from_obj_for_encoding(e["asset-freeze-transaction"]):void 0,assetTransferTransaction:void 0!==e["asset-transfer-transaction"]?bs.from_obj_for_encoding(e["asset-transfer-transaction"]):void 0,authAddr:e["auth-addr"],closeRewards:e["close-rewards"],closingAmou
92nt:e["closing-amount"],confirmedRound:e["confirmed-round"],createdApplicationIndex:e["created-application-index"],createdAssetIndex:e["created-asset-index"],genesisHash:e["genesis-hash"],genesisId:e["genesis-id"],globalStateDelta:void 0!==e["global-state-delta"]?e["global-state-delta"].map(vZ.from_obj_for_encoding):void 0,group:e.group,id:e.id,innerTxns:void 0!==e["inner-txns"]?e["inner-txns"].map(br.from_obj_for_encoding):void 0,intraRoundOffset:e["intra-round-offset"],keyregTransaction:void 0!==e["keyreg-transaction"]?bo.from_obj_for_encoding(e["keyreg-transaction"]):void 0,lease:e.lease,localStateDelta:void 0!==e["local-state-delta"]?e["local-state-delta"].map(vA.from_obj_for_encoding):void 0,logs:e.logs,note:e.note,paymentTransaction:void 0!==e["payment-transaction"]?bl.from_obj_for_encoding(e["payment-transaction"]):void 0,receiverRewards:e["receiver-rewards"],rekeyTo:e["rekey-to"],roundTime:e["round-time"],senderRewards:e["sender-rewards"],signature:void 0!==e.signature?bc.from_obj_for_encoding(e.signature):void 0,stateProofTransaction:void 0!==e["state-proof-transaction"]?bp.from_obj_for_encoding(e["state-proof-transaction"]):void 0,txType:e["tx-type"]})}}class bi extends mA{constructor({applicationId:e,accounts:t,applicationArgs:r,approvalProgram:i,clearStateProgram:n,extraProgramPages:a,foreignApps:s,foreignAssets:o,globalStateSchema:l,localStateSchema:u,onCompletion:c}){super(),this.applicationId=e,this.accounts=t,this.applicationArgs=r,this.approvalProgram="string"==typeof i?new Uint8Array(gj.Buffer.from(i,"base64")):i,this.clearStateProgram="string"==typeof n?new Uint8Array(gj.Buffer.from(n,"base64")):n,this.extraProgramPages=a,this.foreignApps=s,this.foreignAssets=o,this.globalStateSchema=l,this.localStateSchema=u,this.onCompletion=c,this.attribute_map={applicationId:"application-id",accounts:"accounts",applicationArgs:"application-args",approvalProgram:"approval-program",clearStateProgram:"clear-state-program",extraProgramPages:"extra-program-pages",foreignApps:"foreign-apps",foreignAssets:"foreign-assets",globalStateSchema:"global-state-schema",localStateSchema:"local-state-schema",onCompletion:"on-completion"}}static from_obj_for_encoding(e){if(void 0===e["application-id"])throw Error(`Response is missing required field 'application-id': ${e}`);return new bi({applicationId:e["application-id"],accounts:e.accounts,applicationArgs:e["application-args"],approvalProgram:e["approval-program"],clearStateProgram:e["clear-state-program"],extraProgramPages:e["extra-program-pages"],foreignApps:e["foreign-apps"],foreignAssets:e["foreign-assets"],globalStateSchema:void 0!==e["global-state-schema"]?v9.from_obj_for_encoding(e["global-state-schema"]):void 0,localStateSchema:void 0!==e["local-state-schema"]?v9.from_obj_for_encoding(e["local-state-schema"]):void 0,onCompletion:e["on-completion"]})}}class bn extends mA{constructor({assetId:e,params:t}){super(),this.assetId=e,this.params=t,this.attribute_map={assetId:"asset-id",params:"params"}}static from_obj_for_encoding(e){return new bn({assetId:e["asset-id"],params:void 0!==e.params?vL.from_obj_for_encoding(e.params):void 0})}}class ba extends mA{constructor({address:e,assetId:t,newFreezeStatus:r}){super(),this.address=e,this.assetId=t,this.newFreezeStatus=r,this.attribute_map={address:"address",assetId:"asset-id",newFreezeStatus:"new-freeze-status"}}static from_obj_for_encoding(e){if(void 0===e.address)throw Error(`Response is missing required field 'address': ${e}`);if(void 0===e["asset-id"])throw Error(`Response is missing required field 'asset-id': ${e}`);if(void 0===e["new-freeze-status"])throw Error(`Response is missing required field 'new-freeze-status': ${e}`);return new ba({address:e.address,assetId:e["asset-id"],newFreezeStatus:e["new-freeze-status"]})}}class bs extends mA{constructor({amount:e,assetId:t,receiver:r,closeAmount:i,closeTo:n,sender:a}){super(),this.amount=e,this.assetId=t,this.receiver=r,this.closeAmount=i,this.closeTo=n,this.sender=a,this.attribute_map={amount:"amount",assetId:"asset-id",receiver:"receiver",closeAmount:"close-amount",closeTo:"close-to",sender:"sender"}}static from_obj_for_encoding(e){if(void 0===e.amount)throw Error(`Response is missing required field 'amount': ${e}`);if(void 0===e["asset-id"])throw Error(`Response is missing required field 'asset-id': ${e}`);if(void 0===e.receiver)throw Error(`Response is missing required field 'receiver': ${e}`);return new bs({amount:e.amount,assetId:e["asset-id"],receiver:e.receiver,closeAmount:e["close-amount"],closeTo:e["close-to"],sender:e.sender})}}class bo extends mA{constructor({nonParticipation:e,selectionParticipationKey:t,stateProofKey:r,voteFirstValid:i,voteKeyDilution:n,voteLastValid:a,voteParticipationKey:s}){super(),this.nonParticipation=e,this.selectionParticipationKey="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.stateProofKey="string"==typeof r?new Uint8Array(gj.Buffer.from(r,"base64")):r,this.voteFirstValid=i,this.voteKeyDilution=n,this.voteLastValid=a,this.voteParticipationKey="string"==typeof s?new Uint8Array(gj.Buffer.from(s,"base64")):s,this.attribute_map={nonParticipation:"non-participation",selectionParticipationKey:"selection-
92participation-key",stateProofKey:"state-proof-key",voteFirstValid:"vote-first-valid",voteKeyDilution:"vote-key-dilution",voteLastValid:"vote-last-valid",voteParticipationKey:"vote-participation-key"}}static from_obj_for_encoding(e){return new bo({nonParticipation:e["non-participation"],selectionParticipationKey:e["selection-participation-key"],stateProofKey:e["state-proof-key"],voteFirstValid:e["vote-first-valid"],voteKeyDilution:e["vote-key-dilution"],voteLastValid:e["vote-last-valid"],voteParticipationKey:e["vote-participation-key"]})}}class bl extends mA{constructor({amount:e,receiver:t,closeAmount:r,closeRemainderTo:i}){super(),this.amount=e,this.receiver=t,this.closeAmount=r,this.closeRemainderTo=i,this.attribute_map={amount:"amount",receiver:"receiver",closeAmount:"close-amount",closeRemainderTo:"close-remainder-to"}}static from_obj_for_encoding(e){if(void 0===e.amount)throw Error(`Response is missing required field 'amount': ${e}`);if(void 0===e.receiver)throw Error(`Response is missing required field 'receiver': ${e}`);return new bl({amount:e.amount,receiver:e.receiver,closeAmount:e["close-amount"],closeRemainderTo:e["close-remainder-to"]})}}class bu extends mA{constructor({currentRound:e,transaction:t}){super(),this.currentRound=e,this.transaction=t,this.attribute_map={currentRound:"current-round",transaction:"transaction"}}static from_obj_for_encoding(e){if(void 0===e["current-round"])throw Error(`Response is missing required field 'current-round': ${e}`);if(void 0===e.transaction)throw Error(`Response is missing required field 'transaction': ${e}`);return new bu({currentRound:e["current-round"],transaction:br.from_obj_for_encoding(e.transaction)})}}class bc extends mA{constructor({logicsig:e,multisig:t,sig:r}){super(),this.logicsig=e,this.multisig=t,this.sig="string"==typeof r?new Uint8Array(gj.Buffer.from(r,"base64")):r,this.attribute_map={logicsig:"logicsig",multisig:"multisig",sig:"sig"}}static from_obj_for_encoding(e){return new bc({logicsig:void 0!==e.logicsig?bd.from_obj_for_encoding(e.logicsig):void 0,multisig:void 0!==e.multisig?bf.from_obj_for_encoding(e.multisig):void 0,sig:e.sig})}}class bd extends mA{constructor({logic:e,args:t,multisigSignature:r,signature:i}
92){super(),this.logic="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.args=t,this.multisigSignature=r,this.signature="string"==typeof i?new Uint8Array(gj.Buffer.from(i,"base64")):i,this.attribute_map={logic:"logic",args:"args",multisigSignature:"multisig-signature",signature:"signature"}}static from_obj_for_encoding(e){if(void 0===e.logic)throw Error(`Response is missing required field 'logic': ${e}`);return new bd({logic:e.logic,args:e.args,multisigSignature:void 0!==e["multisig-signature"]?bf.from_obj_for_encoding(e["multisig-signature"]):void 0,signature:e.signature})}}class bf extends mA{constructor({subsignature:e,threshold:t,version:r}){super(),this.subsignature=e,this.threshold=t,this.version=r,this.attribute_map={subsignature:"subsignature",threshold:"threshold",version:"version"}}static from_obj_for_encoding(e){return new bf({subsignature:void 0!==e.subsignature?e.subsignature.map(bh.from_obj_for_encoding):void 0,threshold:e.threshold,version:e.version})}}class bh extends mA{constructor({publicKey:e,signature:t}){super(),this.publicKey="string"==typeof e?new Uint8Array(gj.Buffer.from(e,"base64")):e,this.signature="string"==typeof t?new Uint8Array(gj.Buffer.from(t,"base64")):t,this.attribute_map={publicKey:"public-key",signature:"signature"}}static from_obj_for_encoding(e){return new bh({publicKey:e["public-key"],signature:e.signature})}}class bp extends mA{constructor({message:e,stateProof:t,stateProofType:r}){super(),this.message=e,this.stateProof=t,this.stateProofType=r,this.attribute_map={message:"message",stateProof:"state-proof",stateProofType:"state-proof-type"}}static from_obj_for_encoding(e){return new bp({message:void 0!==e.message?vY.from_obj_for_encoding(e.message):void 0,stateProof:void 0!==e["state-proof"]?v2.from_obj_for_encoding(e["state-proof"]):void 0,stateProofType:e["state-proof-type"]})}}class bg extends mA{constructor({currentRound:e,transactions:t,nextToken:r}){super(),this.currentRound=e,this.transactions=t,this.nextToken=r,this.attribute_map={currentRound:"current-round",transactions:"transactions",nextToken:"next-token"}}static from_obj_for_encoding(e){if(void 0===e["current-round"])throw Error(`Response is missing required field 'current-round': ${e}`);if(!Array.isArray(e.transactions))throw Error(`Response is missing required array field 'transactions': ${e}`);return new bg({currentRound:e["current-round"],transactions:e.transactions.map(br.from_obj_for_encoding),nextToken:e["next-token"]})}}e.s(["Account",0,vb,"AccountParticipation",0,vw,"AccountResponse",0,v_,"AccountStateDelta",0,vA,"AccountsResponse",0,vS,"Application",0,vE,"ApplicationLocalState",0,vx,"ApplicationLocalStatesResponse",0,vT,"ApplicationLogData",0,vI,"ApplicationLogsResponse",0,vk,"ApplicationParams",0,vO,"ApplicationResponse",0,vC,"ApplicationStateSchema",0,vN,"ApplicationsResponse",0,vP,"Asset",0,vD,"AssetBalancesResponse",0,vR,"AssetHolding",0,v$,"AssetHoldingsResponse",0,vB,"AssetParams",0,vL,"AssetResponse",0,vU,"AssetsResponse",0,vF,"Block",0,vM,"BlockRewards",0,vj,"BlockUpgradeState",0,vz,"BlockUpgradeVote",0,vV,"Box",0,vH,"BoxDescriptor",0,vq,"BoxesResponse",0,vW,"ErrorResponse",0,vK,"EvalDelta",0,vG,"EvalDeltaKeyValue",0,vZ,"HashFactory",0,vX,"HealthCheck",0,vJ,"IndexerStateProofMessage",0,vY,"MerkleArrayProof",0,vQ,"MiniAssetHolding",0,v0,"ParticipationUpdates",0,v1,"StateProofFields",0,v2,"StateProofParticipant",0,v6,"StateProofReveal",0,v5,"StateProofSigSlot",0,v4,"StateProofSignature",0,v3,"StateProofTracking",0,v8,"StateProofVerifier",0,v7,"StateSchema",0,v9,"TealKeyValue",0,be,"TealValue",0,bt,"Transaction",0,br,"TransactionApplication",0,bi,"TransactionAssetConfig",0,bn,"TransactionAssetFreeze",0,ba,"TransactionAssetTransfer",0,bs,"TransactionKeyreg",0,bo,"TransactionPayment",0,bl,"TransactionResponse",0,bu,"TransactionSignature",0,bc,"TransactionSignatureLogicsig",0,bd,"TransactionSignatureMultisig",0,bf,"TransactionSignatureMultisigSubsignature",0,bh,"TransactionStateProof",0,bp,"TransactionsResponse",0,bg],874799);
92class bm extends yT{constructor(e,t,r,i){super(e,t),this.index=r,this.index=r;const n=gj.Buffer.from(i).toString("base64");this.query.name=encodeURI(`b64:${n}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return vH.from_obj_for_encoding(e)}}class by extends yT{path(){return"/v2/accounts"}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}limit(e){return this.query.limit=e,this}assetID(e){return this.query["asset-id"]=e,this}nextToken(e){return this.query.next=e,this}round(e){return this.query.round=e,this}authAddr(e){return this.query["auth-addr"]=e,this}applicationID(e){return this.query["application-id"]=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}exclude(e){return this.query.exclude=e,this}}class bv extends yT{path(){return"/v2/transactions"}notePrefix(e){return this.query["note-prefix"]=vs(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}assetID(e){return this.query["asset-id"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e,this}afterTime(e){return this.query["after-time"]=e,this}addressRole(e){return this.query["address-role"]=e,this}address(e){return this.query.address=e,this}excludeCloseTo(e){return this.query["exclude-close-to"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}applicationID(e){return this.query["application-id"]=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}}class bb extends yT{path(){return"/v2/assets"}limit(e){return this.query.limit=e,this}creator(e){return this.query.creator=e,this}name(e){return this.query.name=e,this}unit(e){return this.query.unit=e,this}index(e){return this.query["asset-id"]=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}}class bw extends yT{path(){return"/v2/applications"}index(e){return this.query["application-id"]=e,this}creator(e){return this.query.creator=e,this}nextToken(e){return this.query.next=e,this}limit(e){return this.query.limit=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}}class b_ extends yT{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/applications/${this.index}/boxes`}nextToken(e){return this.query.next=e,this}limit(e){return this.query.limit=e,this}prepare(e){return vW.from_obj_for_encoding(e)}}class bA extends m_{constructor(e,t="http://127.0.0.1",r=8080,i={}){super("X-Indexer-API-Token",e,t,r,i)}makeHealthCheck(){return new vn(this.c,this.intDecoding)}lookupAssetBalances(e){return new va(this.c,this.intDecoding,e)}lookupAssetTransactions(e){return new vl(this.c,this.intDecoding,e)}lookupAccountTransactions(e){return new vo(this.c,this.intDecoding,e)}lookupBlock(e){return new vu(this.c,this.intDecoding,e)}lookupTransactionByID(e){return new vc(this.c,this.intDecoding,e)}lookupAccountByID(e){return new vd(this.c,this.intDecoding,e)}lookupAccountAssets(e){return new vf(this.c,this.intDecoding,e)}lookupAccountCreatedAssets(e){return new vh(this.c,this.intDecoding,e)}lookupAccountAppLocalStates(e){return new vp(this.c,this.intDecoding,e)}lookupAccountCreatedApplications(e){return new vg(this.c,this.intDecoding,e)}lookupAssetByID(e){return new vm(this.c,this.intDecoding,e)}lookupApplications(e){return new vy(this.c,this.intDecoding,e)}lookupApplicationLogs(e){return new vv(this.c,this.intDecoding,e)}searchAccounts(){return new by(this.c,this.intDecoding)}searchForTransactions(){return new bv(this.c,this.intDecoding)}searchForAssets(){return new bb(this.c,this.intDecoding)}searchForApplications(){return new bw(this.c,this.intDecoding)}searchForApplicationBoxes(e){return new b_(this.c,this.intDecoding,e)}lookupApplicationBoxByIDandName(e,t){return new bm(this.c,this.intDecoding,e,t)}}function bS(e,t){let r=e.toString(16);r.length!==2*t&&(r=r.padStart(2*t,"0"));let i=new Uint8Array(r.length/2);for(let e=0,t=0;e<r.length/2;e++,t+=2)i[e]=parseInt(r.slice(t,t+2),16);return i}function bE(e){let t=BigInt(0),r=gj.Buffer.from(e);for(let i=0;i<e.length;i++)t=BigInt(Number(r.readUIntBE(i,1)))+t*BigInt(256);return t}var bx=e.i(157433),bT=e.i(874799);let bI=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","a
92head","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","
92initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","ric
92h","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"],bk="failed to decode mnemonic";function bO(e){let t=[],r=0,i=0;return e.forEach(function(e){r|=e<<i,(i+=8)>=11&&(t.push(2047&r),r>>=11,i-=11)}),i&&t.push(r),t}function bC(e){return e.map(e=>bI[e])}function bN(e){return bC(bO(gZ(e)))[0]}function bP(e){if(32!==e.length)throw RangeError("Seed length must be 32");let t=bC(bO(e)),r=bN(e);return`${t.join(" ")} ${r}`}function bD(e){let t,r,i,n=e.split(" "),a=n.slice(0,24);for(let e of a)if(-1===bI.indexOf(e))throw Error("the mnemonic contains a word that is not in the wordlist");let s=n[n.length-1],o=a.map(e=>bI.indexOf(e)),l=(t=[],r=0,i=0,o.forEach(function(e){for(r|=e<<i,i+=11;i>=8;)t.push(255&r),r>>=8,i-=8}),i&&t.push(r),new Uint8Array(t));if(33!==l.length||0!==l[l.length-1])throw Error(bk);if(bN(l=l.slice(0,l.length-1))===s)return l;throw Error(bk)}class bR{constructor(e){if(this.name="Transaction group",this.tag=gj.Buffer.from("TG"),e.length>16)throw Error(`${e.length.toString()} transactions grouped together but max group size is 16`);this.txGroupHashes=e}get_obj_for_encoding(){return{txlist:this.txGroupHashes}}static from_obj_for_encoding(e){let t=Object.create(this.prototype);for(let r of(t.name="Transaction group",t.tag=gj.Buffer.from("TG"),t.txGroupHashes=[],e.txlist))t.txGroupHashes.push(gj.Buffer.from(r));return t}toByte(){return ms(this.get_obj_for_encoding())}}function b$(e){let t=[];for(let r of e){let e=mp(r);
92t.push(e.rawTxID())}let r=new bR(t),i=r.toByte(),n=gZ(gj.Buffer.from(gG(r.tag,i)));return gj.Buffer.from(n)}function bB(e,t){let r=b$(e),i=[];for(let n of e){let e=mp(n);t&&me(e.from.publicKey)!==t||(e.group=r,i.push(e))}return i}let bL="Cannot mutate a multisig field as it would invalidate all existing signatures.";function bU(e,{version:t,threshold:r,addrs:i}){let n=i.map(e=>g7(e).publicKey),a=n.map(e=>({pk:gj.Buffer.from(e)})),s=e.get_obj_for_encoding(),o={msig:{v:t,thr:r,subsig:a},txn:s},l=mt({version:t,threshold:r,pks:n});return me(s.snd)!==me(l)&&(o.sgnr=gj.Buffer.from(l)),new Uint8Array(ms(o))}function bF(e,{rawSig:t,myPk:r},{version:i,threshold:n,pks:a}){let s=mo(bU(e,{version:i,threshold:n,addrs:a.map(e=>me(e))})),o=!1;if(s.msig.subsig.forEach((e,i)=>{g0(e.pk,r)&&(o=!0,s.msig.subsig[i].s=t)}),!1===o)throw Error("Key does not exist");let l=mt({version:i,threshold:n,pks:a});return me(s.txn.snd)!==me(l)&&(s.sgnr=gj.Buffer.from(l)),new Uint8Array(ms(s))}class bM extends mu{addLease(){throw Error(bL)}addRekey(){throw Error(bL)}signTxn(e){throw Error("Cannot sign a multisig transaction using `signTxn`. Use `partialSignTxn` instead.")}partialSignTxn({version:e,threshold:t,pks:r},i){let n=gY(i).publicKey;return bF(this,{rawSig:this.rawSignTxn(i),myPk:n},{version:e,threshold:t,pks:r})}partialSignWithMultisigSignature(e,t,r){if(!gJ(r.length))throw Error("Cannot add multisig signature. Signature is not of the correct length.");return bF(this,{rawSig:r,myPk:g7(t).publicKey},e)}static from_obj_for_encoding(e){return super.from_obj_for_encoding(e)}}function bj(e){if(e.length<2)throw Error("Not enough multisig transactions to merge. Need at least two");let t=mo(e[0]),r=bM.from_obj_for_encoding(t.txn).txID(),i=t.sgnr?me(t.sgnr):void 0,n=me(mt({version:t.msig.v,threshold:t.msig.thr,pks:t.msig.subsig.map(e=>e.pk)})),a=t.msig.subsig.map(e=>({...e}));for(let s=1;s<e.length;s++){let o=mo(e[s]);if(bM.from_obj_for_encoding(o.txn).txID()!==r)throw Error("Cannot merge txs. txIDs differ");if(i!==(o.sgnr?me(o.sgnr):void 0))throw Error("Cannot merge txs. Auth addrs differ");if(o.msig.subsig.length!==t.msig.subsig.length||n!==me(mt({version:o.msig.v,threshold:o.msig.thr,pks:o.msig.subsig.map(e=>e.pk)})))throw Error("Cannot merge txs. Multisig preimages differ");o.msig.subsig.forEach((e,t)=>{if(!e.s)return;let r=a[t];if(r.s&&0!==gj.Buffer.compare(gj.Buffer.from(e.s),gj.Buffer.from(r.s)))throw Error("Cannot merge txs. subsigs are mismatched.");r.s=e.s})}let s={msig:{v:t.msig.v,thr:t.msig.thr,subsig:a},txn:t.txn};return void 0!==i&&(s.sgnr=gj.Buffer.from(g7(i).publicKey)),new Uint8Array(ms(s))}function bz(e,t,r){let i,n=t.v,a=t.thr,s=t.subsig,o=s.map(e=>e.pk);if(t.subsig.length<a)return!1;try{i=mt({version:n,threshold:a,pks:o})}catch(e){return!1}if(!gK(i,r))return!1;let l=0;for(let e of s)void 0!==e.s&&(l+=1);if(l<a)return!1;let u=0;for(let t of s)void 0!==t.s&&g1(e,t.s,t.pk)&&(u+=1);return!(u<a)}function bV(e,{version:t,threshold:r,addrs:i},n){let a,s,o=mr({version:t,threshold:r,addrs:i});Object.prototype.hasOwnProperty.call(e,"from")||(e.from=o);let l=i.map(e=>g7(e).publicKey);return e instanceof mu?(a=e,s=bM.prototype.partialSignTxn.call(a,{version:t,threshold:r,pks:l},n)):s=(a=new bM(e)).partialSignTxn({version:t,threshold:r,pks:l},n),{txID:a.txID().toString(),blob:s}}function bH(e){if(!e||0===e.length)throw Error("empty program");if(e.every(e=>10===e||32<=e&&e<=126)){let t=gj.Buffer.from(e).toString();if(g9(t))throw Error("requesting program bytes, get Algorand address");if(gj.Buffer.from(t,"base64").toString("base64")===t)throw Error("program should not be b64 encoded");throw Error("program bytes are all ASCII printable characters, not looking like Teal byte code")}}class bq{constructor(e,t){let r;if(this.tag=gj.Buffer.from("Program"),t&&(!Array.isArray(t)||!t.every(e=>e.constructor===Uint8Array||gj.Buffer.isBuffer(e))))throw TypeError("Invalid arguments");null!=t&&(r=t.map(e=>new Uint8Array(e))),bH(e),this.logic=e,this.args=r,this.sig=void 0,this.msig=void 0}get_obj_for_encoding(){let e={l:this.logic};return this.args&&(e.arg=this.args),this.sig?e.sig=this.sig:this.msig&&(e.msig=this.msig),e}static from_obj_for_encoding(e){let t=new bq(e.l,e.arg);return t.sig=e.sig,t.msig=e.msig,t}verify(e){if(this.sig&&this.msig)return!1;try{bH(this.logic)}catch(e){return!1}let t=gG(this.tag,this.logic);return this.sig||this.msig?this.sig?g1(t,this.sig,e):bz(t,this.msig,e):gK(gZ(t),e)}address(){return me(new Uint8Array(gZ(gG(this.tag,this.logic))))}sign(e,t){if(null==t)this.sig=this.signProgram(e);else{let r=t.addrs.map(e=>({pk:g7(e).publicKey}));this.msig={v:t.version,thr:t.threshold,subsig:r};let[i,n]=this.singleSignMultisig(e,this.msig);this.msig.subsig[n].s=i}}appendToMultisig(e){if(void 0===this.msig)throw Error("no multisig present");let[t,r]=this.singleSignMultisig(e,this.msig);this.msig.subsig[r].s=t}signProgram(e){return gQ(gG(this.tag,this.logic),e)}singleSignMultisig(e,t){let r=-1,i=gY(e).publicKey;for(let e=0;e<t.subsig.length;e++){let{pk:n}=t.subsig[e];if(gK(n,i)){r=e;break}}if(-1===r)throw Error("invalid secret key");return[this.signProgram(e),r]}toByte(){return ms(this.get_obj_for_encoding())}static fromByte(e){let t=mo(e);return bq.from_obj_for_encoding(t)}
92}class bW{constructor(e,t){this.lsig=new bq(e,t),this.sigkey=void 0}get_obj_for_encoding(){let e={lsig:this.lsig.get_obj_for_encoding()};return this.sigkey&&(e.sigkey=this.sigkey),e}static from_obj_for_encoding(e){let t=new bW(e.lsig.l,e.lsig.arg);return t.lsig=bq.from_obj_for_encoding(e.lsig),t.sigkey=e.sigkey,t}toByte(){return ms(this.get_obj_for_encoding())}static fromByte(e){let t=mo(e);return bW.from_obj_for_encoding(t)}isDelegated(){return!!(this.lsig.sig||this.lsig.msig)}verify(){let e=this.address();return this.lsig.verify(g7(e).publicKey)}address(){if(this.lsig.sig&&this.lsig.msig)throw Error("LogicSig has too many signatures. At most one of sig or msig may be present");if(this.lsig.sig){if(!this.sigkey)throw Error("Signing key for delegated account is missing");return me(this.sigkey)}return this.lsig.msig?me(mt({version:this.lsig.msig.v,threshold:this.lsig.msig.thr,pks:this.lsig.msig.subsig.map(e=>e.pk)})):this.lsig.address()}signMultisig(e,t){this.lsig.sign(t,e)}appendToMultisig(e){this.lsig.appendToMultisig(e)}sign(e){this.lsig.sign(e),this.sigkey=gY(e).publicKey}}function bK(e,t){let r,i;t instanceof bW?(r=t.lsig,i=g7(t.address()).publicKey):i=(r=t).sig?e.from.publicKey:r.msig?mt({version:r.msig.v,threshold:r.msig.thr,pks:r.msig.subsig.map(e=>e.pk)}):g7(r.address()).publicKey;var n=r,a=i;if(!n.verify(a))throw Error("Logic signature verification failed. Ensure the program and signature are valid.");let s={lsig:n.get_obj_for_encoding(),txn:e.get_obj_for_encoding()};return g0(a,e.from.publicKey)||(s.sgnr=gj.Buffer.from(a)),{txID:e.txID().toString(),blob:ms(s)}}let bG=gj.Buffer.from("ProgData");function bZ(e,t,r){let i=gG(g7(r).publicKey,t);return gQ(gj.Buffer.from(gG(bG,i)),e)}let bX={},bJ={};function bY(e){return e.params["approval-program"]=gj.Buffer.from(e.params["approval-program"].toString(),"base64"),e.params["clear-state-program"]=gj.Buffer.from(e.params["clear-state-program"].toString(),"base64"),e}async function bQ({client:e,txns:t,protocolVersion:r,latestTimestamp:i,round:n,sources:a}){let s=[],o=[],l=[],u=[],c=[];for(let e of t)e.txn.type===q.appl&&(c.push(me(e.txn.from.publicKey)),e.txn.appAccounts&&c.push(...e.txn.appAccounts.map(e=>me(e.publicKey))),e.txn.appForeignApps&&(l.push(...e.txn.appForeignApps),c.push(...e.txn.appForeignApps.map(e=>mi(e)))),e.txn.appForeignAssets&&u.push(...e.txn.appForeignAssets),void 0===e.txn.appIndex||0===e.txn.appIndex?s.push(new mk({id:0x52414e44,params:new mD({creator:me(e.txn.from.publicKey),approvalProgram:e.txn.appApprovalProgram,clearStateProgram:e.txn.appClearProgram,localStateSchema:new m$({numUint:e.txn.appLocalInts,numByteSlice:e.txn.appLocalByteSlices}),globalStateSchema:new m$({numUint:e.txn.appGlobalInts,numByteSlice:e.txn.appGlobalByteSlices})})})):(l.push(e.txn.appIndex),c.push(mi(e.txn.appIndex))));let d=[];for(let t of[...new Set(u)])d.push(e.getAssetByID(t).do().then(e=>{c.push(e.params.creator)}));await Promise.all(d);let f=[];for(let t of[...new Set(l)])f.push(e.getApplicationByID(t).do().then(e=>{let t=bY(e);s.push(t),c.push(t.params.creator)}));await Promise.all(f);let h=[];for(let t of[...new Set(c)])h.push(e.accountInformation(t).do().then(e=>{"created-apps"in e&&(e["created-apps"]=e["created-apps"].map(e=>bY(e))),o.push(e)}));return await Promise.all(h),new mY({txns:t.map(e=>({...e,txn:e.txn.get_obj_for_encoding()})),accounts:o,apps:s,latestTimestamp:i,round:n,protocolVersion:r,sources:a})}"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split("").forEach(function(e,t){bX[e]=t,bJ[t]=e}),e.s([],102199);class b0{constructor(e){this.type=0,this.bytes="",this.uint=0,this.type=e.type,this.bytes=e.bytes,this.uint=e.uint}toString(){return 1===this.type?`0x${gj.Buffer.from(this.bytes,"base64").toString("hex")}`:this.uint.toString()}}class b1{constructor(e){this.error="",this.line=0,this.pc=0,this.scratch=[],this.stack=[],this.error=void 0===e.error?"":e.error,this.line=e.line,this.pc=e.pc,this.scratch=e.scratch,this.stack=e.stack.map(e=>new b0(e))}}class b2{constructor(e){if(this.trace=[],null==e)return;this.trace=e.map(e=>new b1(e))}}function b6(e,t){return e.length>t&&t>0?`${e.slice(0,t)}...`:e}class b5{constructor(e){this.disassembly=[],this.appCallMessages=[],this.localDeltas=[],this.globalDelta=[],this.cost=0,this.logicSigMessages=[],this.logicSigDisassembly=[],this.logs=[],this.appCallTrace=void 0,this.logicSigTrace=void 0,this.required=["disassembly"],this.optionals=["app-call-messages","local-deltas","global-delta","cost","logic-sig-messages","logic-sig-disassembly","logs"],this.traces=["app-call-trace","logic-sig-trace"],this.disassembly=e.disassembly,this.appCallMessages=e["app-call-messages"],this.localDeltas=e["local-deltas"],this.globalDelta=e["global-delta"],this.cost=e.cost,this.logicSigMessages=e["logic-sig-messages"],this.logicSigDisassembly=e["logic-sig-disassembly"],this.logs=e.logs,this.appCallTrace=new b2(e["app-call-trace"]),this.logicSigTrace=new b2(e["logic-sig-trace"])}appCallRejected(){return void 0!==this.appCallMessages&&this.appCallMessages.includes("REJECT")}logicSigRejected(){return void 0!==this.logicSigMessages&&this.logicSigMessages.includes("REJECT")}static trace(e,t,r){let i=r.maxValueWidth||30,n=[["pc#","ln#","source","scratch","stack"]];for(let a=0;a<e.trace.length;a++){let{line:s,error:o,pc:l,scratch:u,stack:c}=e.trace[a],d=void 0!==u?u:[],f=a>0&&void 0!==e.trace[a-1].scratch?e.trace[a-1].scratch:[],h=""===o?t[s]:`!! ${o} !!`;n.push([l.toString().padEnd(3," "),s.toString().padEnd(3," "),b6(h,i),b6(function(e,t){if(0===t.length)return"";let r=null;for(let i=0;i<t.length;i++){if(i>e.length){r=i;continue}JSON.stringify(e[i])!==JSON.stringify(t[i])&&(r=i)}if(null==r)return"";let i=t[r];return i.bytes.length>0?`${r} = 0x${gj.Buffer.from(i.bytes,"base64").toString("hex")}`:`${r} = ${i.uint.toString()}`}(f,d),i),b6(function(e,t){let r=t?e.reverse():e;return`[${r.map(e=>{switch(e.type){case 1:return`0x${gj.Buffer.from(e.bytes,"base64").toString("hex")}`;case 2:return`${e.uint.toString()}`;default:return""}}).join(", ")}]`}(c,r.topOfStackFirst),i)])}let a=n.reduce((e,t)=>
92{let r=Array(n[0].length).fill(0);for(let i=0;i<e.length;i++)r[i]=t[i].length>e[i]?t[i].length:e[i];return r},Array(n[0].length).fill(0));return`${n.map(e=>e.map((e,t)=>e.padEnd(a[t]+1," ")).join("|").trim()).join("\n")} 93`}appTrace(e){if(void 0===this.appCallTrace||!this.disassembly)return"";let t=e;return void 0===e&&(t={maxValueWidth:30,topOfStackFirst:!1}),b5.trace(this.appCallTrace,this.disassembly,t)}lsigTrace(e){if(void 0===this.logicSigTrace||void 0===this.logicSigDisassembly)return"";let t=e;return void 0===e&&(t={maxValueWidth:30,topOfStackFirst:!0}),b5.trace(this.logicSigTrace,this.logicSigDisassembly,t)}}class b4{constructor(e){this.error="",this.protocolVersion="",this.txns=[],this.error=e.error,this.protocolVersion=e["protocol-version"],this.txns=e.txns.map(e=>new b5(e))}}function b3(e,t,r,i,n,a,s){return new mu({from:e,to:t,amount:r,closeRemainderTo:i,note:n,suggestedParams:a,type:q.pay,reKeyTo:s})}function b8(e){return b3(e.from,e.to,e.amount,e.closeRemainderTo,e.note,e.suggestedParams,e.rekeyTo)}function b7(e,t,r,i,n,a,s,o,l,u=!1,c){let d={from:e,note:t,voteKey:r,selectionKey:i,voteFirst:n,voteLast:a,voteKeyDilution:s,suggestedParams:o,type:q.keyreg,reKeyTo:l,nonParticipation:u,stateProofKey:c};return new mu(d)}function b9(e){return b7(e.from,e.note,e.voteKey,e.selectionKey,e.voteFirst,e.voteLast,e.voteKeyDilution,e.suggestedParams,e.rekeyTo,e.nonParticipation,e.stateProofKey)}function we(e,t,r,i,n,a,s,o,l,u,c,d,f,h,p){let g={from:e,note:t,suggestedParams:h,assetTotal:r,assetDecimals:i,assetDefaultFrozen:n,assetUnitName:u,assetName:c,assetURL:d,assetMetadataHash:f,assetManager:a,assetReserve:s,assetFreeze:o,assetClawback:l,type:q.acfg,reKeyTo:p};return new mu(g)}function wt(e){return we(e.from,e.note,e.total,e.decimals,e.defaultFrozen,e.manager,e.reserve,e.freeze,e.clawback,e.unitName,e.assetName,e.assetURL,e.assetMetadataHash,e.suggestedParams,e.rekeyTo)}function wr(e,t,r,i,n,a,s,o,l=!0,u){if(l&&(void 0===i||void 0===n||void 0===a||void 0===s))throw Error("strict empty address checking was turned on, but at least one empty address was provided");let c={from:e,suggestedParams:o,assetIndex:r,assetManager:i,assetReserve:n,assetFreeze:a,assetClawback:s,type:q.acfg,note:t,reKeyTo:u};return new mu(c)}function wi(e){return wr(e.from,e.note,e.assetIndex,e.manager,e.reserve,e.freeze,e.clawback,e.suggestedParams,e.strictEmptyAddressChecking,e.rekeyTo)}function wn(e,t,r,i,n){return new mu({from:e,suggestedParams:i,assetIndex:r,type:q.acfg,note:t,reKeyTo:n})}function wa(e){return wn(e.from,e.note,e.assetIndex,e.suggestedParams,e.rekeyTo)}function ws(e,t,r,i,n,a,s){return new mu({from:e,type:q.afrz,freezeAccount:i,assetIndex:r,freezeState:n,note:t,suggestedParams:a,reKeyTo:s})}function wo(e){return ws(e.from,e.note,e.assetIndex,e.freezeTarget,e.freezeState,e.suggestedParams,e.rekeyTo)}function wl(e,t,r,i,n,a,s,o,l){let u={type:q.axfer,from:e,to:t,amount:n,suggestedParams:o,assetIndex:s,note:a,assetRevocationTarget:i,closeRemainderTo:r,reKeyTo:l};return new mu(u)}function wu(e){return wl(e.from,e.to,e.closeRemainderTo,e.revocationTarget,e.amount,e.note,e.assetIndex,e.suggestedParams,e.rekeyTo)}function wc(e,t,r,i,n,a,s,o,l,u,c,d,f,h,p,g,m,y){let v={type:q.appl,from:e,suggestedParams:t,appIndex:0,appOnComplete:r,appLocalInts:a,appLocalByteSlices:s,appGlobalInts:o,appGlobalByteSlices:l,appApprovalProgram:i,appClearProgram:n,appArgs:u,appAccounts:c,appForeignApps:d,appForeignAssets:f,boxes:y,note:h,lease:p,reKeyTo:g,extraPages:m};return new mu(v)}function wd(e){return wc(e.from,e.suggestedParams,e.onComplete,e.approvalProgram,e.clearProgram,e.numLocalInts,e.numLocalByteSlices,e.numGlobalInts,e.numGlobalByteSlices,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.extraPages,e.boxes)}function wf(e,t,r,i,n,a,s,o,l,u,c,d,f){let h={type:q.appl,from:e,suggestedParams:t,appIndex:r,appApprovalProgram:i,appOnComplete:W.UpdateApplicationOC,appClearProgram:n,appArgs:a,appAccounts:s,appForeignApps:o,appForeignAssets:l,boxes:f,note:u,lease:c,reKeyTo:d};return new mu(h)}function wh(e){return wf(e.from,e.suggestedParams,e.appIndex,e.approvalProgram,e.clearProgram,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.boxes)}function wp(e,t,r,i,n,a,s,o,l,u,c){let d={type:q.appl,from:e,suggestedParams:t,appIndex:r,appOnComplete:W.DeleteApplicationOC,appArgs:i,appAccounts:n,appForeignApps:a,appForeignAssets:s,boxes:c,note:o,lease:l,reKeyTo:u};return new mu(d)}function wg(e){return wp(e.from,e.suggestedParams,e.appIndex,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.boxes)}function wm(e,t,r,i,n,a,s,o,l,u,c){let d={type:q.appl,from:e,suggestedParams:t,appIndex:r,appOnComplete:W.OptInOC,appArgs:i,appAccounts:n,appForeignApps:a,appForeignAssets:s,boxes:c,note:o,lease:l,reKeyTo:u};return new mu(d)}function wy(e){return wm(e.from,e.suggestedParams,e.appIndex,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.boxes)}function wv(e,t,r,i,n,a,s,o,l,u,c){let d={type:q.appl,from:e,suggestedParams:t,appIndex:r,appOnComplete:W.CloseOutOC,appArgs:i,appAccounts:n,appForeignApps:a,appForeignAssets:s,boxes:c,note:o,lease:l,reKeyTo:u};return new mu(d)}function wb(e){return wv(e.from,e.suggestedParams,e.appIndex,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.boxes)}function ww(e,t,r,i,n,a,s,o,l,u,c){let d={type:q.appl,from:e,suggestedParams:t,appIndex:r,appOnComplete:W.ClearStateOC,appArgs:i,appAccounts:n,appForeignApps:a,appForeignAssets:s,boxes:c,note:o,lease:l,reKeyTo:u};return new mu(d)}function w_(e){return ww(e.from,e.suggestedParams,e.appIndex,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.boxes)}function wA(e,t,r,i,n,a,s,o,l,u,c){let d={type:q.appl,from:e,suggestedParams:t,appIndex:r,appOnComplete:W.N
93oOpOC,appArgs:i,appAccounts:n,appForeignApps:a,appForeignAssets:s,boxes:c,note:o,lease:l,reKeyTo:u};return new mu(d)}function wS(e){return wA(e.from,e.suggestedParams,e.appIndex,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.boxes)}function wE(e){return new mu({type:q.appl,from:e.from,suggestedParams:e.suggestedParams,appIndex:e.appIndex,appOnComplete:e.onComplete,appLocalInts:e.numLocalInts,appLocalByteSlices:e.numLocalByteSlices,appGlobalInts:e.numGlobalInts,appGlobalByteSlices:e.numGlobalByteSlices,appApprovalProgram:e.approvalProgram,appClearProgram:e.clearProgram,appArgs:e.appArgs,appAccounts:e.accounts,appForeignApps:e.foreignApps,appForeignAssets:e.foreignAssets,boxes:e.boxes,note:e.note,lease:e.lease,reKeyTo:e.rekeyTo,extraPages:e.extraPages})}function wx(e){return(t,r)=>{let i=[];for(let n of r)i.push(t[n].signTxn(e.sk));return Promise.resolve(i)}}function wT(e){return(t,r)=>{let i=[];for(let n of r){let{blob:r}=bK(t[n],e);i.push(r)}return Promise.resolve(i)}}function wI(e,t){return(r,i)=>{let n=[];for(let a of i){let i=r[a],s=[];for(let r of t){let{blob:t}=bV(i,e,r);s.push(t)}s.length>1?n.push(bj(s)):n.push(s[0])}return Promise.resolve(n)}}function wk(){return(e,t)=>{let r=[];for(let i of t)r.push(mc(e[i]));return Promise.resolve(r)}}function wO(e){return"object"==typeof e&&2===Object.keys(e).length&&"object"==typeof e.txn&&"function"==typeof e.signer}e.s(["DryrunResult",0,b4,"createDryrun",0,bQ],937490),e.s(["makeApplicationCallTxnFromObject",0,wE,"makeApplicationClearStateTxn",0,ww,"makeApplicationClearStateTxnFromObject",0,w_,"makeApplicationCloseOutTxn",0,wv,"makeApplicationCloseOutTxnFromObject",0,wb,"makeApplicationCreateTxn",0,wc,"makeApplicationCreateTxnFromObject",0,wd,"makeApplicationDeleteTxn",0,wp,"makeApplicationDeleteTxnFromObject",0,wg,"makeApplicationNoOpTxn",0,wA,"makeApplicationNoOpTxnFromObject",0,wS,"makeApplicationOptInTxn",0,wm,"makeApplicationOptInTxnFromObject",0,wy,"makeApplicationUpdateTxn",0,wf,"makeApplicationUpdateTxnFromObject",0,wh,"makeAssetConfigTxnWithSuggestedParams",0,wr,"makeAssetConfigTxnWithSuggestedParamsFromObject",0,wi,"makeAssetCreateTxnWithSuggestedParams",0,we,"makeAssetCreateTxnWithSuggestedParamsFromObject",0,wt,"makeAssetDestroyTxnWithSuggestedParams",0,wn,"makeAssetDestroyTxnWithSuggestedParamsFromObject",0,wa,"makeAssetFreezeTxnWithSuggestedParams",0,ws,"makeAssetFreezeTxnWithSuggestedParamsFromObject",0,wo,"makeAssetTransferTxnWithSuggestedParams",0,wl,"makeAssetTransferTxnWithSuggestedParamsFromObject",0,wu,"makeKeyRegistrationTxnWithSuggestedParams",0,b7,"makeKeyRegistrationTxnWithSuggestedParamsFromObject",0,b9,"makePaymentTxnWithSuggestedParams",0,b3,"makePaymentTxnWithSuggestedParamsFromObject",0,b8],236892),e.s(["isTransactionWithSigner",0,wO,"makeBasicAccountTransactionSigner",0,wx,"makeEmptyTransactionSigner",0,wk,"makeLogicSigAccountTransactionSigner",0,wT,"makeMultiSigAccountTransactionSigner",0,wI],278295);let wC=/^([a-z\d[\](),]+)\[(0|[1-9][\d]*)]$/,wN=/^ufixed([1-9][\d]*)x([1-9][\d]*)$/;class wP{static from(e){if(e.endsWith("[]"))return new wM(wP.from(e.slice(0,e.length-2)));if(e.endsWith("]")){let t=e.match(wC);if(3!==t.length)throw Error(`malformed static array string: ${e}`);let r=parseInt(t[2],10);if(r>65535)throw Error("array length exceeds limit 65535");return new wF(wP.from(t[1]),r)}if(e.startsWith("uint")){let t=e.slice(4,e.length);if(![...t].every(e=>"0123456789".includes(e)))throw Error(`malformed uint string: ${t}`);let r=parseInt(t,10);if(r>65535)throw Error(`malformed uint string: ${r}`);return new wD(r)}if("byte"===e)return new wL;if(e.startsWith("ufixed")){let t=e.match(wN);if(3!==t.length)throw Error(`malformed ufixed type: ${e}`);return new wR(parseInt(t[1],10),parseInt(t[2],10))}if("bool"===e)return new wB;if("address"===e)return new w$;if("string"===e)return new wU;if(e.length>=2&&"("===e[0]&&")"===e[e.length-1]){let t=wj.parseTupleContent(e.slice(1,e.length-1)),r=[];for(let e=0;e<t.length;e++){let i=wP.from(t[e]);r.push(i)}return new wj(r)}throw Error(`cannot convert a string ${e} to an ABI type`)}}class wD extends wP{constructor(e){if(super(),e%8!=0||e<8||e>512)throw Error(`unsupported uint type bitSize: ${e}`);this.bitSize=e}toString(){return`uint${this.bitSize}`}equals(e){return e instanceof wD&&this.bitSize===e.bitSize}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(e){if("bigint"!=typeof e&&"number"!=typeof e)throw Error(`Cannot encode value as uint${this.bitSize}: ${e}`);if(e>=BigInt(2**this.bitSize)||e<BigInt(0))throw Error(`${e} is not a non-negative int or too big to fit in size uint${this.bitSize}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw Error(`${e} should be converted into a BigInt before it is encoded`);return bS(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw Error(`byte string must correspond to a uint${this.bitSize}`);return bE(e)}}class wR extends wP{constructor(e,t){if(super(),e%8!=0||e<8||e>512)throw Error(`unsupported ufixed type bitSize: ${e}`);if(t>160||t<1)throw Error(`unsupported ufixed type precision: ${t}`);this.bitSize=e,this.precision=t}toString(){return`ufixed${this.bitSize}x${this.precision}`}equals(e){return e instanceof wR&&this.bitSize===e.bitSize&&this.precision===e.precision}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(e){if("bigint"!=typeof e&&"number"!=typeof e)throw Error(`Cannot encode value as ${this.toString()}: ${e}`);if(e>=BigInt(2**this.bitSize)||e<BigInt(0))throw Error(`${e} is not a non-negative int or too big to fit in size ${this.toString()}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw Error(`${e} should be converted into a BigInt before it is encoded`);return bS(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw Error(`byte string must correspond to a ${this.toString()}`);return bE(e)}}class w$ extends wP{toString(){return"address"}equals(e){return e instanceof w$}isDynamic(){return!1}byteLen(){return 32}encode(e){if("string"!=typeof e&&!(e instanceof Uint8Array))throw Error(`Cannot encode value as ${this.toString()}: ${e}`);if("string"==typeof e)return g7(e).publicKey;if(32!==e.byteLength)throw Error("byte string must be 32 bytes long for an address");return e}decode(e){if(32!==e.byteLength)throw Error("byte string must be 32 bytes long for an address");return me(e)}}class wB extends wP{toString(){return"bool"}equals(e){return e instanceof wB}isDynamic(){return!1}byteLen(){return 1}encode(e){if("boolean"!=typeof e)throw Error(`Cannot encode value as bool: ${e}`);return new Uint8Array(e?[128]:[0])}decode(e){if(1!==e.byteLength)throw Error("bool string must be 1 byte long");let t=e[0];if(128===t)return!0;
93if(0===t)return!1;throw Error("boolean could not be decoded from the byte string")}}class wL extends wP{toString(){return"byte"}equals(e){return e instanceof wL}isDynamic(){return!1}byteLen(){return 1}encode(e){if("number"!=typeof e&&"bigint"!=typeof e)throw Error(`Cannot encode value as byte: ${e}`);if("bigint"==typeof e&&(e=Number(e)),e<0||e>255)throw Error(`${e} cannot be encoded into a byte`);return new Uint8Array([e])}decode(e){if(1!==e.byteLength)throw Error("byte string must be 1 byte long");return e[0]}}class wU extends wP{toString(){return"string"}equals(e){return e instanceof wU}isDynamic(){return!0}byteLen(){throw Error(`${this.toString()} is a dynamic type`)}encode(e){if("string"!=typeof e&&!(e instanceof Uint8Array))throw Error(`Cannot encode value as string: ${e}`);let t=gj.Buffer.from(e),r=bS(t.length,2),i=new Uint8Array(t.length+2);return i.set(r),i.set(t,2),i}decode(e){if(e.length<2)throw Error(`byte string is too short to be decoded. Actual length is ${e.length}, but expected at least 2`);let t=gj.Buffer.from(e).readUIntBE(0,2),r=e.slice(2,e.length);if(t!==r.length)throw Error(`string length bytes do not match the actual length of string. Expected ${t}, got ${r.length}`);return gj.Buffer.from(r).toString("utf-8")}}class wF extends wP{constructor(e,t){if(super(),t<0)throw Error(`static array must have a non negative length: ${t}`);this.childType=e,this.staticLength=t}toString(){return`${this.childType.toString()}[${this.staticLength}]`}equals(e){return e instanceof wF&&this.staticLength===e.staticLength&&this.childType.equals(e.childType)}isDynamic(){return this.childType.isDynamic()}byteLen(){return this.childType.constructor===wB?Math.ceil(this.staticLength/8):this.staticLength*this.childType.byteLen()}encode(e){if(!Array.isArray(e)&&!(e instanceof Uint8Array))throw Error(`Cannot encode value as ${this.toString()}: ${e}`);if(e.length!==this.staticLength)throw Error(`Value array does not match static array length. Expected ${this.staticLength}, got ${e.length}`);return this.toABITupleType().encode(e)}decode(e){return this.toABITupleType().decode(e)}toABITupleType(){return new wj(Array(this.staticLength).fill(this.childType))}}class wM extends wP{constructor(e){super(),this.childType=e}toString(){return`${this.childType.toString()}[]`}equals(e){return e instanceof wM&&this.childType.equals(e.childType)}isDynamic(){return!0}byteLen(){throw Error(`${this.toString()} is a dynamic type`)}encode(e){if(!Array.isArray(e)&&!(e instanceof Uint8Array))throw Error(`Cannot encode value as ${this.toString()}: ${e}`);let t=this.toABITupleType(e.length),r=t.encode(e);return gG(bS(t.childTypes.length,2),r)}decode(e){let t=gj.Buffer.from(e).readUIntBE(0,2);return this.toABITupleType(t).decode(e.slice(2,e.length))}toABITupleType(e){return new wj(Array(e).fill(this.childType))}}class wj extends wP{constructor(e){if(super(),e.length>=65535)throw Error("tuple type child type number larger than maximum uint16 error");this.childTypes=e}toString(){let e=[];for(let t=0;t<this.childTypes.length;t++)e[t]=this.childTypes[t].toString();return`(${e.join(",")})`}equals(e){return e instanceof wj&&this.childTypes.length===e.childTypes.length&&this.childTypes.every((t,r)=>t.equals(e.childTypes[r]))}isDynamic(){return this.childTypes.some(e=>e.isDynamic())}byteLen(){let e=0;for(let t=0;t<this.childTypes.length;t++)if(this.childTypes[t].constructor===wB){let r=wz(this.childTypes,t,1),i=r+1;t+=r,e+=Math.trunc((i+7)/8)}else e+=this.childTypes[t].byteLen();return e}encode(e){if(!Array.isArray(e)&&!(e instanceof Uint8Array))throw Error(`Cannot encode value as ${this.toString()}: ${e}`);let t=Array.from(e);if(e.length>65535)throw Error("length of tuple array should not exceed a uint16");let r=this.childTypes,i=[],n=[],a=new Map,s=0;for(;s<r.length;){let e=r[s];if(e.isDynamic())a.set(i.length,!0),i.push(new Uint8Array([0,0])),n.push(e.encode(t[s]));else{if(e.constructor===wB){let e=wz(r,s,-1),n=wz(r,s,1);if(e%8!=0)throw Error("expected before index should have number of bool mod 8 equal 0");n=Math.min(7,n);let a=function(e){let t=0;if(e.length>8)throw Error("value list passed in should be no greater than length 8");for(let r=0;r<e.length;r++){let i=e[r];if("boolean"!=typeof i)throw Error("non-boolean values cannot be compressed into a byte");i&&(t|=1<<7-r)}return t}(t.slice(s,s+n+1));i.push(bS(a,1)),s+=n}else{let r=e.encode(t[s]);i.push(r)}a.set(s,!1),n.push(new Uint8Array)}s+=1}let o=0;for(let e of i)o+=e.length;let l=0;for(let e=0;e<i.length;
93e++){if(a.get(e)){let t=o+l;if(t>65535)throw Error(`byte length of ${t} should not exceed a uint16`);i[e]=bS(t,2)}l+=n[e].length}return gG(...i,...n)}decode(e){let t=this.childTypes,r=[],i=[],n=0,a=0,s=gj.Buffer.from(e);for(;n<t.length;){let o=t[n];if(o.isDynamic()){if(e.slice(a,e.length).length<2)throw Error("dynamic type in tuple is too short to be decoded");let t=s.readUIntBE(a,2);if(r.length>0&&(r[r.length-1].right=t,t<r[r.length-1].left))throw Error("dynamic index segment miscalculation: left is greater than right index");let n={left:t,right:-1};r.push(n),i.push(null),a+=2}else if(o.constructor===wB){let t=wz(this.childTypes,n,-1),r=wz(this.childTypes,n,1);if(t%8!=0)throw Error("expected before bool number mod 8 === 0");r=Math.min(7,r);for(let t=0;t<=r;t++){let r=128>>t;(e[a]&r)>0?i.push(new Uint8Array([128])):i.push(new Uint8Array([0]))}n+=r,a+=1}else{let t=o.byteLen();i.push(e.slice(a,a+t)),a+=t}if(n!==t.length-1&&a>=e.length)throw Error("input byte not enough to decode");n+=1}if(r.length>0&&(r[r.length-1].right=e.length,a=e.length),a<e.length)throw Error("input byte not fully consumed");for(let e=0;e<r.length;e++){let t=r[e];if(t.left>t.right)throw Error("dynamic segment should display a [l, r] space with l <= r");if(e!==r.length-1&&t.right!==r[e+1].left)throw Error("dynamic segment should be consecutive")}let o=0;for(let n=0;n<t.length;n++)t[n].isDynamic()&&(i[n]=e.slice(r[o].left,r[o].right),o+=1);let l=[];for(let e=0;e<t.length;e++){let r=t[e].decode(i[e]);l.push(r)}return l}static parseTupleContent(e){if(0===e.length)return[];if(e.endsWith(",")||e.startsWith(","))throw Error("tuple string should not start with comma");if(e.includes(",,"))throw Error("tuple string should not have consecutive commas");let t=[],r=0,i="";for(let n of e)i+=n,"("===n?r+=1:")"===n?r-=1:","===n&&0===r&&(t.push(i.slice(0,i.length-1)),i="");if(0!==i.length&&t.push(i),0!==r)throw Error("tuple string has mismatched parentheses");return t}}function wz(e,t,r){let i=0;for(;;){let n=t+r*i;if(e[n].constructor===wB)if(n!==e.length-1&&1===r)i+=1;else if(n>0&&-1===r)i+=1;else break;else{i-=1;break}}return i}function wV(e){return e===K.any||e===K.pay||e===K.keyreg||e===K.acfg||e===K.axfer||e===K.afrz||e===K.appl}function wH(e,t){return e===K.any||t.type&&t.type.toString()===e.toString()}
93function wq(e){return e===G.account||e===G.application||e===G.asset}e.s(["ABIAddressType",0,w$,"ABIArrayDynamicType",0,wM,"ABIArrayStaticType",0,wF,"ABIBoolType",0,wB,"ABIByteType",0,wL,"ABIStringType",0,wU,"ABITupleType",0,wj,"ABIType",0,wP,"ABIUfixedType",0,wR,"ABIUintType",0,wD,"ADDR_BYTE_SIZE",0,32,"LENGTH_ENCODE_BYTE_SIZE",0,2,"MAX_LEN",0,65535,"SINGLE_BOOL_SIZE",0,1,"SINGLE_BYTE_SIZE",0,1],504452),(f=K||(K={})).any="txn",f.pay="pay",f.keyreg="keyreg",f.acfg="acfg",f.axfer="axfer",f.afrz="afrz",f.appl="appl",e.s(["ABITransactionType",0,K,"abiCheckTransactionType",0,wH,"abiTypeIsTransaction",0,wV],601522),(h=G||(G={})).account="account",h.application="application",h.asset="asset",e.s(["ABIReferenceType",0,G,"abiTypeIsReference",0,wq],757944);class wW{constructor(e){if("string"!=typeof e.name||"object"!=typeof e.returns||!Array.isArray(e.args))throw Error("Invalid ABIMethod parameters");this.name=e.name,this.description=e.desc,this.args=e.args.map(({type:e,name:t,desc:r})=>wV(e)||wq(e)?{type:e,name:t,description:r}:{type:wP.from(e),name:t,description:r}),this.returns={type:"void"===e.returns.type?e.returns.type:wP.from(e.returns.type),description:e.returns.desc}}getSignature(){let e=this.args.map(e=>e.type.toString()).join(","),t=this.returns.type.toString();return`${this.name}(${e})${t}`}getSelector(){return new Uint8Array(gZ(this.getSignature()).slice(0,4))}txnCount(){let e=1;for(let t of this.args)"string"==typeof t.type&&wV(t.type)&&(e+=1);return e}toJSON(){return{name:this.name,desc:this.description,args:this.args.map(({type:e,name:t,description:r})=>({type:e.toString(),name:t,desc:r})),returns:{type:this.returns.type.toString(),desc:this.returns.description}}}static fromSignature(e){let{name:t,args:r,returns:i}=function(e){let t=e.indexOf("(");if(-1===t)throw Error(`Invalid method signature: ${e}`);let r=-1,i=0;for(let n=t;n<e.length;n++){let t=e[n];if("("===t)i+=1;else if(")"===t){if(0===i)break;if(0==(i-=1)){r=n;break}}}if(-1===r)throw Error(`Invalid method signature: ${e}`);return{name:e.slice(0,t),args:wj.parseTupleContent(e.slice(t+1,r)),returns:e.slice(r+1)}}(e);return new wW({name:t,args:r.map(e=>({type:e})),returns:{type:i}})}}function wK(e,t){if(null===e||!Array.isArray(e)||!e.every(e=>e instanceof wW))throw Error("Methods list provided is null or not the correct type");let r=e.filter(e=>e.name===t);if(r.length>1)throw Error(`found ${r.length} methods with the same name ${r.map(e=>e.getSignature()).join(",")}`);if(0===r.length)throw Error(`found 0 methods with the name ${t}`);return r[0]}e.s(["ABIMethod",0,wW,"getMethodByName",0,wK],904252);class wG{constructor(e){if("string"!=typeof e.name||!Array.isArray(e.methods)||e.networks&&"object"!=typeof e.networks)throw Error("Invalid ABIContract parameters");this.name=e.name,this.description=e.desc,this.networks=e.networks?{...e.networks}:{},this.methods=e.methods.map(e=>new wW(e))}toJSON(){return{name:this.name,desc:this.description,networks:this.networks,methods:this.methods.map(e=>e.toJSON())}}getMethodByName(e){return wK(this.methods,e)}}e.s(["ABIContract",0,wG],654686);class wZ{constructor(e){if("string"!=typeof e.name||!Array.isArray(e.methods))throw Error("Invalid ABIInterface parameters");this.name=e.name,this.description=e.desc,this.methods=e.methods.map(e=>new wW(e))}toJSON(){return{name:this.name,desc:this.description,methods:this.methods.map(e=>e.toJSON())}}getMethodByName(e){return wK(this.methods,e)}}async function wX(e,t,r){let i=await e.status().do();if(void 0===i)throw Error("Unable to get node status");let n=i["last-round"]+1,a=n;for(;a<n+r;){let r=!1;try{let i=await e.pendingTransactionInformation(t).do();if(i["confirmed-round"])return i;if(i["pool-error"])throw r=!0,Error(`Transaction Rejected: ${i["pool-error"]}`)}catch(e){if(r)throw e}await e.statusAfterBlock(a).do(),a+=1}throw Error(`Transaction not confirmed after ${r} rounds`)}e.s(["ABIInterface",0,wZ],759917),e.s([],297899);let wJ=gj.Buffer.from([21,31,124,117]);function wY(e,t,r){if(null!=r&&e===r)return 0;let i=+(null!=r);for(let r=0;r<t.length;r++)if(e===t[r])return r+i;return t.push(e),t.length-1+i}(p=Z||(Z={}))[p.BUILDING=0]="BUILDING",p[p.BUILT=1]="BUILT",p[p.SIGNED=2]="SIGNED",p[p.SUBMITTED=3]="SUBMITTED",p[p.COMMITTED=4]="COMMITTED";
93class wQ{constructor(){this.status=Z.BUILDING,this.transactions=[],this.methodCalls=new Map,this.signedTxns=[],this.txIDs=[]}getStatus(){return this.status}count(){return this.transactions.length}clone(){let e=new wQ;return e.transactions=this.transactions.map(({txn:e,signer:t})=>({txn:mu.from_obj_for_encoding({...e.get_obj_for_encoding(),grp:void 0}),signer:t})),e.methodCalls=new Map(this.methodCalls),e}addTransaction(e){if(this.status!==Z.BUILDING)throw Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length===wQ.MAX_GROUP_SIZE)throw Error(`Adding an additional transaction exceeds the maximum atomic group size of ${wQ.MAX_GROUP_SIZE}`);if(e.txn.group&&e.txn.group.some(e=>0!==e))throw Error("Cannot add a transaction with nonzero group ID");this.transactions.push(e)}addMethodCall({appID:e,method:t,methodArgs:r,sender:i,suggestedParams:n,onComplete:a,approvalProgram:s,clearProgram:o,numGlobalInts:l,numGlobalByteSlices:u,numLocalInts:c,numLocalByteSlices:d,extraPages:f,appAccounts:h,appForeignApps:p,appForeignAssets:g,boxes:m,note:y,lease:v,rekeyTo:b,signer:w}){if(this.status!==Z.BUILDING)throw Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length+t.txnCount()>wQ.MAX_GROUP_SIZE)throw Error(`Adding additional transactions exceeds the maximum atomic group size of ${wQ.MAX_GROUP_SIZE}`);if(0===e){if(null==s||null==o||null==l||null==u||null==c||null==d)throw Error("One of the following required parameters for application creation is missing: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices")}else if(a===W.UpdateApplicationOC){if(null==s||null==o)throw Error("One of the following required parameters for OnApplicationComplete.UpdateApplicationOC is missing: approvalProgram, clearProgram");if(null!=l||null!=u||null!=c||null!=d||null!=f)throw Error("One of the following application creation parameters were set on a non-creation call: numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages")}else if(null!=s||null!=o||null!=l||null!=u||null!=c||null!=d||null!=f)throw Error("One of the following application creation parameters were set on a non-creation call: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages");if(null==r&&(r=[]),r.length!==t.args.length)throw Error(`Incorrect number of method arguments. Expected ${t.args.length}, got ${r.length}`);let _=[],A=[],S=[],E=[],x=[],T=new Map;for(let e=0;e<r.length;e++){let i=t.args[e].type,n=r[e];if(wV(i)){if(!wO(n)||!wH(i,n.txn))throw Error(`Expected ${i} TransactionWithSigner for argument at index ${e}`);if(n.txn.group&&n.txn.group.some(e=>0!==e))throw Error("Cannot add a transaction with nonzero group ID");S.push(n);continue}if(wO(n))throw Error(`Expected non-transaction value for argument at index ${e}`);if(wq(i)&&(T.set(E.length,_.length),E.push(i),x.push(n),i=new wD(8)),"string"==typeof i)throw Error(`Unknown ABI type: ${i}`);_.push(i),A.push(n)}let I=[],k=null==h?[]:h.slice(),O=null==p?[]:p.slice(),C=null==g?[]:g.slice();for(let t=0;t<E.length;t++){let r=E[t],n=x[t],a=0;switch(r){case G.account:{let e=new w$;a=wY(e.decode(e.encode(n)),k,i);break}case G.application:{let t=new wD(64),r=t.decode(t.encode(n));if(r>Number.MAX_SAFE_INTEGER)throw Error(`Expected safe integer for application value, got ${r}`);a=wY(Number(r),O,e);break}case G.asset:{let e=new wD(64),t=e.decode(e.encode(n));if(t>Number.MAX_SAFE_INTEGER)throw Error(`Expected safe integer for asset value, got ${t}`);a=wY(Number(t),C);break}default:throw Error(`Unknown reference type: ${r}`)}I.push(a)}for(let e=0;e<I.length;e++)A[T.get(e)]=I[e];if(_.length>15){let e=_.slice(14),t=A.slice(14);_=_.slice(0,14),A=A.slice(0,14),_.push(new wj(e)),A.push(t)}let N=[t.getSelector()];for(let e=0;e<_.length;e++)N.push(_[e].encode(A[e]));let P={txn:wE({from:i,appIndex:e,appArgs:N,accounts:k,foreignApps:O,foreignAssets:C,boxes:m||[],onComplete:null==a?W.NoOpOC:a,approvalProgram:s,clearProgram:o,numGlobalInts:l,numGlobalByteSlices:u,numLocalInts:c,numLocalByteSlices:d,extraPages:f,lease:v,note:y,rekeyTo:b,suggestedParams:n}),signer:w};this.transactions.push(...S,P),this.methodCalls.set(this.transactions.length-1,t)}
93buildGroup(){if(this.status===Z.BUILDING){if(0===this.transactions.length)throw Error("Cannot build a group with 0 transactions");this.transactions.length>1&&bB(this.transactions.map(e=>e.txn)),this.status=Z.BUILT}return this.transactions}async gatherSignatures(){if(this.status>=Z.SIGNED)return this.signedTxns;let e=this.buildGroup(),t=e.map(e=>e.txn),r=new Map;for(let t=0;t<e.length;t++){let{signer:i}=e[t];r.has(i)||r.set(i,[]),r.get(i).push(t)}let i=Array.from(r),n=await Promise.all(i.map(([e,r])=>e(t,r))),a=e.map(()=>null);for(let e=0;e<i.length;e++){let t=i[e][1],r=n[e];for(let e=0;e<t.length;e++)a[t[e]]=r[e]}if(!a.every(e=>null!=e))throw Error(`Missing signatures. Got ${a}`);let s=a.map((e,t)=>{try{return mh(e).txn.txID()}catch(e){throw Error(`Cannot decode signed transaction at index ${t}. ${e}`)}});return this.signedTxns=a,this.txIDs=s,this.status=Z.SIGNED,a}async submit(e){if(this.status>Z.SUBMITTED)throw Error("Transaction group cannot be resubmitted");let t=await this.gatherSignatures();return await e.sendRawTransaction(t).do(),this.status=Z.SUBMITTED,this.txIDs}async simulate(e,t){if(this.status>Z.SUBMITTED)throw Error("Simulated Transaction group has already been submitted to the network");let r=(await this.gatherSignatures()).map(e=>mo(e)),i=null==t?new yo({txnGroups:[]}):t;i.txnGroups=[new yl({txns:r})];let n=await e.simulateTransactions(i).do(),a=[];for(let[e,t]of this.methodCalls){let r=this.txIDs[e],i=n.txnGroups[0].txnResults[e].txnResult,s={txID:r,rawReturnValue:new Uint8Array,method:t};a.push(wQ.parseMethodResponse(t,s,i.get_obj_for_encoding()))}return{methodResults:a,simulateResponse:n}}async execute(e,t){if(this.status===Z.COMMITTED)throw Error("Transaction group has already been executed successfully");let r=await this.submit(e);this.status=Z.SUBMITTED;let i=this.transactions.findIndex((e,t)=>this.methodCalls.has(t)),n=await wX(e,r[-1===i?0:i],t);this.status=Z.COMMITTED;let a=n["confirmed-round"],s=[];for(let[t,a]of this.methodCalls){let o=r[t],l={txID:o,rawReturnValue:new Uint8Array,method:a};try{let r=t===i?n:await e.pendingTransactionInformation(o).do();l=wQ.parseMethodResponse(a,l,r)}catch(e){l.decodeError=e}s.push(l)}return{confirmedRound:a,txIDs:r,methodResults:s}}static parseMethodResponse(e,t,r){try{if(t.txInfo=r,"void"!==e.returns.type){let i=r.logs||[];if(0===i.length)throw Error("App call transaction did not log a return value");let n=gj.Buffer.from(i[i.length-1],"base64");if(n.byteLength<4||!n.slice(0,4).equals(wJ))throw Error("App call transaction did not log a return value");t.rawReturnValue=new Uint8Array(n.slice(4)),t.returnValue=e.returns.type.decode(t.rawReturnValue)}}catch(e){t.decodeError=e}return t}}wQ.MAX_GROUP_SIZE=16,e.s(["AtomicTransactionComposer",0,wQ,"AtomicTransactionComposerStatus",0,Z],242105),e.s([],780397);let w0=gj.Buffer.from([77,88]),w1="The transaction sender address and multisig preimage do not match.";function w2(e,t){void 0===e.from&&(e.from=me(gY(t).publicKey));let r=mp(e);return{txID:r.txID().toString(),blob:r.signTxn(t)}}function w6(e,t){return new mg(e).signBid(t)}function w5(e,t){return gQ(gj.Buffer.from(gG(w0,e)),t)}function w4(e,t,r){return g1(gj.Buffer.from(gG(w0,e)),t,g7(r).publicKey)}function w3(e){return new Uint8Array(ms(e))}function w8(e){return mo(e)}let w7=Error(w1),w9=Error(mm);e.s(["ERROR_INVALID_MICROALGOS",0,w9,"ERROR_MULTISIG_BAD_SENDER",0,w7,"MULTISIG_BAD_SENDER_ERROR_MSG",0,w1,"decodeObj",0,w8,"encodeObj",0,w3,"signBid",0,w6,"signBytes",0,w5,"signTransaction",0,w2,"verifyBytes",0,w4],929267),e.i(929267),e.i(937490),e.i(236892),e.s(["OnApplicationComplete",0,W,"makeApplicationCallTxnFromObject",0,wE,"makeApplicationClearStateTxn",0,ww,"makeApplicationClearStateTxnFromObject",0,w_,"makeApplicationCloseOutTxn",0,wv,"makeApplicationCloseOutTxnFromObject",0,wb,"makeApplicationCreateTxn",0,wc,"makeApplicationCreateTxnFromObject",0,wd,"makeApplicationDeleteTxn",0,wp,"makeApplicationDeleteTxnFromObject",0,wg,"makeApplicationNoOpTxn",0,wA,"makeApplicationNoOpTxnFromObject",0,wS,"makeApplicationOptInTxn",0,wm,"makeApplicationOptInTxnFromObject",0,wy,"makeApplicationUpdateTxn",0,wf,"makeApplicationUpdateTxnFromObject",0,wh,"makeAssetConfigTxnWithSuggestedParams",0,wr,"makeAssetConfigTxnWithSuggestedParamsFromObject",0,wi,"makeAssetCreateTxnWithSuggestedParams",0,we,"makeAssetCreateTxnWithSuggestedParamsFromObject",0,wt,"makeAssetDestroyTxnWithSuggestedParams",0,wn,"makeAssetDestroyTxnWithSuggestedParamsFromObject",0,wa,"makeAssetFreezeTxnWithSuggestedParams",0,ws,"makeAssetFreezeTxnWithSuggestedParamsFromObject",0,wo,"makeAssetTransferTxnWithSuggestedParams",0,wl,"makeAssetTransferTxnWithSuggestedParamsFromObject",0,wu,"makeKeyRegistrationTxnWithSuggestedParams",0,b7,"makeKeyRegistrationTxnWithSuggestedParamsFromObject",0,b9,"makePaymentTxnWithSuggestedParams",0,b3,"makePaymentTxnWithSuggestedParamsFromObject",0,b8],429665
93),e.i(429665),e.i(36651),e.i(278295),e.i(242105),e.i(780397),e.i(102199),e.s([],200858),e.i(200858),e.s(["TransactionType",0,q],907548),e.i(907548),e.s([],848860),e.i(848860),e.s([],793568),e.i(793568),e.s(["TransactionType",0,q],103882),e.i(103882),e.i(297899),e.i(504452),e.i(654686),e.i(759917),e.i(904252),e.i(601522),e.i(757944),e.s(["ABIAddressType",0,w$,"ABIArrayDynamicType",0,wM,"ABIArrayStaticType",0,wF,"ABIBoolType",0,wB,"ABIByteType",0,wL,"ABIContract",0,wG,"ABIInterface",0,wZ,"ABIMethod",0,wW,"ABIReferenceType",0,G,"ABIStringType",0,wU,"ABITransactionType",0,K,"ABITupleType",0,wj,"ABIType",0,wP,"ABIUfixedType",0,wR,"ABIUintType",0,wD,"ADDR_BYTE_SIZE",0,32,"LENGTH_ENCODE_BYTE_SIZE",0,2,"MAX_LEN",0,65535,"SINGLE_BOOL_SIZE",0,1,"SINGLE_BYTE_SIZE",0,1,"abiCheckTransactionType",0,wH,"abiTypeIsReference",0,wq,"abiTypeIsTransaction",0,wV,"getMethodByName",0,wK],170885),e.i(170885),e.s(["ABIAddressType",0,w$,"ABIArrayDynamicType",0,wM,"ABIArrayStaticType",0,wF,"ABIBoolType",0,wB,"ABIByteType",0,wL,"ABIContract",0,wG,"ABIInterface",0,wZ,"ABIMethod",0,wW,"ABIReferenceType",0,G,"ABIStringType",0,wU,"ABITransactionType",0,K,"ABITupleType",0,wj,"ABIType",0,wP,"ABIUfixedType",0,wR,"ABIUintType",0,wD,"ADDR_BYTE_SIZE",0,32,"ALGORAND_MIN_TX_FEE",0,1e3,"Algodv2",()=>vr,"AtomicTransactionComposer",0,wQ,"AtomicTransactionComposerStatus",0,Z,"DryrunResult",0,b4,"ERROR_INVALID_MICROALGOS",0,w9,"ERROR_MULTISIG_BAD_SENDER",0,w7,"INVA
93LID_MICROALGOS_ERROR_MSG",0,mm,"Indexer",()=>bA,"IntDecoding",0,gq,"Kmd",()=>vi,"LENGTH_ENCODE_BYTE_SIZE",0,2,"LogicSig",0,bq,"LogicSigAccount",0,bW,"MAX_LEN",0,65535,"MULTISIG_BAD_SENDER_ERROR_MSG",0,w1,"OnApplicationComplete",0,W,"SINGLE_BOOL_SIZE",0,1,"SINGLE_BYTE_SIZE",0,1,"SourceMap",0,class{constructor({version:e,sources:t,names:r,mappings:i}){if(this.version=e,this.sources=t,this.names=r,this.mappings=i,3!==this.version)throw Error(`Only version 3 is supported, got ${this.version}`);if(void 0===this.mappings)throw Error("mapping undefined, cannot build source map without `mapping`");const n=this.mappings.split(";").map(e=>{let t=function(e){let t=[],r=0,i=0;for(let n=0;n<e.length;n+=1){let a=bX[e[n]];if(void 0===a)throw Error("Invalid character ("+e[n]+")");let s=32&a;if(a&=31,i+=a<<r,s)r+=5;else{let e=1&i;i>>>=1,e?t.push(0===i?-0x80000000:-i):t.push(i),i=r=0}}return t}(e);if(t.length>2)return t[2]});this.pcToLine={},this.lineToPc={};let a=0;for(const[e,t]of n.entries())void 0!==t&&(a+=t),a in this.lineToPc||(this.lineToPc[a]=[]),this.lineToPc[a].push(e),this.pcToLine[e]=a}getLineForPc(e){return this.pcToLine[e]}getPcsForLine(e){return this.lineToPc[e]}},"Transaction",0,mu,"TransactionType",0,q,"abiCheckTransactionType",0,wH,"abiTypeIsReference",0,wq,"abiTypeIsTransaction",0,wV,"algosToMicroalgos",0,function(e){return Math.round(1e6*e)},"appendSignMultisigTransaction",0,function(e,{version:t,threshold:r,addrs:i},n){let a=i.map(e=>g7(e).publicKey),s=mo(e),o=bM.from_obj_for_encoding(s.txn),l=o.partialSignTxn({version:t,threshold:r,pks:a},n);return{txID:o.txID().toString(),blob:bj([e,l])}},"appendSignRawMultisigSignature",0,function(e,{version:t,threshold:r,addrs:i},n,a){let s=i.map(e=>g7(e).publicKey),o=mo(e),l=bM.from_obj_for_encoding(o.txn),u=l.partialSignWithMultisigSignature({version:t,threshold:r,pks:s},n,a);return{txID:l.txID().toString(),blob:bj([e,u])}},"assignGroupID",0,bB,"bigIntToBytes",0,bS,"bytesToBigInt",0,bE,"computeGroupID",0,b$,"createDryrun",0,bQ,"createMultisigTransaction",0,bU,"decodeAddress",0,g7,"decodeObj",0,w8,"decodeSignedTransaction",0,mh,"decodeUint64",0,function(e,t="safe"){if("safe"!==t&&"mixed"!==t&&"bigint"!==t)throw Error(`Unknown decodingMode option: ${t}`);if(0===e.byteLength||e.byteLength>8)throw Error(`Data has unacceptable length. Expected length is between 1 and 8, got ${e.byteLength}`);let r=new DataView(gG(new Uint8Array(8-e.byteLength),e).buffer).getBigUint64(0),i=r>BigInt(Number.MAX_SAFE_INTEGER);if("safe"===t){if(i)throw Error(`Integer exceeds maximum safe integer: ${r.toString()}. Try decoding with "mixed" or "safe" decodingMode.`);return Number(r)}return"mixed"!==t||i?r:Number(r)},"decodeUnsignedTransaction",0,mf,"encodeAddress",0,me,"encodeObj",0,w3,"encodeUint64",0,g5,"encodeUnsignedSimulateTransaction",0,mc,"encodeUnsignedTransaction",0,md,"generateAccount",0,function(){var e;let t=gX((e=gz.default.box.secretKeyLength,function(){let{navigator:e}=globalThis;return"object"==typeof e&&"ReactNative"===e.product}()&&console.warn("It looks like you're running in react-native. In order to perform common crypto operations you will need to polyfill common operations such as crypto.getRandomValues"),gz.default.randomBytes(e)));return{addr:me(t.publicKey),sk:t.secretKey}},"getApplicationAddress",0,mi,"getMethodByName",0,wK,"indexerModels",0,bT,"instantiateTxnIfNeeded",0,mp,"isTransactionWithSigner",0,wO,"isValidAddress",0,g9,"logicSigFromByte",0,function(e){return bq.fromByte(e)},"makeApplicationCallTxnFromObject",0,wE,"makeApplicationClearStateTxn",0,ww,"makeApplicationClearStateTxnFromObject",0,w_,"makeApplicationCloseOutTxn",0,wv,"makeApplicationCloseOutTxnFromObject",0,wb,"makeApplicationCreateTxn",0,wc,"makeApplicationCreateTxnFromObject",0,wd,"makeApplicationDeleteTxn",0,wp,"makeApplicationDeleteTxnFromObject",0,wg,"makeApplicationNoOpTxn",0,wA,"makeApplicationNoOpTxnFromObject",0,wS,"makeApplicationOptInTxn",0,wm,"makeApplicationOptInTxnFromObject",0,wy,"makeApplicationUpdateTxn",0,wf,"makeApplicationUpdateTxnFromObject",0,wh,"makeAssetConfigTxnWithSuggestedParams",0,wr,"makeAssetConfigTxnWithSuggestedParamsFromObject",0,wi,"makeAssetCreateTxnWithSuggestedParams",0,we,"makeAssetCreateTxnWithSuggestedParamsFromObject",0,wt,"makeAssetDestroyTxnWithSuggestedParams",0,wn,"makeAssetDestroyTxnWithSuggestedParamsFromObject",0,wa,"makeAssetFreezeTxnWithSuggestedParams",0,ws,"makeAssetFreezeTxnWithSuggestedParamsFromObject",0,wo,"makeAssetTransferTxnWithSuggestedParams",0,wl,"makeAssetTransferTxnWithSuggestedParamsFromObject",0,wu,"makeBasicAccountTransactionSigner",0,wx,"makeEmptyTransactionSigner",0,wk,"makeKeyRegistrationTxnWithSuggestedParams",0,b7,"makeKeyRegistrationTxnWithSuggestedParamsFromObject",0,b9,"makeLogicSigAccountTransactionSigner",0,wT,"makeMultiSigAccountTransactionSigner",0,wI,"makePaymentTxnWithSuggestedParams",0,b3,"makePaymentTxnWithSuggestedParamsFromObject",0,b8,"masterDerivationKeyToMnemonic",0,function(e){return bP(e)},"mergeMultisigTransactions",0,bj,"microalgosToAlgos",0,function(e){if(e<0||!Number.isSafeInteger(e))throw Error(mm);return e/1e6},"mnemonicFromSeed",0,bP,"mnemonicToMasterDerivationKey",0,function(e){return bD(e)},"mnemonicToSecretKey",0,function(e){let t=gX(bD(e));return{addr:me(t.publicKey),sk:t.secretKey}},"modelsv2",0,bx,"multisigAddress",0,function({version:e,threshold:t,addrs:r}){return mr({version:e,threshold:t,addrs:r})},"secretKeyToMnemonic",0,function(e){return bP(e.slice(0,32))},"seedFromMnemonic",0,bD,"signBid",0,w6,"signBytes",0,w5,"signLogicSigTransaction",0,function(e,t){return bK(mp(e),t)},"signLogicSigTransactionObject",0,bK,"signMultisigTransaction",0,bV,"signTransaction",0,w2,"tealSign",0,bZ,"tealSignFromProgram",0,function(e,t,r){return bZ(e,t,new bq(r).address())},"verifyBytes",0,w4,"verifyMultisig",0,bz,"verifyTealSign",0,function(e,t,r,i){let n=gG(g7(t).publicKey,e);return g1(gj.Buffer.from(gG(bG,n)),r,i)}
93,"waitForConfirmation",0,wX],752654),e.i(752654);let _e="Algorand";class _t{static byteSize=32;static platform=_e;type="Native";address;constructor(e){if(_t.instanceof(e))this.address=e.address;else if(gU.UniversalAddress.instanceof(e))this.address=e.toUint8Array();else if(e instanceof Uint8Array&&e.byteLength===_t.byteSize)this.address=e;else if("string"==typeof e&&g9(e))this.address=g7(e).publicKey;else if("string"!=typeof e||isNaN(parseInt(e)))if("bigint"==typeof e)this.address=gF.encoding.bytes.zpad(gF.encoding.bignum.toBytes(e,8),_t.byteSize);else if(e instanceof Uint8Array&&8===e.byteLength)this.address=gF.encoding.bytes.zpad(e,_t.byteSize);else throw Error(`Invalid Algorand address or ASA ID: ${e}`);else this.address=gF.encoding.bytes.zpad(gF.encoding.bignum.toBytes(BigInt(e),8),_t.byteSize)}unwrap(){return this.toString()}toString(){return me(this.address)}toNative(){return this}toUint8Array(){return this.address}toUniversalAddress(){return new gU.UniversalAddress(this.toUint8Array())}toBigInt(){return gF.encoding.bignum.decode(this.toUint8Array().slice(24,32))}toInt(){var e=this.toBigInt();if(e<BigInt(Number.MIN_SAFE_INTEGER)||e>BigInt(Number.MAX_SAFE_INTEGER))throw Error("Integer is unsafe");return Number(e)}equals(e){return _t.instanceof(e)?e.address===this.address:this.toUniversalAddress().equals(e)}static instanceof(e){return e.constructor.platform===_e}}(0,gM.registerNative)(_e,_t);let _r="Aptos";class _i{static byteSize=32;static platform=_r;type="Native";address;module;constructor(e){if(_i.instanceof(e))this.address=e.address,this.module=e.module;else if(gU.UniversalAddress.instanceof(e))this.address=e.toUint8Array();else if("string"==typeof e){if((e=>/^(0x)?[0-9a-fA-F]+::\w+::\w+$/.test(e))(e)){const t=e.split("::");this.module=t.slice(1).join("::"),e=t[0]}if(e=function(e){return e.length%2!=0||e.length<66?"0x"+(e=e.startsWith("0x")?e.slice(2):e).padStart(64,"0"):e}(e),!gF.encoding.hex.valid(e))throw Error("Invalid Aptos address: "+e);this.address=gF.encoding.hex.decode(e)}else this.address=e}unwrap(){let e=gF.encoding.hex.encode(this.address).replace(/^0+/,""),t=this.module?"::"+this.module:"";return`0x${e}${t}`}toString(){return this.unwrap()}toNative(){return this}toUint8Array(){return this.address}toUniversalAddress(){return new gU.UniversalAddress(this.toUint8Array())}static instanceof(e){return e.constructor.platform===_i.platform}equals(e){return _i.instanceof(e)?e.unwrap()===this.unwrap():this.toUniversalAddress().equals(e)}}(0,gM.registerNative)(_r,_i);var _n=e.i(308331);let _a=[["Cosmoshub","cosmos"],["Evmos","evmos"],["Injective","inj"],["Kujira","kuji"],["Osmosis","osmo"],["Sei","sei"],["Wormchain","wormhole"],["Celestia","celestia"],["Stargaze","stars"],["Dymension","dym"],["Neutron","neutron"],["Seda","seda"],["Provenance","pb"],["Noble","noble"]],_s=(0,_n.constMap)(_a);(0,_n.constMap)(_a,[1,[0]]);let _o=[["Mainnet",[["Cosmoshub","uatom"],["Evmos","aevmos"],["Injective","inj"],["Kujira","kuji"],["Osmosis","uosmo"],["Sei","usei"],["Wormchain","uworm"],["Celestia","utia"],["Dymension","adym"],["Stargaze","ustars"],["Neutron","untrn"],["Provenance","nhash"],["Noble","uusdc"]]],["Testnet",[["Cosmoshub","uatom"],["Evmos","atevmos"],["Injective","inj"],["Kujira","kuji"],["Osmosis","uosmo"],["Sei","usei"],["Wormchain","uworm"],["Seda","aseda"]]],["Devnet",[["Cosmoshub","uatom"],["Evmos","atevmos"],["Injective","inj"],["Kujira","kuji"],["Osmosis","uosmo"],["Sei","usei"],["Wormchain","uworm"]]]];(0,_n.constMap)(_o),(0,_n.constMap)(_o,[[0,2],[1]]),(0,_n.constMap)([["Mainnet",[["Wormchain",{Osmosis:"channel-3",Evmos:"channel-5",Kujira:"channel-9",Stargaze:"channel-12",Injective:"channel-13",Dymension:"channel-15"}],["Osmosis",{Wormchain:"channel-2186"}],["Evmos",{Wormchain:"channel-94"}],["Kujira",{Wormchain:"channel-113"}],["Injective",{Wormchain:"channel-183"}],["Dymension",{Wormchain:"channel-36"}],["Stargaze",{Wormchain:"channel-278"}]]],["Testnet",[["Wormchain",{Cosmoshub:"channel-5",Injective:"channel-15",Kujira:"channel-16",Stargaze:"channel-17",Osmosis:"channel-19",Dymension:"channel-18",Evmos:"channel-20"}],["Cosmoshub",{Wormchain:"channel-3086"}],["Injective",{Wormchain:"channel-76973"}],["Kujira",{Wormchain:"channel-114"}],["Osmosis",{Wormchain:"channel-7904"}],["Stargaze",{Wormchain:"channel-949"}],["Evmos",{Wormchain:"channel-240"}],["Dymension",{Wormchain:"channel-23"}]]],["Devnet",[["Wormchain",{Cosmoshub:"channel-1",Osmosis:"channel-2"}],["Cosmoshub",{Wormchain:"channel-1"}],["Osmosis",{Wormchain:"channel-1"}]]]]),(0,_n.constMap)([["Mainnet",[["Injective","https://lcd.injective.network"],["Evmos","https://rest.bd.evmos.org:1317"]]],["Testnet",[["Injective","https://k8s.testnet.lcd.injective.network"],["Evmos","https://rest.bd.evmos.dev:1317"]]],["Devnet",[["Injective","https://localhost:1234"],["Evmos","https://localhost:1233"]]]]),(0,_n.constMap)([["Mainnet",[["Osmosis","0.025"],["Sei","0.02"],["Cosmoshub","0.025"],["Kujira","0.0051"],["Neutron","0.075"],["Celestia","0.02"],["Stargaze","1.1"],["Injective","700000000"],["Evmos","25000000000"],["Dymension","5000000000"],["Provenance","2100"],["Noble","0.1"]]]]);let _l="Cosmwasm";function _u(e){try{let t=gF.encoding.bech32.decodeToBytes(e);return{data:t.bytes,prefix:t.prefix}}catch{}try{return{data:gF.encoding.hex.decode(e)}}catch{}try{return{data:gF.encoding.b64.decode(e)}}catch{}throw Error(`Cannot decode: ${e}`)}class _c{static contractAddressByteSize=32;static accountAddressByteSize=20;static platform=_l;address;domain;denom;denomType;constructor(e){if(_c.instanceof(e)){this.address=e.address,this.domain=e.domain,this.denom=e.denom,this.denomType=e.denomType;return}if("string"==typeof e){if(e.length<=8){this.address=new Uint8Array(0),this.denom=e,this.denomType="native";return}if(-1!==e.indexOf("/")){const t=e.split("/");if(t.length>=3){const{data:e,prefix:r}=_u(t[t.length-2]);this.address=e,this.domain=r,this.denom=t[t.length-1],this.denomType=t.slice(0,t.length-2).join("/")}else{const{data:e}=_u(t[1]);this.address=e,this.denomType=t[0]}}else{if(!_c.isValidAddress(e))throw Error(`Invalid Cosmwasm address: ${e}`);const{bytes:t,prefix:r}=gF.encoding.bech32.decodeToBytes(e);this.address=t,this.domain=r}}else if(e instanceof Uint8Array)this.address=e;else if(gU.UniversalAddress.instanceof(e))this.address=e.toUint8Array();else throw Error(`Invalid Cosmwasm address ${e}`);
93if(!_c.validAddressLength(this.address))throw Error("Expected 20 or 32 bytes address")}unwrap(){return this.toString()}toString(){return void 0!==this.denomType?"native"===this.denomType?this.denom:"ibc"===this.denomType?`${this.denomType.toLowerCase()}/${gF.encoding.hex.encode(this.address).toUpperCase()}`:`${this.denomType}/${_c.encode(this.domain,this.address)}/${this.denom}`:_c.encode(this.domain,this.address)}toNative(){return this}toUint8Array(){return this.address}toUniversalAddress(){let e=new Uint8Array(gU.UniversalAddress.byteSize);return e.set(this.address,gU.UniversalAddress.byteSize-this.address.length),new gU.UniversalAddress(e)}setChain(e){this.domain=_s.get(e)}static isValidAddress(e){try{let t=gF.encoding.bech32.decodeToBytes(e);return _c.validAddressLength(t.bytes)}catch{}return!1}static encode(e,t){return gF.encoding.bech32.encode(e,gF.encoding.bech32.toWords(t))}static validAddressLength(e){if(e.length!==_c.contractAddressByteSize&&e.length!==_c.accountAddressByteSize)throw Error(`Invalid Cosmwasm address, expected ${_c.contractAddressByteSize} or ${_c.accountAddressByteSize} bytes but got ${e.length}`);return!0}static instanceof(e){return e.constructor.platform===_c.platform}equals(e){return _c.instanceof(e)?this.toString()===e.toString():e.equals(this.toUniversalAddress())}}(0,gM.registerNative)(_l,_c),e.i(432999),e.i(63621);var _d=e.i(329470);let _f="Stacks";var _h=e.i(949574);function _p(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function _g(e,...t){if(!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}let _m=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");_p(e.outputLen),_p(e.blockLen)},_y=function(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")},_v=function(e,t){_g(e);let r=t.outputLen;if(e.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)},_b=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),_w=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([0x11223344]).buffer)[0])throw Error("Non little-endian hardware is not supported");function __(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw TypeError(`utf8ToBytes expected string, got ${typeof e}`);return new TextEncoder().encode(e)}(e)),!(e instanceof Uint8Array))throw TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));class _A{clone(){return this._cloneInto()}}function _S(e){let t=t=>e().update(__(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}class _E extends _A{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,_m(e);const r=__(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?e.create().update(r).digest():r);for(let e=0;e<n.length;e++)n[e]^=54;this.iHash.update(n),this.oHash=e.create();for(let e=0;e<n.length;e++)n[e]^=106;this.oHash.update(n),n.fill(0)}update(e){return _y(this),this.iHash.update(e),this}digestInto(e){_y(this),_g(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:i,destroyed:n,blockLen:a,outputLen:s}=this;return e.finished=i,e.destroyed=n,e.blockLen=a,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let _x=(e,t,r)=>new _E(e,t).update(r).digest();_x.create=(e,t)=>
93new _E(e,t);class _T extends _A{constructor(e,t,r,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=_b(this.buffer)}update(e){_y(this);let{view:t,buffer:r,blockLen:i}=this,n=(e=__(e)).length;for(let a=0;a<n;){let s=Math.min(i-this.pos,n-a);if(s===i){let t=_b(e);for(;i<=n-a;a+=i)this.process(t,a);continue}r.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){_y(this),_v(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:i,isLE:n}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>i-a&&(this.process(r,0),a=0);for(let e=a;e<i;e++)t[e]=0;!function(e,t,r,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,i);let n=BigInt(32),a=BigInt(0xffffffff),s=Number(r>>n&a),o=Number(r&a),l=4*!!i,u=4*!i;e.setUint32(t+l,s,i),e.setUint32(t+u,o,i)}(r,i-8,BigInt(8*this.length),n),this.process(r,0);let s=_b(e),o=this.outputLen;if(o%4)throw Error("_sha2: outputLen should be aligned to 32bit");let l=o/4,u=this.get();if(l>u.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)s.setUint32(4*e,u[e],n)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:i,finished:n,destroyed:a,pos:s}=this;return e.length=i,e.pos=s,e.finished=n,e.destroyed=a,i%t&&e.buffer.set(r),e}}let _I=(e,t,r)=>e&t^~e&r,_k=(e,t,r)=>e&t^e&r^t&r,_O=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),_C=new Uint32Array([0x6a09e66
937,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),_N=new Uint32Array(64);class _P extends _T{constructor(){super(64,32,8,!1),this.A=0|_C[0],this.B=0|_C[1],this.C=0|_C[2],this.D=0|_C[3],this.E=0|_C[4],this.F=0|_C[5],this.G=0|_C[6],this.H=0|_C[7]}get(){let{A:e,B:t,C:r,D:i,E:n,F:a,G:s,H:o}=this;return[e,t,r,i,n,a,s,o]}set(e,t,r,i,n,a,s,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|a,this.G=0|s,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)_N[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=_N[e-15],r=_N[e-2],i=_w(t,7)^_w(t,18)^t>>>3,n=_w(r,17)^_w(r,19)^r>>>10;_N[e]=n+_N[e-7]+i+_N[e-16]|0}let{A:r,B:i,C:n,D:a,E:s,F:o,G:l,H:u}=this;for(let e=0;e<64;e++){let t=u+(_w(s,6)^_w(s,11)^_w(s,25))+_I(s,o,l)+_O[e]+_N[e]|0,c=(_w(r,2)^_w(r,13)^_w(r,22))+_k(r,i,n)|0;u=l,l=o,o=s,s=a+t|0,a=n,n=i,i=r,r=t+c|0}r=r+this.A|0,i=i+this.B|0,n=n+this.C|0,a=a+this.D|0,s=s+this.E|0,o=o+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,i,n,a,s,o,l,u)}roundClean(){_N.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class _D extends _P{constructor(){super(),this.A=-0x3efa6128,this.B=0x367cd507,this.C=0x3070dd17,this.D=-0x8f1a6c7,this.E=-4191439,this.F=0x68581511,this.G=0x64f98fa7,this.H=-0x4105b05c,this.outputLen=28}}let _R=_S(()=>new _P);_S(()=>new _D);let _$=BigInt(0),_B=BigInt(1),_L=BigInt(2),_U=BigInt(3),_F=BigInt(8),_M=Object.freeze({a:_$,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:_B,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")}),_j=(e,t)=>(e+t/_L)/t,_z={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(e){let{n:t}=_M,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-_B*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=BigInt("0x100000000000000000000000000000000"),s=_j(r*e,t),o=_j(-i*e,t),l=Ar(e-s*r-o*n,t),u=Ar(-s*i-o*r,t),c=l>a,d=u>a;if(c&&(l=t-l),d&&(u=t-u),l>a||u>a)throw Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:c,k1:l,k2neg:d,k2:u}}};function _V(e){let{a:t,b:r}=_M,i=Ar(e*e),n=Ar(i*e);return Ar(n+t*e+r)}let _H=_M.a===_$;class _q extends Error{constructor(e){super(e)}}function _W(e){if(!(e instanceof _K))throw TypeError("JacobianPoint expected")}class _K{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof _X))throw TypeError("JacobianPoint#fromAffine: expected Point");return e.equals(_X.ZERO)?_K.ZERO:new _K(e.x,e.y,_B)}static toAffineBatch(e){let t=function(e,t=_M.P){let r=Array(e.length),i=An(e.reduce((e,i,n)=>i===_$?e:(r[n]=e,Ar(e*i,t)),_B),t);return e.reduceRight((e,i,n)=>i===_$?e:(r[n]=Ar(e*r[n],t),Ar(e*i,t)),i),r}(e.map(e=>e.z));return e.map((e,r)=>e.toAffine(t[r]))}static normalizeZ(e){return _K.toAffineBatch(e).map(_K.fromAffine)}equals(e){_W(e);let{x:t,y:r,z:i}=this,{x:n,y:a,z:s}=e,o=Ar(i*i),l=Ar(s*s),u=Ar(t*l),c=Ar(n*o),d=Ar(Ar(r*s)*l),f=Ar(Ar(a*i)*o);return u===c&&d===f}negate(){return new _K(this.x,Ar(-this.y),this.z)}double(){let{x:e,y:t,z:r}=this,i=Ar(e*e),n=Ar(t*t),a=Ar(n*n),s=e+n,o=Ar(_L*(Ar(s*s)-i-a)),l=Ar(_U*i),u=Ar(l*l),c=Ar(u-_L*o),d=Ar(l*(o-c)-_F*a);return new _K(c,d,Ar(_L*t*r))}add(e){_W(e);let{x:t,y:r,z:i}=this,{x:n,y:a,z:s}=e;if(n===_$||a===_$)return this;if(t===_$||r===_$)return e;let o=Ar(i*i),l=Ar(s*s),u=Ar(t*l),c=Ar(n*o),d=Ar(Ar(r*s)*l),f=Ar(Ar(a*i)*o),h=Ar(c-u),p=Ar(f-d);if(h===_$)if(p===_$)return this.double();else return _K.ZERO;let g=Ar(h*h),m=Ar(h*g),y=Ar(u*g),v=Ar(p*p-m-_L*y),b=Ar(p*(y-v)-d*m);return new _K(v,b,Ar(i*s*h))}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){let t=_K.ZERO;if("bigint"==typeof e&&e===_$)return t;let r=At(e);if(r===_B)return this;if(!_H){let e=t,i=this;for(;r>_$;)r&_B&&(e=e.add(i)),i=i.double(),r>>=_B;return e}let{k1neg:i,k1:n,k2neg:a,k2:s}=_z.splitScalar(r),o=t,l=t,u=this;for(;n>_$||s>_$;)n&_B&&(o=o.add(u)),s&_B&&(l=l.add(u)),u=u.double(),n>>=_B,s>>=_B;return i&&(o=o.negate()),a&&(l=l.negate()),l=new _K(Ar(l.x*_z.beta),l.y,l.z),o.add(l)}precomputeWindow(e){let t=_H?128/e+1:256/e+1,r=[],i=this,n=i;for(let a=0;a<t;a++){n=i,r.push(n);for(let t=1;t<2**(e-1);t++)n=n.add(i),r.push(n);i=n.double()}return r}wNAF(e,t){!t&&this.equals(_K.BASE)&&(t=_X.BASE);let r=t&&t._WINDOW_SIZE||1;if(256%r)throw Error("Point#wNAF: Invalid precomputation window, must be power of 2");let i=t&&_Z.get(t);
93!i&&(i=this.precomputeWindow(r),t&&1!==r&&(i=_K.normalizeZ(i),_Z.set(t,i)));let n=_K.ZERO,a=_K.BASE,s=1+(_H?128/r:256/r),o=2**(r-1),l=BigInt(2**r-1),u=2**r,c=BigInt(r);for(let t=0;t<s;t++){let r=t*o,s=Number(e&l);e>>=c,s>o&&(s-=u,e+=_B);let d=r+Math.abs(s)-1,f=t%2!=0,h=s<0;0===s?a=a.add(_G(f,i[r])):n=n.add(_G(h,i[d]))}return{p:n,f:a}}multiply(e,t){let r,i,n=At(e);if(_H){let{k1neg:e,k1:a,k2neg:s,k2:o}=_z.splitScalar(n),{p:l,f:u}=this.wNAF(a,t),{p:c,f:d}=this.wNAF(o,t);l=_G(e,l),c=new _K(Ar((c=_G(s,c)).x*_z.beta),c.y,c.z),r=l.add(c),i=u.add(d)}else{let{p:e,f:a}=this.wNAF(n,t);r=e,i=a}return _K.normalizeZ([r,i])[0]}toAffine(e){let{x:t,y:r,z:i}=this,n=this.equals(_K.ZERO);null==e&&(e=n?_F:An(i));let a=e,s=Ar(a*a),o=Ar(s*a),l=Ar(t*s),u=Ar(r*o),c=Ar(i*a);if(n)return _X.ZERO;if(c!==_B)throw Error("invZ was invalid");return new _X(l,u)}}function _G(e,t){let r=t.negate();return e?r:t}_K.BASE=new _K(_M.Gx,_M.Gy,_B),_K.ZERO=new _K(_$,_B,_$);let _Z=new WeakMap;class _X{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,_Z.delete(this)}hasEvenY(){return this.y%_L===_$}static fromCompressedHex(e){let t=32===e.length,r=_9(t?e:e.subarray(1));if(!As(r))throw Error("Point is not on curve");let i=function(e){let{P:t}=_M,r=BigInt(6),i=BigInt(11),n=BigInt(22),a=BigInt(23),s=BigInt(44),o=BigInt(88),l=e*e*e%t,u=l*l*e%t,c=Ai(u,_U)*u%t,d=Ai(c,_U)*u%t,f=Ai(d,_L)*l%t,h=Ai(f,i)*f%t,p=Ai(h,n)*h%t,g=Ai(p,s)*p%t,m=Ai(g,o)*g%t,y=Ai(m,s)*p%t,v=Ai(y,_U)*u%t,b=Ai(v,a)*h%t,w=Ai(b,r)*l%t,_=Ai(w,_L);if(_*_%t!==e)throw Error("Cannot find square root");return _}(_V(r)),n=(i&_B)===_B;t?n&&(i=Ar(-i)):(1&e[0])==1!==n&&(i=Ar(-i));let a=new _X(r,i);return a.assertValidity(),a}static fromUncompressedHex(e){let t=new _X(_9(e.subarray(1,33)),_9(e.subarray(33,65)));return t.assertValidity(),t}static fromHex(e){let t=Ae(e),r=t.length,i=t[0];if(32===r||33===r&&(2===i||3===i))return this.fromCompressedHex(t);if(65===r&&4===i)return this.fromUncompressedHex(t);throw Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${r}`)}static fromPrivateKey(e){return _X.BASE.multiply(Ao(e))}static fromSignature(e,t,r){let{r:i,s:n}=function(e){if(e instanceof _Q)return e.assertValidity(),e;try{return _Q.fromDER(e)}catch(t){return _Q.fromCompact(e)}}(t);if(![0,1,2,3].includes(r))throw Error("Cannot recover: invalid recovery bit");let a=function(e,t=!1){let r,i,n=(r=8*e.length-256,i=_9(e),r>0?i>>BigInt(r):i);if(t)return n;let{n:a}=_M;return n>=a?n-a:n}(Ae(e)),{n:s}=_M,o=2===r||3===r?i+s:i,l=An(o,s),u=Ar(-a*l,s),c=Ar(n*l,s),d=1&r?"03":"02",f=_X.fromHex(d+_5(o)),h=_X.BASE.multiplyAndAddUnsafe(f,u,c);if(!h)throw Error("Cannot recover signature: point at infinify");return h.assertValidity(),h}toRawBytes(e=!1){return _7(this.toHex(e))}toHex(e=!1){let t=_5(this.x);if(!e)return`04${t}${_5(this.y)}`;{let e=this.hasEvenY()?"02":"03";return`${e}${t}`}}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){let e="Point is not on elliptic curve",{x:t,y:r}=this;if(!As(t)||!As(r))throw Error(e);let i=Ar(r*r);if(Ar(i-_V(t))!==_$)throw Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new _X(this.x,Ar(-this.y))}double(){return _K.fromAffine(this).double().toAffine()}add(e){return _K.fromAffine(this).add(_K.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return _K.fromAffine(this).multiply(e,this).toAffine()}multiplyAndAddUnsafe(e,t,r){let i=_K.fromAffine(this),n=t===_$||t===_B||this!==_X.BASE?i.multiplyUnsafe(t):i.multiply(t),a=_K.fromAffine(e).multiplyUnsafe(r),s=n.add(a);return s.equals(_K.ZERO)?void 0:s.toAffine()}}function _J(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function _Y(e){if(e.length<2||2!==e[0])throw Error(`Invalid signature integer tag: ${_2(e)}`);let t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw Error("Invalid signature integer: trailing length");return{data:_9(r),left:e.subarray(t+2)}}_X.BASE=new _X(_M.Gx,_M.Gy),_X.ZERO=new _X(_$,_$);class _Q{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){let t=e instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof e&&!t)throw TypeError(`${r}: Expected string or Uint8Array`);let i=t?_2(e):e;if(128!==i.length)throw Error(`${r}: Expected 64-byte hex`);return new _Q(_8(i.slice(0,64)),_8(i.slice(64,128)))}static fromDER(e){let t=e instanceof Uint8Array;
93if("string"!=typeof e&&!t)throw TypeError("Signature.fromDER: Expected string or Uint8Array");let{r,s:i}=function(e){if(e.length<2||48!=e[0])throw Error(`Invalid signature tag: ${_2(e)}`);if(e[1]!==e.length-2)throw Error("Invalid signature: incorrect length");let{data:t,left:r}=_Y(e.subarray(2)),{data:i,left:n}=_Y(r);if(n.length)throw Error(`Invalid signature: left bytes after parsing: ${_2(n)}`);return{r:t,s:i}}(t?e:_7(e));return new _Q(r,i)}static fromHex(e){return this.fromDER(e)}assertValidity(){let{r:e,s:t}=this;if(!Aa(e))throw Error("Invalid Signature: r must be 0 < r < n");if(!Aa(t))throw Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){let e=_M.n>>_B;return this.s>e}normalizeS(){return this.hasHighS()?new _Q(this.r,Ar(-this.s,_M.n)):this}toDERRawBytes(){return _7(this.toDERHex())}toDERHex(){let e=_J(_3(this.s)),t=_J(_3(this.r)),r=e.length/2,i=t.length/2,n=_3(r),a=_3(i),s=_3(i+r+4);return`30${s}02${a}${t}02${n}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return _7(this.toCompactHex())}toCompactHex(){return _5(this.r)+_5(this.s)}}function _0(...e){if(!e.every(e=>e instanceof Uint8Array))throw Error("Uint8Array list expected");if(1===e.length)return e[0];let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));for(let r=0,i=0;r<e.length;r++){let n=e[r];t.set(n,i),i+=n.length}return t}let _1=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function _2(e){if(!(e instanceof Uint8Array))throw Error("Expected Uint8Array");let t="";for(let r=0;r<e.length;r++)t+=_1[e[r]];return t}let _6=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function _5(e){if("bigint"!=typeof e)throw Error("Expected bigint");if(!(_$<=e&&e<_6))throw Error("Expected number 0 <= n < 2^256");return e.toString(16).padStart(64,"0")}function _4(e){let t=_7(_5(e));if(32!==t.length)throw Error("Error: expected 32 bytes");return t}function _3(e){let t=e.toString(16);return 1&t.length?`0${t}`:t}function _8(e){if("string"!=typeof e)throw TypeError("hexToNumber: expected string, got "+typeof e);return BigInt(`0x${e}`)}function _7(e){if("string"!=typeof e)throw TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw Error("hexToBytes: received invalid unpadded hex"+e.length);let t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){let i=2*r,n=Number.parseInt(e.slice(i,i+2),16);if(Number.isNaN(n)||n<0)throw Error("Invalid byte sequence");t[r]=n}return t}function _9(e){return _8(_2(e))}function Ae(e){return e instanceof Uint8Array?Uint8Array.from(e):_7(e)}function At(e){if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if("bigint"==typeof e&&Aa(e))return e;throw TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function Ar(e,t=_M.P){let r=e%t;return r>=_$?r:t+r}function Ai(e,t){let{P:r}=_M,i=e;for(;t-- >_$;)i*=i,i%=r;return i}function An(e,t=_M.P){if(e===_$||t<=_$)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Ar(e,t),i=t,n=_$,a=_B,s=_B,o=_$;for(;r!==_$;){let e=i/r,t=i%r,l=n-s*e,u=a-o*e;i=r,r=t,n=s,a=o,s=l,o=u}if(i!==_B)throw Error("invert: does not exist");return Ar(n,t)}function Aa(e){return _$<e&&e<_M.n}function As(e){return _$<e&&e<_M.P}function Ao(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw Error("Expected 32 bytes of private key");t=_8(e)}else if(e instanceof Uint8Array){if(32!==e.length)throw Error("Expected 32 bytes of private key");t=_9(e)}else throw TypeError("Expected valid private key");if(!Aa(t))throw Error("Expected private key: 0 < key < n");return t}_X.BASE._setWindowSize(8);let Al={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},Au={},Ac={bytesToHex:_2,hexToBytes:_7,concatBytes:_0,mod:Ar,invert:An,isValidPrivateKey(e){try{return Ao(e),!0}catch(e){return!1}},_bigintTo32Bytes:_4,_normalizePrivateKey:Ao,hashToPrivateKey:e=>{if((e=Ae(e)).length<40||e.length>1024)throw Error("Expected valid bytes of private key as per FIPS 186");return _4(Ar(_9(e),_M.n-_B)+_B)},randomBytes:(e=32)=>{if(Al.web)return Al.web.getRandomValues(new Uint8Array(e));if(Al.node){let{randomBytes:t}=Al.node;return Uint8Array.from(t(e))}throw Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>Ac.hashToPrivateKey(Ac.randomBytes(40)),precompute(e=8,t=_X.BASE){let r=t===_X.BASE?t:new _X(t.x,t.y);return r._setWindowSize(e),r.multiply(_U),r},sha256:async(...e)=>{if(Al.web)return new Uint8Array(await Al.web.subtle.digest("SHA-256",_0(...e)));if(Al.node){let{createHash:t}=Al.node,r=t("sha256");
93return e.forEach(e=>r.update(e)),Uint8Array.from(r.digest())}throw Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(Al.web){let r=await Al.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),i=_0(...t);return new Uint8Array(await Al.web.subtle.sign("HMAC",r,i))}if(Al.node){let{createHmac:r}=Al.node,i=r("sha256",e);return t.forEach(e=>i.update(e)),Uint8Array.from(i.digest())}throw Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(e,...t)=>{let r=Au[e];if(void 0===r){let t=await Ac.sha256(Uint8Array.from(e,e=>e.charCodeAt(0)));r=_0(t,t),Au[e]=r}return Ac.sha256(r,...t)},taggedHashSync:(e,...t)=>{if("function"!=typeof r)throw new _q("sha256Sync is undefined, you need to set it");let i=Au[e];if(void 0===i){let t=r(Uint8Array.from(e,e=>e.charCodeAt(0)));i=_0(t,t),Au[e]=i}return r(i,...t)},_JacobianPoint:_K};Object.defineProperties(Ac,{sha256Sync:{configurable:!1,get:()=>r,set(e){r||(r=e)}},hmacSha256Sync:{configurable:!1,get:()=>i,set(e){i||(i=e)}}});let Ad=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Af(e){if(!(e instanceof Uint8Array))throw Error("Uint8Array expected");let t="";for(let r of e)t+=Ad[r];return t}function Ah(e){var t;if("string"!=typeof e)throw TypeError(`hexToBytes: expected string, got ${typeof e}`);t=e;let r=new Uint8Array((e=(e=/^0x/i.test(t)?t.slice(2):t).length%2?`0${e}`:e).length/2);for(let t=0;t<r.length;t++){let i=2*t,n=Number.parseInt(e.slice(i,i+2),16);if(Number.isNaN(n)||n<0)throw Error("Invalid byte sequence");r[t]=n}return r}(g=X||(X={}))[g.Mainnet=1]="Mainnet",g[g.Testnet=0x80000000]="Testnet",(m=J||(J={}))[m.Mainnet=0x17000000]="Mainnet",m[m.Testnet=0xff000000]="Testnet",X.Mainnet,(y=Y||(Y={}))[y.Mainnet=0]="Mainnet",y[y.Testnet=128]="Testnet",(v=Q||(Q={}))[v.MainnetSingleSig=22]="MainnetSingleSig",v[v.MainnetMultiSig=20]="MainnetMultiSig",v[v.TestnetSingleSig=26]="TestnetSingleSig",v[v.TestnetMultiSig=21]="TestnetMultiSig",Y.Mainnet;let Ap={chainId:X.Mainnet,transactionVersion:Y.Mainnet,peerNetworkId:J.Mainnet,magicBytes:"X2",bootAddress:"SP000000000000000000002Q6VF78",addressVersion:{singleSig:Q.MainnetSingleSig,multiSig:Q.MainnetMultiSig},client:{baseUrl:"https://api.mainnet.hiro.so"}},Ag={chainId:X.Testnet,transactionVersion:Y.Testnet,peerNetworkId:J.Testnet,magicBytes:"T2",bootAddress:"ST000000000000000000002AMW42H",addressVersion:{singleSig:Q.TestnetSingleSig,multiSig:Q.TestnetMultiSig},client:{baseUrl:"https://api.testnet.hiro.so"}},Am={...Ag,addressVersion:{...Ag.addressVersion},magicBytes:"id",client:{baseUrl:"http://localhost:3999"}},Ay={...Am,addressVersion:{...Am.addressVersion},client:{...Am.client}},Av=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Ab=Uint8Array.from({length:16},(e,t)=>t),Aw=Ab.map(e=>(9*e+5)%16),A_=[Ab],AA=[Aw];for(let e=0;e<4;e++)for(let t of[A_,AA])t.push(t[e].map(e=>Av[e]));let AS=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),AE=A_.map((e,t)=>e.map(e=>AS[t][e])),Ax=AA.map((e,t)=>e.map(e=>AS[t][e])),AT=new Uint32Array([0,0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xa953fd4e]),AI=new Uint32Array([0x50a28be6,0x5c4dd124,0x6d703ef3,0x7a6d76e9,0]),Ak=(e,t)=>e<<t|e>>>32-t;function AO(e,t,r,i){return 0===e?t^r^i:1===e?t&r|~t&i:2===e?(t|~r)^i:3===e?t&i|r&~i:t^(r|~i)}let AC=new Uint32Array(16);class AN extends _T{constructor(){super(64,20,8,!0),this.h0=0x67452301,this.h1=-0x10325477,this.h2=-0x67452302,this.h3=0x10325476,this.h4=-0x3c2d1e10}get(){let{h0:e,h1:t,h2:r,h3:i,h4:n}=this;return[e,t,r,i,n]}set(e,t,r,i,n){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|i,this.h4=0|n}process(e,t){for(let r=0;r<16;r++,t+=4)AC[r]=e.getUint32(t,!0);let r=0|this.h0,i=r,n=0|this.h1,a=n,s=0|this.h2,o=s,l=0|this.h3,u=l,c=0|this.h4,d=c;for(let e=0;e<5;e++){let t=4-e,f=AT[e],h=AI[e],p=A_[e],g=AA[e],m=AE[e],y=Ax[e];for(let t=0;t<16;t++){let i=Ak(r+AO(e,n,s,l)+AC[p[t]]+f,m[t])+c|0;r=c,c=l,l=0|Ak(s,10),s=n,n=i}for(let e=0;e<16;e++){let r=Ak(i+AO(t,a,o,u)+AC[g[e]]+h,y[e])+d|0;i=d,d=u,u=0|Ak(o,10),o=a,a=r}}this.set(this.h1+s+u|0,this.h2+l+d|0,this.h3+c+i|0,this.h4+r+a|0,this.h0+n+o|0)}roundClean(){AC.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}let AP=_S(()=>new AN),AD=BigInt(0x100000000-1),AR=BigInt(32),A$=(e,t,r)=>e>>>r,AB=(e,t,r)=>e<<32-r|t>>>r,AL=(e,t,r)=>e>>>r|t<<32-r,AU=(e,t,r)=>e<<32-r|t>>>r,AF=(e,t,r)=>e<<64-r|t>>>r-32,AM=(e,t,r)=>e>>>r-32|t<<64-r,Aj=function(e,t,r,i){let n=(t>>
93>0)+(i>>>0);return{h:e+r+(n/0x100000000|0)|0,l:0|n}},Az=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),AV=(e,t,r,i)=>t+r+i+(e/0x100000000|0)|0,AH=(e,t,r,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),Aq=(e,t,r,i,n)=>t+r+i+n+(e/0x100000000|0)|0,AW=(e,t,r,i,n,a)=>t+r+i+n+a+(e/0x100000000|0)|0,AK=(e,t,r,i,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0)+(n>>>0),[AG,AZ]=function(e,t=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let n=0;n<e.length;n++){let{h:a,l:s}=function(e,t=!1){return t?{h:Number(e&AD),l:Number(e>>AR&AD)}:{h:0|Number(e>>AR&AD),l:0|Number(e&AD)}}(e[n],t);[r[n],i[n]]=[a,s]}return[r,i]}(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
935771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),AX=new Uint32Array(80),AJ=new Uint32Array(80);class AY extends _T{constructor(){super(128,64,16,!1),this.Ah=0x6a09e667,this.Al=-0xc4336f8,this.Bh=-0x4498517b,this.Bl=-0x7b3558c5,this.Ch=0x3c6ef372,this.Cl=-0x16b07d5,this.Dh=-0x5ab00ac6,this.Dl=0x5f1d36f1,this.Eh=0x510e527f,this.El=-0x52197d2f,this.Fh=-0x64fa9774,this.Fl=0x2b3e6c1f,this.Gh=0x1f83d9ab,this.Gl=-0x4be4295,this.Hh=0x5be0cd19,this.Hl=0x137e2179}get(){let{Ah:e,Al:t,Bh:r,Bl:i,Ch:n,Cl:a,Dh:s,Dl:o,Eh:l,El:u,Fh:c,Fl:d,Gh:f,Gl:h,Hh:p,Hl:g}=this;return[e,t,r,i,n,a,s,o,l,u,c,d,f,h,p,g]}set(e,t,r,i,n,a,s,o,l,u,c,d,f,h,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|a,this.Dh=0|s,this.Dl=0|o,this.Eh=0|l,this.El=0|u,this.Fh=0|c,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)AX[r]=e.getUint32(t),AJ[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|AX[e-15],r=0|AJ[e-15],i=AL(t,r,1)^AL(t,r,8)^A$(t,r,7),n=AU(t,r,1)^AU(t,r,8)^AB(t,r,7),a=0|AX[e-2],s=0|AJ[e-2],o=AL(a,s,19)^AF(a,s,61)^A$(a,s,6),l=AH(n,AU(a,s,19)^AM(a,s,61)^AB(a,s,6),AJ[e-7],AJ[e-16]),u=Aq(l,i,o,AX[e-7],AX[e-16]);AX[e]=0|u,AJ[e]=0|l}let{Ah:r,Al:i,Bh:n,Bl:a,Ch:s,Cl:o,Dh:l,Dl:u,Eh:c,El:d,Fh:f,Fl:h,Gh:p,Gl:g,Hh:m,Hl:y}=this;for(let e=0;e<80;e++){let t=AL(c,d,14)^AL(c,d,18)^AF(c,d,41),v=AU(c,d,14)^AU(c,d,18)^AM(c,d,41),b=c&f^~c&p,w=AK(y,v,d&h^~d&g,AZ[e],AJ[e]),_=AW(w,m,t,b,AG[e],AX[e]),A=0|w,S=AL(r,i,28)^AF(r,i,34)^AF(r,i,39),E=AU(r,i,28)^AM(r,i,34)^AM(r,i,39),x=r&n^r&s^n&s,T=i&a^i&o^a&o;m=0|p,y=0|g,p=0|f,g=0|h,f=0|c,h=0|d,({h:c,l:d}=Aj(0|l,0|u,0|_,0|A)),l=0|s,u=0|o,s=0|n,o=0|a,n=0|r,a=0|i;let I=Az(A,E,T);r=AV(I,_,S,x),i=0|I}({h:r,l:i}=Aj(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:a}=Aj(0|this.Bh,0|this.Bl,0|n,0|a)),({h:s,l:o}=Aj(0|this.Ch,0|this.Cl,0|s,0|o)),({h:l,l:u}=Aj(0|this.Dh,0|this.Dl,0|l,0|u)),({h:c,l:d}=Aj(0|this.Eh,0|this.El,0|c,0|d)),({h:f,l:h}=Aj(0|this.Fh,0|this.Fl,0|f,0|h)),({h:p,l:g}=Aj(0|this.Gh,0|this.Gl,0|p,0|g)),({h:m,l:y}=Aj(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(r,i,n,a,s,o,l,u,c,d,f,h,p,g,m,y)}roundClean(){AX.fill(0),AJ.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class AQ extends AY{constructor(){super(),this.Ah=-0x73c2c838,this.Al=0x19544da2,this.Bh=0x73e19966,this.Bl=-0x76232b2a,this.Ch=0x1dfab7ae,this.Cl=0x32ff9c82,this.Dh=0x679dd514,this.Dl=0x582f9fcf,this.Eh=0xf6d2b69,this.El=0x7bd44da8,this.Fh=0x77e36f73,this.Fl=0x4c48942,this.Gh=0x3f9d85a8,this.Gl=0x6a1d36c8,this.Hh=0x1112e6ad,this.Hl=-0x6e296d5f,this.outputLen=28}}class A0 extends AY{constructor(){super(),this.Ah=0x22312194,this.Al=-0x3d408d4,this.Bh=-0x60aaa05d,this.Bl=-0x37b39b3e,this.Ch=0x2393b86b,this.Cl=0x6f53b151,this.Dh=-0x69c788e7,this.Dl=0x5940eabd,this.Eh=-0x69d7c11e,this.El=-0x5771001d,this.Fh=-0x41a1e1db,this.Fl=0x53863992,this.Gh=0x2b0199fc,this.Gl=0x2c85b8aa,this.Hh=0xeb72ddc,this.Hl=-0x7e3ad35e,this.outputLen=32}}class A1 extends AY{constructor(){super(),this.Ah=-0x344462a3,this.Al=-0x3efa6128,this.Bh=0x629a292a,this.Bl=0x367cd507,this.Ch=-0x6ea6fea6,this.Cl=0x3070dd17,this.Dh=0x152fecd8,this.Dl=-0x8f1a6c7,this.Eh=0x67332667,this.El=-4191439,this.Fh=-0x714bb579,this.Fl=0x68581511,this.Gh=-0x24f3d1f3,this.Gl=0x64f98fa7,this.Hh=0x47b5481d,this.Hl=-0x4105b05c,this.outputLen=48}}_S(()=>new AY),_S(()=>new AQ),_S(()=>new A0),_S(()=>new A1),e.i(894230),(b=ee||(ee={})).Int="int",b.UInt="uint",b.Buffer="buffer",b.BoolTrue="true",b.BoolFalse="false",b.PrincipalStandard="address",b.PrincipalContract="contract",b.ResponseOk="ok",b.ResponseErr="err",b.OptionalNone="none",b.OptionalSome="some",b.List="list",b.Tuple="tuple",b.StringASCII="ascii",b.StringUTF8="utf8",(w=et||(et={}))[w.int=0]="int",w[w.uint=1]="uint",w[w.buffer=2]="buffer",w[w.true=3]="true",w[w.false=4]="false",w[w.address=5]="address",w[w.contract=6]="contract",w[w.ok=7]="ok",w[w.err=8]="err",w[w.none=9]="none",w[w.some=10]="some",w[w.list=11]="list",w[w.tuple=12]="tuple",w[w.ascii=13]="ascii",w[w.utf8=14]="utf8",BigInt("0xffffffffffffffffffffffffffffffff"),BigInt(0),BigInt("0x7fffffffffffffffffffffffffffffff"),BigInt("-170141183460469231731687303715884105728"),(_=er||(er={}))[_.TokenTransfer=0]="TokenTransfer",_[_.SmartContract=1]="SmartContract",_[_.VersionedSmartContract=6]="VersionedSmartContract",_[_.ContractCall=2]="ContractCall",_[_.PoisonMicroblock=3]="PoisonMicroblock",_[_.Coinbase=4]="Coinbase",_[_.CoinbaseToAltRecipient=5]="CoinbaseToAltRecipient",_[_.TenureChange=7]="TenureChange",_[_.NakamotoCoinbase=8]="NakamotoCoinbase",(A=ei||(ei={}))[A.Clarity1=1]="Clarity1",A[A.Clarity2=2]="Clarity2",A[A.Clarity3=3]="Clarity3",A[A.Clarity4=4]="Clarity4",A[A.Clarity5=5]="Clarity5",A[A.Clarity6=6]="Clarity6",(S=en||(en={}))[S.OnChainOnly=1]="OnChainOnly",S[S.OffChainOnly=2]="OffChainOnly",S[S.Any=3]="Any";function A2(e,t){return t=t?function(e){if("string"==typeof e)switch(e){case"mainnet":return Ap;case"testnet":return Ag;
93case"devnet":return Am;case"mocknet":return Ay;default:throw Error(`Unknown network name: ${e}`)}return e}(t):Ap,e="string"==typeof e?Ah(e):e,(0,_h.c32address)(t.addressVersion.singleSig,Af(AP(_R(e))))}en.OnChainOnly,en.OffChainOnly,en.Any,en.OnChainOnly,en.OnChainOnly,en.OffChainOnly,en.OffChainOnly,en.Any,en.Any,(E=ea||(ea={}))[E.Allow=1]="Allow",E[E.Deny=2]="Deny",E[E.Originator=3]="Originator",(x=es||(es={}))[x.STX=0]="STX",x[x.Fungible=1]="Fungible",x[x.NonFungible=2]="NonFungible",x[x.Staking=3]="Staking",x[x.PoX=4]="PoX",(T=eo||(eo={}))[T.Standard=4]="Standard",T[T.Sponsored=5]="Sponsored",(I=el||(el={}))[I.P2PKH=0]="P2PKH",I[I.P2SH=1]="P2SH",I[I.P2WPKH=2]="P2WPKH",I[I.P2WSH=3]="P2WSH",I[I.P2SHNonSequential=5]="P2SHNonSequential",I[I.P2WSHNonSequential=7]="P2WSHNonSequential",(k=eu||(eu={}))[k.Compressed=0]="Compressed",k[k.Uncompressed=1]="Uncompressed",(O=ec||(ec={}))[O.Equal=1]="Equal",O[O.Greater=2]="Greater",O[O.GreaterEqual=3]="GreaterEqual",O[O.Less=4]="Less",O[O.LessEqual=5]="LessEqual",(C=ed||(ed={}))[C.Sends=16]="Sends",C[C.DoesNotSend=17]="DoesNotSend",C[C.MaybeSent=18]="MaybeSent",(N=ef||(ef={}))[N.WillNotPerform=48]="WillNotPerform",N[N.MayPerform=49]="MayPerform",N[N.WillPerform=50]="WillPerform",(P=eh||(eh={}))[P.Origin=1]="Origin",P[P.Standard=2]="Standard",P[P.Contract=3]="Contract",(D=ep||(ep={}))[D.STX=0]="STX",D[D.Fungible=1]="Fungible",D[D.NonFungible=2]="NonFungible",(R=eg||(eg={}))[R.BlockFound=0]="BlockFound",R[R.Extended=1]="Extended",R[R.ExtendedRuntime=2]="ExtendedRuntime",R[R.ExtendedReadCount=3]="ExtendedReadCount",R[R.ExtendedReadLength=4]="ExtendedReadLength",R[R.ExtendedWriteCount=5]="ExtendedWriteCount",R[R.ExtendedWriteLength=6]="ExtendedWriteLength",($=em||(em={}))[$.PublicKeyCompressed=0]="PublicKeyCompressed",$[$.PublicKeyUncompressed=1]="PublicKeyUncompressed",$[$.SignatureCompressed=2]="SignatureCompressed",$[$.SignatureUncompressed=3]="SignatureUncompressed",(B=ey||(ey={})).Serialization="Serialization",B.Deserialization="Deserialization",B.SignatureValidation="SignatureValidation",B.FeeTooLow="FeeTooLow",B.BadNonce="BadNonce",B.NotEnoughFunds="NotEnoughFunds",B.NoSuchContract="NoSuchContract",B.NoSuchPublicFunction="NoSuchPublicFunction",B.BadFunctionArgument="BadFunctionArgument",B.ContractAlreadyExists="ContractAlreadyExists",B.PoisonMicroblocksDoNotConflict="PoisonMicroblocksDoNotConflict",B.PoisonMicroblockHasUnknownPubKeyHash="PoisonMicroblockHasUnknownPubKeyHash",B.PoisonMicroblockIsInvalid="PoisonMicroblockIsInvalid",B.BadAddressVersionByte="BadAddressVersionByte",B.NoCoinbaseViaMempool="NoCoinbaseViaMempool",B.ServerFailureNoSuchChainTip="ServerFailureNoSuchChainTip",B.ServerFailureDatabase="ServerFailureDatabase",B.ServerFailureOther="ServerFailureOther",(L=ev||(ev={}))[L.Address=0]="Address",L[L.Principal=1]="Principal",L[L.LengthPrefixedString=2]="LengthPrefixedString",L[L.MemoString=3]="MemoString",L[L.Asset=4]="Asset",L[L.PostCondition=5]="PostCondition",L[L.PublicKey=6]="PublicKey",L[L.LengthPrefixedList=7]="LengthPrefixedList",L[L.Payload=8]="Payload",L[L.MessageSignature=9]="MessageSignature",L[L.StructuredDataSignature=10]="StructuredDataSignature",L[L.TransactionAuthField=11]="TransactionAuthField",Ac.hmacSha256Sync=(e,...t)=>{let r=_x.create(_R,e);return t.forEach(e=>r.update(e)),r.digest()};let A6="0123456789ABCDEFGHJKMNPQRSTVWXYZ";e.s(["fromPrivateKey",0,function(e,t){var r,i;let n;return A2((n=("string"==typeof(i=r=function(e){let t="string"==typeof e?Ah(e):e;if(32!=t.length&&33!=t.length)throw Error(`Improperly formatted private-key. Private-key byte length should be 32 or 33. Length provided: ${t.length}`);if(33==t.length&&1!==t[32])throw Error("Improperly formatted private-key. 33 bytes indicate compressed key, but the last byte must be == 01");return t}(r=e))?i.length/2:i.byteLength)===33,Af(function(e,t=!1){return _X.fromPrivateKey(e).toRawBytes(t)}(r.slice(0,32),n))),t)},"fromPublicKey",0,A2,"parse",0,function(e){let[t,r]=e.split("."),i=(0,_h.c32addressDecode)(t);return{version:i[0],versionChar:A6[i[0]],hash160:i[1],contractName:r}},"stringify",0,function(e){let t="version"in e?e.version:A6.indexOf(e.versionChar.toUpperCase()),r=(0,_h.c32address)(t,e.hash160);return e.contractName?`${r}.${e.contractName}`:r}],104902);var A5=e.i(104902),A5=A5;class A4{static byteSize=20;static platform=_f;type="Native";address;constructor(e){if(A4.instanceof(e)){this.address=e.address;return}if("string"==typeof e){if(!A4.isValidAddress(e))throw Error(`Invalid Stacks address ${e}`);this.address=e}else throw Error(`Invalid Stacks address ${e}`)}unwrap(){return this.address}toString(){return this.address}toNative(){return this}toUint8Array(){return new Uint8Array(_d.Buffer.from(this.address))}toUniversalAddress(){return new gU.UniversalAddress(this.address,"keccak256")}static isValidAddress(e){try{return A5.parse(e),!0}catch(e){return!1}}static instanceof(e){return e.constructor.platform===A4.platform}equals(e){return A4.instanceof(e)?e.address===this.address:e.equals(this.toUniversalAddress())}}function A3(e){let t=64===(e=(e=e.startsWith("0x")?e.slice(2):e).length%2==0?e:"0"+e).length?e:gF.encoding.hex.encode(gF.encoding.bytes.zpad(gF.encoding.hex.decode(e),32));return`0x${t}`}(0,gM.registerNative)(_f,A4);class A8{static byteSize=32;static platform="Sui";address;module;constructor(e){if(A8.instanceof(e))this.address=e.address,this.module=e.module;else if(gU.UniversalAddress.instanceof(e))this.address=e.toUint8Array();else if("string"==typeof e){if((e=>/^(0x)?[0-9a-fA-F]+::\w+::\w+$/.test(e))(e)){const t=e.split("::");this.module=t.slice(1).join("::"),e=t[0]}if(e=A3(e),!gF.encoding.hex.valid(e))throw Error("Invalid Sui address: "+e);this.address=gF.encoding.hex.decode(e)}else this.address=e}unwrap(){let e=this.getPackageId(),t=this.module?"::"+this.module:"";return`${e}${t}`}toString(){return this.unwrap()}toNative(){return this}toUint8Array(){return this.address}toUniversalAddress(){return new gU.UniversalAddress(this.toUint8Array())}getPackageId(){return A3(gF.encoding.hex.encode(this.address))}
93getCoinType(){if("sui::SUI"===this.module)return"0x2::sui::SUI";if(!this.module)throw Error("No module present in Sui token address");return this.unwrap()}static instanceof(e){return e.constructor.platform===A8.platform}equals(e){return A8.instanceof(e)?e.unwrap()===this.unwrap():this.toUniversalAddress().equals(e)}}(0,gM.registerNative)("Sui",A8);var A7=e.i(72232);let A9="Xrpl",Se=/^[A-Z0-9a-z?!@#$%^&*(){}[\]|]{3}$/,St=/^[A-Fa-f0-9]{40}$/,Sr=/^[0-9a-fA-F]{48}$/;function Si(e){let t=new Uint8Array(20);for(let r=0;r<e.length;r++)t[12+r]=e.charCodeAt(r);return t}class Sn{static platform=A9;type="Native";address;format;constructor(e){if(Sn.instanceof(e))this.address=e.address,this.format=e.format;else if("string"==typeof e)if(Sn.isIouTokenId(e))this.address=e,this.format="iou";else if(Sn.isMptTokenId(e))this.address=e,this.format="mpt";else if((0,A7.isValidClassicAddress)(e))this.address=e,this.format="account";else throw Error(`Invalid XRPL address or token identifier: ${e}`);else throw Error(`Invalid XRPL address: ${e}`)}unwrap(){return this.address}toString(){return this.address}toNative(){return this}toUint8Array(){switch(this.format){case"account":return(0,A7.decodeAccountID)(this.address);case"mpt":return gF.encoding.hex.decode(this.address);case"iou":{let{code:e,issuer:t}=Sn.parseIou(this.address),r=Se.test(e)?Si(e):gF.encoding.hex.decode(e),i=(0,A7.decodeAccountID)(t),n=new Uint8Array(40);return n.set(r,0),n.set(i,20),n}}}toUniversalAddress(){switch(this.format){case"account":{let e=(0,A7.decodeAccountID)(this.address),t=new Uint8Array(gU.UniversalAddress.byteSize);return t.set(e,gU.UniversalAddress.byteSize-e.length),new gU.UniversalAddress(t)}case"iou":{let{code:e,issuer:t}=Sn.parseIou(this.address),r=Se.test(e)?Si(e):gF.encoding.hex.decode(e),i=gF.encoding.hex.encode(r).toUpperCase();return new gU.UniversalAddress(`iou:${i}.${t}`,"sha256")}case"mpt":{let e=this.address.toUpperCase();return new gU.UniversalAddress(`mpt:${e}`,"sha256")}}}static isValidAddress(e){return(0,A7.isValidClassicAddress)(e)||Sn.isIouTokenId(e)||Sn.isMptTokenId(e)}static isIouTokenId(e){let t=e.indexOf(".");if(t<=0)return!1;let r=e.substring(0,t),i=e.substring(t+1);return(Se.test(r)||St.test(r))&&(0,A7.isValidClassicAddress)(i)}static isMptTokenId(e){return Sr.test(e)}static parseIou(e){let t=e.split(".");if(2!==t.length||!t[0]||!t[1])throw Error(`Not a valid IOU token identifier: ${e}`);return{code:t[0],issuer:t[1]}}static instanceof(e){return e?.constructor?.platform===Sn.platform}equals(e){return Sn.instanceof(e)?e.address===this.address:e.equals(this.toUniversalAddress())}}(0,gM.registerNative)(A9,Sn);class Sa{static byteSize=gU.UniversalAddress.byteSize;static platform="Btc";type="Native";address;constructor(e){let t;if(Sa.instanceof(e)){this.address=e.address;return}if(t="string"==typeof e?e.trim():e instanceof Uint8Array?new TextDecoder().decode(e).replace(/\0+$/,"").trim():new TextDecoder().decode(e.toUint8Array()).replace(/\0+$/,"").trim(),!Sa.isValidAddress(t))throw Error(`Invalid BTC address: ${JSON.stringify(t)}`);this.address=t}unwrap(){return this.address}toString(){return this.address}toNative(){return this}toUint8Array(){let e=new TextEncoder().encode(this.address);if(e.length>gU.UniversalAddress.byteSize)throw RangeError(`BTC address encoding exceeds UniversalAddress size: encoded length ${e.length} > ${gU.UniversalAddress.byteSize} bytes`);let t=new Uint8Array(gU.UniversalAddress.byteSize);return t.set(e),t}toUniversalAddress(){return new gU.UniversalAddress(this.toUint8Array())}static isValidAddress(e){return"string"==typeof e&&e.trim().length>0}static instanceof(e){return e?.constructor?.platform===Sa.platform}equals(e){if(Sa.instanceof(e))return e.address===this.address;try{return e.equals(this.toUniversalAddress())}catch(e){if(e instanceof RangeError)return!1;throw e}}}(0,gM.registerNative)("Btc",Sa);let Ss={"sol-57d087fd8c460f612f8701f5499ad8b2eec5ab68.omft.near":V.Sol,"sol-c58e6539c2f2e097c251f8edf11f9c03e581f8d4.omft.near":V.Sol,"sol-b9c68f94ec8fd160137af8cdfe5e61cd68e2afba.omft.near":V.Sol,"sol-bb27241c87aa401cc963c360c175dd7ca7035873.omft.near":V.Sol,"sol-c800a4bd850783ccb82c2b2c7e84175443606352.omft.near":V.Sol,"sol-91914f13d3b54f8126a2824d71632d4b078d7403.omft.near":V.Sol,"sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near":V.Sol,"sol-df27d7abcc1c656d4ac3b1399bbfbba1994e6d8c.omft.near":V.Sol,"sol-1f00bb36e75cfc8e1274c1507cc3054f5b3f3ce1.omft.near":V.Sol,"sol-c634d063ceff771aff0c972ec396fd915a6bbd0e.omft.near":V.Sol,"sol-d600e625449a4d9380eaf5e3265e54c90d34e260.omft.near":V.Sol,"sol.omft.near":V.Sol};BigInt(ge("300 Tgas")),BigInt(ge("120 Tgas")),BigInt(ge("300 Tgas")),BigInt(ge("300 Tgas")),BigInt(ge("300 Tgas")),BigInt(ge("300 Tgas")),BigInt(ge("10 Tgas")),BigInt(ge("300 Tgas")),BigInt(ge("300 Tgas")),BigInt(ge("100 Tgas")),BigInt(ge("300 Tgas")),BigInt(ge("300 Tgas")),BigInt(ge("5 Tgas")),BigInt(p9("1 yocto")),BigInt(p9("0.25 NEAR")),BigInt(p9("0.0012 NEAR")),(U=eb||(eb={}))[U.InitTransfer=0]="InitTransfer",U[U.FinTransfer=1]="FinTransfer",U[U.DeployToken=2]="DeployToken",U[U.LogMetadata=3]="LogMetadata";let So=fh.b.nativeEnum(eb),Sl=fh.b.nativeEnum(V),Su=fh.b.struct({token_id:fh.b.string(),account_id:fh.b.string(),storage_deposit_amount:fh.b.option(fh.b.u128())}),Sc=fh.b.struct({log_index:fh.b.u64(),log_entry_data:fh.b.bytes(),receipt_index:fh.b.u64(),receipt_data:fh.b.bytes(),header_data:fh.b.bytes(),proof:fh.b.vec(fh.b.bytes())});fh.b.struct({proof_kind:So,proof:Sc}),fh.b.struct({proof_kind:So,vaa:fh.b.string()}),fh.b.struct({chain_kind:Sl,storage_deposit_actions:fh.b.vec(Su),prover_args:fh.b.bytes()}),fh.b.struct({chain_kind:Sl,prover_args:fh.b.bytes()}),fh.b.struct({chain_kind:Sl,prover_args:fh.b.bytes()});let Sd=fh.b.enum({Eth:fh.b.array(fh.b.u8(),20),Near:fh.b.string(),Sol:fh.b.array(fh.b.u8(),32),Arb:fh.b.array(fh.b.u8(),20),Base:fh.b.array(fh.b.u8(),20),Bnb:fh.b.array(fh.b.u8(),20),Btc:fh.b.string(),Zcash:fh.b.string(),Pol:fh.b.array(fh.b.u8(),20),HyperEvm:fh.b.array(fh.b.u8(),20),Strk:fh.b.array(fh.b.u8(),32),Abs:fh.b.array(fh.b.u8(),20),Fogo:fh.b.array(fh.b.u8(),32)}
93),Sf=fh.b.struct({token:Sd,amount:fh.b.u128(),recipient:Sd,fee:fh.b.struct({fee:fh.b.u128(),native_fee:fh.b.u128()}),sender:Sd,msg:fh.b.string()});function Sh(e){let t=e.split(":",2),r=t[0],i=t[1];if(!i)throw Error(`Invalid token address format: ${e}`);let n=e=>Array.from(gL.hex.decode(e.slice(2))),a=e=>Array.from(gL.base58.decode(e));switch(r){case"eth":return{Eth:n(i)};case"near":return{Near:i};case"sol":return{Sol:a(i)};case"arb":return{Arb:n(i)};case"base":return{Base:n(i)};case"bnb":return{Bnb:n(i)};case"pol":return{Pol:n(i)};case"hlevm":return{HyperEvm:n(i)};case"btc":return{Btc:i};case"zcash":return{Zcash:i};case"strk":return{Strk:(e=>{let t=e.startsWith("0x")||e.startsWith("0X")?e.slice(2):e;if(t.length>64)throw Error(`Starknet address exceeds 32 bytes: ${e}`);return Array.from(gL.hex.decode(t.padStart(64,"0")))})(i)};case"abs":return{Abs:n(i)};case"fogo":return{Fogo:a(i)};default:throw Error(`Unknown chain: ${r}`)}}let Sp=[[eA.Chains.Ethereum,V.Eth],[eA.Chains.Base,V.Base],[eA.Chains.Arbitrum,V.Arb],[eA.Chains.Solana,V.Sol],[eA.Chains.BNB,V.Bnb],[eA.Chains.Bitcoin,V.Btc],[eA.Chains.Abstract,V.Abs],[eA.Chains.Starknet,V.Strk],[eA.Chains.Fogo,V.Fogo]];function Sg(e){return Sp.find(([t])=>t===e)?.[1]??null}function Sm(e){return Sp.find(([t,r])=>r===e)?.[0]??null}let Sy=[V.Btc];function Sv(e){return Sy.includes(e)}function Sb(e){return Ss[e]??null}async function Sw(e,t){return eY.utils.queryContract({contractId:t1,methodName:"storage_balance_of",args:{account_id:t},finality:"optimistic",nearClient:e,schema:e4.union([e4.null(),e4.object({total:e4.string(),available:e4.string()})])})}let S_=e4.custom(e=>"string"==typeof e&&(e.startsWith("eth:")||e.startsWith("near:")||e.startsWith("sol:")||e.startsWith("arb:")||e.startsWith("base:")||e.startsWith("btc:")||e.startsWith("bnb:")||e.startsWith("abs:")||e.startsWith("strk:")||e.startsWith("fogo:")),"Must comply with omni address schema");async function SA(e,t,r){return eY.utils.queryContract({contractId:t1,methodName:"get_bridged_token",args:{chain:V[r].toString(),address:t},finality:"optimistic",nearClient:e,schema:e4.union([e4.null(),S_])})}async function SS(e,t){if(gN(t)===V.Near)throw Error("Token decimals cannot be queried using NEAR addresses. Use the token's foreign chain representation (e.g., eth:0x...) to query decimals.");return eY.utils.queryContract({contractId:t1,methodName:"get_token_decimals",args:{address:t},finality:"optimistic",nearClient:e,schema:e4.union([e4.null(),e4.object({decimals:e4.number(),origin_decimals:e4.number()})])})}var SE=e.i(602638),Sx=class{constructor({envConfig:e,nearProvider:t,solverRelayApiKey:r,routeMigratedPoaTokensThroughOmniBridge:i}){this.route=e_.RouteEnum.OmniBridge,this.intentsStorageBalanceCache=new SE.default({max:1,ttl:3e3}),this.storageDepositCache=new ty({max:100,ttl:36e5}),this.destinationChainAddressCache=new SE.default({ttl:36e5}),this.tokenDecimalsCache=new SE.default({ttl:36e5}),this.envConfig=e,this.nearProvider=t,this.omniBridgeAPI=new fc("mainnet"),this.solverRelayApiKey=r,this.routeMigratedPoaTokensThroughOmniBridge=i??!1}is(e){return e.route===e_.RouteEnum.OmniBridge}async supports(e){if(e.routeConfig&&!this.is(e.routeConfig))return!1;let t=eQ(e.assetId),r=!!(e.routeConfig&&e.routeConfig.route===e_.RouteEnum.OmniBridge&&void 0===e.routeConfig.chain),i=this.targetChainSpecified(e.routeConfig),n="nep141"!==t.standard;if(n&&(r||i))throw new ew.UnsupportedAssetIdError(e.assetId,"Only NEP-141 tokens are supported by Omni Bridge.");if(n)return!1;let a=this.isPoaTokenRoutedThroughOmniBridge(t.contractId),s=!a&&!1===function(e){return!e.endsWith(".testnet")&&(e in gD||gR.test(e))}(t.contractId);if(s&&r)throw new ew.UnsupportedAssetIdError(e.assetId,`Non valid omni contract id ${t.contractId}`);if(!i&&s)return!1;let o=null,l=null;if(this.targetChainSpecified(e.routeConfig)){if(null===(o=Sg(e.routeConfig.chain)))throw new ew.UnsupportedAssetIdError(e.assetId,`Chain ${e.routeConfig.chain} is not supported in Omni Bridge.`);l=e.routeConfig.chain}else if(null===(o=a?Sb(t.contractId):gB(t.contractId))||null===(l=Sm(o)))throw new ew.UnsupportedAssetIdError(e.assetId,`Withdrawal of ${t.contractId} to its origin chain is not supported in Omni Bridge.`);if(await this.getCachedDestinationTokenAddress(t.contractId,o)===null)throw new tZ(e.assetId,l);return!0}targetChainSpecified(e){return!!(e?.route&&e.route===e_.RouteEnum.OmniBridge&&e.chain)}parseAssetId(e){let t=eQ(e);if("nep141"!==t.standard)return null;let r=this.isPoaTokenRoutedThroughOmniBridge(t.contractId)?Sb(t.contractId):gB(t.contractId);if(null===r)return null;let i=Sm(r);return null===i?null:Object.assign(t,{blockchain:i,bridgeName:te,address:t.contractId})}makeAssetInfo(e,t){let r=eQ(e);if("nep141"!==r.standard)return null;let i=null,n=null;if(this.targetChainSpecified(t))i=Sg(t.chain),n=t.chain;else{if(null===(i=this.isPoaTokenRoutedThroughOmniBridge(r.contractId)?Sb(r.contractId):gB(r.contractId)))return null;n=Sm(i)}return null===i||null===n?null:Object.assign(r,{blockchain:n,bridgeName:te,address:r.contractId})}async createWithdrawalIntents(e){let t=this.makeAssetInfo(e.withdrawalParams.assetId,e.withdrawalParams.routeC
93onfig);(0,eW.assert)(null!==t,`Asset ${e.withdrawalParams.assetId} is not supported by Omni Bridge`);let r=Sg(t.blockchain);(0,eW.assert)(null!==r,`Chain ${t.blockchain} is not supported by Omni Bridge`);let i=[];null!==e.feeEstimation.quote&&i.push({intent:"token_diff",diff:{[e.feeEstimation.quote.defuse_asset_identifier_in]:`-${e.feeEstimation.quote.amount_in}`,[e.feeEstimation.quote.defuse_asset_identifier_out]:e.feeEstimation.quote.amount_out},referral:e.referral});let n=eX(e.feeEstimation,e_.RouteEnum.OmniBridge,"relayerFee");(0,eW.assert)(n>=0n,`Invalid Omni bridge relayer fee: expected >= 0, got ${n}`);let a=e.withdrawalParams.amount,s=null;if(Sv(r)){s=eX(e.feeEstimation,e_.RouteEnum.OmniBridge,"utxoMaxGasFee");let t=eX(e.feeEstimation,e_.RouteEnum.OmniBridge,"utxoProtocolFee");(0,eW.assert)(void 0!==s&&s>0n,`Invalid Omni Bridge utxo max gas fee: expected > 0, got ${s}`),(0,eW.assert)(void 0!==t&&t>0n,`Invalid Omni Bridge utxo protocol fee: expected > 0, got ${t}`),a+=s+t}let o=e.withdrawalParams.destinationAddress;return t.blockchain===eA.Chains.Bitcoin&&/^bc1/i.test(o)&&(o=o.toLowerCase()),i.push(...function(e){var t;let r,i,{contractId:n,standard:a}=eY.utils.parseDefuseAssetId(e.assetId);(0,eW.assert)("nep141"===a,"Only NEP-141 is supported");let s=gP(e.omniChainKind,e.destinationAddress),o="",l={recipient:s,fee:"0",native_token_fee:e.nativeFee.toString()};Sv(e.omniChainKind)&&((0,eW.assert)(null!==e.utxoMaxGasFee&&e.utxoMaxGasFee>0n,`Invalid utxo max gas fee: expected > 0, got ${e.utxoMaxGasFee}`),l.msg=o=JSON.stringify({MaxGasFee:e.utxoMaxGasFee.toString()}));let u=[];return e.nativeFee>0n&&u.push({deposit_for_account_id:(t={token:`near:${n}`,amount:e.amount,recipient:s,fee:{fee:0n,native_fee:e.nativeFee},sender:`near:${e.intentsContract}`,msg:o},r=Sf.serialize({token:Sh(t.token),amount:t.amount,recipient:Sh(t.recipient),fee:{fee:t.fee.fee,native_fee:t.fee.native_fee},sender:Sh(t.sender),msg:t.msg}),i=(0,f6.sha256)(r),gL.hex.encode(i)),amount:e.nativeFee.toString(),contract_id:t1,intent:"storage_deposit"}),u.push({intent:"ft_withdraw",token:n,receiver_id:t1,amount:e.amount.toString(),storage_deposit:e.storageDepositAmount>0n?e.storageDepositAmount.toString():void 0,msg:JSON.stringify(l),min_gas:"37400000000000"}),u}({assetId:e.withdrawalParams.assetId,destinationAddress:o,amount:a,omniChainKind:r,intentsContract:this.envConfig.contractID,nativeFee:n,storageDepositAmount:eX(e.feeEstimation,e_.RouteEnum.OmniBridge,"storageDepositFee"),utxoMaxGasFee:s})),Promise.resolve(i)}async validateWithdrawal(e){let t=t6.includes(e.assetId);t||(0,eW.assert)(e.feeEstimation.amount>0n,`Invalid Omni Bridge fee: expected > 0, got ${e.feeEstimation.amount}`);let r=this.makeAssetInfo(e.assetId,e.routeConfig);if((0,eW.assert)(null!==r,`Asset ${e.assetId} is not supported by Omni Bridge`),!1===(0,e0.validateAddress)(e.destinationAddress,r.blockchain))throw new ew.InvalidDestinationAddressForWithdrawalError(e.destinationAddress,r.blockchain);let i=Sg(r.blockchain);(0,eW.assert)(null!==i,`Chain ${r.blockchain} is not supported by Omni Bridge`);let n=await this.getCachedDestinationTokenAddress(r.contractId,i);if(null===n)throw new tZ(e.assetId,r.blockchain);let a=await this.getCachedTokenDecimals(n);if((0,eW.assert)(null!==a,`Failed to retrieve token decimals for address ${n} via OmniBridge contract. 94 Ensure the token is supported and the address is correct.`),!e.skipMinAmountValidation&&!1===function(e,t,r){try{var i;let n=Math.min(t,r);return i=e-0n,(t===n?i:t>n?i/10n**BigInt(t-n):i*10n**BigInt(n-t))>0n}catch{return!1}}(e.amount,a.origin_decimals,a.decimals)){var s,o;let t;throw new ew.MinWithdrawalAmountError((s=a.origin_decimals,o=a.decimals,t=1n,s>o&&(t*=10n**BigInt(s-o)),t),e.amount,e.assetId)}let l=await this.getCachedIntentsStorageBalance();if(l<=0x69e10de76676d0800000n)throw new tJ(l.toString());let u=Sv(i);if(!u&&!t){let t=eX(e.feeEstimation,e_.RouteEnum.OmniBridge,"relayerFee");(0,eW.assert)(eX(e.feeEstimation,e_.RouteEnum.OmniBridge,"relayerFee")>0n,`Invalid Omni Bridge relayer fee for non UTXO chain withdrawal: expected > 0, got ${t}`)}if(u){let t=await (0,tj.withTimeout)(()=>this.omniBridgeAPI.getFee(gP(V.Near,this.envConfig.contractID),gP(i,e.destinationAddress),gP(V.Near,r.contractId),e.amount),{timeout:"u">typeof window?1e4:3e3,errorInstance:new tY});if(t.insufficient_utxo)throw new tQ(r.blockchain);(0,eW.assert)(null!==t.min_amount&&void 0!==t.min_amount&&BigInt(t.min_amount)>0n,`Invalid min amount value for a UTXO chain withdrawal: expected > 0, got ${t.min_amount}`);let n=BigInt(t.min_amount),a=eX(e.feeEstimation,e_.RouteEnum.OmniBridge,"utxoMaxGasFee"),s=eX(e.feeEstimation,e_.RouteEnum.OmniBridge,"utxoProtocolFee");
94if((0,eW.assert)(void 0!==a&&a>0n,`Invalid Omni Bridge utxo max gas fee: expected > 0, got ${a}`),(0,eW.assert)(void 0!==s&&s>0n,`Invalid Omni Bridge utxo protocol fee: expected > 0, got ${s}`),!e.skipMinAmountValidation){let t=e.amount+a+s;if(t<n)throw new ew.MinWithdrawalAmountError(n,t,e.assetId)}}}async estimateWithdrawalFee(e){let t=this.makeAssetInfo(e.withdrawalParams.assetId,e.withdrawalParams.routeConfig);(0,eW.assert)(null!==t,`Asset ${e.withdrawalParams.assetId} is not supported by Omni Bridge`);let r=Sg(t.blockchain);(0,eW.assert)(null!==r,`Chain ${t.blockchain} is not supported by Omni Bridge`);let i=await (0,tj.withTimeout)(()=>this.omniBridgeAPI.getFee(gP(V.Near,this.envConfig.contractID),gP(r,e.withdrawalParams.destinationAddress),gP(V.Near,t.contractId),e.withdrawalParams.amount),{timeout:"u">typeof window?1e4:3e3,errorInstance:new tY});if(null===i.native_token_fee||i.native_token_fee<0n)throw new tX(e.withdrawalParams.assetId,i.native_token_fee);t6.includes(e.withdrawalParams.assetId)&&(i.native_token_fee=0n);let n={relayerFee:i.native_token_fee,storageDepositFee:0n},a=i.native_token_fee,[s,o]=await this.getCachedStorageDepositValue(t.contractId),l=s-o;if(l>0n&&(a+=l,n.storageDepositFee=l),e.withdrawalParams.assetId===t0)return{amount:a,quote:null,underlyingFees:{[e_.RouteEnum.OmniBridge]:n}};let u=0n,c=null;return a>0n&&(u+=BigInt((c=await eJ({feeAmount:a,feeAssetId:t0,tokenAssetId:e.withdrawalParams.assetId,logger:e.logger,envConfig:this.envConfig,quoteOptions:e.quoteOptions,solverRelayApiKey:this.solverRelayApiKey})).amount_in)),Sv(r)&&((0,eW.assert)(null!==i.gas_fee&&void 0!==i.gas_fee&&i.gas_fee>0n,`Invalid Omni Bridge utxo gas fee: expected > 0, got ${i.gas_fee}`),(0,eW.assert)(null!==i.protocol_fee&&void 0!==i.protocol_fee&&i.protocol_fee>0n,`Invalid Omni Bridge utxo protocol fee: expected > 0, got ${i.protocol_fee}`),u+=i.gas_fee+i.protocol_fee,n.utxoMaxGasFee=i.gas_fee,n.utxoProtocolFee=i.protocol_fee),{amount:u,quote:c,underlyingFees:{[e_.RouteEnum.OmniBridge]:n}}}createWithdrawalIdentifier(e){let t=this.makeAssetInfo(e.withdrawalParams.assetId,e.withdrawalParams.routeConfig);return(0,eW.assert)(null!==t,`Asset ${e.withdrawalParams.assetId} is not supported by Omni Bridge`),{landingChain:null!=e.withdrawalParams.routeConfig&&"chain"in e.withdrawalParams.routeConfig&&void 0!==e.withdrawalParams.routeConfig.chain?e.withdrawalParams.routeConfig.chain:t.blockchain,index:e.index,withdrawalParams:e.withdrawalParams,tx:e.tx}}async describeWithdrawal(e){let t=(await this.omniBridgeAPI.getTransfer({transactionHash:e.tx.hash}))[e.index];if(null==t||null==t.transfer_message)return{status:"pending"};let r=gN(t.transfer_message.recipient),i=null;if(r===V.Eth||r===V.Base||r===V.Arb||r===V.Bnb||r===V.Pol||r===V.Abs)i=t.finalised?.EVMLog?.transaction_hash;else if(r===V.Sol||r===V.Fogo)i=t.finalised?.Solana?.signature;else if(r===V.Btc)i="u">typeof window?t.utxo_transfer?.btc_pending_id:t.finalised?.UtxoLog?.transaction_hash;else{if(r!==V.Strk)return{status:"completed",txHash:null};i=t.finalised?.Starknet?.transaction_hash}return i?{status:"completed",txHash:i}:{status:"pending"}}async getCachedStorageDepositValue(e){let t=this.storageDepositCache.get(e);if(void 0!==t)return t;let r=await Promise.all([e7({contractId:e,nearProvider:this.nearProvider}),e8({contractId:e,accountId:t1,nearProvider:this.nearProvider})]);return r[1]>=r[0]&&this.storageDepositCache.set(e,r),r}async getCachedDestinationTokenAddress(e,t){let r=`${t}:${e}`,i=this.destinationChainAddressCache.get(r);if(void 0!==i)return i;let n=await SA(this.nearProvider,gP(V.Near,e),t);return null!==n&&this.destinationChainAddressCache.set(r,n),n}async getCachedTokenDecimals(e){let t=this.tokenDecimalsCache.get(e);if(void 0!==t)return t;let r=await SS(this.nearProvider,e);return null!==r&&this.tokenDecimalsCache.set(e,r),r}async getCachedIntentsStorageBalance(){let e=this.intentsStorageBalanceCache.get(t2);if(void 0!==e)return e;let t=await Sw(this.nearProvider,this.envConfig.contractID),r=null===t?0n:BigInt(t.available);return r>0x69e10de76676d0800000n&&this.intentsStorageBalanceCache.set(t2,r),r}isPoaTokenRoutedThroughOmniBridge(e){return!!this.routeMigratedPoaTokensThroughOmniBridge&&void 0!==Ss[e]}};e.s(["OmniBridge",0,Sx],601841);var ST=eD,SI=class extends ST.BaseError{constructor(e){super("Destination address only accepts transfers with a destination tag.",{metaMessages:[`Destination address: ${e}`],name:"XrplDestinationTagRequiredError",details:`Address ${e} has the RequireDestTag flag set and cannot receive transfers without a destination tag.`}),this.destinationAddress=e}},Sk=class extends ST.BaseError{constructor(e){super("Destination address has deposit authorization enabled and cannot receive payments from unauthorized senders.",{metaMessages:[`Destination address: ${e}`],name:"XrplDepositAuthEnabledError",details:`Address ${e} has the DepositAuth flag set and only accepts payments from preauthorized senders.`}),this.destinationAddress=e}};let SO={[eA.Chains.Ethereum]:"eth:1",[eA.Chains.Base]:"eth:8453",[eA.Chains.Arbitrum]:"eth:42161",[eA.Chains.Bitcoin]:"btc:mainnet",[eA.Chains.BitcoinCash]:"bch:mainnet",[eA.Chains.Solana]:"sol:mainnet",[eA.Chains.Dogecoin]:"doge:mainnet",[eA.Chains.XRPL]:"xrp:mainnet",[eA.Chains.Zcash]:"zec:mainnet",[eA.Chains.Gnosis]:"eth:100",[eA.Chains.Berachain]:"eth:80094",[eA.Chains.Tron]:"tron:mainnet",[eA.Chains.Sui]:"sui:mainnet",[eA.Chains.Aptos]:"aptos:mainnet",[eA.Chains.Movement]:"movement:mainnet",[eA.Chains.Cardano]:"cardano:mainnet",[eA.Chains.Litecoin]:"ltc:mainnet",[eA.Chains.Starknet]:"starknet:mainnet",[eA.Chains.Aleo]:"aleo:mainnet",[eA.Chains.Dash]:"dash:mainnet",[eA.Chains.Plasma]:"eth:9745"};function SC(e){if(null==SO[e])throw Error(`Unsupported POA Bridge chain = ${e}`);return SO[e]}let SN={eth:eA.Chains.Ethereum,base:eA.Chains.Base,arb:eA.Chains.Arbitrum,btc:eA.Chains.Bitcoin,bch:eA.Chains.BitcoinCash,sol:eA.Chains.Solana,doge:eA.Chains.Dogecoin,xrp:eA.Chains.XRPL,zec:eA.Chains.Zcash,gnosis:eA.Chains.Gnosis,bera:eA.Chains.Berachain,tron:eA.Chains.Tron,sui:eA.Chains.Sui,aptos:eA.Chains.Aptos,movement:eA.Chains.Movement,cardano:eA.Chains.Cardano,ltc:eA.Chains.Litecoin,starknet:eA.Chains.Starknet,aleo:eA.Chains.Aleo,dash:eA.Chains.Dash,plasma:eA.Chains.Plasma};var SP=e.i(278932),SD=eD,SR=class extends SD.BaseError{constructor(e){super("XRPL API request failed.",{metaMessages:[`Error: ${e.error}`,`Error code: ${e.error_code}`],name:"XrplApiError",details:e.error_message}),this.output=e}},S$=class extends SD.BaseError{constructor(e){super("XRPL account is not funded.",{metaMessages:e?[`Account: ${e}
94`]:void 0,name:"XrplAccountNotFundedError",details:e?`Account ${e} was not found on the XRPL ledger. The account must be funded with the minimum reserve before it can receive tokens.`:"Account was not found on the XRPL ledger. The account must be funded with the minimum reserve before it can receive tokens."}),this.account=e}};let SB=e4.object({depositAuth:e4.boolean(),requireDestinationTag:e4.boolean()}),SL=e4.object({result:e4.object({account_data:e4.object({Account:e4.string()}),account_flags:SB,validated:e4.optional(e4.boolean())})}),SU=e4.object({account:e4.string(),currency:e4.string(),limit:e4.string(),limit_peer:e4.string(),balance:e4.string()}),SF=e4.object({result:e4.object({lines:e4.array(SU),marker:e4.optional(e4.unknown())})}),SM=e4.object({result:e4.object({status:e4.literal("error"),account:e4.optional(e4.string()),error:e4.string(),error_code:e4.number(),error_message:e4.string(),request:e4.optional(e4.record(e4.string(),e4.unknown())),validated:e4.optional(e4.boolean())})});var Sj=e.i(712291);async function Sz(e,t,r,i){let n;t.api_version=2;let a={method:e,params:[t]},s=await (0,tR.request)({url:r.baseURL,body:a,timeout:r.timeout,retryOptions:r.retryOptions??Sj.RETRY_CONFIGS.THIRTY_SECS_AGGRESSIVE,logger:r.logger,fetchOptions:{...r.fetchOptions,method:"POST"}});try{n=await s.json()}catch(e){throw new eR.HttpRequestError({body:a,details:"Failed to deserialize JSON",cause:e instanceof Error?e:Error(String(e)),url:s.url})}let o=e4.safeParse(SM,n);if(o.success){let e=o.output.result;if(19===e.error_code||"actNotFound"===e.error)throw new S$(e.account);throw new SR(e)}let l=e4.safeParse(i,n);if(l.success)return l.output;throw new eR.HttpRequestError({body:a,details:"Failed to parse response JSON",cause:Error((0,t$.serialize)(l.issues)),url:s.url})}async function SV(e,t){return(await Sz("account_info",{account:e,ledger_index:"validated"},t,SL)).result}async function SH(e,t){let r,i=[];do{let n=await Sz("account_lines",{account:e,ledger_index:"validated",marker:r},t,SF);i.push(...n.result.lines),r=n.result.marker}while(void 0!==r)return{lines:i}}var Sq=(0,ex.__exportAll)({XrplAccountNotFundedError:()=>S$,XrplApiError:()=>SR,getAccountInfo:()=>SV,getAccountLines:()=>SH}),SW=(0,ex.__exportAll)({httpClient:()=>Sq}),SK=class{constructor({envConfig:e,xrplRpcUrls:t,routeMigratedPoaTokensThroughOmniBridge:r}){this.route=e_.RouteEnum.PoaBridge,this.supportedTokensCache=new SE.default({ttl:3e4}),this.envConfig=e,this.xrplRpcUrls=t,this.routeMigratedPoaTokensThroughOmniBridge=r??!1}getPoaBridgeBaseURL(){if(!this.envConfig.poaBridgeBaseURL)throw Error("POA Bridge is not available in this environment: poaBridgeBaseURL is not configured");return this.envConfig.poaBridgeBaseURL}is(e){return e.route===e_.RouteEnum.PoaBridge}async supports(e){if(null!=e.routeConfig&&!this.is(e.routeConfig))return!1;let t=this.parseAssetId(e.assetId),r=null!=t;if(!r&&null!=e.routeConfig)throw new ew.UnsupportedAssetIdError(e.assetId,"`assetId` does not match `routeConfig`.");return(!this.routeMigratedPoaTokensThroughOmniBridge||null==t||void 0===Ss[t.contractId]||void 0!==e.routeConfig)&&r}parseAssetId(e){let t;if(!this.envConfig.poaTokenFactoryContractID)return null;let r=eQ(e);if(!r.contractId.endsWith(`.${this.envConfig.poaTokenFactoryContractID}`))return null;try{t=function(e){for(let[t,r]of Object.entries(SN))if(e.startsWith(`${t}.`)||e.startsWith(`${t}-`))return r;throw Error(`Unsupported POA Bridge contractId = ${e}`)}(r.contractId)}catch{throw new ew.UnsupportedAssetIdError(e,"Asset belongs to unknown blockchain.")}return Object.assign(r,{blockchain:t,bridgeName:"poa",address:""})}createWithdrawalIntents(e){let t=eX(e.feeEstimation,e_.RouteEnum.PoaBridge,"relayerFee");return(0,eW.assert)(t>0n,`Invalid POA bridge relayer fee: expected > 0, got ${t}`),Promise.resolve([function(e){let{contractId:t}=eY.utils.parseDefuseAssetId(e.assetId);return{intent:"ft_withdraw",token:t,receiver_id:t,amount:e.amount.toString(),memo:function({receiverAddress:e,xrpMemo:t}){let r=["WITHDRAW_TO",e.toLowerCase().startsWith("bitcoincash:")?e.slice(12):e];return null!=t&&""!==t&&r.push(t),r.join(":")}({receiverAddress:e.destinationAddress,xrpMemo:e.destinationMemo}),min_gas:"17050000000000"}}({...e.withdrawalParams,amount:e.withdrawalParams.amount+t,destinationMemo:e.withdrawalParams.destinationMemo})])}async validateWithdrawal(e){let t=this.parseAssetId(e.assetId);if((0,eW.assert)(null!=t,"Asset is not supported"),!1===(0,e0.validateAddress)(e.destinationAddress,t.blockchain))throw new ew.InvalidDestinationAddressForWithdrawalError(e.destinationAddress,t.blockchain);let{tokens:r}=await this.getCachedSupportedTokens([SC(t.blockchain)],e.logger),i=r.find(t=>t.intents_token_id===e.assetId);if(null==i)throw new ew.UnsupportedAssetIdError(e.assetId,"`assetId` is not supported in PoA bridge.");if(!e.skipMinAmountValidation){let t=BigInt(i.min_withdrawal_amount);if(e.amount<t)throw new ew.MinWithdrawalAmountError(t,e.amount,e.assetId)}if(t.blockchain===eA.Chains.XRPL){let r=this.xrplRpcUrls[0];
94(0,eW.assert)(r,"No XRPL RPC URL configured");let i={baseURL:r,logger:e.logger},n="xrp.omft.near"===t.contractId;try{let t=await SW.httpClient.getAccountInfo(e.destinationAddress,i);if(t.account_flags.requireDestinationTag&&!e.destinationMemo)throw new SI(e.destinationAddress);if(t.account_flags.depositAuth)throw new Sk(e.destinationAddress)}catch(e){if(!(n&&e instanceof SW.httpClient.XrplAccountNotFundedError))throw e}}}async estimateWithdrawalFee(e){let t=this.parseAssetId(e.withdrawalParams.assetId);(0,eW.assert)(null!=t,"Asset is not supported");let r=BigInt((await SP.poaBridge.httpClient.getWithdrawalEstimate({token:eY.utils.getTokenAccountId(e.withdrawalParams.assetId),address:e.withdrawalParams.destinationAddress,chain:SC(t.blockchain)},{baseURL:this.getPoaBridgeBaseURL(),logger:e.logger})).withdrawalFee);return(0,eW.assert)(r>0n,`Invalid POA bridge relayer fee: expected > 0, got ${r}`),{amount:r,quote:null,underlyingFees:{[e_.RouteEnum.PoaBridge]:{relayerFee:r}}}}createWithdrawalIdentifier(e){let t=this.parseAssetId(e.withdrawalParams.assetId);return(0,eW.assert)(null!=t,"Asset is not supported"),{landingChain:t.blockchain,index:e.index,withdrawalParams:e.withdrawalParams,tx:e.tx}}async describeWithdrawal(e){var t,r;let i=(t=(await this.getWithdrawalStatusWithRetry(e)).withdrawals,r=e.withdrawalParams.assetId,t.find(e=>`nep141:${e.data.near_token_id}`===r));return null==i||"PENDING"===i.status?{status:"pending"}:"COMPLETED"===i.status?{status:"completed",txHash:i.data.transfer_tx_hash}:{status:"failed",reason:i.status}}async getWithdrawalStatusWithRetry(e){let t=Date.now();for(;;)try{return await SP.poaBridge.httpClient.getWithdrawalStatus({withdrawal_hash:e.tx.hash},{baseURL:this.getPoaBridgeBaseURL(),logger:e.logger})}catch(i){var r;if(!((r=i)instanceof eR.RpcRequestError&&"Withdrawals not found"===r.details))throw i;if(Date.now()-t>=SG)return{withdrawals:[]};e.logger?.warn("Withdrawal not indexed yet, retrying..."),await function(e){return new Promise(t=>setTimeout(t,e))}(SZ)}}async getCachedSupportedTokens(e,t){let r=e.sort().join(","),i=this.supportedTokensCache.get(r);if(null!=i)return i;let n=await SP.poaBridge.httpClient.getSupportedTokens({chains:e},{baseURL:this.getPoaBridgeBaseURL(),logger:t});return this.supportedTokensCache.set(r,n),n}};let SG=3e3,SZ=1e3;e.s(["PoaBridge",0,SK],201667);let SX={[eA.Chains.BNB]:["https://bsc-rpc.publicnode.com"],[eA.Chains.Polygon]:["https://polygon-bor-rpc.publicnode.com"],[eA.Chains.Monad]:["https://rpc.monad.xyz"],[eA.Chains.Optimism]:["https://optimism-rpc.publicnode.com"],[eA.Chains.Avalanche]:["https://avalanche-c-chain-rpc.publicnode.com"],[eA.Chains.LayerX]:["https://rpc.xlayer.tech"],[eA.Chains.Adi]:["https://rpc.adifoundation.ai"],[eA.Chains.Plasma]:["https://rpc.plasma.to"],[eA.Chains.Scroll]:["https://rpc.scroll.io"]};e.s(["PUBLIC_EVM_RPC_URLS",0,SX,"PUBLIC_STELLAR_RPC_URLS",0,{soroban:["https://mainnet.sorobanrpc.com"],horizon:["https://horizon.stellar.org"]},"PUBLIC_XRPL_RPC_URLS",0,["https://xrplcluster.com/"]],212635)},225520,(e,t,r)=>{"use strict";var i,n=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),a=e.e&&e.e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=e.e&&e.e.__importStar||(i=function(e){return(i=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),s=0;s<r.length;s++)"default"!==r[s]&&n(t,e,r[s]);return a(t,e),t});Object.defineProperty(r,"__esModule",{value:!0}),r.BorshSchema=void 0;let o=e.r(956376),l=s(e.r(899764));class u{schema;constructor(e){this.schema=e}static fromSchemaUnchecked(e){return new u(e)}toSchema(){return this.schema}serialize(e){let t=l.serialize(this.toSchema(),e);return o.Buffer.from(t)}deserialize(e){return l.deserialize(this.toSchema(),e)}
94static get u8(){return u.fromSchemaUnchecked("u8")}static get u16(){return u.fromSchemaUnchecked("u16")}static get u32(){return u.fromSchemaUnchecked("u32")}static get u64(){return u.fromSchemaUnchecked("u64")}static get u128(){return u.fromSchemaUnchecked("u128")}static get i8(){return u.fromSchemaUnchecked("i8")}static get i16(){return u.fromSchemaUnchecked("i16")}static get i32(){return u.fromSchemaUnchecked("i32")}static get i64(){return u.fromSchemaUnchecked("i64")}static get i128(){return u.fromSchemaUnchecked("i128")}static get f32(){return u.fromSchemaUnchecked("f32")}static get f64(){return u.fromSchemaUnchecked("f64")}static get bool(){return u.fromSchemaUnchecked("bool")}static get String(){return u.fromSchemaUnchecked("string")}static Option(e){return u.fromSchemaUnchecked({option:e.toSchema()})}static Array(e,t){return u.fromSchemaUnchecked({array:{type:e.toSchema(),len:t}})}static Vec(e){return u.fromSchemaUnchecked({array:{type:e.toSchema()}})}static HashSet(e){return u.fromSchemaUnchecked({set:e.toSchema()})}static HashMap(e,t){return u.fromSchemaUnchecked({map:{key:e.toSchema(),value:t.toSchema()}})}static get Unit(){return u.Struct({})}static Struct(e){let t=u.parseStructSchema(e);return u.fromSchemaUnchecked(t)}static Enum(e){let t=u.parseEnumSchema(e);return u.fromSchemaUnchecked(t)}static parseStructSchema(e){return{struct:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.toSchema()]))}}static parseEnumSchema(e){return{enum:Object.entries(e).map(([e,t])=>({struct:{[e]:t.toSchema()}}))}}}r.BorshSchema=u},164207,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BorshSchema=void 0,r.borshSerialize=function(e,t){return e.serialize(t)},r.borshDeserialize=function(e,t){return e.deserialize(t)};var i=e.r(225520);Object.defineProperty(r,"BorshSchema",{enumerable:!0,get:function(){return i.BorshSchema}})},720549,e=>{"use strict";var t,r=e.i(114402),i=e.i(569871),n=e.i(885258),a=e.i(916937),s=e.i(255832),o=e.i(878621),l=e.i(198769),u=e.i(438763),c=e.i(601841),d=e.i(201667),f=e.i(212635),h=e.i(887005);function p(e,{intents:t,verifying_contract:r,...i}){let n=new Date(null!=(i=Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))).deadline?i.deadline:Date.now()+6e4),a=new Date(n.getTime()+6e4);return{verifying_contract:r,deadline:n.toISOString(),nonce:h.VersionedNonceBuilder.encodeNonce(e,a),intents:null==t?[]:t,signer_id:void 0,...i}}var g=e.i(164207);let m=g.BorshSchema.Struct({message:g.BorshSchema.String,nonce:g.BorshSchema.Array(g.BorshSchema.u8,32),recipient:g.BorshSchema.String,callback_url:g.BorshSchema.Option(g.BorshSchema.String)});async function y({message:e,recipient:t,nonce:r,callback_url:i}){let n=(0,g.borshSerialize)(m,{message:e,nonce:Array.from(r),recipient:t,callback_url:i}),a=(0,g.borshSerialize)(g.BorshSchema.u32,0x8000019d),s=new Uint8Array(a.length+n.length);return s.set(a),s.set(n,a.length),new Uint8Array(await crypto.subtle.digest("SHA-256",s))}var v=e.i(987750);async function b(e){let t=e.payload;return y({message:t.message,recipient:t.recipient,nonce:Array.from(v.base64.decode(t.nonce)),callback_url:t.callbackUrl})}var w=e.i(96157),_=e.i(117956),A=e.i(936959);function S(e,t){let r=new Uint8Array(t);for(let i=t-1;i>=0;i--)r[i]=255&e,e>>=8;return r}var E=e.i(104147);async function x(e){var t,r,i,n,a;let{standard:s}=e;switch(s){case"nep413":return b(e);case"erc191":let o,l,u;return t=e.payload,(0,w.keccak_256)((o=new TextEncoder().encode(t),(u=new Uint8Array((l=new TextEncoder().encode(`\x19Ethereum Signed Message: 95${o.length}`)).length+o.length)).set(l,0),u.set(o,l.length),u));case"tip191":let c,d,f;return r=e.payload,(0,w.keccak_256)((c=new TextEncoder().encode(r),(f=new Uint8Array((d=new TextEncoder().encode(`\x19TRON Signed Message: 96${c.length}`)).length+c.length)).set(d,0),f.set(c,d.length),f));case"raw_ed25519":return i=e.payload,(0,_.sha256)(new TextEncoder().encode(i));case"webauthn":return n=e.payload,(0,_.sha256)(new TextEncoder().encode(n));case"ton_connect":return function(e){let{address:t,domain:r,timestamp:i,payload:n}=e,a=function(e){let t=(0,A.tryParseTonAddress)(e);if(null===t)throw Error(`Invalid TON address: ${e}`);return t}(t),s=n.type;if("text"===s){let e=new TextEncoder().encode(n.text),t=[new Uint8Array([255,255]),new TextEncoder().encode("ton-connect/sign-data/"),S(a.workchainId,4),a.address,S(r.length,4),new TextEncoder().encode(r),S(Number(i),8),new TextEncoder().encode("txt"),S(e.length,4),e],s=new Uint8Array(t.reduce((e,t)=>
96e+t.length,0)),o=0;for(let e of t)s.set(e,o),o+=e.length;return(0,_.sha256)(s)}throw Error(`Unknown TON Connect payload type: ${s}`)}(e);case"sep53":let h,p;return a=e.payload,(0,_.sha256)((h=new TextEncoder().encode("Stellar Signed Message:\n"),p=new TextEncoder().encode(a),E.utils.concatUint8Arrays([h,p])));default:throw Error(`Unknown payload standard: ${s}`)}}async function T(e){let t=await x(e);return v.base58.encode(t)}var I=class{constructor(e){this.envConfig=e.envConfig,this.logger=e.logger,this.intentPayloadFactory=e.intentPayloadFactory,this.intentRelayer=e.intentRelayer,this.intentSigner=e.intentSigner,this.onBeforePublishIntent=e.onBeforePublishIntent}async signAndSendIntent({relayParams:e,salt:t,signedIntents:r,...i}){let n=p(t,{verifying_contract:this.envConfig.contractID,...i});this.intentPayloadFactory&&(n=await k(n,this.intentPayloadFactory,t));let a=await this.intentSigner.signIntent(n),s=e?await e():{};if(this.onBeforePublishIntent){let e=await T(a);await this.onBeforePublishIntent({intentHash:e,intentPayload:n,multiPayload:a,relayParams:s})}let o=function(e,t){if(!t)return[e];let r=[];return t.before&&t.before.length>0&&r.push(...t.before),r.push(e),t.after&&t.after.length>0&&r.push(...t.after),r}(a,r);if(o.length>1){let e=s.quoteHashes??[];return{ticket:(await this.intentRelayer.publishIntents({multiPayloads:o,quoteHashes:e},{logger:this.logger}))[r?.before?.length??0]}}return{ticket:await this.intentRelayer.publishIntent({multiPayload:a,...s},{logger:this.logger})}}async waitForSettlement(e,t){return this.intentRelayer.waitForSettlement(e,{logger:this.logger,signal:t?.signal})}async sendSignedIntents(e){return{tickets:await this.intentRelayer.publishIntents({multiPayloads:e.multiPayloads,quoteHashes:e.quoteHashes??[]},{logger:this.logger})}}};async function k(e,t,r){let i=await t(e),n=i.intents??[],{nonce:a,...s}=e;return p(r,{...s,...i,intents:Array.from(new Set([...n,...s.intents]))})}var O=e.i(545937),C=class{constructor({envConfig:e,solverRelayApiKey:t}){this.envConfig=e,this.solverRelayApiKey=t}async publishIntent({multiPayload:e,quoteHashes:t},r={}){return(await this.publishIntents({multiPayloads:[e],quoteHashes:t??[]},r))[0]}async publishIntents({multiPayloads:e,quoteHashes:t},r={}){let i=await O.solverRelay.publishIntents({quote_hashes:t,signed_datas:e},{baseURL:this.envConfig.solverRelayBaseURL,logger:r.logger,solverRelayApiKey:this.solverRelayApiKey});if(i.isOk())return i.unwrap();throw i.unwrapErr()}async waitForSettlement(e,t={}){return{tx:{hash:(await O.solverRelay.waitForIntentSettlement({intentHash:e,signal:t.signal,baseURL:this.envConfig.solverRelayBaseURL,logger:t.logger,solverRelayApiKey:this.solverRelayApiKey})).txHash,accountId:this.envConfig.contractID}}}};let N={signIntent(){throw Error("Not implemented")}};var P=e.i(514425),D=e.i(379665);let R={"eip155:1":1852,"eip155:56":36,"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":1387,"eip155:8453":651,"tron:27Lqcw":2358,"eip155:42161":928,"bip122:000000000019d6689c085ae165831e93":3656,"eip155:137":410,"xrpl:0":2276,"bip122:00040fe8ec8471911baa1db1266ea15d":2093,"tvm:-239":53,"near:mainnet":356,"bip122:12a765e31ffd4059bada1e25190f6e98":2385,"eip155:143":22,"eip155:43114":657,"stellar:pubnet":50,"eip155:10":23,"bip122:1a91e3dace36e2be3bf030a65679fe82":1970,"sui:mainnet":752,"eip155:80085":579,"eip155:100":3308,"aptos:mainnet":394,"cip34:1-764824073":807},$={p50:6e4,p90:6e5,p99:216e5};var B=e.i(116453),L=e.i(713440);async function U(e){let t=function(e){let t=R[e.chain];if(null==t){let t=72e4*(e.bridgeRoute===n.RouteEnum.HotBridge);return{...$,p99:$.p99+t}}let r=1e3*t;return{p50:Math.max(5e3,.15*r),p90:Math.max(3e4,.5*r),p99:3*r+72e4*(e.bridgeRoute===n.RouteEnum.HotBridge)}}({chain:e.wid.landingChain,bridgeRoute:e.bridge.route}),r=0;try{return await (0,L.poll)(async()=>{try{let t=await e.bridge.describeWithdrawal({...e.wid,logger:e.logger});if(r=0,"completed"===t.status)return null!=t.txHash?{hash:t.txHash}:{hash:null};if("failed"===t.status)throw new z(t.reason);return L.POLL_PENDING}catch(t){if(t instanceof z)throw t;if(++r>=5)throw new V(t);return e.logger?.warn(`Transient error (${r}/5): ${t}`),L.POLL_PENDING}},{stats:t,signal:e.signal})}catch(e){if(e instanceof L.PollTimeoutError)throw new V(e);throw e}}async function F(e){let t=new Map,r=[];for(let i of e.withdrawalParams){let n=await M(e.bridges,i);if(null==n)throw new j;let a=t.get(n.route)??0;t.set(n.route,a+1);let s=n.createWithdrawalIdentifier({withdrawalParams:i,index:a,tx:e.intentTx});r.push({bridge:n,wid:s})}return r}async function M(e,t){for(let r of e)if(await r.supports(t))return r}var j=class extends B.BaseError{constructor(){super("Bridge adapter not found",{name:"BridgeNotFoundError"})}},z=class extends B.BaseError{constructor(e){super(`Withdrawal failed: ${e}`,{name:"WithdrawalFailedError"})}},V=class extends B.BaseError{constructor(e){super("Withdrawal watch failed",{name:"WithdrawalWatchError",cause:e})}},H=e.i(472074),q=class{constructor(e){if(this.salt=v.hex.decode(e),4!==this.salt.length)throw Error(`Invalid salt length: ${this.salt.length}, expected 4`)}async getCachedSalt(){return this.salt}async refresh(){return this.salt}},W=class{constructor({envConfig:e,nearProvider:t}){this.currentSalt=null,this.fetchPromise=null,this.lastFetchTime=0,this.intentsContract=e.contractID,this.nearProvider=t}async getCachedSalt(){return this.isCacheValid()?this.currentSalt:(this.fetchPromise||(this.fetchPromise=this.fetchAndCache().finally(()=>{this.fetchPromise=null})),this.fetchPromise)}async refresh(){return this.invalidateCache(),this.getCachedSalt()}async fetchAndCache(){try{return this.currentSalt=await K(this.nearProvider,this.intentsContract),this.lastFetchTime=Date.now(),this.currentSalt}catch(e){throw this.fetchPromise=null,Error("Failed to fetch salt",{cause:e})}}isCacheValid(){return null!=this.currentSalt&&Date.now()-this.lastFetchTime<3e5}invalidateCache(){this.currentSalt=null,this.lastFetchTime=0}};async function K(e,t){let r=await E.utils.queryContract({contractId:t,methodName:"current_salt",args:{}
96,finality:"optimistic",nearClient:e,schema:H.string()});return v.hex.decode(r)}var G=class e{constructor(e){this.intents=[],this.envConfig=e.envConfig,this.saltManager=e.saltManager,this.verifyingContract=this.envConfig.contractID}setSigner(e){if(!E.utils.validateNearAddress(e))throw Error(`Invalid signer_id: "${e}" is not a valid NEAR account ID`);return this.signerId=e,this}setDeadline(e){return this.deadline=e,this}addIntent(e){return this.intents.push(e),this}addIntents(e){return this.intents.push(...e),this}setVerifyingContract(e){return this.verifyingContract=e,this}setNonce(e){return this.customNonce=e,this}setNonceRandomBytes(e){return this.customRandomBytes=e,this}clearIntents(){return this.intents=[],this}reset(){return this.signerId=void 0,this.deadline=void 0,this.intents=[],this.customNonce=void 0,this.customRandomBytes=void 0,this.verifyingContract=this.envConfig.contractID,this}buildWithSalt(e){let t=this.deadline??new Date(Date.now()+6e4),r=this.customNonce??h.VersionedNonceBuilder.encodeNonce(e,t,this.customRandomBytes);return{verifying_contract:this.verifyingContract,signer_id:this.signerId,deadline:t.toISOString(),nonce:r,intents:[...this.intents]}}async build(){let e=await this.saltManager.getCachedSalt();return this.buildWithSalt(e)}async buildAndSign(e){let t=await this.build();return{signed:await e.signIntent(t),payload:t}}clone(){let t=new e({envConfig:this.envConfig,saltManager:this.saltManager});return t.verifyingContract=this.verifyingContract,t.signerId=this.signerId,t.deadline=this.deadline,t.intents=[...this.intents],t.customNonce=this.customNonce,t.customRandomBytes=this.customRandomBytes,t}getState(){return{envConfig:this.envConfig,verifyingContract:this.verifyingContract,signerId:this.signerId,deadline:this.deadline,intents:[...this.intents],customNonce:this.customNonce}}},Z=e.i(195637);let X=["https://near-rpc.defuse.org","https://free.rpc.fastnear.com","https://1rpc.io/near","https://rpc.mainnet.pagoda.co","https://near.lava.build:443"];(0,Z.nearFailoverRpcProvider)({urls:X});var J=e.i(192328),Y=e.i(854449),Q=e.i(608649),ee=e.i(674758),et=e.i(861912),er=e.i(861488),ei=e.i(329470),en=e.i(3054),ea=e.i(741470);let es=class{constructor(e=["https://api0.herewallet.app","https://api2.herewallet.app"],t=["https://rpc1.hotdao.ai","https://rpc2.hotdao.ai"]){this.api=e,this.mpcApi=t,this.headers={}}setApiKey(e){this.headers["api-key"]=e}async request(e,t){try{let r=Array.isArray(t.endpoint)?t.endpoint:[t.endpoint],i=null;for(let n of r)try{let r=Object.assign({"omni-version":"v2","Content-Type":"application/json",Referer:"https://near-intents.org",Origin:"https://near-intents.org"},t.headers,this.headers),i=await fetch(`${n}${e}`,{...t,headers:r});if(!i.ok){let r=await i.text().catch(()=>"Unknown error");throw new et.ApiError(i.status,t.method,`${n}${e}`,r)}return i}catch(e){i=e}throw i}catch(r){if(null==t.retry||t.retry<=0)throw r;return await (0,ee.wait)(t.retryDelay||1e3),this.request(e,{...t,retry:t.retry-1})}}async requestRpc(e,t){return t.endpoint||(t.endpoint=this.mpcApi),await this.request(e,t)}async requestApi(e,t){return t.endpoint||(t.endpoint=this.api),await this.request(e,t)}async notifyWithdrawal(e){await this.requestApi(`/api/v1/evm/bridge_withdrawal_hash?near_trx=${e}`,{endpoint:"https://api.hot-labs.org",retryDelay:2e3,method:"GET",retry:3})}async getPendingsWithdrawals(){let e=await fetch("https://api0.herewallet.app/api/v1/transactions/hot_bridge_withdrawals"),{withdrawals:t}=await e.json();return t}async getTokenAssets(){let e=await this.requestApi("/api/v1/exchange/intent_tokens",{method:"GET"}),{tokens:t}=await e.json();return t}async getTime(){let e=await this.requestApi("/api/v1/web/time",{method:"GET"}),{ts:t}=await e.json();return t}async getSwapQuoteExectOut(e,t,r){let i=await this.requestApi("/api/v1/exchange/intent_quote_with_exact_amount_out",{body:JSON.stringify({token_in:e,token_out:t,exact_amount_out:r.toString()}),method:"POST"});return await i.json()}async getSwapQuoteExectIn(e,t,r,i){let n=await this.requestApi("/api/v1/exchange/intent_exact_swap_quote",{body:JSON.stringify({sender_id:e,token_in:t,token_out:r,exact_amount_in:i.toString()}),method:"POST"});return await n.json()}async registerDeposit(e){await this.requestApi("/api/v1/transactions/hot_bridges/auto_deposit_register",{body:JSON.stringify({intent_id:e}),method:"POST"})}async getBridgeTokens(){let e=await this.requestApi("/api/v1/exchange/intent_swap/groups",{method:"GET"}),{groups:t,stable_swap_contract:r}=await e.json();return{groups:t,liquidityContract:r}}async estimateSwapStableGroup(e,t,r,i,n){let a=await this.requestApi("/api/v1/exchange/intent_swap_quote",{body:JSON.stringify({token_out:r,amount_in:i,tokens_in:t,sender_id:e,mode:n}),method:"POST"}),s=await a.json();return{amountOut:BigInt(s.amount_out),quote_hashes:s.quote_hashes,signed_fee_quote:s.signed_fee_quote,quote:s.quote,fees:s.fees}}async withdrawSign(e){let t=await this.requestRpc("/withdraw/sign",{body:JSON.stringify({nonce:e}),method:"POST",retryDelay:3e3,retry:3}),{signature:r}=await t.json();return r}async clearWithdrawSign(e,t,r){let i=(0,Q.baseDecode)((0,ee.encodeReceiver)(e,r)),n=en.default.encode([ei.Buffer.from("clear"),BigInt(t),i]),a=ea.default.createHash("sha256").update(n).digest(),s=await this.requestRpc("/clear/sign",{body:JSON.stringify({nonce:t,ownership_proof:(0,Q.baseEncode)(a)}),retryDelay:1e3,method:"POST",retry:1});return await s.json()}async executeClearWithdraw(e,t,r){try{let e=JSON.stringify({nonce:t}),r=await this.requestApi("/api/v1/transactions/clear_completed_withdrawal",{method:"POST",body:e});return await r.json()}catch{return await this.clearWithdrawSign(e,t,r)}}async depositSign(e,t,r,i,n,a,s){1111===e&&(e=1117);let o=JSON.stringify({nonce:t,chain_from:e,sender_id:r,receiver_id:i,token_id:n,amount:a,autopilot:s}),l=await this.requestRpc("/deposit/sign",{method:"POST",body:o,retry:3,retryDelay:1e4});return await l.json()}async executeDeposit(e){try{1111===e.chain_id&&(e.chain_id=1117);let t=JSON.stringify(e),r=await this.requestApi("/api/v1/transactions/process_bridge_deposit",{retry:3,retryDelay:1e4,method:"POST",body:t}),i=await r.json();if(!i.signature&&!i.hash)throw Error("Failed to execute deposit");return i}catch{try{return await this.depositSign(e.chain_id,e.nonce,e.sender_id,e.receiver_id,e.token_id,e.amount,!0)}catch{return await this.depositSign(e.chain_id,e.nonce,e.sender_id,e.receiver_id,e.token_id,e.amount,!1)}}}};var eo=e.i(897436),el=e.i(777811),eu=e.i(345257),ec=e.i(376904);let ed="GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7",ef=class{constructor(e,t){this.omni=e,this.options=t,this.assetsCache=new Map,this.soroban=t.sorobanRpc?t.sorobanRpc.map(e=>new eu.rpc.Server(e)):[new eu.rpc.Server("https://mainnet.sorobanrpc.com")],this.horizon=t.horizonRpc?t.horizonRpc.map(e=>new eu.Horizon.Server(e)):[new eu.Horizon.Server("https://horizon.stellar.org")],this.contract=t.contract||"CCLWL5NYSV2WJQ3VBU44AMDHEVKEPA45N2QP2LL62O3JVKPGWWAQUVAG",this.baseFee=t.baseFee||"500000"}async callHorizon(e){let t;for(let r of this.horizon)try{return await e(r)}catch(e){t=e;continue}throw t}async callSoroban(e){let t;for(let r of this.soroban)try{return await e(r)}catch(e){t=e;continue}throw t}async getWithdrawFee(){let e=BigInt((0,ee.parseAmount)(.15,7)),t=BigInt((0,ee.parseAmount)(.1,7));return new el.ReviewFee({reserve:e,baseFee:t,chain:er.Network.Stellar})}
96async getDepositFee(e,t,r,i){let n=(0,ee.omniEphemeralReceiver)(i),a=BigInt((await this.buildDepositTx(e,t,1n,n)).fee);return new el.ReviewFee({reserve:a,baseFee:a,chain:er.Network.Stellar})}async isWithdrawUsed(e){let t=await this.buildSmartContactTx(ed,this.contract,"is_executed",new eu.XdrLargeInt("u128",e).toU128()),r=await this.callSoroban(e=>e.simulateTransaction(t));return!!r.result?.retval.value()}async isAccountExists(e){let t=await this.callHorizon(t=>t.accounts().accountId(e).call()).catch(()=>null);return!!t&&t.balances.length>0}async isTrustlineExists(e,t){if("native"===t)return!0;let r=await this.getAssetFromContractId(t);return(await this.callHorizon(t=>t.accounts().accountId(e).call())).balances.some(e=>"asset_issuer"in e&&e.asset_issuer===r.issuer)}async buildDepositTx(e,t,r,i){let n=await this.omni.api.getTime();n=String(BigInt(n)-20n*10n**12n);let a="native"===t?new eu.Asset("XLM").contractId(eu.Networks.PUBLIC):t,s=new eu.Contract(this.contract).call("deposit",eu.Address.fromString(e).toScVal(),new eu.XdrLargeInt("u128",r.toString()).toU128(),eu.xdr.ScVal.scvAddress(eu.Address.contract(eu.StrKey.decodeContract(a)).toScAddress()),eu.xdr.ScVal.scvBytes(i),new eu.XdrLargeInt("u128",n.toString()).toU128()),o=await this.callSoroban(t=>t.getAccount(e)),l=new eu.TransactionBuilder(o,{fee:this.baseFee,networkPassphrase:eu.Networks.PUBLIC}).addOperation(s).setTimeout(eu.TimeoutInfinite);return await this.callSoroban(e=>e.prepareTransaction(l.build()))}async deposit(e){this.omni.api.registerDeposit(e.intentAccount);let t=(0,ee.omniEphemeralReceiver)(e.intentAccount),r=await this.buildDepositTx(e.sender,e.token,e.amount,t);return await e.sendTransaction(r)}async withdraw(e){let t=new eu.Contract(this.contract),r=await this.omni.api.withdrawSign(e.nonce),i=ei.Buffer.from((0,Q.baseDecode)(r)),n="native"===e.token?new eu.Asset("XLM").contractId(eu.Networks.PUBLIC):e.token,a=t.call("withdraw",new eu.XdrLargeInt("u128",e.amount.toString()).toU128(),new eu.XdrLargeInt("u128",e.nonce).toU128(),eu.Address.fromString(n).toScVal(),eu.Address.fromString(e.receiver).toScVal(),eu.xdr.ScVal.scvBytes(i)),s=await this.callSoroban(t=>t.getAccount(e.sender)),o=new eu.TransactionBuilder(s,{fee:this.baseFee,networkPassphrase:eu.Networks.PUBLIC}).addOperation(a).setTimeout(eu.TimeoutInfinite),l=await this.callSoroban(e=>e.prepareTransaction(o.build()));return await e.sendTransaction(l)}async clearDepositNonceIfNeeded(e){}async parseDeposit(e){let t,r=await this.callSoroban(t=>t.getTransaction(e));if(r.status!==eu.rpc.Api.GetTransactionStatus.SUCCESS)throw new et.DepositNotFoundError(er.Network.Stellar,e,"tx not found");let i=eu.TransactionBuilder.fromXDR(r.envelopeXdr,eu.Networks.PUBLIC);if(!i.operations.length||"invokeHostFunction"!==i.operations[0].type)throw new et.DepositNotFoundError(er.Network.Stellar,e,"Deposit tx not found");let n=i.operations[0].func.invokeContract().args(),a=new eu.Asset("XLM").contractId(eu.Networks.PUBLIC),s=eu.Address.fromScAddress(n[0].address()),o=(0,eu.scValToBigInt)(n[1]),l=eu.Address.fromScAddress(n[2].address()).toString(),u=(0,Q.baseEncode)(n[3].bytes());try{t=(0,eu.scValToBigInt)(r.resultMetaXdr.v4().sorobanMeta().returnValue())}catch(e){t=(0,eu.scValToBigInt)(r.resultMetaXdr.v3().sorobanMeta().returnValue())}return{tx:e,receiver:u,nonce:t.toString(),amount:o.toString(),sender:s.toString(),token:l===a?"native":l,chain:er.Network.Stellar,timestamp:Date.now()}}async activateToken(e){let t=e.token instanceof eu.Asset?e.token:await this.getAssetFromContractId(e.token),r=await this.callSoroban(t=>t.getAccount(e.sender)),i=eu.Operation.changeTrust({asset:t,source:e.sender}),n=new eu.TransactionBuilder(r,{fee:this.baseFee,networkPassphrase:eu.Networks.PUBLIC}).addOperation(i).setTimeout(eu.TimeoutInfinite).build();return await e.sendTransaction(n)}async buildSmartContactTx(e,t,r,...i){let n=await this.callSoroban(t=>t.getAccount(e)),a=new eu.Contract(t),s=new eu.TransactionBuilder(n,{fee:this.baseFee,networkPassphrase:eu.Networks.PUBLIC});return i?s.addOperation(a.call(r,...i)):s.addOperation(a.call(r)),s.setTimeout(eu.TimeoutInfinite).build()}async getAssetFromContractId(e){if("native"===e)return eu.Asset.native();if(this.assetsCache.has(e))return Promise.resolve(this.assetsCache.get(e));let t=await this.buildSmartContactTx(ed,e,"name"),r=await this.callSoroban(e=>e.simulateTransaction(t)),i=r?.result?.retval?.value();if(!i)throw"Asset not found";let[n,a]=i.toString().split(":"),s=a?new eu.Asset(n,a):eu.Asset.native();return this.assetsCache.set(e,s),s}async getTokenBalance(e,t=this.contract){let r=await this.buildSmartContactTx(ed,"string"==typeof e?"native"===e?new eu.Asset("XLM").contractId(eu.Networks.PUBLIC):e:e.contractId(eu.Networks.PUBLIC),"balance",eu.Address.fromString(t).toScVal()),i=await this.callSoroban(e=>e.simulateTransaction(r));return i?BigInt((0,ee.parseAmount)(this.i128ToInt(i.result?.retval.value()),7)):0n}i128ToInt(e){return new ec.default(e.hi()._value).plus(e.lo()._value).div(1e7).toString()}};var eh=e.i(938622),ep=e.i(901249),eg=e.i(222956),em=e.i(849755),ey=e.i(927431),ev=e.i(566168);let eb="function deposit(bytes memory receiver, address contract_id, uint128 amount)",ew="function deposit(bytes memory receiver) payable",e_={anonymous:!1,inputs:[{indexed:!1,internalType:"uint128",name:"nonce",type:"uint128"},{indexed:!1,internalType:"uint128",name:"amount",type:"uint128"},{indexed:!1,internalType:"bytes",name:"contract_id",type:"bytes"},{indexed:!1,internalType:"bytes",name:"receiver",type:"bytes"}],name:"NewTransfer",type:"event"},eA=[e_,"function withdraw(uint128 nonce, address contract_id, address receiver_id, uint128 amount, bytes memory signature)",{inputs:[{internalType:"uint128",name:"",type:"uint128"}],outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",name:"usedNonces"}],eS=["function name() public view returns (string)","function symbol() public view returns (string)","function decimals() public view returns (uint8)","function totalSupply() public view returns (uint256)","function balanceOf(address _owner) public view returns (uint256 balance)","function transfer(address _to, uint256 _value) public returns (bool success)","function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)","function approve(address _spender, uint256 _value) public returns (bool success)","function allowance(address _owner, address _spender) public view returns (uint256 remaining)"],eE=class{constructor(e,t){this.omni=e,this.getProvider="function"==typeof t.rpcs?t.rpcs:(e=>t=>{if(!e[t])throw`No rpc for chain ${t}`;let r=(Array.isArray(e[t])?e[t]:[e[t]]).map(e=>new ep.ethers.JsonRpcProvider(e,t,{staticNetwork:!0}));return new ep.ethers.FallbackProvider(r,t,{})})(t.rpcs||{}),this.treasuryDefaultContract=t?.treasuryDefaultContract||"0x233c5370CCfb3cD7409d9A3fb98ab94dE94Cb4Cd",this.treasuryContracts=Object.assign({[er.Network.ADI]:"0x4A3b9D07a9A1E3D9dfb0A6edfC87384f8F424003"},t?.treasuryContracts||{}),this.enableApproveMax=t.enableApproveMax??!1}getContract(e){return this.treasuryContracts[e]||this.treasuryDefaultContract}async getGasPrice(e){let t=await this.getProvider(e).getFeeData();return el.ReviewFee.fromFeeData(t,e)}async getWithdrawFee(e){return(await this.getGasPrice(e)).changeGasLimit(200000n)}
96async getDepositFee(e,t,r,i){let n=await this.getGasPrice(e),a=await this.depositEstimateGas(e,t,r,i);return n.changeGasLimit(a)}async approveTokenEstimate(e){let{chain:t,token:r,allowed:i,need:n}=e,a=this.getProvider(t),s=new ev.VoidSigner(e.sender,a),o=new ep.ethers.Contract(r,eS,s);return await o.allowance(e.sender,e.allowed)>=n?0n:await o.approve.estimateGas(i,ey.MaxUint256)}async depositEstimateGas(e,t,r,i){let n=this.getProvider(e),a=new ev.VoidSigner(i,n);if("native"===t)return new eh.Contract(this.getContract(e),[ew],a).deposit.estimateGas(i,{value:r});let s=await this.approveTokenEstimate({sender:i,chain:e,token:t,allowed:this.getContract(e),need:r});if(s)return s+(e==er.Network.Arbitrum?400000n:160000n);let o=new eh.Contract(this.getContract(e),[eb],a);return await o.deposit.estimateGas(i,t,r)}async approveToken(e){let t=this.getProvider(e.chain),r=new ep.ethers.Contract(e.token,eS,t);if(await r.allowance(e.sender,e.allowed)>=e.need)return;let i=await r.approve.populateTransaction(e.allowed,e.amount),n=await e.sendTransaction({...i,chainId:e.chain});this.omni.logger?.log(`Approve tx: ${n}`)}async getTokenBalance(e,t,r=this.getContract(t)){let i=this.getProvider(t);if("native"===e)return await i.getBalance(r);let n=new eh.Contract(e,eS,i);return BigInt(await n.balanceOf(r))}async isWithdrawUsed(e,t){let r=this.getProvider(e),i=new eh.Contract(this.getContract(e),eA,r);return await i.usedNonces(t)}async withdraw(e){let t=await this.omni.api.withdrawSign(e.nonce);this.omni.logger?.log(`Withdrawing ${e.amount} ${e.token} from ${e.chain}`);let r=new eh.Contract(this.getContract(e.chain),eA,this.getProvider(e.chain)),i=await r.withdraw.populateTransaction(e.nonce,(0,eg.hexlify)((0,Q.baseDecode)((0,ee.encodeTokenAddress)(e.chain,e.token))),e.receiver,BigInt(e.amount),(0,eg.hexlify)((0,Q.baseDecode)(t))),n=await e.sendTransaction({...i,chainId:e.chain});return this.omni.logger?.log(`Withdraw tx: ${n}`),n}async deposit(e){this.omni.api.registerDeposit(e.intentAccount),this.omni.logger?.log(`Call deposit ${e.amount} ${e.token} to ${e.intentAccount}`);let t=(0,ee.omniEphemeralReceiver)(e.intentAccount);if("native"===e.token){this.omni.logger?.log("Depositing native");let r=new eh.Contract(this.getContract(e.chain),[ew],this.getProvider(e.chain)),i=await r.deposit.populateTransaction((0,eg.hexlify)(t),{value:e.amount});return await e.sendTransaction({...i,chainId:e.chain})}this.omni.logger?.log(`Approving token if needed ${e.token} ${e.amount}`),await this.approveToken({sendTransaction:e.sendTransaction,need:e.amount,amount:this.enableApproveMax?ey.MaxUint256:e.amount,allowed:this.getContract(e.chain),sender:e.sender,chain:e.chain,token:e.token}),this.omni.logger?.log("Depositing token");let r=new eh.Contract(this.getContract(e.chain),[eb],this.getProvider(e.chain)),i=await r.deposit.populateTransaction((0,eg.hexlify)(t),e.token,e.amount);return await e.sendTransaction({...i,chainId:e.chain})}async parseDeposit(e,t){let r=this.getProvider(e),i=async(e=0)=>{let n=await r.provider.getTransactionReceipt(t).catch(()=>null);return n||e>2?n:(await (0,ee.wait)(3e3),await i(e+1))},n=await i();if(null==n)throw new et.DepositNotFoundError(e,t,"no tx receipt yet");let a=new em.Interface([e_]);if(null==n.logs[0])throw new et.DepositNotFoundError(e,t,"no deposit logs");let s=n.logs.map(e=>a.parseLog(e)).find(e=>e?.args[0]!=null);if(null==s)throw new et.DepositNotFoundError(e,t,"no deposit nonce yet");let o=String(s.args[0]),l=String(s.args[1]),u="0x0000000000000000000000000000000000000000"===s.args[2]?"native":s.args[2];return{amount:l,chain:e,receiver:(0,Q.baseEncode)((0,eg.getBytes)(s.args[3])),timestamp:await n.getBlock().then(e=>e.timestamp)*1e3,tx:t,nonce:o,token:u,sender:n.from}}};var ex=e.i(218123),eT=e.i(149830),eI=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"],ek=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),i=parseInt(r)/8;this.resize_if_necessary(i);var n="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[n](this.offset,e,!0),this.offset+=i},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}(),eO=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var i="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),n=this.view[i](this.offset,!0);return this.offset+=r,n},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}(),eC=(t=function(e,r){return(t=Object.setPrototypeOf||({__proto__:[]}
96)instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,r)},function(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)});function eN(e,t,r){if(typeof e!==t)throw Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))}function eP(e,t,r){if(e!==t)throw Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))}var eD=eI.concat(["bool","string"]),eR=["option","enum","array","set","map","struct"],e$=function(e){function t(t,r){var i="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,i)||this}return eC(t,e),t}(Error),eB=function(){function e(e){this.encoded=new ek,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(eI.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&eN(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&function(e,t){var r=["number","string","bigint","boolean"].includes(typeof e),i="object"==typeof e&&null!==e&&"toString"in e;if(!r&&!i)throw Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,i=new Uint8Array(r),n=0;n<r;n++)i[n]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(i))},e.prototype.encode_string=function(e){this.checkTypes&&eN(e,"string",this.fieldPath),this.encoded.store_value(e.length,"u32");for(var t=0;t<e.length;t++)this.encoded.store_value(e.charCodeAt(t),"u8")},e.prototype.encode_boolean=function(e){this.checkTypes&&eN(e,"boolean",this.fieldPath),this.encoded.store_value(+!!e,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&function(e,t){if("object"!=typeof e||null===e)throw Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}(e,this.fieldPath);for(var r=Object.keys(e)[0],i=0;i<t.enum.length;i++){var n=t.enum[i];if(r===Object.keys(n.struct)[0])return this.encoded.store_value(i,"u8"),this.encode_struct(e,n)}throw Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(Array.isArray(e)||e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?eP(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?eP(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&eN(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var i=0;i<r.length;i++){var n=r[i];this.encode_value(n,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&eN(e,"object",this.fieldPath);var r=e instanceof Map,i=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(i.length,"u32");for(var n=0;n<i.length;n++){var a=i[n];this.encode_value(a,t.map.key),this.encode_value(r?e.get(a):e[a],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&eN(e,"object",this.fieldPath);for(var r=0,i=Object.keys(t.struct);r<i.length;r++){var n=i[r];this.fieldPath.push(n),this.encode_value(e[n],t.struct[n]),this.fieldPath.pop()}},e}();function eL(e){this.buffer=new eO(e)}eL.prototype.decode=function(e){return this.decode_value(e)},eL.prototype.decode_value=function(e){if("string"==typeof e){if(eI.includes(e))return this.decode_integer(e);if("string"===e)return this.decode_string();if("bool"===e)return this.decode_boolean()}if("object"==typeof e){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);
96if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw Error("Unsupported type: ".concat(e))},eL.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},eL.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,i=new Uint8Array(this.buffer.consume_bytes(r)),n=i.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&i[r-1]?BigInt.asIntN(e,BigInt("0x".concat(n))):BigInt("0x".concat(n))},eL.prototype.decode_string=function(){var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e));return String.fromCharCode.apply(null,t)},eL.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},eL.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw Error("Invalid option ".concat(t));return null},eL.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw Error("Enum option ".concat(r," is not available"));var i=e.enum[r].struct,n=Object.keys(i)[0];return(t={})[n]=this.decode_value(i[n]),t},eL.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),i=0;i<r;++i)t.push(this.decode_value(e.array.type));return t},eL.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,i=0;i<t;++i)r.add(this.decode_value(e.set));return r},eL.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,i=0;i<t;++i){var n=this.decode_value(e.map.key),a=this.decode_value(e.map.value);r.set(n,a)}return r},eL.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t};let eU=new class{Ed25519Signature={struct:{data:{array:{type:"u8",len:64}}}};Secp256k1Signature={struct:{data:{array:{type:"u8",len:65}}}};Signature={enum:[{struct:{ed25519Signature:this.Ed25519Signature}},{struct:{secp256k1Signature:this.Secp256k1Signature}}]};Ed25519Data={struct:{data:{array:{type:"u8",len:32}}}};Secp256k1Data={struct:{data:{array:{type:"u8",len:64}}}};PublicKey={enum:[{struct:{ed25519Key:this.Ed25519Data}},{struct:{secp256k1Key:this.Secp256k1Data}}]};FunctionCallPermission={struct:{allowance:{option:"u128"},receiverId:"string",methodNames:{array:{type:"string"}}}};FullAccessPermission={struct:{}};AccessKeyPermission={enum:[{struct:{functionCall:this.FunctionCallPermission}},{struct:{fullAccess:this.FullAccessPermission}}]};AccessKey={struct:{nonce:"u64",permission:this.AccessKeyPermission}};CreateAccount={struct:{}};DeployContract={struct:{code:{array:{type:"u8"}}}};FunctionCall={struct:{methodName:"string",args:{array:{type:"u8"}},gas:"u64",deposit:"u128"}};Transfer={struct:{deposit:"u128"}};Stake={struct:{stake:"u128",publicKey:this.PublicKey}};AddKey={struct:{publicKey:this.PublicKey,accessKey:this.AccessKey}};DeleteKey={struct:{publicKey:this.PublicKey}};DeleteAccount={struct:{beneficiaryId:"string"}};GlobalContractDeployMode={enum:[{struct:{CodeHash:{struct:{}}}},{struct:{AccountId:{struct:{}}}}]};GlobalContractIdentifier={enum:[{struct:{CodeHash:{array:{type:"u8",len:32}}}},{struct:{AccountId:"string"}}]};DeployGlobalContract={struct:{code:{array:{type:"u8"}},deployMode:this.GlobalContractDeployMode}};UseGlobalContract={struct:{contractIdentifier:this.GlobalContractIdentifier}};DelegateActionPrefix={struct:{prefix:"u32"}};ClassicActions={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:"string"}},{struct:{deployGlobalContract:this.DeployGlobalContract}},{struct:{useGlobalContract:this.UseGlobalContract}}]};DelegateAction={struct:{senderId:"string",receiverId:"string",actions:{array:{type:this.ClassicActions}},nonce:"u64",maxBlockHeight:"u64",publicKey:this.PublicKey}};SignedDelegate={struct:{delegateAction:this.DelegateAction,signature:this.Signature}};Action={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:this.SignedDelegate}},{struct:{deployGlobalContract:this.DeployGlobalContract}},{struct:{useGlobalContract:this.UseGlobalContract}}]};Transaction={struct:{signerId:"string",publicKey:this.PublicKey,nonce:"u64",receiverId:"string",blockHash:{array:{type:"u8",len:32}},actions:{array:{type:this.Action}}}};SignedTransaction={struct:{transaction:this.Transaction,signature:this.Signature}}};var eF=e.i(851380);
96class eM extends Error{cause;constructor(e,t){super(e,t),t.cause&&(this.cause=t.cause)}}async function ej(e,t,r,i){let n=await (0,eF.backOff)(async()=>{let i=await fetch(e,{method:"POST",body:JSON.stringify(t),headers:{...r,"Content-Type":"application/json"}}),{ok:n,status:a}=i;if(500===a)throw new eM("Internal server error",{cause:a});if(408===a)throw new eM("Timeout error",{cause:a});if(400===a)throw new eM("Request validation error",{cause:a});if(503===a)throw new eM(`${e} unavailable`,{cause:a});if(!n)throw new eM(await i.text(),{cause:a});return i},i);if(!n)throw new eT.TypedError(`Exceeded 10 attempts for ${e}.`,"RetriesExceeded");return await n.json()}let ez=123;class eV{connection;options;networkId;constructor(e,t){this.connection=e||{url:""},this.options=Object.assign({},{retries:12,wait:500,backoff:1.5},t),this.networkId=void 0}async getNetworkId(){if(this.networkId)return this.networkId;let{chain_id:e}=await this.viewNodeStatus();return this.networkId=e,this.networkId}async getCurrentEpochSeatPrice(){let{minimum_stake_ratio:e,protocol_version:t}=await this.experimental_protocolConfig({finality:"final"}),{current_validators:r}=await this.viewValidators();return(0,Q.findSeatPrice)(r,300,e,t)}async getNextEpochSeatPrice(){let{minimum_stake_ratio:e,protocol_version:t}=await this.experimental_protocolConfig({finality:"final"}),{next_validators:r}=await this.viewValidators();return(0,Q.findSeatPrice)(r,300,e,t)}async viewAccessKey(e,t,r={finality:"final"}){let i=await this.query({...r,request_type:"view_access_key",account_id:e,public_key:t.toString()});return{...i,nonce:BigInt(i.nonce)}}async viewAccessKeyList(e,t={finality:"final"}){return this.query({...t,request_type:"view_access_key_list",account_id:e})}async viewAccount(e,t={finality:"final"}){let r=await this.query({...t,request_type:"view_account",account_id:e});return{...r,amount:BigInt(r.amount),locked:BigInt(r.locked)}}async viewContractCode(e,t={finality:"final"}){let r=await this.query({...t,request_type:"view_code",account_id:e});return{...r,code:new Uint8Array(ei.Buffer.from(r.code_base64,"base64"))}}async viewContractState(e,t,r={finality:"final"}){let i=ei.Buffer.from(t||"").toString("base64");return this.query({...r,request_type:"view_state",account_id:e,prefix_base64:i})}async callFunction(e,t,r,i={finality:"final"}){let{result:n}=await this.callFunctionRaw(e,t,r,i);if(0===n.length)return;let a=ei.Buffer.from(n).toString();try{return JSON.parse(a)}catch{return a}}async callFunctionRaw(e,t,r,i={finality:"final"}){let n=ei.Buffer.from(JSON.stringify(r)).toString("base64");return await this.query({...i,request_type:"call_function",account_id:e,method_name:t,args_base64:n})}async viewBlock(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("block",{block_id:r,finality:t})}async viewChunk(e){return this.sendJsonRpc("chunk",[e])}async viewGasPrice(e){return this.sendJsonRpc("gas_price",[e||null])}async viewNodeStatus(){return this.sendJsonRpc("status",[])}async viewValidators(e){return this.sendJsonRpc("validators",[e||null])}async viewTransactionStatus(e,t,r){let i="string"==typeof e?e:(0,Q.baseEncode)(e);return this.sendJsonRpc("tx",{tx_hash:i,sender_account_id:t,wait_until:r})}async viewTransactionStatusWithReceipts(e,t,r){let i="string"==typeof e?e:(0,Q.baseEncode)(e);return this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:i,sender_account_id:t,wait_until:r})}async viewTransactionReceipt(e){return this.sendJsonRpc("EXPERIMENTAL_receipt",{receipt_id:e})}async status(){return this.sendJsonRpc("status",[])}async sendTransactionUntil(e,t){var r,i;let n=(r="signature"in e?eU.SignedTransaction:eU.Transaction,void 0===i&&(i=!0),i&&function e(t){if(!("string"==typeof t&&eD.includes(t))){if(t&&"object"==typeof t){var r=Object.keys(t);if(1===r.length&&eR.includes(r[0])){var i=r[0];if("option"===i)return e(t[i]);if("enum"===i){var n=t[i];if(!Array.isArray(n))throw new e$(n,"Array");for(var a=0;a<n.length;a++){var s=n[a];if("object"!=typeof s||!("struct"in s))throw Error('Missing "struct" key in enum schema');if("object"!=typeof s.struct||1!==Object.keys(s.struct).length)throw Error('The "struct" in each enum must have a single key');e({struct:s.struct})}return}if("array"===i){var o=t[i];if("object"!=typeof o)throw new e$(o,"{ type, len? }");if(o.len&&"number"!=typeof o.len)throw Error("Invalid schema: ".concat(o));if("type"in o)return e(o.type);throw new e$(o,"{ type, len? }")}if("set"===i)return e(t[i]);if("map"===i){var l=t[i];if("object"==typeof l&&"key"in l&&"value"in l)e(l.key),e(l.value);else throw new e$(l,"{ key, value }");return}if("struct"===i){var u=t[i];if("object"!=typeof u)throw new e$(u,"object");for(var c in u)e(u[c]);return}}}throw new e$(t,eR.join(", ")+" or "+eD.join(", "))}}(r),new eB(i).encode(e,r));return this.sendJsonRpc("send_tx",{signed_tx_base64:ei.Buffer.from(n).toString("base64"),wait_until:t})}async sendTransaction(e){return this.sendTransactionUntil(e,"EXECUTED_OPTIMISTIC")}async sendTransactionAsync(e){return this.sendTransactionUntil(e,"NONE")}async txStatus(e,t,r="EXECUTED_OPTIMISTIC"){return"string"==typeof e?this.txStatusString(e,t,r):this.txStatusUint8Array(e,t,r)}async txStatusUint8Array(e,t,r){return this.sendJsonRpc("tx",{tx_hash:(0,Q.baseEncode)(e),sender_account_id:t,wait_until:r})}async txStatusString(e,t,r){return this.sendJsonRpc("tx",{tx_hash:e,sender_account_id:t,wait_until:r})}async txStatusReceipts(e,t,r="EXECUTED_OPTIMISTIC"){return"string"==typeof e?this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:e,sender_account_id:t,wait_until:r}):this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:(0,Q.baseEncode)(e),sender_account_id:t,wait_until:r})}async query(...e){let t;if(1===e.length){let{block_id:r,blockId:i,...n}=e[0];t=await this.sendJsonRpc("query",{...n,block_id:r||i})}else{let[r,i]=e;t=await this.sendJsonRpc("query",[r,i])}if(t&&t.error)throw new eT.TypedError(`Querying failed: ${t.error}. 97${JSON.stringify(t,null,2)}`,(0,Q.getErrorTypeFromErrorMessage)(t.error,t.error.name));return t}async block(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("block",{block_id:r,finality:t})}async blockChanges(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("EXPERIMENTAL_changes_in_block",{block_id:r,finality:t})}async chunk(e){return this.sendJsonRpc("chunk",[e])}async validators(e){return this.sendJsonRpc("validators",[e])}async experimental_protocolConfig(e){let{blockId:t,...r}=e;return await this.sendJsonRpc("EXPERIMENTAL_protocol_config",{...r,block_id:t})}async lightClientProof(e){return await this.sendJsonRpc("EXPERIMENTAL_light_client_proof",e)}
97async nextLightClientBlock(e){return await this.sendJsonRpc("next_light_client_block",e)}async accessKeyChanges(e,t){let{finality:r}=t,{blockId:i}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"all_access_key_changes",account_ids:e,block_id:i,finality:r})}async singleAccessKeyChanges(e,t){let{finality:r}=t,{blockId:i}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"single_access_key_changes",keys:e,block_id:i,finality:r})}async accountChanges(e,t){let{finality:r}=t,{blockId:i}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"account_changes",account_ids:e,block_id:i,finality:r})}async contractStateChanges(e,t,r=""){let{finality:i}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"data_changes",account_ids:e,key_prefix_base64:r,block_id:n,finality:i})}async contractCodeChanges(e,t){let{finality:r}=t,{blockId:i}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"contract_code_changes",account_ids:e,block_id:i,finality:r})}async gasPrice(e){return await this.sendJsonRpc("gas_price",[e])}async sendJsonRpc(e,t){let r={method:e,params:t,id:ez++,jsonrpc:"2.0"},i=await ej(this.connection.url,r,this.connection.headers||{},function(e=10,t=1.5,r=0){return{numOfAttempts:e,timeMultiple:t,startingDelay:r,retry:e=>!!([503,500,408].includes(e.cause)||e.toString().includes("FetchError")||e.toString().includes("Failed to fetch"))}}(this.options.retries,this.options.backoff,this.options.wait));if(i.error)if("object"==typeof i.error.data){if("string"==typeof i.error.data.error_message&&"string"==typeof i.error.data.error_type)throw new eT.TypedError(i.error.data.error_message,i.error.data.error_type);throw(0,Q.parseRpcError)(i.error.data)}else{let e=`[${i.error.code}] ${i.error.message}: ${i.error.data}`,r=(0,Q.getErrorTypeFromErrorMessage)(i.error.data,"");if(r)throw new eT.TypedError((0,Q.formatError)(r,t),r);throw new eT.TypedError(e,i.error.name)}if("string"==typeof i.result?.error){let e=(0,Q.getErrorTypeFromErrorMessage)(i.result.error,"");if(e)throw new Q.ServerError((0,Q.formatError)(e,t),e)}let{result:n}=i;if(void 0===n)throw new eT.TypedError(`Exceeded ${this.options.retries} attempts for request to ${e}.`,"RetriesExceeded");return n}}let eH=123,eq=["https://relmn.aurora.dev","https://nearrpc.aurora.dev","https://archival-rpc.mainnet.near.org",Math.random()>.5?"https://c1.rpc.fastnear.com":"https://c2.rpc.fastnear.com"];
97class eW extends Error{constructor(e,t,r,i){super(r),this.status=e,this.title=t,this.body=r,this.json=i,this.name="NetworkError"}toString(){return"object"==typeof this.body?JSON.stringify(this.body):this.body}}class eK extends eW{constructor(e){super(0,e,"Timeout error")}}let eG=class extends eV{constructor(e=eq,t=3e4,r=3,i=!0){super({url:""}),this.timeout=t,this.triesCountForEveryProvider=r,this.incrementTimout=i,this.currentProviderIndex=0,this.currentProviderIndex=0,this.providers=e,this.startTimeout=t}async sendJsonRpc(e,t,r=0){let i=this.providers[this.currentProviderIndex],n=Date.now();try{let r=await this.send(e,t,i,this.timeout);return this.timeout=Math.max(this.startTimeout,this.timeout/1.2),r}catch(i){if(i instanceof eK&&this.incrementTimout&&(this.timeout=Math.min(6e4,1.2*this.timeout)),i instanceof eW){if(this.currentProviderIndex+=1,null==this.providers[this.currentProviderIndex]&&(this.currentProviderIndex=0),r+1>this.providers.length*this.triesCountForEveryProvider)throw i;let a=500*r,s=Date.now()-n;return s<a&&await (0,ee.wait)(a-s),await this.sendJsonRpc(e,t,r+1)}throw i}}async send(e,t,r,i){let n=new AbortController,a=setTimeout(()=>n.abort(),i),s=await fetch(r,{body:JSON.stringify({method:e,params:t,id:eH++,jsonrpc:"2.0"}),headers:{"Content-Type":"application/json",Referer:"https://my.herewallet.app"},signal:n.signal,method:"POST"}).catch(()=>{if(clearTimeout(a),n.signal.aborted)throw new eK("RPC Network Error");if("u">typeof window&&!window.navigator.onLine)throw new eW(0,"RPC Network Error","No internet connection");throw new eW(0,"RPC Network Error","Unknown Near RPC Error, maybe connection unstable, try VPN")});if(clearTimeout(a),!s.ok){let e=await s.text().catch(()=>"Unknown error");throw new eW(s.status,"RPC Network Error",e)}let o=await s.json();if(o.error){if("object"==typeof o.error.data){if("string"==typeof o.error.data.error_message&&"string"==typeof o.error.data.error_type)throw new eT.TypedError(o.error.data.error_message,o.error.data.error_type);throw(0,Q.parseRpcError)(o.error.data)}let e=`[${o.error.code}] ${o.error.message}: ${o.error.data}`;if("Timeout"===o.error.data||e.includes("Timeout error")||e.includes("query has timed out"))throw new eT.TypedError(e,"TimeoutError");let t=(0,Q.getErrorTypeFromErrorMessage)(o.error.data,o.error.name);throw new eT.TypedError(e,t)}return o.result}},eZ=class{constructor(e,t){this.omni=e,this.rpc=Array.isArray(t)?new eG(t):t||new eG}get logger(){return this.omni.logger}async viewFunction(e){let t=ei.Buffer.from(JSON.stringify(e.args),"utf8").toString("base64"),r=await this.rpc.query({args_base64:t,finality:"optimistic",request_type:"call_function",method_name:e.methodName,account_id:e.contractId});return JSON.parse(ei.Buffer.from(r.result).toString("utf8"))}async deposit(e){let t=[];"native"===e.token&&(this.logger?.log("Wrapping native NEAR"),t=await this.getWrapNearDepositAction(e.amount,e.sender)),this.logger?.log("Depositing token to HOT Bridge");let r="native"===e.token?"wrap.near":e.token,i=[...t,(0,ee.functionCall)({args:{amount:e.amount,receiver_id:eo.GlobalSettings.intentsContract,msg:e.intentAccount},methodName:"ft_transfer_call",gas:String(80n*el.TGAS),deposit:"1"})];return await e.sendTransaction({actions:i,receiverId:r})}async parseWithdrawalNonce(e,t){let r=await this.parseWithdrawalNonces(e,t);if(0===r.length)throw"Nonce not found";return r[0].toString()}async parseWithdrawalNonces(e,t){let r=await this.rpc.txStatusReceipts(e,t,"EXECUTED_OPTIMISTIC"),i=[];for(let e of r.receipts_outcome)for(let t of e.outcome.logs){let e=`${t}`.match(/"memo":"(\d+)"/)?.[1];e&&i.push(BigInt(e))}return i}async getTokenBalance(e,t){return"native"===e?BigInt((await this.rpc.query({request_type:"view_account",account_id:t,finality:"optimistic"})).amount):await this.viewFunction({args:{account_id:t},methodName:"ft_balance_of",contractId:e})}async isTokenRegistered(e,t){return null!=await this.viewFunction({args:{account_id:t},methodName:"storage_balance_of",contractId:e})}async getWrapNearDepositAction(e,t){let r=await this.viewFunction({contractId:"wrap.near",methodName:"storage_balance_of",args:{account_id:t}}
97),i=(0,ee.functionCall)({methodName:"near_deposit",deposit:e.toString(),gas:String(50n*el.TGAS),args:{}});return null!=r?[i]:[(0,ee.functionCall)({gas:String(30n*el.TGAS),methodName:"storage_deposit",deposit:"12500000000000000000000",args:{account_id:t,registration_only:!0}}),i]}},eX=class{constructor(e){this.options=e,this.defaultEvmWithdrawGasLimit=200000n,this.customEvmWithdrawGasLimit={},this._solana=null,this._cosmos=null,this._cacheCompleted={},this.executeIntents=async(e,t)=>{let r=await this.api.requestApi("/api/v1/evm/intent-solver",{method:"POST",body:JSON.stringify({params:[{signed_datas:e,quote_hashes:t}],method:"publish_intents",id:"dontcare",jsonrpc:"2.0"})}),{result:i}=await r.json();if(i.reason)throw i.reason;if(!i.intent_hashes?.length)throw"No intent hashes";let n=i.intent_hashes[0],a=async()=>{let e=await this.api.requestApi("/api/v1/evm/intent-solver",{body:JSON.stringify({id:"dontcare",jsonrpc:"2.0",method:"get_status",params:[{intent_hash:n}]}),method:"POST"}),{result:t}=await e.json();return t},s=async()=>{await (0,ee.wait)(1e3);let e=await a().catch(()=>null);if(null==e)return await s();if("SETTLED"===e.status)return e.data.hash;if("FAILED"===e.status)throw"Swap failed";return await s()},o=await s();return{sender:eo.GlobalSettings.intentsContract,hash:o}},this.executeNearTransaction=e.executeNearTransaction,this.publishIntents=e.publishIntents??this.executeIntents,this.logger=e.logger,this.api=new es(e.api,e.mpcApi),e.apiKey&&this.api.setApiKey(e.apiKey),this.near=new eZ(this,e.nearRpc),this.evm=new eE(this,{enableApproveMax:e.enableApproveMax,treasuryDefaultContract:e.evmTreasuryDefaultContract,treasuryContracts:e.evmTreasuryContracts,rpcs:e.evmRpc}),this.customEvmWithdrawGasLimit=Object.assign(this.customEvmWithdrawGasLimit,e.customEvmWithdrawGasLimit),this.defaultEvmWithdrawGasLimit=e.defaultEvmWithdrawGasLimit??200000n,this.stellar=new ef(this,{contract:e.stellarContract,sorobanRpc:e.stellarRpc,horizonRpc:e.stellarHorizonRpc,baseFee:e.stellarBaseFee}),this.ton=new ex.default(this,{contract:e.tonContract,rpc:e.tonRpc}),Object.assign(eo.GlobalSettings.cosmos,e.cosmos)}async solana(){if(this._solana)return this._solana;let t=await e.A(828031);return this._solana=new t.SolanaOmniService(this,{rpc:this.options.solanaRpc,programId:this.options.solanaProgramId}),this._solana}async cosmos(){if(this._cosmos)return this._cosmos;let t=await e.A(541488);return this._cosmos=new t.CosmosService(this),this._cosmos}async checkPendingWithdrawalWithCache(e,t){if(e.withdraw_hash)return void await t.completedWithHash?.(e);if(this._cacheCompleted[e.nonce])return void await t.completedWithoutHash?.(e);if(e.chain===er.Network.Solana){let r=await this.solana(),i=await r.isWithdrawUsed(e.nonce,e.receiver);this._cacheCompleted[e.nonce]=i,i?await t.completedWithoutHash?.(e):await t.needToExecute?.(e);return}if(e.chain===er.Network.Stellar){let r=await this.stellar.isWithdrawUsed(e.nonce);this._cacheCompleted[e.nonce]=r,r?await t.completedWithoutHash?.(e):await t.needToExecute?.(e);return}if((0,ee.isTon)(e.chain)){let r=await this.ton.isWithdrawUsed(e.nonce,e.receiver);this._cacheCompleted[e.nonce]=r,r?await t.completedWithoutHash?.(e):await t.needToExecute?.(e);return}let r=await this.evm.isWithdrawUsed(e.chain,e.nonce);this._cacheCompleted[e.nonce]=r,r?await t.completedWithoutHash?.(e):await t.needToExecute?.(e)}parsePendingWithdrawal(e){let t={receiver:(0,ee.decodeReceiver)(e.chain_id,e.withdraw_data.receiver_id),withdraw_hash:e.withdraw_hash||void 0,amount:BigInt(e.withdraw_data.amount),timestamp:e.timestamp,near_trx:e.near_trx,chain:e.chain_id,nonce:e.nonce,token:""},{contract_id:r,token_id:i}=e.withdraw_data,n=null!=r?r.includes("_")?r:e.chain_id+"_"+r:i?.includes("_")?i:e.chain_id+"_"+i;return t.token=(0,ee.fromOmni)(n).split(":")[1],t}async iterateWithdrawals(e){let t=e.logger||new ee.Logger,r=await this.api.getPendingsWithdrawals(),i={};r.forEach(e=>{null==e.withdraw_data||"bridge-refuel.hot.tg"===e.sender_id&&(null==i[e.chain_id]&&(i[e.chain_id]=new Set),i[e.chain_id].add((0,ee.decodeReceiver)(e.chain_id,e.withdraw_data.receiver_id)))});let n=Object.entries(i).map(async([r,i])=>
97{for(let n of i)try{if(e.signal?.aborted)break;t.log(`Getting pending withdrawals for chain ${r} and receiver ${n}`);let i=await this.getPendingWithdrawalsWithStatus(Number(r),n),a=i.filter(e=>e.completed);if((t.log(`Pending withdrawals: ${i.length}, completed: ${a.length}`),a.length)&&(e.signal?.aborted||(t.log(`Clearing ${a.length} completed withdrawals for chain ${r} and receiver ${n}`,a),await this.clearPendingWithdrawals(a),e.signal?.aborted)))break;for(let a of i.filter(e=>!e.completed)){if(e.signal?.aborted)break;t.log(`Executing withdrawal for chain ${r} and receiver ${n}`,a);let i=await e.execute(a);if(null==i)throw"Execute failed because of no hash";e.submitHashesPwd&&this.api.requestApi("/api/v1/evm/bridge_withdrawal_hash",{endpoint:"https://dev.herewallet.app",method:"POST",body:JSON.stringify({nonce:a.nonce,withdraw_hash:i,pswd:e.submitHashesPwd,chain_id:r})}).then(()=>{t.log(`Submitted withdrawal hash for nonce ${a.nonce}: ${i}`)}).catch(e=>{t.warn(`Failed to submit withdrawal hash for nonce ${a.nonce}: ${i}`,e)}),t.log(`Clearing withdrawal for chain ${r} and receiver ${n}`,a),await this.clearPendingWithdrawals([a])}}catch(e){t.warn(`Failed to execute withdrawal for chain ${r} and receiver ${n}`,e)}});await Promise.allSettled(n)}async getAllIntentBalances(e,t=eo.GlobalSettings.intentsContract){let r=new Set,i=0n;for(;;){let n=await this.near.viewFunction({args:{account_id:e,from_index:i.toString(),limit:250},methodName:"mt_tokens_for_owner",contractId:t});if(n.forEach(e=>r.add(e.token_id)),n.length<250)break;i+=BigInt(250)}return await this.getIntentBalances(Array.from(r),e,t)}async getIntentBalances(e,t,r=eo.GlobalSettings.intentsContract){if(0===e.length)return{};let i=await this.near.viewFunction({args:{token_ids:e,account_id:t},methodName:"mt_batch_balance_of",contractId:r});return e.reduce((e,t,r)=>(e[t]=BigInt(i[r]||0n),e),{})}async getIntentBalance(e,t,r=eo.GlobalSettings.intentsContract){return(await this.getIntentBalances([e],t,r))[e]||0n}async getPendingWithdrawals(e,t){1111===e&&(e=1117);let r=await this.near.viewFunction({args:{receiver_id:(0,ee.encodeReceiver)(e,t),chain_id:e},methodName:"get_withdrawals_by_receiver",contractId:eo.GlobalSettings.omniHotContract});return r?r.map(e=>({nonce:e.nonce,chain:e.chain_id,amount:e.amount,timestamp:1e3*e.created_ts,receiver:(0,ee.decodeReceiver)(e.chain_id,e.receiver_id),token:(0,ee.decodeTokenAddress)(e.chain_id,e.contract_id)})):[]}async getPendingWithdrawalsWithStatus(e,t){1111===e&&(e=1117);let r=(await this.getPendingWithdrawals(e,t)).map(async r=>{let i=await this.isWithdrawUsed(e,r.nonce,t).catch(()=>!1);return{...r,completed:i}});return await Promise.all(r)}async clearPendingWithdrawals(e){let t=e.map(async e=>{let{signature:t,hash:r,sender_id:i}=await this.api.executeClearWithdraw(e.chain,e.nonce,e.receiver);return r&&i?null:(0,ee.functionCall)({methodName:"clear_completed_withdrawal",args:{nonce:e.nonce,signature:t},gas:String(80n*el.TGAS),deposit:"0"})}),r=(await Promise.all(t)).filter(e=>null!=e);if(0===r.length)return null;if(!this.executeNearTransaction)throw"No executeNearTransaction";return await this.executeNearTransaction({receiverId:eo.GlobalSettings.omniHotContract,actions:r})}async isDepositUsed(e,t){return await this.near.viewFunction({args:{chain_id:e,nonce:t},methodName:"is_executed",contractId:eo.GlobalSettings.omniHotContract})}async isWithdrawUsed(e,t,r){return(0,ee.isTon)(e)?await this.ton.isWithdrawUsed(t,r):(0,ee.isCosmos)(e)?await this.cosmos().then(r=>r.isWithdrawUsed(e,t)):e===er.Network.Solana?await this.solana().then(e=>e.isWithdrawUsed(t,r)):e===er.Network.Stellar?await this.stellar.isWithdrawUsed(t):await this.evm.isWithdrawUsed(e,t)}async getPendingWithdrawal(e){this.logger?.log(`Getting withdrawal by nonce ${e}`);let t=await this.near.viewFunction({contractId:eo.GlobalSettings.omniHotContract,methodName:"get_transfer",args:{nonce:e}});if(!t)throw new et.WithdrawalNotFoundError(e);this.logger?.log(`Transfer: ${JSON.stringify(t,null,2)}`),this.logger?.log("Checking if nonce is used");let r=(0,ee.decodeReceiver)(t.chain_id,t.receiver_id);if(await this.isWithdrawUsed(t.chain_id,e,r).catch(()=>!1))throw new et.DepositAlreadyClaimedError(t.chain_id,e);this.logger?.log(`Depositing on ${t.chain_id}`);let i=(0,ee.decodeTokenAddress)(t.chain_id,t.contract_id);return{chain:+t.chain_id,timestamp:t.timestamp,amount:BigInt(t.amount),receiver:r,token:i,nonce:e}}
97async waitPendingDeposit(e,t,r,i){let n=async()=>(0,ee.isTon)(e)?await this.ton.parseDeposit(t):(0,ee.isCosmos)(e)?await this.cosmos().then(r=>r.parseDeposit(e,t)):e===er.Network.Solana?await this.solana().then(e=>e.parseDeposit(t)):e===er.Network.Stellar?await this.stellar.parseDeposit(t):await this.evm.parseDeposit(e,t);for(;;){if(i?.aborted)throw new et.ProcessAbortedError("waitPendingDeposit");let e=await n().catch(e=>(this.logger?.log(`Error waiting pending deposit: ${e}`),null));if(e){if(await this.isDepositUsed(e.chain,e.nonce))throw new et.DepositAlreadyClaimedError(e.chain,e.nonce);let t=(0,Q.baseEncode)((0,ee.omniEphemeralReceiver)(r)),i=(0,Q.baseEncode)((0,ee.legacyUnsafeOmniEphemeralReceiver)(r));if(e.receiver!==t&&e.receiver!==i)throw new et.MismatchReceiverAndIntentAccountError(e.receiver,r);return{...e,intentAccount:r}}await (0,ee.wait)(2e3)}}async finishDeposit(e){this.logger?.log("Checking if deposit is executed");let t=1111===e.chain?1117:e.chain;if(await this.isDepositUsed(t,e.nonce))return null;this.logger?.log("Signing deposit");let r=(0,ee.encodeTokenAddress)(t,e.token),i=JSON.stringify({receiver_id:e.intentAccount}),{signature:n,hash:a,sender_id:s,status:o}=await this.api.executeDeposit({receiver_id:e.receiver,sender_id:e.sender,amount:e.amount,nonce:e.nonce,chain_id:t,token_id:r,msg:i});if(a&&s)return{hash:a,sender:s};if("ok"===o)return null;if(!n)throw new et.FailedToExecuteDepositError(o);let l=(0,ee.functionCall)({methodName:"mt_deposit_call",gas:String(80n*el.TGAS),deposit:"1",args:{deposit_call_args:{account_id:eo.GlobalSettings.intentsContract,msg:i},amount:e.amount,nonce:e.nonce,contract_id:r,chain_id:t,signature:n}});try{if(this.logger?.log("Calling deposit to omni and deposit to intents"),!this.executeNearTransaction)throw"No executeNearTransaction";return await this.executeNearTransaction({actions:[l],receiverId:eo.GlobalSettings.omniHotContract})}catch(e){if(!e?.toString?.().includes("Nonce already used"))throw e;return null}}async getGaslessWithdrawFee(e){if(e.chain===er.Network.Solana)throw new et.GaslessNotAvailableError(e.chain);if(e.chain===er.Network.Stellar)return await this.stellar.isAccountExists(e.receiver)?{gasPrice:1000000n,blockNumber:0n}:{gasPrice:11000000n,blockNumber:0n};if([er.Network.Juno,er.Network.Gonka,er.Network.Near,er.Network.Hot].includes(e.chain))return{gasPrice:0n,blockNumber:0n};if([er.Network.Ton,er.Network.OmniTon].includes(e.chain))return{gasPrice:40000000n,blockNumber:0n};let{gasPrice:t}=await this.evm.getProvider(e.chain).getFeeData(),r=await this.evm.getProvider(e.chain).getBlockNumber(),i=this.customEvmWithdrawGasLimit[e.chain]??this.defaultEvmWithdrawGasLimit;return{gasPrice:130n*BigInt(t||0n)/100n*i,blockNumber:BigInt(r)}}async buildWithdrawIntent(e){let t=(0,ee.toOmniIntent)(e.chain,e.token),[r,i]=t.split(/:(.*)/s);if("nep245"===r){let[t,r]=i.split(":"),n=(0,ee.encodeReceiver)(e.chain,e.receiver);return{intent:"mt_withdraw",amounts:[e.amount.toString()],receiver_id:eo.GlobalSettings.omniHotContract,token_ids:[r],token:t,memo:n}}if("nep141"===r){let t="wrap.near"===i||"native"===i;return{intent:t?"native_withdraw":"ft_withdraw",memo:e.chain!==er.Network.Near?`WITHDRAW_TO:${e.receiver}`:void 0,receiver_id:e.chain!==er.Network.Near?i:e.receiver,token:t?void 0:i,amount:e.amount.toString()}}throw new et.UnsupportedTokenFormatError(t)}async buildSwapExectInIntent(e){let t=await this.api.getSwapQuoteExectIn(e.intentAccount,e.intentFrom,e.intentTo,e.amountIn),r=BigInt(t.quote.intents[0].diff[e.intentTo]||0);return{amountOut:r,signed_fee_quote:t.signed_fee_quote,quote_hashes:t.quote_hashes,intent:{diff:{[e.intentFrom]:`-${e.amountIn}`,[e.intentTo]:String(r)},referral:"intents.tg",intent:"token_diff"}}}async buildSwapExectOutIntent(e){let t=await this.api.getSwapQuoteExectOut(e.intentFrom,e.intentTo,e.amountOut),r=BigInt(t.amount_in);return{signed_fee_quote:t.signed_fee_quote,quote_hashes:t.quote_hashes,amount_in:r,intent:{diff:{[e.intentFrom]:`-${r}`,[e.intentTo]:String(e.amountOut)},referral:"intents.tg",intent:"token_diff"}}}async buildGaslessWithdrawIntent(e){let t=(0,ee.toOmni)(e.chain,e.token),r=(0,ee.toOmni)(e.chain,e.feeToken),i=(0,ee.encodeReceiver)(e.chain,e.receiver),n=t!==r&&e.feeAmount>0n;return{intent:"mt_withdraw",receiver_id:"bridge-refuel.hot.tg",amounts:n?[e.amount.toString(),e.feeAmount.toString()]:[e.amount.toString()],token_ids:n?[t,r]:[t],token:"v2_1.omni.hot.tg",msg:JSON.stringify({receiver_id:i,amount_native:e.feeAmount.toString(),block_number:Number(e.blockNumber)})}}async getGaslessWithdrawStatus(e){return await this.near.viewFunction({contractId:"bridge-refuel.hot.tg",methodName:"get_withdrawal_hash",args:{nonce:e}})}async checkWithdrawNonce(e,t,r){let i=await this.getPendingWithdrawalsWithStatus(e,t),n=i.filter(e=>e.completed);n.length&&await this.clearPendingWithdrawals(n);let a=i.filter(e=>!e.completed).find(e=>BigInt(e.nonce)<BigInt(r));if(a)throw new et.CompletePreviousWithdrawalsError(e,t,a.nonce)}async checkLocker(e,t,r){console.warn("use checkWithdrawLocker instead of checkLocker"),await this.checkWithdrawLocker(e,t,r)}async checkWithdrawLocker(e,t,r){if(e===er.Network.Near)return;let i=await this.getPendingWithdrawalsWithStatus(e,r),n=i.filter(e=>e.completed);n.length&&await this.clearPendingWithdrawals(n);let a=i.find(e=>!e.completed);if(a)throw new et.CompletePreviousWithdrawalsError(e,r,a.nonce)}async buildGaslessWithdrawToken(e){let t;if(e.chain===er.Network.Near)throw new et.GaslessNotAvailableError(e.chain);let{gasPrice:r,blockNumber:i}=await this.getGaslessWithdrawFee({chain:e.chain,token:e.token,receiver:e.receiver}).catch(()=>({gasPrice:null,blockNumber:null}));if(null==r||null==i||(this.logger?.log(`Gasless withdraw gas price: ${r}`),r>0n&&"native"!==e.token&&(null==(t=await this.buildSwapExectOutIntent({intentFrom:(0,ee.toOmniIntent)(e.chain,e.token),intentTo:(0,ee.toOmniIntent)(e.chain,"native"),amountOut:r}).catch(()=>null))||BigInt(t.amount_in)>=e.amount))||"native"===e.token&&e.amount<=r)throw new et.GaslessNotAvailableError(e.chain);let n=await this.buildGaslessWithdrawIntent({amount:e.amount-BigInt(t?.amount_in||0n),receiver:e.receiver,chain:e.chain,token:e.token,feeToken:"native",feeAmount:r,blockNumber:i});return{intents:t?[t.intent,n]:[n],quoteHashes:t?.quote_hashes||[],gasless:!0}}async buildWithdrawToken(e){if(this.logger?.log(`Withdrawing ${e.amount} ${e.chain} ${e.token}`),e.gasless)try{return await this.buildGaslessWithdrawToken(e)}catch(t){if(!(t instanceof et.GaslessNotAvailableError))throw t;this.logger?.log(`Gasless withdraw not available for chain ${e.chain}, using regular withdraw`)}return{intents:[await this.buildWithdrawIntent(e)],quoteHashes:[],gasless:!1}}async waitGaslessWithdraw(e,t,r){let i=0;for(;;){if(i>50)throw new et.GaslessWithdrawTxNotFoundError(e,t,r);await (0,ee.wait)(2e3);let n=await this.getGaslessWithdrawStatus(e);
97if(n?.startsWith("CANCELED"))throw new et.GaslessWithdrawCanceledError(n,e,t,r);if("COMPLETED"===n)return"0x0";if(n)return`0x${n}`;i+=1}}async gaslessWithdrawToken(e){let{intents:t,quoteHashes:r}=await this.buildGaslessWithdrawToken(e),i=await e.signIntents(t),n=await this.publishIntents([i],r);this.logger?.log("Parsing withdrawal nonce");let a=await this.near.parseWithdrawalNonce(n.hash,n.sender);this.logger?.log(`Gasless withdraw tx: ${n.hash}, nonce: ${a}`),await this.waitGaslessWithdraw(a,e.chain,e.receiver)}async withdrawToken(e){let t="wrap.near"===e.token||"native"===e.token;if(e.chain===er.Network.Near&&!t&&!await this.near.isTokenRegistered(e.token,e.receiver))throw new et.NearTokenNotRegisteredError(e.token,e.receiver);let r=await this.getIntentBalance((0,ee.toOmniIntent)(e.chain,e.token),e.intentAccount);if(e.adjustMax&&r<e.amount&&(e.amount=r),r<e.amount)throw new et.IntentBalanceIsLessThanAmountError(e.token,e.intentAccount,e.amount);await this.checkLocker(e.chain,e.token,e.receiver),this.logger?.log(`Withdrawing ${e.amount} ${e.chain} ${e.token}`);let i=await this.buildWithdrawToken(e);this.logger?.log("Sign withdraw intent");let n=await e.signIntents(i.intents);this.logger?.log("Push withdraw intent");let a=await this.publishIntents([n],i.quoteHashes);if(e.chain===er.Network.Near)return;this.api.notifyWithdrawal(a.hash),this.logger?.log("Parsing withdrawal nonce");let s=await this.near.parseWithdrawalNonce(a.hash,a.sender);return(this.logger?.log("Waiting for gasless withdrawal"),i.gasless)?void await this.waitGaslessWithdraw(s,e.chain,e.receiver):{nonce:s,tx:a.hash,sender:a.sender}}async waitUntilBalance(e,t,r,i=0){let n=await this.getIntentBalance(e,r).catch(()=>0n);return n>=t?n:(await (0,ee.wait)(1e3),await this.waitUntilBalance(e,t,r,i+1))}async swapTokens(e){let t=await this.buildSwapExectInIntent({intentAccount:e.intentAccount,intentFrom:e.intentFrom,intentTo:e.intentTo,amountIn:e.amountIn}),r=BigInt(t.intent.diff[e.intentTo]||0n);if(r<e.minAmountOut)throw new et.SlippageError(e.minAmountOut,r);t.intent.diff[e.intentTo]=String(e.minAmountOut);let i=await e.signIntents([t.intent]);return await this.publishIntents([i,t.signed_fee_quote].filter(Boolean),t.quote_hashes),await this.waitUntilBalance(e.intentTo,e.minAmountOut,e.intentAccount),{amountOut:r}}async getWithdrawFee(e,t,r,i=!0){if(t===er.Network.Near)return new el.ReviewFee({gasless:!0,baseFee:el.NEAR_PER_GAS,gasLimit:300n*el.TGAS,chain:t});if(t===er.Network.Hot)return new el.ReviewFee({gasless:!0,chain:t});if(i){let i=await this.getGaslessWithdrawFee({chain:t,token:r,receiver:e}).catch(()=>null);if(i)return new el.ReviewFee({gasless:!0,chain:t,baseFee:BigInt(i.gasPrice)})}return(0,ee.isTon)(t)?await this.ton.getWithdrawFee():(0,ee.isCosmos)(t)?await this.cosmos().then(e=>e.getWithdrawFee(t)):t===er.Network.Solana?await this.solana().then(e=>e.getWithdrawFee()):t===er.Network.Stellar?await this.stellar.getWithdrawFee():await this.evm.getWithdrawFee(t)}async getDepositFee(e){let{chain:t,token:r,amount:i,sender:n,intentAccount:a}=e;return t===er.Network.Hot?new el.ReviewFee({gasless:!0,chain:t}):t===er.Network.Near?new el.ReviewFee({gasless:!0,baseFee:el.NEAR_PER_GAS,gasLimit:300n*el.TGAS,chain:t}):t===er.Network.Stellar?await this.stellar.getDepositFee(n,r,i,a):(0,ee.isCosmos)(t)?await this.cosmos().then(e=>e.getDepositFee(t,n,r,i,a)):t===er.Network.Solana?await this.solana().then(e=>e.getDepositFee(r)):(0,ee.isTon)(t)?await this.ton.getDepositFee(r):await this.evm.getDepositFee(t,r,i,n)}},eJ=(e,t,r)=>JSON.stringify(e,(e,r)=>{let i="bigint"==typeof r?r.toString():r;return"function"==typeof t?t(e,i):i},r);var eY=class{constructor(e){this.envConfig=(0,Y.resolveEnvConfig)(e.env),this.referral=e.referral,this.solverRelayApiKey=e.solverRelayApiKey,this.hotBridgeApiKey=e.hotBridgeApiKey;const t=e.rpc?.[r.Chains.Near]??X;(0,P.assert)(t.length>0,"NEAR RPC URLs are not provided");const i=(0,Z.nearFailoverRpcProvider)({urls:t}),n=(0,D.extractRpcUrls)(t),h=function(e,t){let i=t?.[r.Chains.Stellar]?.soroban??e.soroban,n=t?.[r.Chains.Stellar]?.horizon??e.horizon,a={soroban:(0,D.extractRpcUrls)(i),horizon:(0,D.extractRpcUrls)(n)};return(0,P.assert)(a.soroban.length>0,"Stellar Soroban RPC URL is not provided"),(0,P.assert)(a.horizon.length>0,"Stellar Horizon RPC URL is not provided"),a}(f.PUBLIC_STELLAR_RPC_URLS,e.rpc),p=function(e,t,i){let n={};for(let a of i){let i=t?.[a]??e[a];
97i&&(n[(0,r.getEIP155ChainId)(a)]=(0,D.extractRpcUrls)(i))}for(let[e,t]of Object.entries(n))(0,P.assert)(t.length>0,`EVM RPC URLs for chain ${e} are not provided`);return n}(f.PUBLIC_EVM_RPC_URLS,e.rpc,o.HotBridgeEVMChains),g=function(e,t){let i=(0,D.extractRpcUrls)(t?.[r.Chains.XRPL]??e);return(0,P.assert)(i.length>0,"XRPL RPC URL is not provided"),i}(f.PUBLIC_XRPL_RPC_URLS,e.rpc);this.bridges=[new u.IntentsBridge,new a.AuroraEngineBridge({envConfig:this.envConfig,nearProvider:i,solverRelayApiKey:this.solverRelayApiKey}),new d.PoaBridge({envConfig:this.envConfig,xrplRpcUrls:g,routeMigratedPoaTokensThroughOmniBridge:e.features?.routeMigratedPoaTokensThroughOmniBridge}),new l.HotBridge({envConfig:this.envConfig,solverRelayApiKey:this.solverRelayApiKey,hotSdk:new eX({apiKey:this.hotBridgeApiKey,logger:console,evmRpc:p,nearRpc:n,stellarRpc:h.soroban,stellarHorizonRpc:h.horizon,async executeNearTransaction(){throw Error("not implemented")}})}),new c.OmniBridge({envConfig:this.envConfig,nearProvider:i,solverRelayApiKey:this.solverRelayApiKey,routeMigratedPoaTokensThroughOmniBridge:e.features?.routeMigratedPoaTokensThroughOmniBridge}),new s.DirectBridge({envConfig:this.envConfig,nearProvider:i,solverRelayApiKey:this.solverRelayApiKey})],this.intentRelayer=new C({envConfig:this.envConfig,solverRelayApiKey:this.solverRelayApiKey}),this.intentSigner=e.intentSigner,this.saltManager=null!=this.envConfig.contractSalt?new q(this.envConfig.contractSalt):new W({envConfig:this.envConfig,nearProvider:i})}setIntentSigner(e){this.intentSigner=e}intentBuilder(){return new G({envConfig:this.envConfig,saltManager:this.saltManager})}async invalidateNonces(e){if(0===e.nonces.length)return;let t=e.signer??this.intentSigner;(0,P.assert)(null!=t,"Intent signer is not provided");let r=await Promise.all(e.nonces.map(async r=>{let i=this.intentBuilder().setNonce(r);try{let t=h.VersionedNonceBuilder.decodeNonce(r);if(H.is(h.saltedNonceSchema,t.value)){let e=Number(t.value.inner.deadline/1000000n),r=new Date(e),n=new Date(Date.now()+6e4);i.setDeadline(n<r?n:r)}else e.logger?.warn?.("Decoded nonce has unexpected structure, using default deadline")}catch{}let{signed:n}=await i.buildAndSign(t);return n}));await this.intentRelayer.publishIntents({multiPayloads:r,quoteHashes:[]},{logger:e.logger})}async createWithdrawalIntents(e){for(let t of this.bridges)if(await t.supports(e.withdrawalParams)){let r=e.withdrawalParams.feeInclusive?e.withdrawalParams.amount-e.feeEstimation.amount:e.withdrawalParams.amount;return await t.validateWithdrawal({assetId:e.withdrawalParams.assetId,amount:r,destinationAddress:e.withdrawalParams.destinationAddress,destinationMemo:e.withdrawalParams.destinationMemo,feeEstimation:e.feeEstimation,routeConfig:e.withdrawalParams.routeConfig,logger:e.logger}),t.createWithdrawalIntents({withdrawalParams:{...e.withdrawalParams,amount:r},feeEstimation:e.feeEstimation,referral:e.referral??this.referral})}throw Error(`Cannot determine bridge for withdrawal = ${eJ(e.withdrawalParams)}`)}estimateWithdrawalFee(e){return Array.isArray(e.withdrawalParams)?Promise.all(e.withdrawalParams.map(t=>this._estimateWithdrawalFee({...e,withdrawalParams:t}))):this._estimateWithdrawalFee({...e,withdrawalParams:e.withdrawalParams})}async _estimateWithdrawalFee(e){for(let t of this.bridges)if(await t.supports(e.withdrawalParams)){let r=await t.estimateWithdrawalFee({withdrawalParams:e.withdrawalParams,quoteOptions:e.quoteOptions,logger:e.logger});if(e.withdrawalParams.feeInclusive&&e.withdrawalParams.amount<=r.amount)throw new i.FeeExceedsAmountError(r,e.withdrawalParams.amount);let n=e.withdrawalParams.feeInclusive?e.withdrawalParams.amount-r.amount:e.withdrawalParams.amount;return await t.validateWithdrawal({assetId:e.withdrawalParams.assetId,amount:n,destinationAddress:e.withdrawalParams.destinationAddress,feeEstimation:r,routeConfig:e.withdrawalParams.routeConfig,logger:e.logger,destinationMemo:e.withdrawalParams.destinationMemo,skipMinAmountValidation:0n===e.withdrawalParams.amount&&!1===e.withdrawalParams.feeInclusive}),r}throw Error(`Cannot determine bridge for withdrawal = ${eJ(e.withdrawalParams)}`)}async waitForWithdrawalCompletion(e){let t=Array.isArray(e.withdrawalParams)?e.withdrawalParams:[e.withdrawalParams],r=this.createWithdrawalCompletionPromises({withdrawalParams:t,intentTx:e.intentTx,signal:e.signal,logger:e.logger}),i=await Promise.all(r);return Array.isArray(e.withdrawalParams)?i:((0,P.assert)(1===i.length,"Unexpected result length"),i[0])}createWithdrawalCompletionPromises(e){let{withdrawalParams:t,intentTx:r,signal:i,logger:a}=e,s=F({bridges:this.bridges,withdrawalParams:t,intentTx:r}),o=new Map;return t.map(async(e,t)=>{let r=(await s)[t];
97if((0,P.assert)(null!=r,`Missing wid for index ${t}`),r.bridge.route===n.RouteEnum.HotBridge){let e=r.wid.landingChain,t=o.get(e),n=(async()=>(t&&await Promise.allSettled([t]),U({bridge:r.bridge,wid:r.wid,signal:i,logger:a})))();return o.set(e,n),n}return U({bridge:r.bridge,wid:r.wid,signal:i,logger:a})})}parseAssetId(e){for(let t of this.bridges){let r=t.parseAssetId(e);if(null!=r)return r}throw Error(`Cannot determine bridge for assetId = ${e}`)}async sendSignedIntents(e){return{tickets:await this.intentRelayer.publishIntents({multiPayloads:e.multiPayloads,quoteHashes:e.quoteHashes??[]},{logger:e.logger})}}async signAndSendIntent(e){let t=e.signer??this.intentSigner;(0,P.assert)(null!=t,"Intent signer is not provided");let r=new I({envConfig:this.envConfig,logger:e.logger,intentSigner:t,intentRelayer:this.intentRelayer,intentPayloadFactory:e.payload,onBeforePublishIntent:e.onBeforePublishIntent}),{ticket:i}=await this.withSaltRetry(e,async t=>r.signAndSendIntent({intents:e.intents,salt:t,relayParams:e.relayParams,signedIntents:e.signedIntents}));return{intentHash:i}}async withSaltRetry(e,t){try{return await t(await this.saltManager.getCachedSalt())}catch(r){if(!(r instanceof J.RelayPublishRejectedError&&"INVALID_SALT"===r.code))throw r;return e.logger?.warn?.("Salt error detected. Refreshing salt and retrying"),t(await this.saltManager.refresh())}}async signAndSendWithdrawalIntent(e){var t,r;let i,n;Array.isArray(e.withdrawalParams)?(i=e.withdrawalParams,n=e.feeEstimation):(i=[e.withdrawalParams],n=[e.feeEstimation]);let a=(t=i,r=n,(0,P.assert)(t.length===r.length,"Arrays must have the same length"),t.map((e,t)=>[e,r[t]])).map(([t,r])=>this.createWithdrawalIntents({withdrawalParams:t,feeEstimation:r,referral:e.referral??this.referral,logger:e.logger})),s=(await Promise.all(a)).flat(),o=async()=>{let t=e.intent?.relayParams!=null?await e.intent?.relayParams():{quoteHashes:void 0},r=t.quoteHashes??[];for(let e of n)null!=e.quote&&r.push(e.quote.quote_hash);return{...t,quoteHashes:r}};return this.signAndSendIntent({intents:s,signer:e.intent?.signer,onBeforePublishIntent:e.intent?.onBeforePublishIntent,relayParams:o,payload:e.intent?.payload,logger:e.logger,signedIntents:e.intent?.signedIntents})}async waitForIntentSettlement(e){let{tx:t}=await new I({envConfig:this.envConfig,logger:e.logger,intentSigner:N,intentRelayer:this.intentRelayer}).waitForSettlement(e.intentHash,{signal:e.signal});return t}async getIntentStatus({intentHash:e,logger:t}){return O.solverRelay.getStatus({intent_hash:e},{baseURL:this.envConfig.solverRelayBaseURL,logger:t,solverRelayApiKey:this.solverRelayApiKey})}async processWithdrawal(e){let t=Array.isArray(e.withdrawalParams)?e.withdrawalParams:[e.withdrawalParams],r=await (null!=e.feeEstimation?Array.isArray(e.feeEstimation)?e.feeEstimation:[e.feeEstimation]:this.estimateWithdrawalFee({withdrawalParams:t,logger:e.logger})),{intentHash:i}=await this.signAndSendWithdrawalIntent({withdrawalParams:t,feeEstimation:r,referral:e.referral,intent:e.intent,logger:e.logger});e.logger?.info("Intent published",{intentHash:i});let n=await this.waitForIntentSettlement({intentHash:i,logger:e.logger});e.logger?.info("Intent settled",{txHash:n.hash});let a=await this.waitForWithdrawalCompletion({withdrawalParams:t,intentTx:n,logger:e.logger});return Array.isArray(e.withdrawalParams)?{feeEstimation:r,intentHash:i,intentTx:n,destinationTx:a}:{feeEstimation:r[0],intentHash:i,intentTx:n,destinationTx:a[0]}}},eQ=e.i(259004),e0=e.i(945878);let e1=new eY({env:eQ.INTENTS_ENV,rpc:{[r.Chains.Polygon]:[e0.settings.rpcUrls.polygon],[r.Chains.BNB]:[e0.settings.rpcUrls.bsc],[r.Chains.Optimism]:[e0.settings.rpcUrls.optimism],[r.Chains.Avalanche]:[e0.settings.rpcUrls.avalanche]},referral:"near-intents.intents-referral.near",features:{routeMigratedPoaTokensThroughOmniBridge:!0}});e.s(["bridgeSDK",0,e1],720549)},323071,30528,e=>{"use strict";var t=e.i(345188);let r=(0,t.createServerReference)("40a59fcf20e1a85594175ac2dfbc6d96306a90d409",t.callServer,void 0,t.findSourceMapURL,"authenticateAndStoreTokens");e.s(["authenticateAndStoreTokens",0,r],323071);var i=e.i(385989),n=e.i(157946);let a=(0,e.i(186448).setup)({types:{},actors:{checkSession:(0,n.fromPromise)(async e=>{throw Error("checkSession must be provided via .provide()")})},guards:{isSessionResultRetryable:(e,t)=>
97"retryable_failure"===t.result.status,canRetryAfterFailure:({context:e})=>e.attemptCount+1<5,shouldRetryRetryableResult:({context:e},t)=>"retryable_failure"===t.result.status&&e.attemptCount+1<5},actions:{recordRetryableFailure:(0,i.assign)({attemptCount:({context:e})=>e.attemptCount+1,sessionResult:({event:e})=>e.output,failureReason:({event:e})=>e.output.reason}),recordInvokeError:(0,i.assign)({attemptCount:({context:e})=>e.attemptCount+1,failureReason:({event:e})=>e.error instanceof Error?e.error.message:"Session check failed"}),finalizeExhaustedFailure:(0,i.assign)({sessionResult:({context:e})=>({status:"retryable_failure",reason:e.failureReason??"Session check failed"})})},delays:{SESSION_RETRY_DELAY:({context:e})=>{var t;return t=e.attemptCount,Math.min(5e3*2**Math.max(0,t-1),3e4)}}}).createMachine({id:"app-session",context:({input:e})=>({address:e.address,chainType:e.chainType,attemptCount:0,failureReason:null,sessionResult:null}),output:({context:e})=>{let t=e.sessionResult;if(null==t)throw Error("appSessionMachine: missing sessionResult for machine output");return t},initial:"checking",states:{checking:{invoke:{src:"checkSession",input:({context:e})=>({address:e.address,chainType:e.chainType}),onDone:[{guard:{type:"shouldRetryRetryableResult",params:({event:e})=>({result:e.output})},target:"retrying",actions:"recordRetryableFailure"},{guard:{type:"isSessionResultRetryable",params:({event:e})=>({result:e.output})},target:"done",actions:"recordRetryableFailure"},{target:"done",actions:(0,i.assign)({sessionResult:({event:e})=>e.output})}],onError:[{guard:"canRetryAfterFailure",target:"retrying",actions:"recordInvokeError"},{target:"done",actions:["recordInvokeError","finalizeExhaustedFailure"]}]}},retrying:{after:{SESSION_RETRY_DELAY:{target:"checking",reenter:!0}}},done:{type:"final"}}});e.s(["appSessionMachine",0,a],30528)},91421,e=>{"use strict";e.i(324137),e.s(["AuthMethod",0,{Near:"near",EVM:"evm",Solana:"solana",WebAuthn:"webauthn",Ton:"ton",Stellar:"stellar",Tron:"tron"}])},33574,e=>{"use strict";var t=e.i(241258),r=e.i(925419),i=e.i(186448),n=e.i(385989),a=e.i(157946),s=e.i(5895),o=e.i(372732),l=e.i(369256);let u=(0,i.setup)({types:{context:{},input:{},output:{},events:{}},actors:{checkPubKeyActor:(0,a.fromPromise)(({input:e})=>(0,o.hasPublicKey)(e)),addPubKeyActor:(0,a.fromPromise)(({input:e})=>c(e))},actions:{logError:(e,{error:r})=>{t.logger.error(r)},setError:(0,n.assign)({error:(e,{error:t})=>t})},guards:{isNonNearAccount:({context:e})=>null==e.nearAccount,isTrue:(e,t)=>t}}).createMachine({id:"publicKeyVerifier",initial:"idle",context:({input:e})=>({...e,error:null}),output:({context:e})=>null==e.error?{tag:"ok"}:{tag:"err",value:e.error},states:{idle:{always:[{target:"completed",guard:"isNonNearAccount"},{target:"checking"}]},checking:{invoke:{id:"checkPubKeyRef",src:"checkPubKeyActor",input:({context:e})=>{if(null==e.nearAccount)throw Error("no near account");return{nearClient:e.nearClient,...e.nearAccount}},onDone:[{target:"completed",guard:{type:"isTrue",params:({event:e})=>e.output}},{target:"checked"}],onError:{target:"completed",actions:[{type:"logError",params:({event:e})=>e},{type:"setError",params:{error:"ERR_PUBKEY_CHECK_FAILED"}}]}}},checked:{entry:({context:e})=>{let t=e.authJourney;t&&(0,r.trackEvent)("flow_step_reached",{schema_version:1,event_id:`${t.journeyId}:step:add_public_key_requested`,journey_id:t.journeyId,flow:"auth",surface:"login",step:"add_public_key_requested",auth_method:t.method,auth_action:t.action,chain:t.chain,...t.walletId?{wallet_id:t.walletId}:{}})},on:{ADD_PUBLIC_KEY:{target:"adding"},ABORT_ADD_PUBLIC_KEY:{target:"completed",actions:{type:"setError",params:{error:"ERR_PUBKEY_ADDING_DECLINED"}}}}},adding:{invoke:{id:"addPubKeyRef",src:"addPubKeyActor",input:({context:e,event:t})=>{if((0,i.assertEvent)(t,"ADD_PUBLIC_KEY"),null==e.nearAccount)throw Error("no near account");return{pubKey:e.nearAccount.publicKey,accountId:e.nearAccount.accountId,nearClient:e.nearClient,sendNearTransaction:t.sendNearTransaction}},onDone:{target:"completed",actions:({context:e})=>{let t=e.authJourney;t&&(0,r.trackEvent)("flow_step_reached",{schema_version:1,event_id:`${t.journeyId}:step:add_public_key_completed`,journey_id:t.journeyId,flow:"auth",surface:"login",step:"add_public_key_completed",auth_method:t.method,auth_action:t.action,chain:t.chain,...t.walletId?{wallet_id:t.walletId}:{}})}},onError:{target:"completed",actions:[{type:"logError",params:({event:e})=>e},{type:"setError",params:({event:e})=>({error:(0,l.extractWalletErrorCode)(e.error,"ERR_PUBKEY_ADDING_FAILED")})}]}}},completed:{type:"final"}}});async function c({pubKey:e,accountId:t,nearClient:r,sendNearTransaction:i}){let n={receiverId:s.config.env.contractID,actions:[{type:"FunctionCall",params:{methodName:"add_public_key",args:{public_key:e},gas:"5000000000000",deposit:"1"}}]},a=await i(n);if(!a||"string"!=typeof a.txHash||""===a.txHash.trim())throw Error("Wallet did not return an add_public_key transaction");let o=await r.txStatus(a.txHash,t,"EXECUTED");if("object"!=typeof o.status||null==o.status||!("SuccessValue"in o.status))throw Error("add_public_key execution did not succeed");return!0}e.s(["publicKeyVerifierMachine",0,u])},578800,478183,942469,791082,e=>{"use strict";var t=e.i(887005),r=e.i(364516),i=e.i(987750),n=e.i(720549),a=e.i(704040),s=e.i(245164);function o(e){return a.authIdentity.authHandleToIntentsUserId(e.credential,e.credentialType)}function l(e){return"string"==typeof e?e:o(e)}async function u(e,a){let s=l(e.signerId),o=e.deadlineTimestamp??c(5),u=Date.now(),d=await n.bridgeSDK.intentBuilder().setSigner(s).setDeadline(new Date(o)).setNonceRandomBytes(e.n
97once??t.VersionedNonceBuilder.createTimestampedNonceBytes(new Date(u))).build(),f=i.base64.decode(d.nonce),h=r.messageFactory.makeEmptyMessage({signerId:s,deadlineTimestamp:o,nonce:f});if("tron"===a){let e=JSON.parse(h.TRON.message);return{...h,TRON:{...h.TRON,message:JSON.stringify({...e,message_size_validation:"Validates message size compatibility with wallet signing requirements."},null,2)}}}return h}function c(e){return Date.now()+60*e*1e3}function d(e){return new TextEncoder().encode(e)}e.s(["formatSignedIntent",0,function(e,t){return s.prepareBroadcastRequest.prepareSwapSignedData(e,{userAddress:t.credential,userChainType:t.credentialType})},"formatUserIdentity",0,o],478183),e.s(["createTransferMessage",0,function(e,t){let i=r.messageFactory.makeInnerTransferMessage({tokenDeltas:e,signerId:l(t.signerId),deadlineTimestamp:t.deadlineTimestamp??c(5),receiverId:t.receiverId,memo:t.memo});return r.messageFactory.makeSwapMessage({innerMessage:i,nonce:t.nonce})},"createVerificationMessage",0,u,"minutesFromNow",0,c,"wrapPayloadAsWalletMessage",0,function(e){let t={message:"",recipient:"",nonce:new Uint8Array(32)},n={message:""},a={message:new Uint8Array},s={message:""},o={challenge:new Uint8Array,payload:"",parsedPayload:{deadline:"",intents:[],signer_id:"",nonce:"",verifying_contract:""}},l={message:{type:"text",text:""}},u={message:""};switch(e.standard){case"erc191":return{ERC191:{message:e.payload},NEP413:t,SOLANA:a,STELLAR:s,WEBAUTHN:o,TON_CONNECT:l,TRON:u};case"nep413":{let t=e.payload;return{ERC191:n,NEP413:{message:t.message,recipient:t.recipient,nonce:function(e){try{return i.base64.decode(e)}catch{return i.base64urlnopad.decode(e)}}(t.nonce),callbackUrl:t.callbackUrl??void 0},SOLANA:a,STELLAR:s,WEBAUTHN:o,TON_CONNECT:l,TRON:u}}case"raw_ed25519":return{ERC191:n,NEP413:t,SOLANA:{message:d(e.payload)},STELLAR:s,WEBAUTHN:o,TON_CONNECT:l,TRON:u};case"sep53":return{ERC191:n,NEP413:t,SOLANA:a,STELLAR:{message:e.payload},WEBAUTHN:o,TON_CONNECT:l,TRON:u};case"webauthn":return{ERC191:n,NEP413:t,SOLANA:a,STELLAR:s,WEBAUTHN:{challenge:r.messageFactory.makeChallenge(d(e.payload)),payload:e.payload,parsedPayload:JSON.parse(e.payload)},TON_CONNECT:l,TRON:u};case"ton_connect":{let r=e.payload;return{ERC191:n,NEP413:t,SOLANA:a,STELLAR:s,WEBAUTHN:o,TON_CONNECT:{message:"object"==typeof r&&null!=r&&"text"in r&&"string"==typeof r.text?{type:"text",text:r.text}:{type:"text",text:JSON.stringify(r)}},TRON:u}}case"tip191":return{ERC191:n,NEP413:t,SOLANA:a,STELLAR:s,WEBAUTHN:o,TON_CONNECT:l,TRON:{message:e.payload}};default:throw Error(`Unsupported standard: ${e.standard}`)}}],578800);var f=e.i(329470),h=e.i(539114),p=e.i(226520),g=e.i(241475),m=e.i(726610),y=e.i(539698),v=e.i(646952),b=e.i(233001),w=e.i(368189),_=e.i(186249),A=e.i(652873),S=e.i(338363),E=e.i(797535);async function x(e,{account:t=e.account,message:r}){if(!t)throw new S.AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});let i=(0,A.parseAccount)(t);if(i.signMessage)return i.signMessage({message:r});let n="string"==typeof r?(0,E.stringToHex)(r):r.raw instanceof Uint8Array?(0,E.toHex)(r.raw):r.raw;return e.request({method:"personal_sign",params:[n,i.address]},{retryCount:0})}e.s(["signMessage",0,x],942469);var T=e.i(324507),I=e.i(264882);async function k(e,t){let r,{account:i,connector:n,...a}=t;return r="object"==typeof i&&"local"===i.type?e.getClient():await (0,I.getConnectorClient)(e,{account:i,connector:n}),(0,T.getAction)(r,x,"signMessage")({...a,...i?{account:i}:{}})}var O=e.i(518749);e.s(["useWalletAgnosticSignMessage",0,function(){let{state:e}=(0,g.useConnectWallet)(),{signMessage:t}=(0,y.useNearWallet)(),{signMessageAsync:r}=function(e={}){var t;let{mutation:r}=e,i=(t=(0,O.useConfig)(e),{mutationFn:e=>k(t,e),mutationKey:["signMessage"]}),{mutate:n,mutateAsync:a,...s}=(0,_.useMutation)({...r,...i});return{...s,signMessage:n,signMessageAsync:a}}(),i=(0,h.useWallet)(),{signMessage:n}=(0,p.useWebAuthnActions)(),[a]=(0,w.useTonConnectUI)(),{signMessage:s}=(0,b.useTronWallet)();return async(o,l)=>{let u=e.chainType;switch(u){case m.ChainType.EVM:return{type:"ERC191",signatureData:await r({message:o.ERC191.message}),signedData:o.ERC191};case m.ChainType.Near:{let e,r,{signatureData:i,signedData:n}=await function(...e){return Promise.race(e)}(t({...o.NEP413,nonce:f.Buffer.from(o.NEP413.nonce)}),(r=t=>{"hot-close"===t.data&&(window.removeEventListener("message",r),e(Error("User cancelled the operation")))},new Promise((t,i)=>{e=i,window.addEventListener("message",r)}).finally(()=>{window.removeEventListener("message",r)})));return{type:"NEP413",signatureData:i,signedData:n}}case m.ChainType.Solana:if(null==i.signMessage)throw Error("Solana wallet does not support signMessage");return{type:"SOLANA",signatureData:await i.signMessage(o.SOLANA.message),signedData:o.SOLANA};case m.ChainType.WebAuthn:return{type:"WEBAUTHN",signatureData:await n(o.WEBAUTHN.challenge,l),signedData:o.WEBAUTHN};case m.ChainType.Ton:{let e=await a.signData(o.TON_CONNECT.message);return{type:"TON_CONNECT",signatureData:{signature:e.signature,address:e.address,timestamp:e.timestamp,domain:e.domain,payload:{type:"text",text:e.payload.text}},signedData:o.TON_CONNECT}}case m.ChainType.Stellar:return{type:"STELLAR_SEP53",signatureData:await (0,v.signMessageStellar)(o.STELLAR.message),signedData:o.STELLAR};case m.ChainType.Tron:return{type:"TRON",signatureData:await s(o.TRON.message),signedData:o.TRON};case void 0:throw Error("User not signed in");default:throw Error(`Unsupported sign in type: ${u}`)}}}],791082)},791919,e=>{"use strict";var t=e.i(989299);e.s(["and",()=>t.a])},404466,424883,e=>{"use strict";var t=e.i(856e3);e.s(["sendTo",()=>t.b],404466);var r=e.i(989299);e.s(["not",()=>r.n],424883)},382075,271220,e=>{"use strict";var t=e.i(696150),r=t.useLayoutEffect,i=e.i(989299),i=i,n=i;e.s(["createActor",()=>n.c],271220);var n=i,a=e.i(109381),s=e.i(286545);let o=(e,t)=>{t(e);let r=e.getSnapshot().children;
97r&&Object.values(r).forEach(e=>{o(e,t)})};function l(e){let t=[];o(e,e=>{t.push([e,e.getSnapshot()]),e.observers=new Set});let r=e.system.getSnapshot?.();e.stop(),e.system._snapshot=r,t.forEach(([e,t])=>{e._processingStatus=0,e._snapshot=t})}function u(e,...[i]){let[[a,s],o]=(0,t.useState)(()=>{let t=(0,n.c)(e,i);return[e.config,t]});if(e.config!==a){let t=(0,n.c)(e,{...i,snapshot:s.getPersistedSnapshot({__unsafeAllowInlineActors:!0})});o([e.config,t]),s=t}return r(()=>{s.logic.implementations=e.implementations}),s}function c(e,...[r,n]){let a=u(e,r);return(0,t.useEffect)(()=>{if(!n)return;let e=a.subscribe((0,i.e)(n));return()=>{e.unsubscribe()}},[n]),(0,t.useEffect)(()=>(a.start(),()=>{l(a)}),[a]),a}function d(e,t){return e===t}function f(e,r,i=d){let n=(0,t.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:r}=e.subscribe(t);return r},[e]),s=(0,t.useCallback)(()=>e?.getSnapshot(),[e]);return(0,a.useSyncExternalStoreWithSelector)(n,s,s,r,i)}function h(e,...[r]){let i=u(e,r),n=(0,t.useCallback)(()=>i.getSnapshot(),[i]),a=(0,t.useCallback)(e=>{let{unsubscribe:t}=i.subscribe(e);return t},[i]),o=(0,s.useSyncExternalStore)(a,n,n);return(0,t.useEffect)(()=>(i.start(),()=>{l(i)}),[i]),[o,i.send,i]}e.s(["createActorContext",0,function(e,r){let i=t.createContext(null),n=i.Provider;function a({children:i,logic:s=e,machine:o,options:l}){if(o)throw Error('The "machine" prop has been deprecated. Please use "logic" instead.');let u=c(s,{...r,...l});return t.createElement(n,{value:u,children:i})}function s(){let e=t.useContext(i);if(!e)throw Error(`You used a hook from "${a.displayName}" but it's not inside a <${a.displayName}> component.`);return e}return a.displayName="ActorProvider",{Provider:a,useActorRef:s,useSelector:function(e,t){return f(s(),e,t)}}},"useActor",0,h,"useActorRef",0,c,"useMachine",0,function(e,...[t]){return h(e,t)},"useSelector",0,f],382075)},428194,180918,639697,e=>{"use strict";var t,r=e.i(789477),i=e.i(704040),n=e.i(245164),a=e.i(104147),s=e.i(578800),o=e.i(369256),l=e.i(131836),u=e.i(92752),c=e.i(323071),d=e.i(32515),f=e.i(770471),h=e.i(671424),p=e.i(30528),g=e.i(91421),m=e.i(484776),y=e.i(33574),v=e.i(241258),b=e.i(385989),w=e.i(651235),_=e.i(157946),A=e.i(186448);let S=(0,A.setup)({types:{},actors:{verifyWallet:(0,_.fromPromise)(()=>{throw Error("not implemented")})},delays:{VERIFICATION_TIMEOUT:6e4},actions:{logError:(e,{error:t})=>{v.logger.error(t)},setError:(0,b.assign)({hadError:(e,{hadError:t})=>t}),emitVerificationFailed:(0,w.emit)(()=>({type:"VERIFICATION_FAILED"})),clearError:(0,b.assign)({hadError:!1}),setVerificationResult:(0,b.assign)({verificationResult:(e,{result:t})=>t})},guards:{isVerified:(e,t)=>!0===t.success,hasFailedNearSignature:(e,t)=>!1===t.success&&null!=t.failedNearSignature}}).createMachine({id:"verify-wallet",initial:"idle",context:{hadError:!1,verificationResult:null},output:({context:e})=>({verified:e.verificationResult?.success===!0,failedNearSignature:e.verificationResult?.failedNearSignature??null}),states:{idle:{on:{START:{target:"verifying",actions:"clearError"},ABORT:"aborted"}},verifying:{on:{ABORT:"aborted"},after:{VERIFICATION_TIMEOUT:{target:"idle",actions:[{type:"logError",params:{error:"Verification timed out after 60s"}},{type:"setError",params:{hadError:!0}},"emitVerificationFailed"]}},invoke:{src:"verifyWallet",onDone:[{target:"verified",guard:{type:"isVerified",params:({event:e})=>e.output},actions:{type:"setVerificationResult",params:({event:e})=>({result:e.output})}},{target:"failed_pubkey_missing",guard:{type:"hasFailedNearSignature",params:({event:e})=>e.output},actions:{type:"setVerificationResult",params:({event:e})=>({result:e.output})}},{target:"idle",actions:[{type:"logError",params:{error:"Wallet produced an unverifiable signature"}},{type:"setError",params:{hadError:!0}},"emitVerificationFailed"]}],onError:{target:"idle",actions:[{type:"logError",params:({event:e})=>e},{type:"setError",params:{hadError:!0}},"emitVerificationFailed"]}}},verified:{type:"final"},failed_pubkey_missing:{type:"final"},aborted:{type:"final"}}});var E=e.i(856e3),E=E,x=e.i(404466);let T=(0,A.setup)({types:{},actors:{appWalletVerification:S,appPubKeyVerifier:y.publicKeyVerifierMachine,authInvalidationListener:(0,_.fromCallback)(({sendBack:e})=>{let t=()=>e({type:"AUTH_INVALIDATED"});return window.addEventListener("auth:invalidated",t),()=>window.removeEventListener("auth:invalidated",t)}),banService:(0,_.fromPromise)(async e=>{throw Error("banService must be provided via .provide()")}),safetyService:(0,_.fromPromise)(async e=>{throw Error("safetyService must be provided via .provide()")}),reauthAfterPubkey:(0,_.fromPromise)(async e=>{throw Error("reauthAfterPubkey must be provided via .provide()")})},guards:{isSettled:({event:e})=>"WALLET_STATE"===e.type&&"settled"===e.restoreStatus,hasWalletInEvent:({event:e})=>"WALLET_STATE"===e.type&&null!=e.address,isVerified:(e,t)=>t.verified,hasFailedNearSignature:(e,t)=>
97!t.verified&&null!=t.failedNearSignature,isPubKeyOk:(e,t)=>"ok"===t.tag,isReauthSuccess:(e,t)=>!0===t.success,isBanned:(e,t)=>t.output.isBanned,isUnsafe:(e,t)=>"unsafe"===t.output.status},actions:{setWalletFromEvent:(0,b.assign)(({event:e})=>"WALLET_STATE"!==e.type?{}:{address:e.address,chainType:e.chainType}),setVerificationTarget:(0,b.assign)(({event:e})=>{if("START_VERIFICATION"!==e.type)return{};let t=(0,h.readAuthJourneyLease)(),r="near"===e.chainType&&t?.chain==="near"?t:null;return{address:e.address,chainType:e.chainType,authJourney:r}}),captureFailedNearSignature:(0,b.assign)((e,t)=>({nearAccount:{accountId:t.accountId,publicKey:t.publicKey},cachedSignedData:t.signedData})),clearPubkeyRecoveryState:(0,b.assign)({authJourney:()=>void 0,nearAccount:()=>null,cachedSignedData:()=>null}),clearWallet:(0,b.assign)({authJourney:()=>void 0,address:()=>null,chainType:()=>null,nearAccount:()=>null,cachedSignedData:()=>null}),logRestoreTimeout:()=>{v.logger.warn("[authMachine] wallet restore timed out")},logGatingTimeout:()=>{v.logger.warn("[authMachine] ban check timed out â proceeding to safety check")},logBanCheckUnavailable:(e,t)=>{v.logger.warn("[authMachine] ban check unavailable â proceeding to safety check",{error:t.error})},logSafetyCheckUnavailable:()=>{v.logger.warn("[authMachine] safety check unavailable â routing to safety_unreachable")},logWalletVerificationFailed:()=>{v.logger.warn("[authMachine] wallet verification failed â signing out")},logPubkeyVerificationFailed:()=>{v.logger.warn("[authMachine] pubkey verification failed â signing out and requesting wallet disconnect")},logReauthFailed:(e,t)=>{v.logger.warn("[authMachine] reauth after pubkey recovery failed â signing out and requesting wallet disconnect",t?.error!==void 0?{error:t.error}:void 0)},sendParentWalletRestored:(0,E.s)(({context:e})=>({type:"WALLET_RESTORED",address:e.address,chainType:e.chainType})),sendParentAuthInvalidated:(0,E.s)({type:"AUTH_INVALIDATED"}),sendParentVerificationComplete:(0,E.s)({type:"VERIFICATION_COMPLETE"}),sendParentSignOut:(0,E.s)({type:"SIGN_OUT"}),clearAuthJourneyLease:()=>{},failAuthJourney:(e,t)=>{},sendParentBannedDetected:(0,E.s)({type:"BANNED_DETECTED"}),requestWalletDisconnect:(0,w.emit)(({context:e})=>{if(null==e.chainType)throw Error("requestWalletDisconnect fired without a chainType â guards should have prevented this");return{type:"WALLET_DISCONNECT_REQUESTED",chainType:e.chainType}})},delays:{RESTORE_TIMEOUT:1e4,GATING_TIMEOUT:1e4}}).createMachine({id:"auth",context:{authJourney:void 0,address:null,chainType:null,nearAccount:null,cachedSignedData:null},invoke:{id:"authListenerRef",src:"authInvalidationListener"},on:{AUTH_INVALIDATED:{actions:"sendParentAuthInvalidated"}},initial:"restoring",states:{restoring:{on:{WALLET_STATE:[{guard:({event:e})=>"WALLET_STATE"===e.type&&"settled"===e.restoreStatus&&null!=e.address,target:"gating",actions:"setWalletFromEvent"},{guard:"isSettled",target:"ready",actions:"setWalletFromEvent"}]},after:{RESTORE_TIMEOUT:{target:"ready",actions:"logRestoreTimeout"}}},gating:{on:{WALLET_STATE:[{guard:"hasWalletInEvent",target:"gating",reenter:!0,actions:"setWalletFromEvent"},{guard:"isSettled",target:"blocked",actions:["clearAuthJourneyLease","clearWallet","sendParentSignOut"]}]},initial:"checking_ban",states:{checking_ban:{after:{GATING_TIMEOUT:{target:"checking_safety",actions:"logGatingTimeout"}},invoke:{src:"banService",input:({context:e})=>({address:e.address,chainType:e.chainType}),onDone:[{guard:{type:"isBanned",params:({event:e})=>({output:e.output})},target:"banned"},{target:"checking_safety"}],onError:{target:"checking_safety",actions:{type:"logBanCheckUnavailable",params:({event:e})=>({error:e.error})}}}},checking_safety:{after:{GATING_TIMEOUT:{target:"safety_unreachable",actions:"logSafetyCheckUnavailable"}},invoke:{src:"safetyService",input:({context:e})=>({address:e.address,chainType:e.chainType}),onDone:[{guard:{type:"isUnsafe",params:({event:e})=>({output:e.output})},target:"safety_blocked"},{target:"#auth.ready"}],onError:{target:"safety_unreachable",actions:"logSafetyCheckUnavailable"}}},safety_blocked:{on:{BYPASS_SAFETY:{target:"#auth.ready"},ABORT_GATING:{target:"#auth.blocked",actions:[{type:"failAuthJourney",params:{failureStage:"connection",failureReason:"cancelled"}},"clearAuthJourneyLease","clearWallet","sendParentSignOut"]}}},safety_unreachable:{on:{RETRY_SAFETY:{target:"checking_safety"},PROCEED_UNVERIFIED:{target:"#auth.ready"},ABORT_GATING:{target:"#auth.blocked",actions:[{type:"failAuthJourney",params:{failureStage:"connection",failureReason:"cancelled"}},"clearAuthJourneyLease","clearWallet","sendParentSignOut"]}}},banned:{entry:"sendParentBannedDetected",on:{ABORT_GATING:{target:"#auth.blocked",actions:["clearAuthJourneyLease","clearWallet","sendParentSignOut"]}}}}},ready:{entry:"sendParentWalletRestored",on:{START_VERIFICATION:{target:"authenticating",actions:"setVerificationTarget"},WALLET_STATE:{guard:"hasWalletInEvent",target:"gating",actions:"setWalletFromEvent"}}},blocked:{on:{WALLET_STATE:{guard:"hasWalletInEvent",target:"gating",actions:"setWalletFromEvent"}}},authenticating:{initial:"wallet_verifying",on:{START_VERIFICATION:{target:"authenticating",reenter
97:!0,actions:["clearPubkeyRecoveryState","setVerificationTarget"]},WALLET_STATE:{guard:"hasWalletInEvent",target:"gating",actions:["clearPubkeyRecoveryState","setWalletFromEvent"]},ABORT_VERIFICATION:{target:"#auth.ready",actions:[{type:"failAuthJourney",params:{failureStage:"verification",failureReason:"cancelled"}},"clearPubkeyRecoveryState","sendParentSignOut"]}},states:{wallet_verifying:{invoke:{id:"walletVerRef",src:"appWalletVerification",onDone:[{guard:{type:"isVerified",params:({event:e})=>e.output},target:"#auth.ready",actions:"sendParentVerificationComplete"},{guard:{type:"hasFailedNearSignature",params:({event:e})=>e.output},target:"pubkey_verifying",actions:{type:"captureFailedNearSignature",params:({event:e})=>{if(null==e.output.failedNearSignature)throw Error("failedNearSignature required when hasFailedNearSignature is true");return e.output.failedNearSignature}}},{target:"#auth.ready",actions:[{type:"failAuthJourney",params:{failureStage:"verification",failureReason:"verification_rejected"}},"logWalletVerificationFailed","sendParentSignOut"]}]},on:{ABORT_VERIFICATION:{actions:(0,x.sendTo)("walletVerRef",{type:"ABORT"})}}},pubkey_verifying:{entry:(0,b.assign)({authJourney:({context:e})=>e.authJourney??(null==(0,h.readAuthJourneyLease)()?(0,h.startAuthJourney)({method:"wallet",action:"connect",chain:"near"}):null)}),invoke:{id:"pubkeyVerRef",src:"appPubKeyVerifier",input:({context:e})=>{let t=e.authJourney;return{nearAccount:e.nearAccount,nearClient:m.nearClient,...t?.chain==="near"?{authJourney:t}:{}}},onDone:[{guard:{type:"isPubKeyOk",params:({event:e})=>e.output},target:"reauthenticating"},{target:"#auth.ready",actions:[{type:"failAuthJourney",params:({event:e})=>({reason:"err"===e.output.tag?e.output.value:"unknown"})},"logPubkeyVerificationFailed","clearPubkeyRecoveryState","sendParentSignOut","requestWalletDisconnect"]}]}},reauthenticating:{invoke:{src:"reauthAfterPubkey",input:({context:e})=>{if(null==e.cachedSignedData||null==e.nearAccount)throw Error("cachedSignedData/nearAccount must be set before reauthenticating");return{signedData:e.cachedSignedData,address:e.nearAccount.accountId,chainType:g.AuthMethod.Near}},onDone:[{guard:{type:"isReauthSuccess",params:({event:e})=>e.output},target:"#auth.ready",actions:["clearPubkeyRecoveryState","sendParentVerificationComplete"]},{target:"#auth.ready",actions:[{type:"failAuthJourney",params:{failureStage:"verification",failureReason:"verification_rejected"}},"logReauthFailed","clearPubkeyRecoveryState","sendParentSignOut","requestWalletDisconnect"]}],onError:{target:"#auth.ready",actions:[{type:"failAuthJourney",params:{failureStage:"verification",failureReason:"verification_rejected"}},{type:"logReauthFailed",params:({event:e})=>({error:e.error})},"clearPubkeyRecoveryState","sendParentSignOut","requestWalletDisconnect"]}}}}}}});var I=e.i(791082),k=e.i(734047),O=e.i(329470),C=e.i(51218),N=e.i(539114),P=e.i(442465),D=e.i(708339),R=e.i(226520),$=e.i(242957),B=e.i(783857),L=e.i(539698),U=e.i(646952),F=e.i(233001),M=e.i(896271),j=e.i(654863),z=e.i(548065),V=e.i(688990),H=e.i(368189),q=e.i(472727),W=e.i(696150),K=e.i(268424),G=e.i(493034),Z=e.i(532212),X=e.i(802028),J=e.i(363486),Y=e.i(430222);function Q(){let e=(0,z.useQueryClient)(),t=(0,L.useNearWallet)(),r=(0,G.useConnect)(),i=(0,X.useDisconnect)(),n=(0,K.useAccount)(),a=(0,Z.useConnections)(),{sendTransactions:s}=(0,Y.useEVMWalletActions)(),l=async({connector:e})=>{if(!e)throw Error("Invalid connector");await r.connectAsync({connector:e})},u=async()=>{await (0,J.disconnectWagmiConnections)({connections:a,accountAddress:n.address,disconnectClient:i})},{setVisible:c}=(0,P.useWalletModal)(),f=(0,N.useWallet)(),p=(0,C.useConnection)(),g=async()=>{c(!0)},m=async()=>{await f.disconnect(),await u()},y=(0,R.useWebAuthnCurrentCredential)(),b=(0,R.useWebAuthnActions)(),w=(0,$.useWebAuthnUIStore)(),_=(0,H.useTonWallet)(),A=(0,H.useTonConnectMod
97al)(),[S]=(0,H.useTonConnectUI)(),E=(0,H.useIsConnectionRestored)(),{publicKey:x,connect:T,disconnect:I,isLoading:k}=(0,U.useStellarWallet)(),D=async()=>{await T()},Q=async()=>{await I()},et=(0,F.useTronWallet)(),er=async()=>{await et.connect()},ei=async()=>{await et.disconnect()},en={chainType:void 0,network:void 0,address:void 0,displayAddress:void 0,isFake:!1};null!=t.accountId&&(en={address:t.accountId,displayAddress:t.accountId,network:"near:mainnet",chainType:"near",isFake:!1}),null!=n.address&&n.chainId&&(en={address:n.address,displayAddress:n.address,network:n.chainId?`eth:${n.chainId}`:"unknown",chainType:"evm",isFake:!1}),null!=f.publicKey&&(en={address:f.publicKey.toBase58(),displayAddress:f.publicKey.toBase58(),network:"sol:mainnet",chainType:"solana",isFake:!1}),null!=y&&(en={address:y.publicKey,displayAddress:y.publicKey,chainType:"webauthn",isFake:!1}),_&&(en={address:_.account.publicKey,displayAddress:(0,j.parseTonAddress)(_.account.address),network:"ton",chainType:"ton",isFake:!1}),x&&(en={address:x,displayAddress:x,network:"stellar:mainnet",chainType:"stellar",isFake:!1}),et.publicKey&&(en={address:et.publicKey,displayAddress:et.publicKey,network:"tron:mainnet",chainType:"tron",isFake:!1});let ea=function(){let e=(0,q.useSearchParams)().get("user");if(null==e)return null;let t=e.indexOf(":");return{chainType:e.slice(0,t),address:e.slice(t+1),isFake:!0}}();ea&&(en=ea);let es=n.isConnecting||n.isReconnecting||f.connecting||k||et.isLoading||t.isInitializing||!E||w.isSigningIn||w.isCreating,eo=w.isSigningIn||w.isCreating?"signing":n.isConnecting||f.connecting||k||et.isLoading?"connecting":"idle",{setIsDisconnecting:el}=(0,M.useDisconnectingStore)(),[eu,ec]=(0,W.useState)(null),ed=(0,W.useCallback)(()=>ec(null),[]);return{async signIn(e){ec(null);try{return await ({near:()=>t.connect(),evm:()=>e.connector?l({connector:e.connector}):void 0,solana:()=>g(),webauthn:()=>w.open(),ton:()=>A.open(),stellar:()=>D(),tron:()=>er()})[e.id]()}catch(r){if("webauthn"===e.id)return;let t=(0,o.extractWalletErrorCode)(r,null);if("ERR_WALLET_CANCEL_ACTION"===t)return;ec("ERR_WALLET_POPUP_BLOCKED"===t?"Popup was blocked by your browser. Please allow popups and try again.":"Wallet connection failed. Please try again."),v.logger.error("Wallet signIn failed",{chain:e.id,error:r})}},async signOut(r){(0,h.clearAuthJourneyLease)(),el(!0),document.documentElement.dataset.disconnecting="";try{await (0,d.clearActiveSession)(),(0,B.teardownPrivateMode)(),await ({near:()=>t.disconnect(),evm:()=>u(),solana:()=>m(),webauthn:()=>b.signOut(),ton:()=>S.disconnect(),stellar:()=>Q(),tron:()=>ei()})[r.id](),e.removeQueries({queryKey:["token_validation"]})}catch(i){let e=i instanceof Error?i.message:String(i),t=i instanceof Error?i:void 0;throw new ee(r.id,e,t)}finally{delete document.documentElement.dataset.disconnecting,el(!1)}},sendTransaction:async e=>{let r=await ({near:async()=>{if(!t.accountId)throw Error("NEAR wallet not connected");return await t.signAndSendTransactions({transactions:e.tx})},evm:async()=>await s(e.tx),solana:async()=>{let t=e.tx;return await f.sendTransaction(t,p.connection)},webauthn:async()=>{throw Error("WebAuthn does not support transactions")},ton:async()=>{if(!_)throw Error("TON wallet not connected");let t=e.tx,r=await S.sendTransaction(t);return V.Cell.fromBoc(O.Buffer.from(r.boc,"base64"))[0].hash().toString("hex")},stellar:async()=>{if(!x)throw Error("Stellar wallet not connected");let t=e.tx.transaction.toXDR(),{signedTxXdr:r}=await (0,U.signTransactionStellar)(t);return await (0,U.submitTransactionStellar)(r)},tron:async()=>{if(!et)throw Error("Tron wallet not connected");let t=e.tx;return await et.sendTransaction({transaction:t})}})[e.id]();if(void 0===r)throw Error(`Transaction failed for ${e.id}`);return r},connectors:r.connectors,walletState:en,isLoading:es,isReconnecting:n.isReconnecting,restoreStatus:es?"restoring":"settled",interactionStatus:eo,signInError:eu,clearSignInError:ed}}(t={}).Near="near",t.EVM="evm",t.Solana="solana",t.WebAuthn="webauthn",t.Ton="ton",t.Stellar="stellar",t.Tron="tron";class ee extends D.BaseError{chainType;originalError;constructor(e,t,r){super("Wallet sign out error",{cause:r,metaMessages:[`Chain type: ${e}`,`Message: ${t}`],name:"WalletDisconnectError"}),this.chainType=e,this.originalError=r}}e.s(["useWalletSnapshot",0,Q],180918);
97let et=["/login","/gift","/banned"],er=["/gift"];function ei(e,t){return e.some(e=>t===e||t.startsWith(`${e}/`))}let en=(0,A.setup)({types:{},actions:{syncContext:(0,b.assign)(({event:e})=>"SYNC_CONTEXT"!==e.type?{}:{pathname:e.pathname,searchRedirect:e.searchRedirect,routeIntent:e.routeIntent}),navigate:(e,t)=>{}}}).createMachine({id:"app-router",context:({input:e})=>e,on:{SYNC_CONTEXT:{actions:"syncContext"},NAVIGATE_TO_LOGIN:{actions:{type:"navigate",params:({context:e})=>({url:`/login${e.routeIntent?`?redirect=${encodeURIComponent(e.routeIntent)}`:""}`})}},NAVIGATE_FROM_LOGIN_IF_NEEDED:{guard:({context:e})=>"/login"===e.pathname,actions:{type:"navigate",params:({context:e})=>{var t;let r;return{url:null!=(r=function(e){if(null==e||!e.startsWith("/")||e.startsWith("//"))return null;try{return new URL(e,"http://localhost")}catch{return null}}(e.searchRedirect))&&(!ei(et,t=r.pathname)||ei(er,t))?`${r.pathname}${r.search}`:"/home"}}}},NAVIGATE_TO_BANNED:{actions:{type:"navigate",params:{url:"/banned"}}}}});var ea=e.i(791919),es=e.i(424883),eo=e.i(989299),eo=eo;let el=(0,A.setup)({types:{},actors:{appAuth:T,appRouter:en,appSession:p.appSessionMachine},guards:{isPublicRoute:({context:e})=>ei(et,e.pathname),needsVerification:({context:e})=>{let t=e.sessionResult?.status;return"unauthenticated"===t||"reauth_required"===t},noWalletOnProtectedRoute:({context:e})=>null==e.address&&!ei(et,e.pathname),noWalletOnPublicRoute:({context:e})=>null==e.address&&ei(et,e.pathname),isDisconnect:({context:e,event:t})=>null!=e.address&&"WALLET_STATE"===t.type&&null==t.address,isDisconnectOnPublicRoute:({context:e,event:t})=>null!=e.address&&"WALLET_STATE"===t.type&&null==t.address&&ei(et,e.pathname),isAuthorizedOnLogin:({context:e},t)=>"authorized"===t.status&&"/login"===e.pathname,needsVerificationOnLogin:({context:e},t)=>("unauthenticated"===t.status||"reauth_required"===t.status)&&"/login"===e.pathname,isConnect:({context:e,event:t})=>!e.awaitingDisconnect&&null==e.address&&"WALLET_STATE"===t.type&&null!=t.address,isAddressChange:({context:e,event:t})=>null!=e.address&&"WALLET_STATE"===t.type&&null!=t.address&&(t.address!==e.address||t.chainType!==e.chainType),notAwaitingDisconnect:({context:e})=>!e.awaitingDisconnect,isPathnameLogin:({event:e})=>"PATHNAME_CHANGED"===e.type&&"/login"===e.pathname,isPathnameNotLogin:({event:e})=>"PATHNAME_CHANGED"===e.type&&"/login"!==e.pathname,isPathnameContextLogin:({context:e})=>"/login"===e.pathname,isPathnameProtected:({event:e})=>"PATHNAME_CHANGED"===e.type&&!ei(et,e.pathname),isPathnameNotLoginAndNeedsVerification:({context:e,event:t})=>{let r=e.sessionResult?.status;return"PATHNAME_CHANGED"===t.type&&"/login"!==t.pathname&&("unauthenticated"===r||"reauth_required"===r)},isAuthorizedSession:(e,t)=>"authorized"===t.status,needsVerificationSession:(e,t)=>"unauthenticated"===t.status||"reauth_required"===t.status,isBannedSession:(e,t)=>"banned"===t.status,isRetryableSessionFailure:(e,t)=>"retryable_failure"===t.status,hasWalletIdentity:({context:e})=>null!=e.address&&null!=e.chainType},actions:{setWalletInfoFromEvent:(0,b.assign)(({context:e,event:t})=>{if("WALLET_STATE"!==t.type)return{};let r=t.address!==e.address||t.chainType!==e.chainType;return{address:t.address,chainType:t.chainType,...r?{sessionResult:null}:{}}}),setPathnameFromChange:(0,b.assign)(({event:e})=>"PATHNAME_CHANGED"!==e.type?{}:{pathname:e.pathname,searchRedirect:e.searchRedirect??null}),captureRouteIntent:(0,b.assign)({routeIntent:({context:e})=>ei(et,e.pathname)?null:e.pathname}),clearRouteIntent:(0,b.assign)({routeIntent:()=>null}),setSessionResultFromEvent:(0,b.assign)((e,t)=>({sessionResult:t.result})),clearWalletState:(0,b.assign)({address:()=>null,chainType:()=>null,sessionResult:()=>null}),markAwaitingDisconnect:(0,b.assign)({awaitingDisconnect:()=>!0}),clearAwaitingDisconnect:(0,b.assign)({awaitingDisconnect:()=>!1}),syncRouterContext:(0,x.sendTo)("appRouterActor",({context:e})=>({type:"SYNC_CONTEXT",pathname:e.pathname,searchRedirect:e.searchRedirect,routeIntent:e.routeIntent})),forwardToAuthActor:(0,x.sendTo)("authActor",({event:e})=>e),navigateToLogin:(0,x.sendTo)("appRouterActor",{type:"NAVIGATE_TO_LOGIN"}),navigateFromLoginIfNeeded:(0,x.sendTo)("appRouterActor",{type:"NAVIGATE_FROM_LOGIN_IF_NEEDED"}),navigateToBanned:(0,x.sendTo)("appRouterActor",{type:"NAVIGATE_TO_BANNED"}),sendStartVerification:(0,x.sendTo)("authActor",(e,t)=>({type:"START_VERIFICATION",address:t.address,chainType:t.chainType})),refreshRouter:()=>{},clearSession:()=>{},installAnalyticsIdentity:(e,t)=>{},clearAnalyticsIdentity:()=>{},completeAuthJourney:()=>{},clearAuthJourneyLease:()=>{},logSessionCheckFailed:({context:e},t)=>{v.logger.warn("[appBootstrapMachine] session check failed",{error:t.error,chainType:e.chainType})}},delays:{LEAVING_LOGIN_TIMEOUT:3e3,HOME_STABILIZE_DELAY:250,VERIFY_UI_SETTLE_DELAY:120,VERIFY_LOGIN_ESCAPE_TIMEOUT:3e3,NAVIGATE_TO_LOGIN_RETRY:1e3,SESSION_EXPIRY:({context:e})=>e.sessionResult?.status!=="authorized"?6e4:Math.max(e.sessionResult.expiresAt-Date.now(),3e4)}}).createMachine({id:"app-bootstrap",initial:"bootstrapping",context:({input:e})=>({pathname:e.pathname,searchRedirect:null,address:null,chainType:null,sessionResult:null,routeIntent:null,awaitingDisconnect:!1}),invoke:[{id:"authActor",src:"appAuth"},{id:"appRouterActor",src:"appRouter",input:({context:e})=>({pathname:e.pathname,searchRedirect:e.searchRedirect,routeIntent:e.routeIntent})}],on:{PATHNAME_CHANGED:{actions:["setPathnameFromChange","syncRouterContext"]},AUTH_INVALIDATED:{target:".bootstrapping.resolving_session"},BANNED_DETECTED:{target:".signed_out.banned_blocked",actions:"clearAuthJourneyLease"},WALLET_STATE:[{guard:"isDisconnectOnPublicRoute",target:".signed_out.public_route_idle",actions:["clearSession","clearWalletState","clearAwaitingDisconnect","clearAuthJourneyLease"]},{guard:"isDisconnect",target:".signed_out.navigating_to_login",actions:["clearSession","clearWalletState","clearAwaitingDisconnect","clearAuthJourneyLease"]},{guard:({context:e,event:t})=>e.awaitingDisconnect&&"WALLET_STATE"===t.type&&null==t.address,actions:"clearAwaitingDisconnect"}]},states:{bootstrapping:{initial:"restoring_wallet",states:{restoring_wallet:{tags:["initializing"],on:{AUTH_INVALIDATED:{},WALLET_STATE:{guard:(0,es.not)((0,eo.o)(["isDisconnect","isDisconnectOnPublicRoute"])),actions:"forwardToAuthActor"},SIGN_OUT:{target:"#app-bootstrap.signed_out.navigating_to_login",actions:["clearRouteIntent","markAwaitingDisconnect","clearAuthJourneyLease"]},WALLET_RESTORED:{target:"resolving_session",actions:(0,b.assign)(({event:e})=>({address:e.address,chainType:e.chainType}))}}},resolving_session:{tags:["initializing"],initial:"gating",on:{SIGN_OUT:{target:"#app-bootstrap.signed_out.navigating_to_login",actions:["clearRouteIntent","markAwaitingDisconnect","clearAuthJourneyLease"]},WALLET_STATE:[{guard:"isAddressChange",target:"#app-bootstrap.bootstrapping.restoring_wallet",actions:["clearAuthJourneyLease","setWalletInfoFromEvent","forwardToAuthActor"]},{guard:"isConnect",target:"#app-bootstrap.bootstrapping.restoring_wallet",actions:["setWalletInfoFromEvent","forwardToAuthActor"]}]},states:{gating:{always:[{guard:"noWalletOnProtectedRoute",target:"#app-bootstrap.signed_out.navigating_to_login",actions:["clearAuthJourneyLease","captureRouteIntent","syncRouterContext"]},{guard:"noWalletOnPublicRoute",target:"#app-bootstrap.signed_out.public_route_idle",actions:"clearAuthJourneyLease"},{target:"checking"}]},checking:{invoke:{src:"appSession",input:({context:e})=>
97{if(null==e.address||null==e.chainType)throw Error("resolving_session.checking entered without wallet identity");return{address:e.address,chainType:e.chainType}},onDone:[{guard:{type:"isRetryableSessionFailure",params:({event:e})=>({status:e.output.status})},target:"#app-bootstrap.session_unreachable",actions:{type:"setSessionResultFromEvent",params:({event:e})=>({result:e.output})}},{guard:{type:"isBannedSession",params:({event:e})=>({status:e.output.status})},target:"#app-bootstrap.signed_out.banned_blocked",actions:["clearAuthJourneyLease",{type:"setSessionResultFromEvent",params:({event:e})=>({result:e.output})}]},{guard:{type:"isAuthorizedOnLogin",params:({event:e})=>({status:e.output.status})},target:"#app-bootstrap.bootstrapping.exiting_login",actions:{type:"setSessionResultFromEvent",params:({event:e})=>({result:e.output})}},{guard:{type:"needsVerificationOnLogin",params:({event:e})=>({status:e.output.status})},target:"#app-bootstrap.verifying.settling_ui",actions:{type:"setSessionResultFromEvent",params:({event:e})=>({result:e.output})}},{guard:{type:"isAuthorizedSession",params:({event:e})=>({status:e.output.status})},target:"#app-bootstrap.signed_in",actions:{type:"setSessionResultFromEvent",params:({event:e})=>({result:e.output})}},{guard:{type:"needsVerificationSession",params:({event:e})=>({status:e.output.status})},target:"#app-bootstrap.verifying.settling",actions:{type:"setSessionResultFromEvent",params:({event:e})=>({result:e.output})}}],onError:{target:"#app-bootstrap.session_unreachable",actions:[{type:"logSessionCheckFailed",params:({event:e})=>({error:e.error})},(0,b.assign)({sessionResult:()=>({status:"retryable_failure",reason:"Session check failed"})})]}}}}},exiting_login:{tags:["initializing"],entry:"navigateFromLoginIfNeeded",initial:"navigating",on:{SIGN_OUT:{target:"#app-bootstrap.signed_out.navigating_to_login",actions:["clearRouteIntent","markAwaitingDisconnect","clearAuthJourneyLease"]}},states:{navigating:{after:{LEAVING_LOGIN_TIMEOUT:[{guard:(0,ea.and)(["needsVerification",(0,es.not)("isPathnameContextLogin")]),target:"stabilizing"},{guard:"isPathnameContextLogin",target:"navigating",reenter:!0,actions:["navigateFromLoginIfNeeded"]},{target:"#app-bootstrap.signed_in"}]},on:{PATHNAME_CHANGED:[{guard:"isPathnameNotLoginAndNeedsVerification",target:"stabilizing",actions:["setPathnameFromChange","syncRouterContext"]},{guard:"isPathnameNotLogin",target:"#app-bootstrap.signed_in",actions:["setPathnameFromChange","syncRouterContext"]}]}},stabilizing:{after:{HOME_STABILIZE_DELAY:{target:"#app-bootstrap.verifying.settling_ui"}}}}}}},signed_in:{tags:["signed_in"],entry:[{type:"installAnalyticsIdentity",params:({context:e})=>({accountPseudonym:e.sessionResult?.status==="authorized"?e.sessionResult.accountPseudonym??null:null})},"completeAuthJourney","refreshRouter","navigateFromLoginIfNeeded"],initial:"idle",on:{SIGN_OUT:{target:"signed_out.navigating_to_login",actions:["clearRouteIntent","markAwaitingDisconnect","clearAuthJourneyLease"]},AUTH_INVALIDATED:{target:".revalidating"},WALLET_STATE:{guard:"isAddressChange",target:".revalidating.gating",actions:["clearAuthJourneyLease","setWalletInfoFromEvent","forwardToAuthActor"]},PATHNAME_CHANGED:{guard:"isPathnameLogin",actions:["setPathnameFromChange","syncRouterContext","navigateFromLoginIfNeeded"]}},states:{idle:{after:{SESSION_EXPIRY:{target:"revalidating"}}}
97,revalidating:{initial:"checking",states:{gating:{on:{AUTH_INVALIDATED:{},WALLET_STATE:[{guard:"isAddressChange",actions:["clearAuthJourneyLease","forwardToAuthActor"]},{guard:(0,es.not)((0,eo.o)(["isDisconnect","isDisconnectOnPublicRoute"])),actions:"forwardToAuthActor"}],WALLET_RESTORED:{target:"checking",actions:(0,b.assign)(({event:e})=>({address:e.address,chainType:e.chainType}))}}},checking:{invoke:{src:"appSession",input:({context:e})=>{if(null==e.address||null==e.chainType)throw Error("signed_in.revalidating.checking entered without wallet identity");return{address:e.address,chainType:e.chainType}},onDone:[{guard:{type:"isBannedSession",params:({event:e})=>({status:e.output.status})},target:"#app-bootstrap.signed_out.banned_blocked",actions:["clearAuthJourneyLease",{type:"setSessionResultFromEvent",params:({event:e})=>({result:e.output})}]},{guard:{type:"needsVerificationSession",params:({event:e})=>({status:e.output.status})},target:"#app-bootstrap.verifying.settling",actions:{type:"setSessionResultFromEvent",params:({event:e})=>({result:e.output})}},{guard:{type:"isRetryableSessionFailure",params:({event:e})=>({status:e.output.status})},target:"#app-bootstrap.signed_in.idle"},{target:"#app-bootstrap.signed_in.idle",actions:{type:"setSessionResultFromEvent",params:({event:e})=>({result:e.output})}}],onError:{target:"#app-bootstrap.signed_in.idle",actions:{type:"logSessionCheckFailed",params:({event:e})=>({error:e.error})}}}}}}}},verifying:{tags:["verifying"],entry:"navigateFromLoginIfNeeded",initial:"settling_ui",always:{guard:(0,es.not)("hasWalletIdentity"),target:"signed_out.navigating_to_login",actions:"clearAuthJourneyLease"},on:{AUTH_INVALIDATED:{},WALLET_STATE:{guard:"isAddressChange",target:"bootstrapping.restoring_wallet",actions:["clearAuthJourneyLease","setWalletInfoFromEvent","forwardToAuthActor"]},PATHNAME_CHANGED:{guard:"isPathnameLogin",actions:["setPathnameFromChange","syncRouterContext","navigateFromLoginIfNeeded"]},VERIFICATION_COMPLETE:{target:"bootstrapping.resolving_session"},SIGN_OUT:{target:"signed_out.navigating_to_login",actions:["clearRouteIntent","markAwaitingDisconnect","clearAuthJourneyLease"]}},states:{settling_ui:{tags:["initializing"],after:{VERIFY_UI_SETTLE_DELAY:{target:"active",guard:(0,ea.and)(["hasWalletIdentity",(0,es.not)("isPathnameContextLogin")])},VERIFY_LOGIN_ESCAPE_TIMEOUT:{guard:"isPathnameContextLogin",target:"settling_ui",reenter:!0,actions:["navigateFromLoginIfNeeded"]}},on:{PATHNAME_CHANGED:{guard:"isPathnameNotLogin",target:"settling_ui",reenter:!0,actions:["setPathnameFromChange","syncRouterContext"]}}},settling:{after:{VERIFY_UI_SETTLE_DELAY:{target:"active",guard:"hasWalletIdentity"}}},active:{entry:{type:"sendStartVerification",params:({context:e})=>{let{address:t,chainType:r}=e;if(null==t||null==r)throw Error("verifying.active entered without wallet identity");return{address:t,chainType:r}}}}}},session_unreachable:{tags:["session_unreachable"],on:{AUTH_INVALIDATED:{},RETRY_SESSION:{target:"bootstrapping.resolving_session.checking",actions:(0,b.assign)({sessionResult:()=>null})},SIGN_OUT:{target:"signed_out.navigating_to_login",actions:["clearRouteIntent","markAwaitingDisconnect","clearAuthJourneyLease"]}}},signed_out:{tags:["signed_out"],entry:"clearAnalyticsIdentity",initial:"public_route_idle",states:{public_route_idle:{on:{WALLET_STATE:[{guard:"isAddressChange",target:"#app-bootstrap.bootstrapping.restoring_wallet",actions:["clearAwaitingDisconnect","setWalletInfoFromEvent","forwardToAuthActor"]},{guard:"isConnect",target:"#app-bootstrap.bootstrapping.restoring_wallet",actions:["setWalletInfoFromEvent","forwardToAuthActor"]}],PATHNAME_CHANGED:{guard:"isPathnameProtected",target:"navigating_to_login",actions:(0,b.assign)({pathname:({event:e})=>e.pathname,searchRedirect:({event:e})=>e.searchRedirect??null,routeIntent:({event:e})=>e.pathname})}}},navigating_to_login:{tags:["initializing"],entry:["syncRouterContext","navigateToLogin"],always:{guard:"isPathnameContextLogin",target:"public_route_idle"},after:{NAVIGATE_TO_LOGIN_RETRY:{guard:(0,es.not)("isPathnameContextLogin"),target:"navigating_to_login",reenter
97:!0}},on:{AUTH_INVALIDATED:{},PATHNAME_CHANGED:{guard:"isPathnameLogin",target:"public_route_idle",actions:["setPathnameFromChange","syncRouterContext"]},WALLET_STATE:[{guard:(0,ea.and)(["isAddressChange","notAwaitingDisconnect"]),target:"#app-bootstrap.bootstrapping.restoring_wallet",actions:["setWalletInfoFromEvent","forwardToAuthActor"]},{guard:"isDisconnect",actions:["clearSession","clearWalletState","clearAwaitingDisconnect","clearAuthJourneyLease"]}]}},banned_blocked:{entry:"navigateToBanned",on:{SIGN_OUT:{target:"navigating_to_login",actions:["clearRouteIntent","markAwaitingDisconnect","clearAuthJourneyLease"]}}}}}}});var eu=e.i(494411),ec=e.i(892474);let ed=(0,eu.create)()((0,ec.persist)((e,t)=>({walletAddresses:[],addBypassedWalletAddress:r=>e({walletAddresses:[...t().walletAddresses,r]}),isWalletBypassed:e=>t().walletAddresses.includes(e)}),{name:"app_wallets_bypassed_list",storage:(0,ec.createJSONStorage)(()=>localStorage)}));e.s(["useBypassedWalletsStore",0,ed],639697);var ef=e.i(931343),eh=e.i(382075);let ep=(0,W.createContext)(null);function eg(){let e=(0,W.useContext)(ep);if(!e)throw Error("useBootstrapActor must be used within AppBootstrapProvider");return e}function em(e){let t=eg();return(0,eh.useSelector)(t,e)}e.s(["AppBootstrapProvider",0,function({children:e}){let t=(0,q.usePathname)(),g=(0,q.useRouter)(),m=(0,q.useSearchParams)(),y=(0,z.useQueryClient)(),{walletState:b,restoreStatus:w}=Q(),A=(0,I.useWalletAgnosticSignMessage)(),E=ed(e=>e.isWalletBypassed),x=(0,W.useRef)(b);x.current=b;let O=(0,W.useRef)(A);O.current=A;let C=(0,W.useRef)(E);C.current=E;let N=(0,eh.useActorRef)(el.provide({actions:{installAnalyticsIdentity:(e,{accountPseudonym:t})=>{(0,l.setAnalyticsAccountPseudonym)(t),null!=t&&(0,u.resumePendingFirstOperationMilestones)(t)},clearAnalyticsIdentity:()=>{(0,l.setAnalyticsAccountPseudonym)(null)},refreshRouter:()=>{g.refresh()},clearSession:()=>{(0,d.clearActiveSession)()},completeAuthJourney:({context:e})=>{e.sessionResult?.status==="authorized"&&(0,h.completeAuthJourney)(e.chainType,e.address)},clearAuthJourneyLease:h.clearAuthJourneyLease},actors:{appAuth:T.provide({actions:{clearAuthJourneyLease:h.clearAuthJourneyLease,failAuthJourney:({context:e},t)=>(0,h.failAuthJourney)(e.chainType,t,"near"===e.chainType?e.authJourney:void 0)},actors:{appWalletVerification:S.provide({actions:{logError:(e,{error:t})=>{let r=(0,o.extractWalletErrorCode)(t,null),i=new ef.WalletConnectionFailure(t,r);i.isActionable&&v.logger.error("Wallet verification failed",{error:i,chain:x.current.chainType??"unknown"})}},actors:{verifyWallet:(0,_.fromPromise)(async({signal:e})=>{let t=x.current;if(null==t.address||null==t.chainType)return{success:!1};let r=i.authIdentity.authHandleToIntentsUserId(t.address,t.chainType),o=await (0,s.createVerificationMessage)({signerId:r},t.chainType),l=await O.current(o);if(e.aborted)return{success:!1};let u=n.prepareBroadcastRequest.prepareSwapSignedData(l,{userAddress:t.address,userChainType:t.chainType}),d=await (0,c.authenticateAndStoreTokens)({signedData:u,address:t.address,authMethod:t.chainType});return d.success?{success:!0,expiresAt:d.expiresAt}:"NEP413"!==l.type||a.utils.isImplicitAccount(l.signatureData.accountId)?{success:!1}:{success:!1,failedNearSignature:{accountId:l.signatureData.accountId,publicKey:l.signatureData.publicKey,signedData:u}}})}}),banService:(0,_.fromPromise)(async({input:e,signal:t})=>{let r=await fetch(`/api/account/validate-banned?address=${encodeURIComponent(e.address)}&chainType=${encodeURIComponent(e.chainType)}`,{signal:t});if(!r.ok)throw Error("Failed to validate banned account");return{isBanned:(await r.json()).isBanned}}),safetyService:(0,_.fromPromise)(async({input:e,signal:t})=>{if(C.current(e.address)||"evm"!==e.chainType)return{status:"safe"};let r=await fetch(`/api/addresses/${e.address}/safety`,{signal:t});if(!r.ok)throw Error("Failed to check safety status");return{status:(await r.json()).safetyStatus}}),reauthAfterPubkey:(0,_.fromPromise)(async({input:e,signal:t})=>t.aborted?{success:!1}:{success:(await (0,c.authenticateAndStoreTokens)({signedData:e.signedData,address:e.address,authMethod:e.chainType})).success})}}),appRouter:en.provide({actions:{navigate:(e,{url:t})=>{v.logger.trace("[bootstrap] nav â",{url:t}),g.replace(t)}}}),appSession:p.appSessionMachine.provide({actors:{checkSession:(0,_.fromPromise)(async({input:e})=>(0,f.validateTokenForWallet)(e.address,e.chainType))}})}}),{input:{pathname:t}}),P=(0,eh.useSelector)(N,e=>e.children.authActor),D=(0,eh.useSelector)(P,e=>e.context.address),R=(0,eh.useSelector)(P,e=>e.context.chainType),$=(0,eh.useSelector)(N,e=>e.context.sessionResult),B=(0,eh.useSelector)(N,e=>e.matches({signed_out:"public_route_idle"}));return(0,W.useEffect)(()=>{N.send({type:"WALLET_STATE",address:b.address??null,chainType:b.chainType??null,restoreStatus:w})},[b.address,b.chainType,w,N]),(0,W.useEffect)(()=>{B&&N.send({type:"WALLET_STATE",address:b.address??null,chainType:b.chainType??null,restoreStatus:w})},[B,b.address,b.chainType,w,N]),(0,W.useEffect)(()=>{N.send({type:"PATHNAME_CHANGED",pathname:t,searchRedirect:m.get("redirect")})},[t,m,N]),(0,W.useEffect)(()=>{(0,k.syncWalletAuthCache)(y,D,R,$)},[y,D,R,$]),(0,r.jsx)(ep.Provider,{value:N,children:e})},"useAuthActor",0,function(){let e=eg();return(0,eh.useSelector)(e,e=>e.children.authActor)},"useBootstrapActor",0,eg,"useBootstrapRawState",0,function(){return em(e=>e.value)},"useBootstrapSelector",0,em,"useBootstrapState",0,function(){return em(e=>e.hasTag("initializing")?"initializing":e.hasTag("session_unreachable")?"session_unreachable":e.hasTag("signed_in")?"signed_in":e.hasTag("verifying")?"verifying":e.hasTag("signed_out")?"signed_out":"unknown")}],428194)}]); 98 99//# debugId=26e4fd4b-751d-d4ed-8970-445eb51db54e 100//# sourceMappingURL=08cirsdx4_m3z.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.