UNPKG

@orca-so/wavebreak

Version:

The wavebreak JS client for interacting with the wavebreak program.

1,267 lines (1,265 loc) 455 kB
var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); let xI, tC, rC, DC, gA, RC, dC, zI, MC, GC, Qg, AC, mC, LC, YC, KC, HC, eg, WC, ZC, jC, ig, gB, CC, BB, eB, og, tg, tB, QC, rB, DB, RB, dB, MB, GB, ng, mB, LB, YB, KB, HB, sg, Ot, xt, vt, Cn, Pt, Xt, kt, qt, $t, Tt, Wt, zt, _t, An, Zt, jt, Vt, gn, Yt, In, mt, Ft, Ut, pt, bt, Kt, Jt, Ht, Lt, S, ft, Gt, wD, RD, lD, dD, aD, ND, SD, hD, $c, zc, jc, Xc, rn, sn, cn, Dn, un, ln, Rn, wn, Nn, dn, hn, Sn, Mn, yn, fn, Gn, _n, kn, mn, Fn, Un, Ln, Jn, en, Tn, Yn, On, bn, Kn, pn, Pn, Hn, qn, vn, Wn, Vn, xn, Zn, Xn, zn, jn, $n, Aa, ga, Ia, Ca, Ba, Ea, _D, fD, oD, cD, uD, DD, MD, Zc, BD, XI, $I, IC, EC, iC, Br, qc, Wc, vc, Vc, ID, gs, Qs, ns, st, ut, wt, ht, yt, Ds, Ns, As, Es, ts, rt, Dt, Rt, dt, Mt, cs, ws, AD, gr, MA, z, bc, $r, ZI, jr, at, fs, _s, Gs, aC, nC, ms, Us, Fs, cC, sC, Js, Ys, Ts, lC, uC, Is, Kc, bs, ps, Ks, NC, wC, Bs, Hs, vs, qs, SC, hC, Ir, cI, sI, jI, Cs, ct, Vs, Zs, xs, fC, yC, zs, $s, js, kC, _C, es, Hc, os, gC, is, lt, as, g0, C0, I0, UC, FC, E0, e0, Q0, TC, JC, o0, n0, t0, bC, OC, Cr, po, Ko, r0, c0, s0, PC, pC, u0, R0, l0, vC, qC, Qr, or, WA, vA, xA, VA, tr, uI, DI, nr, RI, lI, N0, h0, d0, xC, VC, M0, f0, y0, zC, XC, _0, m0, k0, AB, $C, ar, NI, rr, hI, dI, wI, Dr, MI, SI, ur, fI, yI, lr, Ho, Po, Rr, _I, GI, dr, mI, kI, hr, UI, FI, Sr, JI, LI, pc, U0, J0, L0, CB, IB, ss, BC, rs, Nt, Y0, b0, O0, QB, EB, us, p0, H0, P0, oB, iB, Mr, YI, TI, Pc, v0, V0, W0, aB, nB, Rs, eC, ls, St, Z0, z0, X0, cB, sB, ds, $0, gc, Ac, lB, uB, Gr, bI, OI, Cc, Ec, Bc, NB, wB, ec, oc, ic, SB, hB, mr, XA, ZA, nc, rc, ac, fB, yB, cc, uc, Dc, kB, _B, Lr, jA, zA, Jr, DA, cA, Tr, rg, ag, Yr, pI, KI, Or, vo, qo, br, HI, PI, Rc, Nc, wc, UB, FB, hc, Mc, Sc, TB, JB, Kr, Vo, Wo, pr, Zo, xo, Pr, zo, Xo, fc, _c, Gc, bB, OB, mc, Uc, Fc, PB, pB, Jc, Yc, Tc, vB, qB, Ms, qr, gt, At, Hr, vr, Ct, It, $o, jo, Wr, Et, Bt, Vr, et, Qt, xr, ot, it, Zr, vI, qI, Xr, VI, WI, zr, nt, tt, xc, er, hs, Ss, Er, ir, cr, Nr, fr, kr, Ur, ys, gD, sr, wr, yr, ks, Ls, Os, Ps, Ws, Xs, A0, B0, i0, a0, D0, w0, S0, G0, F0, T0, K0, q0, x0, j0, Ic, Qc, tc, sc, lc, dc, yc, kc, Lc, Oc, _r, Fr, QD, yD, iD, CD, tD, nD, eD, rD, sD, ED, GD, kD; let __tla = (async () => { var ZB = 1, XB = 2, zB = 3, jB = 4, $B = 5, AE = 6, gE = 7, IE = 8, CE = 9, BE = 10, EE = -32700, QE = -32603, eE = -32602, iE = -32601, oE = -32600, tE = -32019, nE = -32018, aE = -32017, rE = -32016, sE = -32015, cE = -32014, DE = -32013, uE = -32012, lE = -32011, RE = -32010, wE = -32009, NE = -32008, dE = -32007, hE = -32006, SE = -32005, ME = -32004, yE = -32003, fE = -32002, GE = -32001, fg = 28e5, Gg = 2800001, _E = 2800002, kE = 2800003, mE = 2800004, FE = 2800005, _g = 2800006, kg = 2800007, Cg = 2800008, mg = 2800009, UE = 2800010, LE = 2800011, Fg = 323e4, Ug = 32300001, Lg = 3230002, JE = 3230003, TE = 3230004, Jg = 361e4, Tg = 3610001, YE = 3610002, OE = 3610003, bE = 3610004, KE = 3610005, pE = 3610006, PE = 3610007, HE = 3611e3, qE = 3704e3, vE = 3704001, WE = 3704002, VE = 3704003, xE = 3704004, ZE = 4128e3, XE = 4128001, zE = 4128002, jE = 4615e3, $E = 4615001, AQ = 4615002, gQ = 4615003, IQ = 4615004, CQ = 4615005, BQ = 4615006, EQ = 4615007, QQ = 4615008, eQ = 4615009, iQ = 4615010, oQ = 4615011, tQ = 4615012, nQ = 4615013, aQ = 4615014, rQ = 4615015, sQ = 4615016, cQ = 4615017, DQ = 4615018, uQ = 4615019, lQ = 4615020, RQ = 4615021, wQ = 4615022, NQ = 4615023, dQ = 4615024, hQ = 4615025, Yg = 4615026, SQ = 4615027, MQ = 4615028, yQ = 4615029, fQ = 4615030, GQ = 4615031, _Q = 4615032, kQ = 4615033, mQ = 4615034, FQ = 4615035, UQ = 4615036, LQ = 4615037, JQ = 4615038, TQ = 4615039, YQ = 4615040, OQ = 4615041, bQ = 4615042, KQ = 4615043, pQ = 4615044, PQ = 4615045, HQ = 4615046, qQ = 4615047, vQ = 4615048, WQ = 4615049, VQ = 4615050, xQ = 4615051, ZQ = 4615052, XQ = 4615053, zQ = 4615054, jQ = 5508e3, $Q = 5508001, Ae = 5508002, ge = 5508003, Ie = 5508004, Ce = 5508005, Be = 5508006, Ee = 5508007, Qe = 5508008, ee = 5508009, ie = 5508010, oe = 5508011, te = 5663e3, ne = 5663001, ae = 5663002, re = 5663003, se = 5663004, ce = 5663005, De = 5663006, ue = 5663007, le = 5663008, Re = 5663009, we = 5663010, Ne = 5663011, de = 5663012, he = 5663013, Se = 5663014, Me = 5663015, ye = 5663016, fe = 5663017, Ge = 5663018, _e = 5663019, ke = 5663020, me = 705e4, Fe = 7050001, Ue = 7050002, Le = 7050003, Je = 7050004, Te = 7050005, Ye = 7050006, Oe = 7050007, be = 7050008, Ke = 7050009, pe = 7050010, Pe = 7050011, He = 7050012, qe = 7050013, ve = 7050014, We = 7050015, Ve = 7050016, xe = 7050017, Ze = 7050018, Xe = 7050019, ze = 7050020, je = 7050021, $e = 7050022, Ai = 7050023, gi = 7050024, Ii = 7050025, Ci = 7050026, Bi = 7050027, Ei = 7050028, Qi = 7050029, ei = 7050030, ii = 7050031, oi = 7050032, ti = 7050033, ni = 7050034, ai = 7050035, ri = 7050036, si = 7618e3, ci = 7618001, Di = 7618002, ui = 7618003, Og = 8078e3, bg = 8078001, Kg = 8078002, li = 8078003, pg = 8078004, Pg = 8078005, Hg = 8078006, qg = 8078007, vg = 8078008, Wg = 8078009, Vg = 8078010, xg = 8078011, pA = 8078012, Ri = 8078013, wi = 8078014, Ni = 8078015, di = 8078016, Zg = 8078017, Xg = 8078018, hi = 8078019, Si = 8078020, Mi = 8078021, Bg = 8078022, yi = 81e5, fi = 8100001, Gi = 8100002, _i = 8100003, ki = 819e4, mi = 8190001, Fi = 8190002, Ui = 8190003, Li = 8190004, Ji = 99e5, Ti = 9900001, Yi = 9900002, Oi = 9900003, bi = 9900004, Ki = 9900005, pi = 9900006; function zg(A) { return Array.isArray(A) ? "%5B" + A.map(zg).join("%2C%20") + "%5D" : typeof A == "bigint" ? `${A}n` : encodeURIComponent(String(A != null && Object.getPrototypeOf(A) === null ? { ...A } : A)); } function Pi([A, I]) { return `${A}=${zg(I)}`; } function Hi(A) { const I = Object.entries(A).map(Pi).join("&"); return btoa(I); } var qi = { [Fg]: "Account not found at address: $address", [TE]: "Not all accounts were decoded. Encoded accounts found at addresses: $addresses.", [JE]: "Expected decoded account at address: $address", [Lg]: "Failed to decode account data at address: $address", [Ug]: "Accounts not found at addresses: $addresses", [mg]: "Unable to find a viable program address bump seed.", [_E]: "$putativeAddress is not a base58-encoded address.", [fg]: "Expected base58 encoded address to decode to a byte array of length 32. Actual length: $actualLength.", [kE]: "The `CryptoKey` must be an `Ed25519` public key.", [LE]: "$putativeOffCurveAddress is not a base58-encoded off-curve address.", [Cg]: "Invalid seeds; point must fall off the Ed25519 curve.", [mE]: "Expected given program derived address to have the following format: [Address, ProgramDerivedAddressBump].", [_g]: "A maximum of $maxSeeds seeds, including the bump seed, may be supplied when creating an address. Received: $actual.", [kg]: "The seed at index $index with length $actual exceeds the maximum length of $maxSeedLength bytes.", [FE]: "Expected program derived address bump to be in the range [0, 255], got: $bump.", [UE]: "Program address cannot end with PDA marker.", [Gg]: "Expected base58-encoded address string of length in the range [32, 44]. Actual length: $actualLength.", [jB]: "Expected base58-encoded blockash string of length in the range [32, 44]. Actual length: $actualLength.", [ZB]: "The network has progressed past the last block for which this transaction could have been committed.", [Og]: "Codec [$codecDescription] cannot decode empty byte arrays.", [Bg]: "Enum codec cannot use lexical values [$stringValues] as discriminators. Either remove all lexical values or set `useValuesAsDiscriminators` to `false`.", [Si]: "Sentinel [$hexSentinel] must not be present in encoded bytes [$hexEncodedBytes].", [Pg]: "Encoder and decoder must have the same fixed size, got [$encoderFixedSize] and [$decoderFixedSize].", [Hg]: "Encoder and decoder must have the same max size, got [$encoderMaxSize] and [$decoderMaxSize].", [pg]: "Encoder and decoder must either both be fixed-size or variable-size.", [vg]: "Enum discriminator out of range. Expected a number in [$formattedValidDiscriminators], got $discriminator.", [Kg]: "Expected a fixed-size codec, got a variable-size one.", [Ri]: "Codec [$codecDescription] expected a positive byte length, got $bytesLength.", [li]: "Expected a variable-size codec, got a fixed-size one.", [hi]: "Codec [$codecDescription] expected zero-value [$hexZeroValue] to have the same size as the provided fixed-size item [$expectedSize bytes].", [bg]: "Codec [$codecDescription] expected $expected bytes, got $bytesLength.", [Xg]: "Expected byte array constant [$hexConstant] to be present in data [$hexData] at offset [$offset].", [Wg]: "Invalid discriminated union variant. Expected one of [$variants], got $value.", [Vg]: "Invalid enum variant. Expected one of [$stringValues] or a number in [$formattedNumericalValues], got $variant.", [Ni]: "Invalid literal union variant. Expected one of [$variants], got $value.", [qg]: "Expected [$codecDescription] to have $expected items, got $actual.", [pA]: "Invalid value $value for base $base with alphabet $alphabet.", [di]: "Literal union discriminator out of range. Expected a number between $minRange and $maxRange, got $discriminator.", [xg]: "Codec [$codecDescription] expected number to be in the range [$min, $max], got $value.", [wi]: "Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.", [Mi]: "Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].", [Zg]: "Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.", [HE]: "No random values implementation could be found.", [eQ]: "instruction requires an uninitialized account", [NQ]: "instruction tries to borrow reference for an account which is already borrowed", [dQ]: "instruction left account with an outstanding borrowed reference", [RQ]: "program other than the account's owner changed the size of the account data", [CQ]: "account data too small for instruction", [wQ]: "instruction expected an executable account", [HQ]: "An account does not have enough lamports to be rent-exempt", [vQ]: "Program arithmetic overflowed", [PQ]: "Failed to serialize or deserialize account data: $encodedData", [zQ]: "Builtin programs must consume compute units", [_Q]: "Cross-program invocation call depth too deep", [JQ]: "Computational budget exceeded", [Yg]: "custom program error: #$code", [cQ]: "instruction contains duplicate accounts", [hQ]: "instruction modifications of multiply-passed account differ", [fQ]: "executable accounts must be rent exempt", [MQ]: "instruction changed executable accounts data", [yQ]: "instruction changed the balance of an executable account", [DQ]: "instruction changed executable bit of an account", [aQ]: "instruction modified data of an account it does not own", [nQ]: "instruction spent from the balance of an account it does not own", [$E]: "generic instruction error", [VQ]: "Provided owner is not allowed", [KQ]: "Account is immutable", [pQ]: "Incorrect authority provided", [EQ]: "incorrect program id for instruction", [BQ]: "insufficient funds for instruction", [IQ]: "invalid account data for instruction", [qQ]: "Invalid account owner", [AQ]: "invalid program argument", [SQ]: "program returned invalid error code", [gQ]: "invalid instruction data", [LQ]: "Failed to reallocate account data", [UQ]: "Provided seeds do not result in a valid address", [xQ]: "Accounts data allocations exceeded the maximum allowed per transaction", [ZQ]: "Max accounts exceeded", [XQ]: "Max instruction trace length exceeded", [FQ]: "Length of the seed is too long for address generation", [kQ]: "An account required by the instruction is missing", [QQ]: "missing required signature for instruction", [tQ]: "instruction illegally modified the program id of an account", [lQ]: "insufficient account keys for instruction", [TQ]: "Cross-program invocation with unauthorized signer or writable account", [YQ]: "Failed to create program execution environment", [bQ]: "Program failed to compile", [OQ]: "Program failed to complete", [sQ]: "instruction modified data of a read-only account", [rQ]: "instruction changed the balance of a read-only account", [mQ]: "Cross-program invocation reentrancy not allowed for this instruction", [uQ]: "instruction modified rent epoch of an account", [oQ]: "sum of account balances before and after instruction do not match", [iQ]: "instruction requires an initialized account", [jE]: "", [GQ]: "Unsupported program id", [WQ]: "Unsupported sysvar", [Ki]: "Invalid instruction plan kind: $kind.", [Di]: "The provided instruction plan is empty.", [ui]: "The provided transaction plan failed to execute. See the `transactionPlanResult` attribute and the `cause` error for more details.", [si]: "The provided message has insufficient capacity to accommodate the next instruction(s) in this plan. Expected at least $numBytesRequired free byte(s), got $numFreeBytes byte(s).", [pi]: "Invalid transaction plan kind: $kind.", [ci]: "No more instructions to pack; the message packer has completed the instruction plan.", [ZE]: "The instruction does not have any accounts.", [XE]: "The instruction does not have any data.", [zE]: "Expected instruction to have progress address $expectedProgramAddress, got $actualProgramAddress.", [$B]: "Expected base58 encoded blockhash to decode to a byte array of length 32. Actual length: $actualLength.", [XB]: "The nonce `$expectedNonceValue` is no longer valid. It has advanced to `$actualNonceValue`", [Yi]: "Invariant violation: Found no abortable iterable cache entry for key `$cacheKey`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant", [bi]: "Invariant violation: This data publisher does not publish to the channel named `$channelName`. Supported channels include $supportedChannelNames.", [Ti]: "Invariant violation: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant", [Ji]: "Invariant violation: WebSocket message iterator is missing state storage. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant", [Oi]: "Invariant violation: Switch statement non-exhaustive. Received unexpected value `$unexpectedValue`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant", [QE]: "JSON-RPC error: Internal JSON-RPC error ($__serverMessage)", [eE]: "JSON-RPC error: Invalid method parameter(s) ($__serverMessage)", [oE]: "JSON-RPC error: The JSON sent is not a valid `Request` object ($__serverMessage)", [iE]: "JSON-RPC error: The method does not exist / is not available ($__serverMessage)", [EE]: "JSON-RPC error: An error occurred on the server while parsing the JSON text ($__serverMessage)", [uE]: "$__serverMessage", [GE]: "$__serverMessage", [ME]: "$__serverMessage", [cE]: "$__serverMessage", [aE]: "Epoch rewards period still active at slot $slot", [RE]: "$__serverMessage", [wE]: "$__serverMessage", [tE]: "Failed to query long-term storage; please try again", [rE]: "Minimum context slot has not been reached", [SE]: "Node is unhealthy; behind by $numSlotsBehind slots", [NE]: "No snapshot", [fE]: "Transaction simulation failed", [nE]: "Rewards cannot be found because slot $slot is not the epoch boundary. This may be due to gap in the queried node's local ledger or long-term storage", [dE]: "$__serverMessage", [lE]: "Transaction history is not available from this node", [hE]: "$__serverMessage", [DE]: "Transaction signature length mismatch", [yE]: "Transaction signature verification failure", [sE]: "$__serverMessage", [qE]: "Key pair bytes must be of length 64, got $byteLength.", [vE]: "Expected private key bytes with length 32. Actual length: $actualLength.", [WE]: "Expected base58-encoded signature to decode to a byte array of length 64. Actual length: $actualLength.", [xE]: "The provided private key does not match the provided public key.", [VE]: "Expected base58-encoded signature string of length in the range [64, 88]. Actual length: $actualLength.", [AE]: "Lamports value must be in the range [0, 2e64-1]", [gE]: "`$value` cannot be parsed as a `BigInt`", [BE]: "$message", [IE]: "`$value` cannot be parsed as a `Number`", [zB]: "No nonce account could be found at address `$nonceAccountAddress`", [ki]: "The notification name must end in 'Notifications' and the API must supply a subscription plan creator function for the notification '$notificationName'.", [Fi]: "WebSocket was closed before payload could be added to the send buffer", [Ui]: "WebSocket connection closed", [Li]: "WebSocket failed to connect", [mi]: "Failed to obtain a subscription id from the server", [_i]: "Could not find an API plan for RPC method: `$method`", [yi]: "The $argumentLabel argument to the `$methodName` RPC method$optionalPathLabel was `$value`. This number is unsafe for use with the Solana JSON-RPC because it exceeds `Number.MAX_SAFE_INTEGER`.", [Gi]: "HTTP error ($statusCode): $message", [fi]: "HTTP header(s) forbidden: $headers. Learn more at https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name.", [jQ]: "Multiple distinct signers were identified for address `$address`. Please ensure that you are using the same signer instance for each address.", [$Q]: "The provided value does not implement the `KeyPairSigner` interface", [ge]: "The provided value does not implement the `MessageModifyingSigner` interface", [Ie]: "The provided value does not implement the `MessagePartialSigner` interface", [Ae]: "The provided value does not implement any of the `MessageSigner` interfaces", [Be]: "The provided value does not implement the `TransactionModifyingSigner` interface", [Ee]: "The provided value does not implement the `TransactionPartialSigner` interface", [Qe]: "The provided value does not implement the `TransactionSendingSigner` interface", [Ce]: "The provided value does not implement any of the `TransactionSigner` interfaces", [ee]: "More than one `TransactionSendingSigner` was identified.", [ie]: "No `TransactionSendingSigner` was identified. Please provide a valid `TransactionWithSingleSendingSigner` transaction.", [oe]: "Wallet account signers do not support signing multiple messages/transactions in a single operation", [PE]: "Cannot export a non-extractable key.", [Tg]: "No digest implementation could be found.", [Jg]: "Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts.", [YE]: `This runtime does not support the generation of Ed25519 key pairs. Install @solana/webcrypto-ed25519-polyfill and call its \`install\` function before generating keys in environments that do not support Ed25519. For a list of runtimes that currently support Ed25519 operations, visit https://github.com/WICG/webcrypto-secure-curves/issues/20.`, [OE]: "No signature verification implementation could be found.", [bE]: "No key generation implementation could be found.", [KE]: "No signing implementation could be found.", [pE]: "No key export implementation could be found.", [CE]: "Timestamp value must be in the range [-(2n ** 63n), (2n ** 63n) - 1]. `$value` given", [Ve]: "Transaction processing left an account with an outstanding borrowed reference", [Fe]: "Account in use", [Ue]: "Account loaded twice", [Le]: "Attempt to debit an account but found no record of a prior credit.", [Ai]: "Transaction loads an address table account that doesn't exist", [Oe]: "This transaction has already been processed", [be]: "Blockhash not found", [Ke]: "Loader call chain is too deep", [We]: "Transactions are currently disabled due to cluster maintenance", [ei]: "Transaction contains a duplicate instruction ($index) that is not allowed", [Te]: "Insufficient funds for fee", [ii]: "Transaction results in an account ($accountIndex) with insufficient funds for rent", [Ye]: "This account may not be used to pay transaction fees", [Pe]: "Transaction contains an invalid account reference", [Ii]: "Transaction loads an address table account with invalid data", [Ci]: "Transaction address table lookup uses an invalid index", [gi]: "Transaction loads an address table account with an invalid owner", [ti]: "LoadedAccountsDataSizeLimit set for transaction must be greater than 0.", [qe]: "This program may not be used for executing instructions", [Bi]: "Transaction leaves an account with a lower balance than rent-exempt minimum", [Xe]: "Transaction loads a writable account that cannot be written", [oi]: "Transaction exceeded max loaded accounts data size cap", [pe]: "Transaction requires a fee but has no signature present", [Je]: "Attempt to load a program that does not exist", [ai]: "Execution of the program referenced by account at index $accountIndex is temporarily restricted.", [ni]: "ResanitizationNeeded", [ve]: "Transaction failed to sanitize accounts offsets correctly", [He]: "Transaction did not pass signature verification", [$e]: "Transaction locked too many accounts", [ri]: "Sum of account balances before and after transaction do not match", [me]: "The transaction failed with the error `$errorName`", [Ze]: "Transaction version is unsupported", [je]: "Transaction would exceed account data limit within the block", [Qi]: "Transaction would exceed total account data limit", [ze]: "Transaction would exceed max account limit within the block", [xe]: "Transaction would exceed max Block Cost Limit", [Ei]: "Transaction would exceed max Vote Cost Limit", [Me]: "Attempted to sign a transaction with an address that is not a signer for it", [we]: "Transaction is missing an address at index: $index.", [ye]: "Transaction has no expected signers therefore it cannot be encoded", [ke]: "Transaction size $transactionSize exceeds limit of $transactionSizeLimit bytes", [ae]: "Transaction does not have a blockhash lifetime", [re]: "Transaction is not a durable nonce transaction", [ce]: "Contents of these address lookup tables unknown: $lookupTableAddresses", [De]: "Lookup of address at index $highestRequestedIndex failed for lookup table `$lookupTableAddress`. Highest known index is $highestKnownIndex. The lookup table may have been extended since its contents were retrieved", [le]: "No fee payer set in CompiledTransaction", [ue]: "Could not find program address at index $index", [Ge]: "Failed to estimate the compute unit consumption for this transaction message. This is likely because simulating the transaction failed. Inspect the `cause` property of this error to learn more", [_e]: "Transaction failed when it was simulated in order to estimate the compute unit consumption. The compute unit estimate provided is for a transaction that failed when simulated and may not be representative of the compute units this transaction would consume if successful. Inspect the `cause` property of this error to learn more", [Ne]: "Transaction is missing a fee payer.", [de]: "Could not determine this transaction's signature. Make sure that the transaction has been signed by its fee payer.", [Se]: "Transaction first instruction is not advance nonce account instruction.", [he]: "Transaction with no instructions cannot be durable nonce transaction.", [te]: "This transaction includes an address (`$programAddress`) which is both invoked and set as the fee payer. Program addresses may not pay fees", [ne]: "This transaction includes an address (`$programAddress`) which is both invoked and marked writable. Program addresses may not be writable", [fe]: "The transaction message expected the transaction to have $signerAddressesLength signatures, got $signaturesLength.", [Re]: "Transaction is missing signatures for addresses: $addresses.", [se]: "Transaction version must be in the range [0, 127]. `$actualVersion` given" }, oA = "i", BA = "t"; function vi(A, I = {}) { const g = qi[A]; if (g.length === 0) return ""; let B; function C(Q) { if (B[BA] === 2) { const i = g.slice(B[oA] + 1, Q); E.push(i in I ? `${I[i]}` : `$${i}`); } else B[BA] === 1 && E.push(g.slice(B[oA], Q)); } const E = []; return g.split("").forEach((Q, i) => { if (i === 0) { B = { [oA]: 0, [BA]: g[0] === "\\" ? 0 : g[0] === "$" ? 2 : 1 }; return; } let n; switch (B[BA]) { case 0: n = { [oA]: i, [BA]: 1 }; break; case 1: Q === "\\" ? n = { [oA]: i, [BA]: 0 } : Q === "$" && (n = { [oA]: i, [BA]: 2 }); break; case 2: Q === "\\" ? n = { [oA]: i, [BA]: 0 } : Q === "$" ? n = { [oA]: i, [BA]: 2 } : Q.match(/\w/) || (n = { [oA]: i, [BA]: 1 }); break; } n && (B !== n && C(i), B = n); }), C(), E.join(""); } function Wi(A, I = {}) { if (process.env.NODE_ENV !== "production") return vi(A, I); { let g = `Solana error #${A}; Decode this error by running \`npx @solana/errors decode -- ${A}`; return Object.keys(I).length && (g += ` '${Hi(I)}'`), `${g}\``; } } function jg(A, I) { return A instanceof Error && A.name === "SolanaError" ? I !== void 0 ? A.context.__code === I : true : false; } var J = class extends Error { constructor(...[A, I]) { let g, B; I && Object.entries(Object.getOwnPropertyDescriptors(I)).forEach(([E, Q]) => { E === "cause" ? B = { cause: Q.value } : (g === void 0 && (g = {}), Object.defineProperty(g, E, Q)); }); const C = Wi(A, g); super(C, B); __publicField(this, "cause", this.cause); __publicField(this, "context"); this.context = g === void 0 ? {} : g, this.context.__code = A, this.name = "SolanaError"; } }; function Vi(A, I) { if (A.length >= I) return A; const g = new Uint8Array(I).fill(0); return g.set(A), g; } var xi = (A, I) => Vi(A.length <= I ? A : A.slice(0, I), I); function h(A, I, g) { const B = g === 0 && A.length === I.length ? A : A.slice(g, g + I.length); return B.length !== I.length ? false : I.every((C, E) => C === B[E]); } function nA(A, I) { return "fixedSize" in I ? I.fixedSize : I.getSizeFromValue(A); } function j(A) { return Object.freeze({ ...A, encode: (I) => { const g = new Uint8Array(nA(I, A)); return A.write(I, g, 0), g; } }); } function $(A) { return Object.freeze({ ...A, decode: (I, g = 0) => A.read(I, g)[0] }); } function v(A) { return "fixedSize" in A && typeof A.fixedSize == "number"; } function $g(A) { if (!v(A)) throw new J(Kg); } function Zi(A) { return !v(A); } function c(A, I) { if (v(A) !== v(I)) throw new J(pg); if (v(A) && v(I) && A.fixedSize !== I.fixedSize) throw new J(Pg, { decoderFixedSize: I.fixedSize, encoderFixedSize: A.fixedSize }); if (!v(A) && !v(I) && A.maxSize !== I.maxSize) throw new J(Hg, { decoderMaxSize: I.maxSize, encoderMaxSize: A.maxSize }); return { ...I, ...A, decode: I.decode, encode: A.encode, read: I.read, write: A.write }; } function Xi(A, I, g = 0) { if (I.length - g <= 0) throw new J(Og, { codecDescription: A }); } function Eg(A, I, g, B = 0) { const C = g.length - B; if (C < I) throw new J(bg, { bytesLength: C, codecDescription: A, expected: I }); } function W(A, I) { const g = (Q, i, n) => { const M = A.encode(Q); return n = I.write(M.length, i, n), i.set(M, n), n + M.length; }; if (v(I) && v(A)) return j({ ...A, fixedSize: I.fixedSize + A.fixedSize, write: g }); const B = v(I) ? I.fixedSize : I.maxSize ?? null, C = v(A) ? A.fixedSize : A.maxSize ?? null, E = B !== null && C !== null ? B + C : null; return j({ ...A, ...E !== null ? { maxSize: E } : {}, getSizeFromValue: (Q) => { const i = nA(Q, A); return nA(i, I) + i; }, write: g }); } function V(A, I) { const g = (Q, i) => { const [n, M] = I.read(Q, i), x = Number(n); return i = M, (i > 0 || Q.length > x) && (Q = Q.slice(i, i + x)), Eg("addDecoderSizePrefix", x, Q), [ A.decode(Q), i + x ]; }; if (v(I) && v(A)) return $({ ...A, fixedSize: I.fixedSize + A.fixedSize, read: g }); const B = v(I) ? I.fixedSize : I.maxSize ?? null, C = v(A) ? A.fixedSize : A.maxSize ?? null, E = B !== null && C !== null ? B + C : null; return $({ ...A, ...E !== null ? { maxSize: E } : {}, read: g }); } function y(A, I) { return j({ fixedSize: I, write: (g, B, C) => { const E = A.encode(g), Q = E.length > I ? E.slice(0, I) : E; return B.set(Q, C), C + I; } }); } function f(A, I) { return $({ fixedSize: I, read: (g, B) => { Eg("fixCodecSize", I, g, B), (B > 0 || g.length > I) && (g = g.slice(B, B + I)), v(A) && (g = xi(g, A.fixedSize)); const [C] = A.read(g, 0); return [ C, B + I ]; } }); } function d(A, I) { return j({ ...Zi(A) ? { ...A, getSizeFromValue: (g) => A.getSizeFromValue(I(g)) } : A, write: (g, B, C) => A.write(I(g), B, C) }); } function hA(A, I) { return $({ ...A, read: (g, B) => { const [C, E] = A.read(g, B); return [ I(C, g, B), E ]; } }); } function zi(A, I, g = I) { if (!I.match(new RegExp(`^[${A}]*$`))) throw new J(pA, { alphabet: A, base: A.length, value: g }); } var ji = (A) => j({ getSizeFromValue: (I) => { const [g, B] = ug(I, A[0]); if (!B) return I.length; const C = lg(B, A); return g.length + Math.ceil(C.toString(16).length / 2); }, write(I, g, B) { if (zi(A, I), I === "") return B; const [C, E] = ug(I, A[0]); if (!E) return g.set(new Uint8Array(C.length).fill(0), B), B + C.length; let Q = lg(E, A); const i = []; for (; Q > 0n; ) i.unshift(Number(Q % 256n)), Q /= 256n; const n = [ ...Array(C.length).fill(0), ...i ]; return g.set(n, B), B + n.length; } }), $i = (A) => $({ read(I, g) { const B = g === 0 ? I : I.slice(g); if (B.length === 0) return [ "", 0 ]; let C = B.findIndex((n) => n !== 0); C = C === -1 ? B.length : C; const E = A[0].repeat(C); if (C === B.length) return [ E, I.length ]; const Q = B.slice(C).reduce((n, M) => n * 256n + BigInt(M), 0n), i = Ao(Q, A); return [ E + i, I.length ]; } }); function ug(A, I) { const [g, B] = A.split(new RegExp(`((?!${I}).*)`)); return [ g, B ]; } function lg(A, I) { const g = BigInt(I.length); let B = 0n; for (const C of A) B *= g, B += BigInt(I.indexOf(C)); return B; } function Ao(A, I) { const g = BigInt(I.length), B = []; for (; A > 0n; ) B.unshift(I[Number(A % g)]), A /= g; return B.join(""); } var AI = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", go = () => ji(AI), Io = () => $i(AI), Rg = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Co = () => j({ getSizeFromValue: (A) => { try { return atob(A).length; } catch { throw new J(pA, { alphabet: Rg, base: 64, value: A }); } }, write(A, I, g) { try { const B = atob(A).split("").map((C) => C.charCodeAt(0)); return I.set(B, g), B.length + g; } catch { throw new J(pA, { alphabet: Rg, base: 64, value: A }); } } }), Bo = (A) => A.replace(/\u0000/g, ""), Eo = globalThis.TextDecoder, wg = globalThis.TextEncoder, Z = () => { let A; return j({ getSizeFromValue: (I) => (A || (A = new wg())).encode(I).length, write: (I, g, B) => { const C = (A || (A = new wg())).encode(I); return g.set(C, B), B + C.length; } }); }, X = () => { let A; return $({ read(I, g) { const B = (A || (A = new Eo())).decode(I.slice(g)); return [ Bo(B), I.length ]; } }); }; function GA(A, I) { try { return "exists" in A && !A.exists ? A : Object.freeze({ ...A, data: I.decode(A.data) }); } catch { throw new J(Lg, { address: A.address }); } } function gI(A, I) { if (!I) return Object.freeze({ address: A, exists: false }); const g = Co().encode(I.data[0]); return Object.freeze({ ...Qo(I), address: A, data: g, exists: true }); } function Qo(A) { return Object.freeze({ executable: A.executable, lamports: A.lamports, programAddress: A.owner, space: A.space }); } async function _A(A, I, g = {}) { const { abortSignal: B, ...C } = g, E = await A.getAccountInfo(I, { ...C, encoding: "base64" }).send({ abortSignal: B }); return gI(I, E.value); } async function kA(A, I, g = {}) { const { abortSignal: B, ...C } = g; return (await A.getMultipleAccounts(I, { ...C, encoding: "base64" }).send({ abortSignal: B })).value.map((Q, i) => gI(I[i], Q)); } function mA(A) { if (!A.exists) throw new J(Fg, { address: A.address }); } function FA(A) { const I = A.filter((g) => !g.exists); if (I.length > 0) { const g = I.map((B) => B.address); throw new J(Ug, { addresses: g }); } } function eo() { if (!globalThis.isSecureContext) throw new J(Jg); } function io() { var _a2; if (eo(), typeof globalThis.crypto > "u" || typeof ((_a2 = globalThis.crypto.subtle) == null ? void 0 : _a2.digest) != "function") throw new J(Tg); } var $A, Ag; function II() { return $A || ($A = go()), $A; } function oo() { return Ag || (Ag = Io()), Ag; } function to(A) { if (A.length < 32 || A.length > 44) throw new J(Gg, { actualLength: A.length }); const B = II().encode(A).byteLength; if (B !== 32) throw new J(fg, { actualLength: B }); } function no(A) { return to(A), A; } function s() { return d(y(II(), 32), (A) => no(A)); } function D() { return f(oo(), 32); } function ao() { return c(s(), D()); } var ro = 37095705934669439343138083508754565189542113879843219016388785533085940283555n, AA = 57896044618658097711785492504343953926634992332820282019728792003956564819949n, Ng = 19681161376707505956807079304988542015446066515923890162744021073123829784752n; function CA(A) { const I = A % AA; return I >= 0n ? I : AA + I; } function EA(A, I) { let g = A; for (; I-- > 0n; ) g *= g, g %= AA; return g; } function so(A) { const g = A * A % AA * A % AA, B = EA(g, 2n) * g % AA, C = EA(B, 1n) * A % AA, E = EA(C, 5n) * C % AA, Q = EA(E, 10n) * E % AA, i = EA(Q, 20n) * Q % AA, n = EA(i, 40n) * i % AA, M = EA(n, 80n) * n % AA, x = EA(M, 80n) * n % AA, IA = EA(x, 10n) * E % AA; return EA(IA, 2n) * A % AA; } function co(A, I) { const g = CA(I * I * I), B = CA(g * g * I), C = so(A * B); let E = CA(A * g * C); const Q = CA(I * E * E), i = E, n = CA(E * Ng), M = Q === A, x = Q === CA(-A), IA = Q === CA(-A * Ng); return M && (E = i), (x || IA) && (E = n), (CA(E) & 1n) === 1n && (E = CA(-E)), !M && !x ? null : E; } function Do(A, I) { const g = CA(A * A), B = CA(g - 1n), C = CA(ro * g + 1n), E = co(B, C); if (E === null) return false; const Q = (I & 128) !== 0; return !(E === 0n && Q); } function uo(A) { const I = A.toString(16); return I.length === 1 ? `0${I}` : I; } function lo(A) { const g = `0x${A.reduce((B, C, E) => `${uo(E === 31 ? C & -129 : C)}${B}`, "")}`; return BigInt(g); } function Ro(A) { if (A.byteLength !== 32) return false; const I = lo(A); return Do(I, A[31]); } var dg = 32, hg = 16, wo = [ 80, 114, 111, 103, 114, 97, 109, 68, 101, 114, 105, 118, 101, 100, 65, 100, 100, 114, 101, 115, 115 ]; async function No({ programAddress: A, seeds: I }) { if (io(), I.length > hg) throw new J(_g, { actual: I.length, maxSeeds: hg }); let g; const B = I.reduce((n, M, x) => { const IA = typeof M == "string" ? (g || (g = new TextEncoder())).encode(M) : M; if (IA.byteLength > dg) throw new J(kg, { actual: IA.byteLength, index: x, maxSeedLength: dg }); return n.push(...IA), n; }, []), C = ao(), E = C.encode(A), Q = await crypto.subtle.digest("SHA-256", new Uint8Array([ ...B, ...E, ...wo ])), i = new Uint8Array(Q); if (Ro(i)) throw new J(Cg); return C.decode(i); } async function UA({ programAddress: A, seeds: I }) { let g = 255; for (; g > 0; ) try { return [ await No({ programAddress: A, seeds: [ ...I, new Uint8Array([ g ]) ] }), g ]; } catch (B) { if (jg(B, Cg)) g--; else throw B; } throw new J(mg); } function ho(A, I, g, B) { if (B < I || B > g) throw new J(xg, { codecDescription: A, max: g, min: I, value: B }); } function CI(A) { return (A == null ? void 0 : A.endian) !== 1; } function uA(A) { return j({ fixedSize: A.size, write(I, g, B) { A.range && ho(A.name, A.range[0], A.range[1], I); const C = new ArrayBuffer(A.size); return A.set(new DataView(C), I, CI(A.config)), g.set(new Uint8Array(C), B), B + A.size; } }); } function lA(A) { return $({ fixedSize: A.size, read(I, g = 0) { Xi(A.name, I, g), Eg(A.name, A.size, I, g); const B = new DataView(So(I, g, A.size)); return [ A.get(B, CI(A.config)), g + A.size ]; } }); } function So(A, I, g) { const B = A.byteOffset + (I ?? 0), C = g ?? A.byteLength; return A.buffer.slice(B, B + C); } var PA = (A = {}) => uA({ config: A, name: "i32", range: [ -+"0x7fffffff" - 1, +"0x7fffffff" ], set: (I, g, B) => I.setInt32(0, Number(g), B), size: 4 }), HA = (A = {}) => lA({ config: A, get: (I, g) => I.getInt32(0, g), name: "i32", size: 4 }), QA = (A = {}) => uA({ config: A, name: "i64", range: [ -BigInt("0x7fffffffffffffff") - 1n, BigInt("0x7fffffffffffffff") ], set: (I, g, B) => I.setBigInt64(0, BigInt(g), B), size: 8 }), eA = (A = {}) => lA({ config: A, get: (I, g) => I.getBigInt64(0, g), name: "i64", size: 8 }), U = (A = {}) => uA({ config: A, name: "u128", range: [ 0n, BigInt("0xffffffffffffffffffffffffffffffff") ], set: (I, g, B) => { const C = B ? 8 : 0, E = B ? 0 : 8, Q = 0xffffffffffffffffn; I.setBigUint64(C, BigInt(g) >> 64n, B), I.setBigUint64(E, BigInt(g) & Q, B); }, size: 16 }), L = (A = {}) => lA({ config: A, get: (I, g) => { const B = g ? 8 : 0, C = g ? 0 : 8, E = I.getBigUint64(B, g), Q = I.getBigUint64(C, g); return (E << 64n) + Q; }, name: "u128", size: 16 }), l = (A = {}) => uA({ config: A, name: "u16", range: [ 0, +"0xffff" ], set: (I, g, B) => I.setUint16(0, Number(g), B), size: 2 }), R = (A = {}) => lA({ config: A, get: (I, g) => I.getUint16(0, g), name: "u16", size: 2 }), T = (A = {}) => uA({ config: A, name: "u32", range: [ 0, +"0xffffffff" ], set: (I, g, B) => I.setUint32(0, Number(g), B), size: 4 }), Y = (A = {}) => lA({ config: A, get: (I, g) => I.getUint32(0, g), name: "u32", size: 4 }), a = (A = {}) => uA({ config: A, name: "u64", range: [ 0n, BigInt("0xffffffffffffffff") ], set: (I, g, B) => I.setBigUint64(0, BigInt(g), B), size: 8 }), r = (A = {}) => lA({ config: A, get: (I, g) => I.getBigUint64(0, g), name: "u64", size: 8 }), e = () => uA({ name: "u8", range: [ 0, +"0xff" ], set: (A, I) => A.setUint8(0, Number(I)), size: 1 }), N = () => lA({ get: (A) => A.getUint8(0), name: "u8", size: 1 }); function BI(A, I, g) { if (I !== g) throw new J(qg, { actual: g, codecDescription: A, expected: I }); } function Mo(A) { return A.reduce((I, g) => I === null || g === null ? null : Math.max(I, g), 0); } function aA(A) { return A.reduce((I, g) => I === null || g === null ? null : I + g, 0); } function SA(A) { return v(A) ? A.fixedSize : null; } function RA(A) { return v(A) ? A.fixedSize : A.maxSize ?? null; } function H(A, I = {}) { const g = I.size ?? T(), B = qA(g, SA(A)), C = qA(g, RA(A)) ?? void 0; return j({ ...B !== null ? { fixedSize: B } : { getSizeFromValue: (E) => (typeof g == "object" ? nA(E.length, g) : 0) + [ ...E ].reduce((i, n) => i + nA(n, A), 0), maxSize: C }, write: (E, Q, i) => (typeof g == "number" && BI("array", g, E.length), typeof g == "object" && (i = g.write(E.length, Q, i)), E.forEach((n) => { i = A.write(n, Q, i); }), i) }); } function q(A, I = {}) { const g = I.size ?? Y(), B = SA(A), C = qA(g, B), E = qA(g, RA(A)) ?? void 0; return $({ ...C !== null ? { fixedSize: C } : { maxSize: E }, read: (Q, i) => { const n = []; if (typeof g == "object" && Q.slice(i).length === 0) return [ n, i ]; if (g === "remainder") { for (; i < Q.length; ) { const [IA, LA] = A.read(Q, i); i = LA, n.push(IA); } return [ n, i ]; } const [M, x] = typeof g == "number" ? [ g, i ] : g.read(Q, i); i = x; for (let IA = 0; IA < M; IA += 1) { const [LA, xB] = A.read(Q, i); i = xB, n.push(LA); } return [ n, i ]; } }); } function qA(A, I) { return typeof A != "number" ? null : A === 0 ? 0 : I === null ? null : I * A; } function b(A = {}) { return d(A.size ?? e(), (I) => I ? 1 : 0); } function K(A = {}) { return hA(A.size ?? N(), (I) => Number(I) === 1); } function G() { return j({ getSizeFromValue: (A) => A.length, write: (A, I, g) => (I.set(A, g), g + A.length) }); } function _() { return $({ read: (A, I) => { const g = A.slice(I); return [ g, I + g.length ]; } }); } var yo = () => $({ read(A, I) { return [ A.slice(I).reduce((B, C) => B + C.toString(16).padStart(2, "0"), ""), A.length ]; } }); function fo(A) { return j({ fixedSize: A.length, write: (I, g, B) => (g.set(A, B), B + A.length) }); } function Go(A) { return $({ fixedSize: A.length, read: (I, g) => { const B = yo(); if (!h(I, A, g)) throw new J(Xg, { constant: A, data: I, hexConstant: B.decode(A), hexData: B.decode(I), offset: g }); return [ void 0, g + A.length ]; } }); } function p(A) { const I = aA(A.map(SA)), g = aA(A.map(RA)) ?? void 0; return j({ ...I === null ? { getSizeFromValue: (B) => A.map((C, E) => nA(B[E], C)).reduce((C, E) => C + E, 0), maxSize: g } : { fixedSize: I }, write: (B, C, E) => (BI("tuple", A.length, B.length), A.forEach((Q, i) => { E = Q.write(B[i], C, E); }), E) }); } function P(A) { const I = aA(A.map(SA)), g = aA(A.map(RA)) ?? void 0; return $({ ...I === null ? { maxSize: g } : { fixedSize: I }, read: (B, C) => { const E = []; return A.forEach((Q) => { const [i, n] = Q.read(B, C); E.push(i), C = n; }), [ E, C ]; } }); } function EI(A, I) { const g = eI(A), B = (E, Q, i) => { const n = I(E); return gg(A, n), A[n].write(E, Q, i); }; if (g !== null) return j({ fixedSize: g, write: B }); const C = iI(A); return j({ ...C !== null ? { maxSize: C } : {}, getSizeFromValue: (E) => { const Q = I(E); return gg(A, Q), nA(E, A[Q]); }, write: B }); } function QI(A, I) { const g = eI(A), B = (E, Q) => { const i = I(E, Q); return gg(A, i), A[i].read(E, Q); }; if (g !== null) return $({ fixedSize: g, read: B }); const C = iI(A); return $({ ...C !== null ? { maxSize: C } : {}, read: B }); } function gg(A, I) { if (typeof A[I] > "u") throw new J(Zg, { maxRange: A.length - 1, minRange: 0, variant: I }); } function eI(A) { if (A.length === 0) return 0; if (!v(A[0])) return null; const I = A[0].fixedSize; return A.every((B) => v(B) && B.fixedSize === I) ? I : null; } function iI(A) { return Mo(A.map((I) => RA(I))); } function wA(A, I = {}) { const g = I.discriminator ?? "__kind", B = I.size ?? e(); return EI(A.map(([, C], E) => d(p([ B, C ]), (Q) => [ E, Q ])), (C) => _o(A, C[g])); } function NA(A, I = {}) { const g = I.discriminator ?? "__kind", B = I.size ?? N(); return QI(A.map(([C, E]) => hA(P([ B, E ]), ([, Q]) => ({ [g]: C, ...Q }))), (C, E) => Number(B.read(C, E)[0])); } function _o(A, I) { const g = A.findIndex(([B]) => I === B); if (g < 0) throw new J(Wg, { value: I, variants: A.map(([B]) => B) }); return g; } function oI(A) { const I = [ ...new Set(Object.values(A).filter((Q) => typeof Q == "number")) ].sort(), g = Object.fromEntries(Object.entries(A).slice(I.length)), B = Object.keys(g), C = Object.values(g), E = [ .../* @__PURE__ */ new Set([ ...B, ...C.filter((Q) => typeof Q == "string") ]) ]; return { enumKeys: B, enumRecord: g, enumValues: C, numericalValues: I, stringValues: E }; } function ko({ enumKeys: A, enumValues: I, variant: g }) { const B = tI(I, (C) => C === g); return B >= 0 ? B : A.findIndex((C) => C === g); } function mo({ discriminator: A, enumKeys: I, enumValues: g, useValuesAsDiscriminators: B }) { return B ? tI(g, (C) => C === A) : A >= 0 && A < I.length ? A : -1; } function tI(A, I) { let g = A.length; for (; g--; ) if (I(A[g], g, A)) return g; return -1; } function nI(A) { if (A.length === 0) return ""; let I = [ A[0], A[0] ]; const g = []; for (let B = 1; B < A.length; B++) { const C = A[B]; I[1] + 1 === C ? I[1] = C : (g.push(I[0] === I[1] ? `${I[0]}` : `${I[0]}-${I[1]}`), I = [ C, C ]); } return g.push(I[0] === I[1] ? `${I[0]}` : `${I[0]}-${I[1]}`), g.join(", "); } function rA(A, I = {}) { const g = I.size ?? e(), B = I.useValuesAsDiscriminators ?? false, { enumKeys: C, enumValues: E, numericalValues: Q, stringValues: i } = oI(A); if (B && E.some((n) => typeof n == "string")) throw new J(Bg, { stringValues: E.filter((n) => typeof n == "string") }); return d(g, (n) => { const M = ko({ enumKeys: C, enumValues: E, variant: n }); if (M < 0) throw new J(Vg, { formattedNumericalValues: nI(Q), numericalValues: Q, stringValues: i, variant: n }); return B ? E[M] : M; }); } function sA(A, I =