@zama-fhe/relayer-sdk 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  (function(x,ft){typeof exports=="object"&&typeof module<"u"?ft(exports):typeof define=="function"&&define.amd?define(["exports"],ft):(x=typeof globalThis<"u"?globalThis:x||self,ft(x.relayerSDK={}))})(this,(function(x){"use strict";var lb=x=>{throw TypeError(x)};var pb=(x,ft,kt)=>ft.has(x)||lb("Cannot "+kt);var L=(x,ft,kt)=>(pb(x,ft,"read from private field"),kt?kt.call(x):ft.get(x)),zt=(x,ft,kt)=>ft.has(x)?lb("Cannot add the same private member more than once"):ft instanceof WeakSet?ft.add(x):ft.set(x,kt),le=(x,ft,kt,wa)=>(pb(x,ft,"write to private field"),wa?wa.call(x,kt):ft.set(x,kt),kt);var no,Fi,oo,ao,_a,aa,ca,xn,co,la,pa,fa,ha,R_,po,ua,P_,M_,E_;var ft=typeof document<"u"?document.currentScript:null;const kt=globalThis||void 0||self,wa="6.16.0";function fb(i,t,e){const r=t.split("|").map(_=>_.trim());for(let _=0;_<r.length;_++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof i===t)return}const s=new Error(`invalid value for type ${t}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${e}`,s.value=i,s}async function Vt(i){const t=Object.keys(i);return(await Promise.all(t.map(r=>Promise.resolve(i[r])))).reduce((r,s,_)=>(r[t[_]]=s,r),{})}function D(i,t,e){for(let r in t){let s=t[r];const _=e?e[r]:null;_&&fb(s,_,r),Object.defineProperty(i,r,{enumerable:!0,value:s,writable:!1})}}function z_(i,t){if(i==null)return"null";if(t==null&&(t=new Set),typeof i=="object"){if(t.has(i))return"[Circular]";t.add(i)}if(Array.isArray(i))return"[ "+i.map(e=>z_(e,t)).join(", ")+" ]";if(i instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let s=0;s<i.length;s++)r+=e[i[s]>>4],r+=e[i[s]&15];return r}if(typeof i=="object"&&typeof i.toJSON=="function")return z_(i.toJSON(),t);switch(typeof i){case"boolean":case"number":case"symbol":return i.toString();case"bigint":return BigInt(i).toString();case"string":return JSON.stringify(i);case"object":{const e=Object.keys(i);return e.sort(),"{ "+e.map(r=>`${z_(r,t)}: ${z_(i[r],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function vt(i,t){return i&&i.code===t}function xc(i){return vt(i,"CALL_EXCEPTION")}function gt(i,t,e){let r=i;{const _=[];if(e){if("message"in e||"code"in e||"name"in e)throw new Error(`value will overwrite populated values: ${z_(e)}`);for(const a in e){if(a==="shortMessage")continue;const c=e[a];_.push(a+"="+z_(c))}}_.push(`code=${t}`),_.push(`version=${wa}`),_.length&&(i+=" ("+_.join(", ")+")")}let s;switch(t){case"INVALID_ARGUMENT":s=new TypeError(i);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(i);break;default:s=new Error(i)}return D(s,{code:t}),e&&Object.assign(s,e),s.shortMessage==null&&D(s,{shortMessage:r}),s}function C(i,t,e,r){if(!i)throw gt(t,e,r)}function y(i,t,e,r){C(i,t,"INVALID_ARGUMENT",{argument:e,value:r})}function vp(i,t,e){e==null&&(e=""),e&&(e=": "+e),C(i>=t,"missing argument"+e,"MISSING_ARGUMENT",{count:i,expectedCount:t}),C(i<=t,"too many arguments"+e,"UNEXPECTED_ARGUMENT",{count:i,expectedCount:t})}["NFD","NFC","NFKD","NFKC"].reduce((i,t)=>{try{if("test".normalize(t)!=="test")throw new Error("bad");if(t==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");i.push(t)}catch{}return i},[]);function ga(i,t,e){if(e==null&&(e=""),i!==t){let r=e,s="new";e&&(r+=".",s+=" "+e),C(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function xp(i,t,e){if(i instanceof Uint8Array)return e?new Uint8Array(i):i;if(typeof i=="string"&&i.length%2===0&&i.match(/^0x[0-9a-f]*$/i)){const r=new Uint8Array((i.length-2)/2);let s=2;for(let _=0;_<r.length;_++)r[_]=parseInt(i.substring(s,s+2),16),s+=2;return r}y(!1,"invalid BytesLike value",t||"value",i)}function j(i,t){return xp(i,t,!1)}function Ft(i,t){return xp(i,t,!0)}function ht(i,t){return!(typeof i!="string"||!i.match(/^0x[0-9A-Fa-f]*$/)||typeof t=="number"&&i.length!==2+2*t||t===!0&&i.length%2!==0)}function Uc(i){return ht(i,!0)||i instanceof Uint8Array}const Up="0123456789abcdef";function K(i){const t=j(i);let e="0x";for(let r=0;r<t.length;r++){const s=t[r];e+=Up[(s&240)>>4]+Up[s&15]}return e}function ot(i){return"0x"+i.map(t=>K(t).substring(2)).join("")}function kn(i){return ht(i,!0)?(i.length-2)/2:j(i).length}function St(i,t,e){const r=j(i);return e!=null&&e>r.length&&C(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:e}),K(r.slice(t??0,e??r.length))}function Tp(i,t,e){const r=j(i);C(t>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:t,offset:t+1});const s=new Uint8Array(t);return s.fill(0),e?s.set(r,t-r.length):s.set(r,0),K(s)}function pe(i,t){return Tp(i,t,!0)}function Op(i,t){return Tp(i,t,!1)}const go=BigInt(0),qr=BigInt(1),I_=9007199254740991;function hb(i,t){const e=Aa(i,"value"),r=BigInt(W(t,"width"));if(C(e>>r===go,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:i}),e>>r-qr){const s=(qr<<r)-qr;return-((~e&s)+qr)}return e}function Tc(i,t){let e=O(i,"value");const r=BigInt(W(t,"width")),s=qr<<r-qr;if(e<go){e=-e,C(e<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:i});const _=(qr<<r)-qr;return(~e&_)+qr}else C(e<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:i});return e}function Ao(i,t){const e=Aa(i,"value"),r=BigInt(W(t,"bits"));return e&(qr<<r)-qr}function O(i,t){switch(typeof i){case"bigint":return i;case"number":return y(Number.isInteger(i),"underflow",t||"value",i),y(i>=-I_&&i<=I_,"overflow",t||"value",i),BigInt(i);case"string":try{if(i==="")throw new Error("empty string");return i[0]==="-"&&i[1]!=="-"?-BigInt(i.substring(1)):BigInt(i)}catch(e){y(!1,`invalid BigNumberish string: ${e.message}`,t||"value",i)}}y(!1,"invalid BigNumberish value",t||"value",i)}function Aa(i,t){const e=O(i,t);return C(e>=go,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:i}),e}const kp="0123456789abcdef";function Oc(i){if(i instanceof Uint8Array){let t="0x0";for(const e of i)t+=kp[e>>4],t+=kp[e&15];return BigInt(t)}return O(i)}function W(i,t){switch(typeof i){case"bigint":return y(i>=-I_&&i<=I_,"overflow",t||"value",i),Number(i);case"number":return y(Number.isInteger(i),"underflow",t||"value",i),y(i>=-I_&&i<=I_,"overflow",t||"value",i),i;case"string":try{if(i==="")throw new Error("empty string");return W(BigInt(i),t)}catch(e){y(!1,`invalid numeric string: ${e.message}`,t||"value",i)}}y(!1,"invalid numeric value",t||"value",i)}function ub(i){return W(Oc(i))}function Yi(i,t){const e=Aa(i,"value");let r=e.toString(16);if(t==null)r.length%2&&(r="0"+r);else{const s=W(t,"width");if(s===0&&e===go)return"0x";for(C(s*2>=r.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:i});r.length<s*2;)r="0"+r}return"0x"+r}function Pt(i,t){const e=Aa(i,"value");if(e===go)return new Uint8Array(0);let r=e.toString(16);r.length%2&&(r="0"+r);const s=new Uint8Array(r.length/2);for(let _=0;_<s.length;_++){const a=_*2;s[_]=parseInt(r.substring(a,a+2),16)}return s}function Xr(i){let t=K(Uc(i)?i:Pt(i)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return t===""&&(t="0"),"0x"+t}const Vp="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const Fp=BigInt(58);function db(i){const t=j(i);let e=Oc(t),r="";for(;e;)r=Vp[Number(e%Fp)]+r,e/=Fp;for(let s=0;s<t.length&&!t[s];s++)r=Vp[0]+r;return r}function wb(i){i=atob(i);const t=new Uint8Array(i.length);for(let e=0;e<i.length;e++)t[e]=i.charCodeAt(e);return j(t)}function gb(i){const t=j(i);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}class Yp{filter;emitter;#t;constructor(t,e,r){this.#t=e,D(this,{emitter:t,filter:r})}async removeListener(){this.#t!=null&&await this.emitter.off(this.filter,this.#t)}}function Ab(i,t,e,r,s){y(!1,`invalid codepoint at offset ${t}; ${i}`,"bytes",e)}function Dp(i,t,e,r,s){if(i==="BAD_PREFIX"||i==="UNEXPECTED_CONTINUE"){let _=0;for(let a=t+1;a<e.length&&e[a]>>6===2;a++)_++;return _}return i==="OVERRUN"?e.length-t-1:0}function bb(i,t,e,r,s){return i==="OVERLONG"?(y(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),Dp(i,t,e))}const yb=Object.freeze({error:Ab,ignore:Dp,replace:bb});function Sb(i,t){t==null&&(t=yb.error);const e=j(i,"bytes"),r=[];let s=0;for(;s<e.length;){const _=e[s++];if(_>>7===0){r.push(_);continue}let a=null,c=null;if((_&224)===192)a=1,c=127;else if((_&240)===224)a=2,c=2047;else if((_&248)===240)a=3,c=65535;else{(_&192)===128?s+=t("UNEXPECTED_CONTINUE",s-1,e,r):s+=t("BAD_PREFIX",s-1,e,r);continue}if(s-1+a>=e.length){s+=t("OVERRUN",s-1,e,r);continue}let l=_&(1<<8-a-1)-1;for(let p=0;p<a;p++){let u=e[s];if((u&192)!=128){s+=t("MISSING_CONTINUE",s,e,r),l=null;break}l=l<<6|u&63,s++}if(l!==null){if(l>1114111){s+=t("OUT_OF_RANGE",s-1-a,e,r,l);continue}if(l>=55296&&l<=57343){s+=t("UTF16_SURROGATE",s-1-a,e,r,l);continue}if(l<=c){s+=t("OVERLONG",s-1-a,e,r,l);continue}r.push(l)}}return r}function _i(i,t){y(typeof i=="string","invalid string value","str",i);let e=[];for(let r=0;r<i.length;r++){const s=i.charCodeAt(r);if(s<128)e.push(s);else if(s<2048)e.push(s>>6|192),e.push(s&63|128);else if((s&64512)==55296){r++;const _=i.charCodeAt(r);y(r<i.length&&(_&64512)===56320,"invalid surrogate pair","str",i);const a=65536+((s&1023)<<10)+(_&1023);e.push(a>>18|240),e.push(a>>12&63|128),e.push(a>>6&63|128),e.push(a&63|128)}else e.push(s>>12|224),e.push(s>>6&63|128),e.push(s&63|128)}return new Uint8Array(e)}function mb(i){return i.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function ba(i,t){return mb(Sb(i,t))}function jp(i){async function t(e,r){C(r==null||!r.cancelled,"request cancelled before sending","CANCELLED");const s=e.url.split(":")[0].toLowerCase();C(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),C(s==="https"||!e.credentials||e.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let _=null;const a=new AbortController,c=setTimeout(()=>{_=gt("request timeout","TIMEOUT"),a.abort()},e.timeout);r&&r.addListener(()=>{_=gt("request cancelled","CANCELLED"),a.abort()});const l=Object.assign({},i,{method:e.method,headers:new Headers(Array.from(e)),body:e.body||void 0,signal:a.signal});let p;try{p=await fetch(e.url,l)}catch(S){throw clearTimeout(c),_||S}clearTimeout(c);const u={};p.headers.forEach((S,R)=>{u[R.toLowerCase()]=S});const d=await p.arrayBuffer(),b=d==null?null:new Uint8Array(d);return{statusCode:p.status,statusMessage:p.statusText,headers:u,body:b}}return t}const Rb=12,Pb=250;let Lp=jp();const Mb=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),Eb=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let kc=!1;async function Hp(i,t){try{const e=i.match(Mb);if(!e)throw new Error("invalid data");return new Di(200,"OK",{"content-type":e[1]||"text/plain"},e[2]?wb(e[3]):zb(e[3]))}catch{return new Di(599,"BAD REQUEST (invalid data: URI)",{},null,new oi(i))}}function Jp(i){async function t(e,r){try{const s=e.match(Eb);if(!s)throw new Error("invalid link");return new oi(`${i}${s[2]}`)}catch{return new Di(599,"BAD REQUEST (invalid IPFS URI)",{},null,new oi(e))}}return t}const ya={data:Hp,ipfs:Jp("https://gateway.ipfs.io/ipfs/")},Qp=new WeakMap;class Cb{#t;#e;constructor(t){this.#t=[],this.#e=!1,Qp.set(t,()=>{if(!this.#e){this.#e=!0;for(const e of this.#t)setTimeout(()=>{e()},0);this.#t=[]}})}addListener(t){C(!this.#e,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#t.push(t)}get cancelled(){return this.#e}checkSignal(){C(!this.cancelled,"cancelled","CANCELLED",{})}}function Sa(i){if(i==null)throw new Error("missing signal; should not happen");return i.checkSignal(),i}class oi{#t;#e;#r;#i;#s;#n;#_;#o;#u;#a;#p;#h;#c;#l;#f;get url(){return this.#n}set url(t){this.#n=String(t)}get body(){return this.#_==null?null:new Uint8Array(this.#_)}set body(t){if(t==null)this.#_=void 0,this.#o=void 0;else if(typeof t=="string")this.#_=_i(t),this.#o="text/plain";else if(t instanceof Uint8Array)this.#_=t,this.#o="application/octet-stream";else if(typeof t=="object")this.#_=_i(JSON.stringify(t)),this.#o="application/json";else throw new Error("invalid body")}hasBody(){return this.#_!=null}get method(){return this.#i?this.#i:this.hasBody()?"POST":"GET"}set method(t){t==null&&(t=""),this.#i=String(t).toUpperCase()}get headers(){const t=Object.assign({},this.#r);return this.#u&&(t.authorization=`Basic ${gb(_i(this.#u))}`),this.allowGzip&&(t["accept-encoding"]="gzip"),t["content-type"]==null&&this.#o&&(t["content-type"]=this.#o),this.body&&(t["content-length"]=String(this.body.length)),t}getHeader(t){return this.headers[t.toLowerCase()]}setHeader(t,e){this.#r[String(t).toLowerCase()]=String(e)}clearHeaders(){this.#r={}}[Symbol.iterator](){const t=this.headers,e=Object.keys(t);let r=0;return{next:()=>{if(r<e.length){const s=e[r++];return{value:[s,t[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#u||null}setCredentials(t,e){y(!t.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#u=`${t}:${e}`}get allowGzip(){return this.#e}set allowGzip(t){this.#e=!!t}get allowInsecureAuthentication(){return!!this.#t}set allowInsecureAuthentication(t){this.#t=!!t}get timeout(){return this.#s}set timeout(t){y(t>=0,"timeout must be non-zero","timeout",t),this.#s=t}get preflightFunc(){return this.#a||null}set preflightFunc(t){this.#a=t}get processFunc(){return this.#p||null}set processFunc(t){this.#p=t}get retryFunc(){return this.#h||null}set retryFunc(t){this.#h=t}get getUrlFunc(){return this.#f||Lp}set getUrlFunc(t){this.#f=t}constructor(t){this.#n=String(t),this.#t=!1,this.#e=!0,this.#r={},this.#i="",this.#s=3e5,this.#l={slotInterval:Pb,maxAttempts:Rb},this.#f=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#_?K(this.#_):"null"}>`}setThrottleParams(t){t.slotInterval!=null&&(this.#l.slotInterval=t.slotInterval),t.maxAttempts!=null&&(this.#l.maxAttempts=t.maxAttempts)}async#d(t,e,r,s,_){if(t>=this.#l.maxAttempts)return _.makeServerError("exceeded maximum retry limit");C($p()<=e,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),r>0&&await Ib(r);let a=this.clone();const c=(a.url.split(":")[0]||"").toLowerCase();if(c in ya){const u=await ya[c](a.url,Sa(s.#c));if(u instanceof Di){let d=u;if(this.processFunc){Sa(s.#c);try{d=await this.processFunc(a,d)}catch(b){(b.throttle==null||typeof b.stall!="number")&&d.makeServerError("error in post-processing function",b).assertOk()}}return d}a=u}this.preflightFunc&&(a=await this.preflightFunc(a));const l=await this.getUrlFunc(a,Sa(s.#c));let p=new Di(l.statusCode,l.statusMessage,l.headers,l.body,s);if(p.statusCode===301||p.statusCode===302){try{const u=p.headers.location||"";return a.redirect(u).#d(t+1,e,0,s,p)}catch{}return p}else if(p.statusCode===429&&(this.retryFunc==null||await this.retryFunc(a,p,t))){const u=p.headers["retry-after"];let d=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return typeof u=="string"&&u.match(/^[1-9][0-9]*$/)&&(d=parseInt(u)),a.clone().#d(t+1,e,d,s,p)}if(this.processFunc){Sa(s.#c);try{p=await this.processFunc(a,p)}catch(u){(u.throttle==null||typeof u.stall!="number")&&p.makeServerError("error in post-processing function",u).assertOk();let d=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return u.stall>=0&&(d=u.stall),a.clone().#d(t+1,e,d,s,p)}}return p}send(){return C(this.#c==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#c=new Cb(this),this.#d(0,$p()+this.timeout,0,this,new Di(0,"",{},null,this))}cancel(){C(this.#c!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const t=Qp.get(this);if(!t)throw new Error("missing signal; should not happen");t()}redirect(t){const e=this.url.split(":")[0].toLowerCase(),r=t.split(":")[0].toLowerCase();C(this.method==="GET"&&(e!=="https"||r!=="http")&&t.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(t)})`});const s=new oi(t);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,s.#r=Object.assign({},this.#r),this.#_&&(s.#_=new Uint8Array(this.#_)),s.#o=this.#o,s}clone(){const t=new oi(this.url);return t.#i=this.#i,this.#_&&(t.#_=this.#_),t.#o=this.#o,t.#r=Object.assign({},this.#r),t.#u=this.#u,this.allowGzip&&(t.allowGzip=!0),t.timeout=this.timeout,this.allowInsecureAuthentication&&(t.allowInsecureAuthentication=!0),t.#a=this.#a,t.#p=this.#p,t.#h=this.#h,t.#l=Object.assign({},this.#l),t.#f=this.#f,t}static lockConfig(){kc=!0}static getGateway(t){return ya[t.toLowerCase()]||null}static registerGateway(t,e){if(t=t.toLowerCase(),t==="http"||t==="https")throw new Error(`cannot intercept ${t}; use registerGetUrl`);if(kc)throw new Error("gateways locked");ya[t]=e}static registerGetUrl(t){if(kc)throw new Error("gateways locked");Lp=t}static createGetUrlFunc(t){return jp(t)}static createDataGateway(){return Hp}static createIpfsGatewayFunc(t){return Jp(t)}}class Di{#t;#e;#r;#i;#s;#n;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#i?K(this.#i):"null"}>`}get statusCode(){return this.#t}get statusMessage(){return this.#e}get headers(){return Object.assign({},this.#r)}get body(){return this.#i==null?null:new Uint8Array(this.#i)}get bodyText(){try{return this.#i==null?"":ba(this.#i)}catch{C(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{C(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const t=this.headers,e=Object.keys(t);let r=0;return{next:()=>{if(r<e.length){const s=e[r++];return{value:[s,t[s]],done:!1}}return{value:void 0,done:!0}}}}constructor(t,e,r,s,_){this.#t=t,this.#e=e,this.#r=Object.keys(r).reduce((a,c)=>(a[c.toLowerCase()]=String(r[c]),a),{}),this.#i=s==null?null:new Uint8Array(s),this.#s=_||null,this.#n={message:""}}makeServerError(t,e){let r;t?r=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${t})`:(t=`${this.statusCode} ${this.statusMessage}`,r=`CLIENT ESCALATED SERVER ERROR (${t})`);const s=new Di(599,r,this.headers,this.body,this.#s||void 0);return s.#n={message:t,error:e},s}throwThrottleError(t,e){e==null?e=-1:y(Number.isInteger(e)&&e>=0,"invalid stall timeout","stall",e);const r=new Error(t||"throttling requests");throw D(r,{stall:e,throttle:!0}),r}getHeader(t){return this.headers[t.toLowerCase()]}hasBody(){return this.#i!=null}get request(){return this.#s}ok(){return this.#n.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:t,error:e}=this.#n;t===""&&(t=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let s=null;try{this.#i&&(s=ba(this.#i))}catch{}C(!1,t,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:e,info:{requestUrl:r,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function $p(){return new Date().getTime()}function zb(i){return _i(i.replace(/%([0-9a-f][0-9a-f])/gi,(t,e)=>String.fromCharCode(parseInt(e,16))))}function Ib(i){return new Promise(t=>setTimeout(t,i))}function Gb(i){let t=i.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function Wp(i,t,e){let r=0;for(let s=0;s<e;s++)r=r*256+i[t+s];return r}function Zp(i,t,e,r){const s=[];for(;e<t+1+r;){const _=qp(i,e);s.push(_.result),e+=_.consumed,C(e<=t+1+r,"child data too short","BUFFER_OVERRUN",{buffer:i,length:r,offset:t})}return{consumed:1+r,result:s}}function qp(i,t){C(i.length!==0,"data too short","BUFFER_OVERRUN",{buffer:i,length:0,offset:1});const e=r=>{C(r<=i.length,"data short segment too short","BUFFER_OVERRUN",{buffer:i,length:i.length,offset:r})};if(i[t]>=248){const r=i[t]-247;e(t+1+r);const s=Wp(i,t+1,r);return e(t+1+r+s),Zp(i,t,t+1+r,r+s)}else if(i[t]>=192){const r=i[t]-192;return e(t+1+r),Zp(i,t,t+1,r)}else if(i[t]>=184){const r=i[t]-183;e(t+1+r);const s=Wp(i,t+1,r);e(t+1+r+s);const _=K(i.slice(t+1+r,t+1+r+s));return{consumed:1+r+s,result:_}}else if(i[t]>=128){const r=i[t]-128;e(t+1+r);const s=K(i.slice(t+1,t+1+r));return{consumed:1+r,result:s}}return{consumed:1,result:Gb(i[t])}}function bo(i){const t=j(i,"data"),e=qp(t,0);return y(e.consumed===t.length,"unexpected junk after rlp payload","data",i),e.result}function Xp(i){const t=[];for(;i;)t.unshift(i&255),i>>=8;return t}function tf(i){if(Array.isArray(i)){let r=[];if(i.forEach(function(_){r=r.concat(tf(_))}),r.length<=55)return r.unshift(192+r.length),r;const s=Xp(r.length);return s.unshift(247+s.length),s.concat(r)}const t=Array.prototype.slice.call(j(i,"object"));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const e=Xp(t.length);return e.unshift(183+e.length),e.concat(t)}const ef="0123456789abcdef";function wi(i){let t="0x";for(const e of tf(i))t+=ef[e>>4],t+=ef[e&15];return t}const Yt=32,Vc=new Uint8Array(Yt),Bb=["then"],ma={},rf=new WeakMap;function Vn(i){return rf.get(i)}function sf(i,t){rf.set(i,t)}function yo(i,t){const e=new Error(`deferred error during ABI decoding triggered accessing ${i}`);throw e.error=t,e}function Fc(i,t,e){return i.indexOf(null)>=0?t.map((r,s)=>r instanceof gi?Fc(Vn(r),r,e):r):i.reduce((r,s,_)=>{let a=t.getValue(s);return s in r||(e&&a instanceof gi&&(a=Fc(Vn(a),a,e)),r[s]=a),r},{})}class gi extends Array{#t;constructor(...t){const e=t[0];let r=t[1],s=(t[2]||[]).slice(),_=!0;e!==ma&&(r=t,s=[],_=!1),super(r.length),r.forEach((l,p)=>{this[p]=l});const a=s.reduce((l,p)=>(typeof p=="string"&&l.set(p,(l.get(p)||0)+1),l),new Map);if(sf(this,Object.freeze(r.map((l,p)=>{const u=s[p];return u!=null&&a.get(u)===1?u:null}))),this.#t=[],this.#t==null&&this.#t,!_)return;Object.freeze(this);const c=new Proxy(this,{get:(l,p,u)=>{if(typeof p=="string"){if(p.match(/^[0-9]+$/)){const b=W(p,"%index");if(b<0||b>=this.length)throw new RangeError("out of result range");const S=l[b];return S instanceof Error&&yo(`index ${b}`,S),S}if(Bb.indexOf(p)>=0)return Reflect.get(l,p,u);const d=l[p];if(d instanceof Function)return function(...b){return d.apply(this===u?l:this,b)};if(!(p in l))return l.getValue.apply(this===u?l:this,[p])}return Reflect.get(l,p,u)}});return sf(c,Vn(this)),c}toArray(t){const e=[];return this.forEach((r,s)=>{r instanceof Error&&yo(`index ${s}`,r),t&&r instanceof gi&&(r=r.toArray(t)),e.push(r)}),e}toObject(t){const e=Vn(this);return e.reduce((r,s,_)=>(C(s!=null,`value at index ${_} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Fc(e,this,t)),{})}slice(t,e){t==null&&(t=0),t<0&&(t+=this.length,t<0&&(t=0)),e==null&&(e=this.length),e<0&&(e+=this.length,e<0&&(e=0)),e>this.length&&(e=this.length);const r=Vn(this),s=[],_=[];for(let a=t;a<e;a++)s.push(this[a]),_.push(r[a]);return new gi(ma,s,_)}filter(t,e){const r=Vn(this),s=[],_=[];for(let a=0;a<this.length;a++){const c=this[a];c instanceof Error&&yo(`index ${a}`,c),t.call(e,c,a,this)&&(s.push(c),_.push(r[a]))}return new gi(ma,s,_)}map(t,e){const r=[];for(let s=0;s<this.length;s++){const _=this[s];_ instanceof Error&&yo(`index ${s}`,_),r.push(t.call(e,_,s,this))}return r}getValue(t){const e=Vn(this).indexOf(t);if(e===-1)return;const r=this[e];return r instanceof Error&&yo(`property ${JSON.stringify(t)}`,r.error),r}static fromItems(t,e){return new gi(ma,t,e)}}function nf(i){let t=Pt(i);return C(t.length<=Yt,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:Yt,offset:t.length}),t.length!==Yt&&(t=Ft(ot([Vc.slice(t.length%Yt),t]))),t}class Ai{name;type;localName;dynamic;constructor(t,e,r,s){D(this,{name:t,type:e,localName:r,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,e){y(!1,t,this.localName,e)}}class Yc{#t;#e;constructor(){this.#t=[],this.#e=0}get data(){return ot(this.#t)}get length(){return this.#e}#r(t){return this.#t.push(t),this.#e+=t.length,t.length}appendWriter(t){return this.#r(Ft(t.data))}writeBytes(t){let e=Ft(t);const r=e.length%Yt;return r&&(e=Ft(ot([e,Vc.slice(r)]))),this.#r(e)}writeValue(t){return this.#r(nf(t))}writeUpdatableValue(){const t=this.#t.length;return this.#t.push(Vc),this.#e+=Yt,e=>{this.#t[t]=nf(e)}}}class Dc{allowLoose;#t;#e;#r;#i;#s;constructor(t,e,r){D(this,{allowLoose:!!e}),this.#t=Ft(t),this.#r=0,this.#i=null,this.#s=r??1024,this.#e=0}get data(){return K(this.#t)}get dataLength(){return this.#t.length}get consumed(){return this.#e}get bytes(){return new Uint8Array(this.#t)}#n(t){if(this.#i)return this.#i.#n(t);this.#r+=t,C(this.#s<1||this.#r<=this.#s*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#s} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Ft(this.#t),offset:this.#e,length:t,info:{bytesRead:this.#r,dataLength:this.dataLength}})}#_(t,e,r){let s=Math.ceil(e/Yt)*Yt;return this.#e+s>this.#t.length&&(this.allowLoose&&r&&this.#e+e<=this.#t.length?s=e:C(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Ft(this.#t),length:this.#t.length,offset:this.#e+s})),this.#t.slice(this.#e,this.#e+s)}subReader(t){const e=new Dc(this.#t.slice(this.#e+t),this.allowLoose,this.#s);return e.#i=this,e}readBytes(t,e){let r=this.#_(0,t,!!e);return this.#n(t),this.#e+=r.length,r.slice(0,t)}readValue(){return Oc(this.readBytes(Yt))}readIndex(){return ub(this.readBytes(Yt))}}function Ra(i){if(!Number.isSafeInteger(i)||i<0)throw new Error(`Wrong positive integer: ${i}`)}function jc(i,...t){if(!(i instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(i.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${i.length}`)}function Nb(i){if(typeof i!="function"||typeof i.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ra(i.outputLen),Ra(i.blockLen)}function G_(i,t=!0){if(i.destroyed)throw new Error("Hash instance has been destroyed");if(t&&i.finished)throw new Error("Hash#digest() has already been called")}function _f(i,t){jc(i);const e=t.outputLen;if(i.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}const Lc=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;const of=i=>i instanceof Uint8Array,Kb=i=>new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)),Hc=i=>new DataView(i.buffer,i.byteOffset,i.byteLength),ai=(i,t)=>i<<32-t|i>>>t;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");function vb(i){if(typeof i!="string")throw new Error(`utf8ToBytes expected string, got ${typeof i}`);return new Uint8Array(new TextEncoder().encode(i))}function Pa(i){if(typeof i=="string"&&(i=vb(i)),!of(i))throw new Error(`expected Uint8Array, got ${typeof i}`);return i}function xb(...i){const t=new Uint8Array(i.reduce((r,s)=>r+s.length,0));let e=0;return i.forEach(r=>{if(!of(r))throw new Error("Uint8Array expected");t.set(r,e),e+=r.length}),t}class Jc{clone(){return this._cloneInto()}}function Qc(i){const t=r=>i().update(Pa(r)).digest(),e=i();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>i(),t}function Ub(i=32){if(Lc&&typeof Lc.getRandomValues=="function")return Lc.getRandomValues(new Uint8Array(i));throw new Error("crypto.getRandomValues must be defined")}class af extends Jc{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Nb(t);const r=Pa(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,_=new Uint8Array(s);_.set(r.length>s?t.create().update(r).digest():r);for(let a=0;a<_.length;a++)_[a]^=54;this.iHash.update(_),this.oHash=t.create();for(let a=0;a<_.length;a++)_[a]^=106;this.oHash.update(_),_.fill(0)}update(t){return G_(this),this.iHash.update(t),this}digestInto(t){G_(this),jc(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:s,destroyed:_,blockLen:a,outputLen:c}=this;return t=t,t.finished=s,t.destroyed=_,t.blockLen=a,t.outputLen=c,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const cf=(i,t,e)=>new af(i,t).update(e).digest();cf.create=(i,t)=>new af(i,t);function Tb(i,t,e,r){if(typeof i.setBigUint64=="function")return i.setBigUint64(t,e,r);const s=BigInt(32),_=BigInt(4294967295),a=Number(e>>s&_),c=Number(e&_),l=r?4:0,p=r?0:4;i.setUint32(t+l,a,r),i.setUint32(t+p,c,r)}class lf extends Jc{constructor(t,e,r,s){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Hc(this.buffer)}update(t){G_(this);const{view:e,buffer:r,blockLen:s}=this;t=Pa(t);const _=t.length;for(let a=0;a<_;){const c=Math.min(s-this.pos,_-a);if(c===s){const l=Hc(t);for(;s<=_-a;a+=s)this.process(l,a);continue}r.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===s&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){G_(this),_f(t,this),this.finished=!0;const{buffer:e,view:r,blockLen:s,isLE:_}=this;let{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(r,0),a=0);for(let d=a;d<s;d++)e[d]=0;Tb(r,s-8,BigInt(this.length*8),_),this.process(r,0);const c=Hc(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const p=l/4,u=this.get();if(p>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<p;d++)c.setUint32(4*d,u[d],_)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:r,length:s,finished:_,destroyed:a,pos:c}=this;return t.length=s,t.pos=c,t.finished=_,t.destroyed=a,s%e&&t.buffer.set(r),t}}const Ob=(i,t,e)=>i&t^~i&e,kb=(i,t,e)=>i&t^i&e^t&e,Vb=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ji=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Li=new Uint32Array(64);class Fb extends lf{constructor(){super(64,32,8,!1),this.A=ji[0]|0,this.B=ji[1]|0,this.C=ji[2]|0,this.D=ji[3]|0,this.E=ji[4]|0,this.F=ji[5]|0,this.G=ji[6]|0,this.H=ji[7]|0}get(){const{A:t,B:e,C:r,D:s,E:_,F:a,G:c,H:l}=this;return[t,e,r,s,_,a,c,l]}set(t,e,r,s,_,a,c,l){this.A=t|0,this.B=e|0,this.C=r|0,this.D=s|0,this.E=_|0,this.F=a|0,this.G=c|0,this.H=l|0}process(t,e){for(let d=0;d<16;d++,e+=4)Li[d]=t.getUint32(e,!1);for(let d=16;d<64;d++){const b=Li[d-15],S=Li[d-2],R=ai(b,7)^ai(b,18)^b>>>3,m=ai(S,17)^ai(S,19)^S>>>10;Li[d]=m+Li[d-7]+R+Li[d-16]|0}let{A:r,B:s,C:_,D:a,E:c,F:l,G:p,H:u}=this;for(let d=0;d<64;d++){const b=ai(c,6)^ai(c,11)^ai(c,25),S=u+b+Ob(c,l,p)+Vb[d]+Li[d]|0,m=(ai(r,2)^ai(r,13)^ai(r,22))+kb(r,s,_)|0;u=p,p=l,l=c,c=a+S|0,a=_,_=s,s=r,r=S+m|0}r=r+this.A|0,s=s+this.B|0,_=_+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,p=p+this.G|0,u=u+this.H|0,this.set(r,s,_,a,c,l,p,u)}roundClean(){Li.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const pf=Qc(()=>new Fb),Ma=BigInt(2**32-1),$c=BigInt(32);function ff(i,t=!1){return t?{h:Number(i&Ma),l:Number(i>>$c&Ma)}:{h:Number(i>>$c&Ma)|0,l:Number(i&Ma)|0}}function hf(i,t=!1){let e=new Uint32Array(i.length),r=new Uint32Array(i.length);for(let s=0;s<i.length;s++){const{h:_,l:a}=ff(i[s],t);[e[s],r[s]]=[_,a]}return[e,r]}const Yb=(i,t)=>BigInt(i>>>0)<<$c|BigInt(t>>>0),Db=(i,t,e)=>i>>>e,jb=(i,t,e)=>i<<32-e|t>>>e,Lb=(i,t,e)=>i>>>e|t<<32-e,Hb=(i,t,e)=>i<<32-e|t>>>e,Jb=(i,t,e)=>i<<64-e|t>>>e-32,Qb=(i,t,e)=>i>>>e-32|t<<64-e,$b=(i,t)=>t,Wb=(i,t)=>i,uf=(i,t,e)=>i<<e|t>>>32-e,df=(i,t,e)=>t<<e|i>>>32-e,wf=(i,t,e)=>t<<e-32|i>>>64-e,gf=(i,t,e)=>i<<e-32|t>>>64-e;function Zb(i,t,e,r){const s=(t>>>0)+(r>>>0);return{h:i+e+(s/2**32|0)|0,l:s|0}}const Q={fromBig:ff,split:hf,toBig:Yb,shrSH:Db,shrSL:jb,rotrSH:Lb,rotrSL:Hb,rotrBH:Jb,rotrBL:Qb,rotr32H:$b,rotr32L:Wb,rotlSH:uf,rotlSL:df,rotlBH:wf,rotlBL:gf,add:Zb,add3L:(i,t,e)=>(i>>>0)+(t>>>0)+(e>>>0),add3H:(i,t,e,r)=>t+e+r+(i/2**32|0)|0,add4L:(i,t,e,r)=>(i>>>0)+(t>>>0)+(e>>>0)+(r>>>0),add4H:(i,t,e,r,s)=>t+e+r+s+(i/2**32|0)|0,add5H:(i,t,e,r,s,_)=>t+e+r+s+_+(i/2**32|0)|0,add5L:(i,t,e,r,s)=>(i>>>0)+(t>>>0)+(e>>>0)+(r>>>0)+(s>>>0)},[qb,Xb]=Q.split(["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","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(i=>BigInt(i))),Hi=new Uint32Array(80),Ji=new Uint32Array(80);class ty extends lf{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:e,Bh:r,Bl:s,Ch:_,Cl:a,Dh:c,Dl:l,Eh:p,El:u,Fh:d,Fl:b,Gh:S,Gl:R,Hh:m,Hl:P}=this;return[t,e,r,s,_,a,c,l,p,u,d,b,S,R,m,P]}set(t,e,r,s,_,a,c,l,p,u,d,b,S,R,m,P){this.Ah=t|0,this.Al=e|0,this.Bh=r|0,this.Bl=s|0,this.Ch=_|0,this.Cl=a|0,this.Dh=c|0,this.Dl=l|0,this.Eh=p|0,this.El=u|0,this.Fh=d|0,this.Fl=b|0,this.Gh=S|0,this.Gl=R|0,this.Hh=m|0,this.Hl=P|0}process(t,e){for(let G=0;G<16;G++,e+=4)Hi[G]=t.getUint32(e),Ji[G]=t.getUint32(e+=4);for(let G=16;G<80;G++){const Y=Hi[G-15]|0,T=Ji[G-15]|0,v=Q.rotrSH(Y,T,1)^Q.rotrSH(Y,T,8)^Q.shrSH(Y,T,7),F=Q.rotrSL(Y,T,1)^Q.rotrSL(Y,T,8)^Q.shrSL(Y,T,7),V=Hi[G-2]|0,q=Ji[G-2]|0,J=Q.rotrSH(V,q,19)^Q.rotrBH(V,q,61)^Q.shrSH(V,q,6),Z=Q.rotrSL(V,q,19)^Q.rotrBL(V,q,61)^Q.shrSL(V,q,6),st=Q.add4L(F,Z,Ji[G-7],Ji[G-16]),nt=Q.add4H(st,v,J,Hi[G-7],Hi[G-16]);Hi[G]=nt|0,Ji[G]=st|0}let{Ah:r,Al:s,Bh:_,Bl:a,Ch:c,Cl:l,Dh:p,Dl:u,Eh:d,El:b,Fh:S,Fl:R,Gh:m,Gl:P,Hh:E,Hl:B}=this;for(let G=0;G<80;G++){const Y=Q.rotrSH(d,b,14)^Q.rotrSH(d,b,18)^Q.rotrBH(d,b,41),T=Q.rotrSL(d,b,14)^Q.rotrSL(d,b,18)^Q.rotrBL(d,b,41),v=d&S^~d&m,F=b&R^~b&P,V=Q.add5L(B,T,F,Xb[G],Ji[G]),q=Q.add5H(V,E,Y,v,qb[G],Hi[G]),J=V|0,Z=Q.rotrSH(r,s,28)^Q.rotrBH(r,s,34)^Q.rotrBH(r,s,39),st=Q.rotrSL(r,s,28)^Q.rotrBL(r,s,34)^Q.rotrBL(r,s,39),nt=r&_^r&c^_&c,se=s&a^s&l^a&l;E=m|0,B=P|0,m=S|0,P=R|0,S=d|0,R=b|0,{h:d,l:b}=Q.add(p|0,u|0,q|0,J|0),p=c|0,u=l|0,c=_|0,l=a|0,_=r|0,a=s|0;const N=Q.add3L(J,st,se);r=Q.add3H(N,q,Z,nt),s=N|0}({h:r,l:s}=Q.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:_,l:a}=Q.add(this.Bh|0,this.Bl|0,_|0,a|0),{h:c,l}=Q.add(this.Ch|0,this.Cl|0,c|0,l|0),{h:p,l:u}=Q.add(this.Dh|0,this.Dl|0,p|0,u|0),{h:d,l:b}=Q.add(this.Eh|0,this.El|0,d|0,b|0),{h:S,l:R}=Q.add(this.Fh|0,this.Fl|0,S|0,R|0),{h:m,l:P}=Q.add(this.Gh|0,this.Gl|0,m|0,P|0),{h:E,l:B}=Q.add(this.Hh|0,this.Hl|0,E|0,B|0),this.set(r,s,_,a,c,l,p,u,d,b,S,R,m,P,E,B)}roundClean(){Hi.fill(0),Ji.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)}}const ey=Qc(()=>new ty);function ry(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof kt<"u")return kt;throw new Error("unable to locate global object")}const Af=ry();Af.crypto||Af.msCrypto;function iy(i){switch(i){case"sha256":return pf.create();case"sha512":return ey.create()}y(!1,"invalid hashing algorithm name","algorithm",i)}const[bf,yf,Sf]=[[],[],[]],sy=BigInt(0),So=BigInt(1),ny=BigInt(2),_y=BigInt(7),oy=BigInt(256),ay=BigInt(113);for(let i=0,t=So,e=1,r=0;i<24;i++){[e,r]=[r,(2*e+3*r)%5],bf.push(2*(5*r+e)),yf.push((i+1)*(i+2)/2%64);let s=sy;for(let _=0;_<7;_++)t=(t<<So^(t>>_y)*ay)%oy,t&ny&&(s^=So<<(So<<BigInt(_))-So);Sf.push(s)}const[cy,ly]=hf(Sf,!0),mf=(i,t,e)=>e>32?wf(i,t,e):uf(i,t,e),Rf=(i,t,e)=>e>32?gf(i,t,e):df(i,t,e);function py(i,t=24){const e=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let a=0;a<10;a++)e[a]=i[a]^i[a+10]^i[a+20]^i[a+30]^i[a+40];for(let a=0;a<10;a+=2){const c=(a+8)%10,l=(a+2)%10,p=e[l],u=e[l+1],d=mf(p,u,1)^e[c],b=Rf(p,u,1)^e[c+1];for(let S=0;S<50;S+=10)i[a+S]^=d,i[a+S+1]^=b}let s=i[2],_=i[3];for(let a=0;a<24;a++){const c=yf[a],l=mf(s,_,c),p=Rf(s,_,c),u=bf[a];s=i[u],_=i[u+1],i[u]=l,i[u+1]=p}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)e[c]=i[a+c];for(let c=0;c<10;c++)i[a+c]^=~e[(c+2)%10]&e[(c+4)%10]}i[0]^=cy[r],i[1]^=ly[r]}e.fill(0)}class Wc extends Jc{constructor(t,e,r,s=!1,_=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=s,this.rounds=_,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ra(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Kb(this.state)}keccak(){py(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){G_(this);const{blockLen:e,state:r}=this;t=Pa(t);const s=t.length;for(let _=0;_<s;){const a=Math.min(e-this.pos,s-_);for(let c=0;c<a;c++)r[this.pos++]^=t[_++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:r,blockLen:s}=this;t[r]^=e,(e&128)!==0&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){G_(this,!1),jc(t),this.finish();const e=this.state,{blockLen:r}=this;for(let s=0,_=t.length;s<_;){this.posOut>=r&&this.keccak();const a=Math.min(r-this.posOut,_-s);t.set(e.subarray(this.posOut,this.posOut+a),s),this.posOut+=a,s+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Ra(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(_f(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:r,outputLen:s,rounds:_,enableXOF:a}=this;return t||(t=new Wc(e,r,s,a,_)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=_,t.suffix=r,t.outputLen=s,t.enableXOF=a,t.destroyed=this.destroyed,t}}const fy=((i,t,e)=>Qc(()=>new Wc(t,i,e)))(1,136,256/8);let Pf=!1;const Mf=function(i){return fy(i)};let Ef=Mf;function mt(i){const t=j(i,"data");return K(Ef(t))}mt._=Mf,mt.lock=function(){Pf=!0},mt.register=function(i){if(Pf)throw new TypeError("keccak256 is locked");Ef=i},Object.freeze(mt);const Cf=function(i){return iy("sha256").update(i).digest()};let zf=Cf,If=!1;function B_(i){const t=j(i,"data");return K(zf(t))}B_._=Cf,B_.lock=function(){If=!0},B_.register=function(i){if(If)throw new Error("sha256 is locked");zf=i},Object.freeze(B_),Object.freeze(B_);BigInt(0);const hy=BigInt(1),uy=BigInt(2),Ea=i=>i instanceof Uint8Array,dy=Array.from({length:256},(i,t)=>t.toString(16).padStart(2,"0"));function N_(i){if(!Ea(i))throw new Error("Uint8Array expected");let t="";for(let e=0;e<i.length;e++)t+=dy[i[e]];return t}function Zc(i){if(typeof i!="string")throw new Error("hex string expected, got "+typeof i);return BigInt(i===""?"0":`0x${i}`)}function mo(i){if(typeof i!="string")throw new Error("hex string expected, got "+typeof i);const t=i.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const e=new Uint8Array(t/2);for(let r=0;r<e.length;r++){const s=r*2,_=i.slice(s,s+2),a=Number.parseInt(_,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");e[r]=a}return e}function Fn(i){return Zc(N_(i))}function qc(i){if(!Ea(i))throw new Error("Uint8Array expected");return Zc(N_(Uint8Array.from(i).reverse()))}function K_(i,t){return mo(i.toString(16).padStart(t*2,"0"))}function Xc(i,t){return K_(i,t).reverse()}function ti(i,t,e){let r;if(typeof t=="string")try{r=mo(t)}catch(_){throw new Error(`${i} must be valid hex string, got "${t}". Cause: ${_}`)}else if(Ea(t))r=Uint8Array.from(t);else throw new Error(`${i} must be hex string or Uint8Array`);const s=r.length;if(typeof e=="number"&&s!==e)throw new Error(`${i} expected ${e} bytes, got ${s}`);return r}function Ro(...i){const t=new Uint8Array(i.reduce((r,s)=>r+s.length,0));let e=0;return i.forEach(r=>{if(!Ea(r))throw new Error("Uint8Array expected");t.set(r,e),e+=r.length}),t}const tl=i=>(uy<<BigInt(i-1))-hy,el=i=>new Uint8Array(i),Gf=i=>Uint8Array.from(i);function Bf(i,t,e){if(typeof i!="number"||i<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let r=el(i),s=el(i),_=0;const a=()=>{r.fill(1),s.fill(0),_=0},c=(...d)=>e(s,r,...d),l=(d=el())=>{s=c(Gf([0]),d),r=c(),d.length!==0&&(s=c(Gf([1]),d),r=c())},p=()=>{if(_++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const b=[];for(;d<t;){r=c();const S=r.slice();b.push(S),d+=r.length}return Ro(...b)};return(d,b)=>{a(),l(d);let S;for(;!(S=b(p()));)l();return a(),S}}const wy={bigint:i=>typeof i=="bigint",function:i=>typeof i=="function",boolean:i=>typeof i=="boolean",string:i=>typeof i=="string",stringOrUint8Array:i=>typeof i=="string"||i instanceof Uint8Array,isSafeInteger:i=>Number.isSafeInteger(i),array:i=>Array.isArray(i),field:(i,t)=>t.Fp.isValid(i),hash:i=>typeof i=="function"&&Number.isSafeInteger(i.outputLen)};function Po(i,t,e={}){const r=(s,_,a)=>{const c=wy[_];if(typeof c!="function")throw new Error(`Invalid validator "${_}", expected function`);const l=i[s];if(!(a&&l===void 0)&&!c(l,i))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${_}`)};for(const[s,_]of Object.entries(t))r(s,_,!1);for(const[s,_]of Object.entries(e))r(s,_,!0);return i}const gy=Object.freeze(Object.defineProperty({__proto__:null,bitMask:tl,bytesToHex:N_,bytesToNumberBE:Fn,bytesToNumberLE:qc,concatBytes:Ro,createHmacDrbg:Bf,ensureBytes:ti,hexToBytes:mo,hexToNumber:Zc,numberToBytesBE:K_,numberToBytesLE:Xc,validateObject:Po},Symbol.toStringTag,{value:"Module"}));const Bt=BigInt(0),Mt=BigInt(1),Yn=BigInt(2),Ay=BigInt(3),rl=BigInt(4),Nf=BigInt(5),Kf=BigInt(8);BigInt(9),BigInt(16);function Qt(i,t){const e=i%t;return e>=Bt?e:t+e}function by(i,t,e){if(e<=Bt||t<Bt)throw new Error("Expected power/modulo > 0");if(e===Mt)return Bt;let r=Mt;for(;t>Bt;)t&Mt&&(r=r*i%e),i=i*i%e,t>>=Mt;return r}function fe(i,t,e){let r=i;for(;t-- >Bt;)r*=r,r%=e;return r}function il(i,t){if(i===Bt||t<=Bt)throw new Error(`invert: expected positive integers, got n=${i} mod=${t}`);let e=Qt(i,t),r=t,s=Bt,_=Mt;for(;e!==Bt;){const c=r/e,l=r%e,p=s-_*c;r=e,e=l,s=_,_=p}if(r!==Mt)throw new Error("invert: does not exist");return Qt(s,t)}function yy(i){const t=(i-Mt)/Yn;let e,r,s;for(e=i-Mt,r=0;e%Yn===Bt;e/=Yn,r++);for(s=Yn;s<i&&by(s,t,i)!==i-Mt;s++);if(r===1){const a=(i+Mt)/rl;return function(l,p){const u=l.pow(p,a);if(!l.eql(l.sqr(u),p))throw new Error("Cannot find square root");return u}}const _=(e+Mt)/Yn;return function(c,l){if(c.pow(l,t)===c.neg(c.ONE))throw new Error("Cannot find square root");let p=r,u=c.pow(c.mul(c.ONE,s),e),d=c.pow(l,_),b=c.pow(l,e);for(;!c.eql(b,c.ONE);){if(c.eql(b,c.ZERO))return c.ZERO;let S=1;for(let m=c.sqr(b);S<p&&!c.eql(m,c.ONE);S++)m=c.sqr(m);const R=c.pow(u,Mt<<BigInt(p-S-1));u=c.sqr(R),d=c.mul(d,R),b=c.mul(b,u),p=S}return d}}function Sy(i){if(i%rl===Ay){const t=(i+Mt)/rl;return function(r,s){const _=r.pow(s,t);if(!r.eql(r.sqr(_),s))throw new Error("Cannot find square root");return _}}if(i%Kf===Nf){const t=(i-Nf)/Kf;return function(r,s){const _=r.mul(s,Yn),a=r.pow(_,t),c=r.mul(s,a),l=r.mul(r.mul(c,Yn),a),p=r.mul(c,r.sub(l,r.ONE));if(!r.eql(r.sqr(p),s))throw new Error("Cannot find square root");return p}}return yy(i)}const my=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ry(i){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=my.reduce((r,s)=>(r[s]="function",r),t);return Po(i,e)}function Py(i,t,e){if(e<Bt)throw new Error("Expected power > 0");if(e===Bt)return i.ONE;if(e===Mt)return t;let r=i.ONE,s=t;for(;e>Bt;)e&Mt&&(r=i.mul(r,s)),s=i.sqr(s),e>>=Mt;return r}function My(i,t){const e=new Array(t.length),r=t.reduce((_,a,c)=>i.is0(a)?_:(e[c]=_,i.mul(_,a)),i.ONE),s=i.inv(r);return t.reduceRight((_,a,c)=>i.is0(a)?_:(e[c]=i.mul(_,e[c]),i.mul(_,a)),s),e}function vf(i,t){const e=t!==void 0?t:i.toString(2).length,r=Math.ceil(e/8);return{nBitLength:e,nByteLength:r}}function Ey(i,t,e=!1,r={}){if(i<=Bt)throw new Error(`Expected Field ORDER > 0, got ${i}`);const{nBitLength:s,nByteLength:_}=vf(i,t);if(_>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=Sy(i),c=Object.freeze({ORDER:i,BITS:s,BYTES:_,MASK:tl(s),ZERO:Bt,ONE:Mt,create:l=>Qt(l,i),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return Bt<=l&&l<i},is0:l=>l===Bt,isOdd:l=>(l&Mt)===Mt,neg:l=>Qt(-l,i),eql:(l,p)=>l===p,sqr:l=>Qt(l*l,i),add:(l,p)=>Qt(l+p,i),sub:(l,p)=>Qt(l-p,i),mul:(l,p)=>Qt(l*p,i),pow:(l,p)=>Py(c,l,p),div:(l,p)=>Qt(l*il(p,i),i),sqrN:l=>l*l,addN:(l,p)=>l+p,subN:(l,p)=>l-p,mulN:(l,p)=>l*p,inv:l=>il(l,i),sqrt:r.sqrt||(l=>a(c,l)),invertBatch:l=>My(c,l),cmov:(l,p,u)=>u?p:l,toBytes:l=>e?Xc(l,_):K_(l,_),fromBytes:l=>{if(l.length!==_)throw new Error(`Fp.fromBytes: expected ${_}, got ${l.length}`);return e?qc(l):Fn(l)}});return Object.freeze(c)}function xf(i){if(typeof i!="bigint")throw new Error("field order must be bigint");const t=i.toString(2).length;return Math.ceil(t/8)}function Uf(i){const t=xf(i);return t+Math.ceil(t/2)}function Cy(i,t,e=!1){const r=i.length,s=xf(t),_=Uf(t);if(r<16||r<_||r>1024)throw new Error(`expected ${_}-1024 bytes of input, got ${r}`);const a=e?Fn(i):qc(i),c=Qt(a,t-Mt)+Mt;return e?Xc(c,s):K_(c,s)}const zy=BigInt(0),sl=BigInt(1);function Iy(i,t){const e=(s,_)=>{const a=_.negate();return s?a:_},r=s=>{const _=Math.ceil(t/s)+1,a=2**(s-1);return{windows:_,windowSize:a}};return{constTimeNegate:e,unsafeLadder(s,_){let a=i.ZERO,c=s;for(;_>zy;)_&sl&&(a=a.add(c)),c=c.double(),_>>=sl;return a},precomputeWindow(s,_){const{windows:a,windowSize:c}=r(_),l=[];let p=s,u=p;for(let d=0;d<a;d++){u=p,l.push(u);for(let b=1;b<c;b++)u=u.add(p),l.push(u);p=u.double()}return l},wNAF(s,_,a){const{windows:c,windowSize:l}=r(s);let p=i.ZERO,u=i.BASE;const d=BigInt(2**s-1),b=2**s,S=BigInt(s);for(let R=0;R<c;R++){const m=R*l;let P=Number(a&d);a>>=S,P>l&&(P-=b,a+=sl);const E=m,B=m+Math.abs(P)-1,G=R%2!==0,Y=P<0;P===0?u=u.add(e(G,_[E])):p=p.add(e(Y,_[B]))}return{p,f:u}},wNAFCached(s,_,a,c){const l=s._WINDOW_SIZE||1;let p=_.get(s);return p||(p=this.precomputeWindow(s,l),l!==1&&_.set(s,c(p))),this.wNAF(l,p,a)}}}function Tf(i){return Ry(i.Fp),Po(i,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...vf(i.n,i.nBitLength),...i,p:i.Fp.ORDER})}function Gy(i){const t=Tf(i);Po(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:e,Fp:r,a:s}=t;if(e){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:By,hexToBytes:Ny}=gy,Dn={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(i){const{Err:t}=Dn;if(i.length<2||i[0]!==2)throw new t("Invalid signature integer tag");const e=i[1],r=i.subarray(2,e+2);if(!e||r.length!==e)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:By(r),l:i.subarray(e+2)}},toSig(i){const{Err:t}=Dn,e=typeof i=="string"?Ny(i):i;if(!(e instanceof Uint8Array))throw new Error("ui8a expected");let r=e.length;if(r<2||e[0]!=48)throw new t("Invalid signature tag");if(e[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:_}=Dn._parseInt(e.subarray(2)),{d:a,l:c}=Dn._parseInt(_);if(c.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(i){const t=p=>Number.parseInt(p[0],16)&8?"00"+p:p,e=p=>{const u=p.toString(16);return u.length&1?`0${u}`:u},r=t(e(i.s)),s=t(e(i.r)),_=r.length/2,a=s.length/2,c=e(_),l=e(a);return`30${e(a+_+4)}02${l}${s}02${c}${r}`}},bi=BigInt(0),he=BigInt(1);BigInt(2);const Of=BigInt(3);BigInt(4);function Ky(i){const t=Gy(i),{Fp:e}=t,r=t.toBytes||((R,m,P)=>{const E=m.toAffine();return Ro(Uint8Array.from([4]),e.toBytes(E.x),e.toBytes(E.y))}),s=t.fromBytes||(R=>{const m=R.subarray(1),P=e.fromBytes(m.subarray(0,e.BYTES)),E=e.fromBytes(m.subarray(e.BYTES,2*e.BYTES));return{x:P,y:E}});function _(R){const{a:m,b:P}=t,E=e.sqr(R),B=e.mul(E,R);return e.add(e.add(B,e.mul(R,m)),P)}if(!e.eql(e.sqr(t.Gy),_(t.Gx)))throw new Error("bad generator point: equation left != right");function a(R){return typeof R=="bigint"&&bi<R&&R<t.n}function c(R){if(!a(R))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(R){const{allowedPrivateKeyLengths:m,nByteLength:P,wrapPrivateKey:E,n:B}=t;if(m&&typeof R!="bigint"){if(R instanceof Uint8Array&&(R=N_(R)),typeof R!="string"||!m.includes(R.length))throw new Error("Invalid key");R=R.padStart(P*2,"0")}let G;try{G=typeof R=="bigint"?R:Fn(ti("private key",R,P))}catch{throw new Error(`private key must be ${P} bytes, hex or bigint, not ${typeof R}`)}return E&&(G=Qt(G,B)),c(G),G}const p=new Map;function u(R){if(!(R instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(m,P,E){if(this.px=m,this.py=P,this.pz=E,m==null||!e.isValid(m))throw new Error("x required");if(P==null||!e.isValid(P))throw new Error("y required");if(E==null||!e.isValid(E))throw new Error("z required")}static fromAffine(m){const{x:P,y:E}=m||{};if(!m||!e.isValid(P)||!e.isValid(E))throw new Error("invalid affine point");if(m instanceof d)throw new Error("projective point not allowed");const B=G=>e.eql(G,e.ZERO);return B(P)&&B(E)?d.ZERO:new d(P,E,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const P=e.invertBatch(m.map(E=>E.pz));return m.map((E,B)=>E.toAffine(P[B])).map(d.fromAffine)}static fromHex(m){const P=d.fromAffine(s(ti("pointHex",m)));return P.assertValidity(),P}static fromPrivateKey(m){return d.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,p.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!e.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y:P}=this.toAffine();if(!e.isValid(m)||!e.isValid(P))throw new Error("bad point: x or y not FE");const E=e.sqr(P),B=_(m);if(!e.eql(E,B))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(e.isOdd)return!e.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){u(m);const{px:P,py:E,pz:B}=this,{px:G,py:Y,pz:T}=m,v=e.eql(e.mul(P,T),e.mul(G,B)),F=e.eql(e.mul(E,T),e.mul(Y,B));return v&&F}negate(){return new d(this.px,e.neg(this.py),this.pz)}double(){const{a:m,b:P}=t,E=e.mul(P,Of),{px:B,py:G,pz:Y}=this;let T=e.ZERO,v=e.ZERO,F=e.ZERO,V=e.mul(B,B),q=e.mul(G,G),J=e.mul(Y,Y),Z=e.mul(B,G);return Z=e.add(Z,Z),F=e.mul(B,Y),F=e.add(F,F),T=e.mul(m,F),v=e.mul(E,J),v=e.add(T,v),T=e.sub(q,v),v=e.add(q,v),v=e.mul(T,v),T=e.mul(Z,T),F=e.mul(E,F),J=e.mul(m,J),Z=e.sub(V,J),Z=e.mul(m,Z),Z=e.add(Z,F),F=e.add(V,V),V=e.add(F,V),V=e.add(V,J),V=e.mul(V,Z),v=e.add(v,V),J=e.mul(G,Y),J=e.add(J,J),V=e.mul(J,Z),T=e.sub(T,V),F=e.mul(J,q),F=e.add(F,F),F=e.add(F,F),new d(T,v,F)}add(m){u(m);const{px:P,py:E,pz:B}=this,{px:G,py:Y,pz:T}=m;let v=e.ZERO,F=e.ZERO,V=e.ZERO;const q=t.a,J=e.mul(t.b,Of);let Z=e.mul(P,G),st=e.mul(E,Y),nt=e.mul(B,T),se=e.add(P,E),N=e.add(G,Y);se=e.mul(se,N),N=e.add(Z,st),se=e.sub(se,N),N=e.add(P,B);let k=e.add(G,T);return N=e.mul(N,k),k=e.add(Z,nt),N=e.sub(N,k),k=e.add(E,B),v=e.add(Y,T),k=e.mul(k,v),v=e.add(st,nt),k=e.sub(k,v),V=e.mul(q,N),v=e.mul(J,nt),V=e.add(v,V),v=e.sub(st,V),V=e.add(st,V),F=e.mul(v,V),st=e.add(Z,Z),st=e.add(st,Z),nt=e.mul(q,nt),N=e.mul(J,N),st=e.add(st,nt),nt=e.sub(Z,nt),nt=e.mul(q,nt),N=e.add(N,nt),Z=e.mul(st,N),F=e.add(F,Z),Z=e.mul(k,N),v=e.mul(se,v),v=e.sub(v,Z),Z=e.mul(se,st),V=e.mul(k,V),V=e.add(V,Z),new d(v,F,V)}subtract(m){return this.add(m.negate())}is0(){return this.equals(d.ZERO)}wNAF(m){return S.wNAFCached(this,p,m,P=>{const E=e.invertBatch(P.map(B=>B.pz));return P.map((B,G)=>B.toAffine(E[G])).map(d.fromAffine)})}multiplyUnsafe(m){const P=d.ZERO;if(m===bi)return P;if(c(m),m===he)return this;const{endo:E}=t;if(!E)return S.unsafeLadder(this,m);let{k1neg:B,k1:G,k2neg:Y,k2:T}=E.splitScalar(m),v=P,F=P,V=this;for(;G>bi||T>bi;)G&he&&(v=v.add(V)),T&he&&(F=F.add(V)),V=V.double(),G>>=he,T>>=he;return B&&(v=v.negate()),Y&&(F=F.negate()),F=new d(e.mul(F.px,E.beta),F.py,F.pz),v.add(F)}multiply(m){c(m);let P=m,E,B;const{endo:G}=t;if(G){const{k1neg:Y,k1:T,k2neg:v,k2:F}=G.splitScalar(P);let{p:V,f:q}=this.wNAF(T),{p:J,f:Z}=this.wNAF(F);V=S.constTimeNegate(Y,V),J=S.constTimeNegate(v,J),J=new d(e.mul(J.px,G.beta),J.py,J.pz),E=V.add(J),B=q.add(Z)}else{const{p:Y,f:T}=this.wNAF(P);E=Y,B=T}return d.normalizeZ([E,B])[0]}multiplyAndAddUnsafe(m,P,E){const B=d.BASE,G=(T,v)=>v===bi||v===he||!T.equals(B)?T.multiplyUnsafe(v):T.multiply(v),Y=G(this,P).add(G(m,E));return Y.is0()?void 0:Y}toAffine(m){const{px:P,py:E,pz:B}=this,G=this.is0();m==null&&(m=G?e.ONE:e.inv(B));const Y=e.mul(P,m),T=e.mul(E,m),v=e.mul(B,m);if(G)return{x:e.ZERO,y:e.ZERO};if(!e.eql(v,e.ONE))throw new Error("invZ was invalid");return{x:Y,y:T}}isTorsionFree(){const{h:m,isTorsionFree:P}=t;if(m===he)return!0;if(P)return P(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:P}=t;return m===he?this:P?P(d,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return this.assertValidity(),r(d,this,m)}toHex(m=!0){return N_(this.toRawBytes(m))}}d.BASE=new d(t.Gx,t.Gy,e.ONE),d.ZERO=new d(e.ZERO,e.ONE,e.ZERO);const b=t.nBitLength,S=Iy(d,t.endo?Math.ceil(b/2):b);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:l,weierstrassEquation:_,isWithinCurveOrder:a}}function vy(i){const t=Tf(i);return Po(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function xy(i){const t=vy(i),{Fp:e,n:r}=t,s=e.BYTES+1,_=2*e.BYTES+1;function a(N){return bi<N&&N<e.ORDER}function c(N){return Qt(N,r)}function l(N){return il(N,r)}const{ProjectivePoint:p,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:b}=Ky({...t,toBytes(N,k,$){const pt=k.toAffine(),_t=e.toBytes(pt.x),wt=Ro;return $?wt(Uint8Array.from([k.hasEvenY()?2:3]),_t):wt(Uint8Array.from([4]),_t,e.toBytes(pt.y))},fromBytes(N){const k=N.length,$=N[0],pt=N.subarray(1);if(k===s&&($===2||$===3)){const _t=Fn(pt);if(!a(_t))throw new Error("Point is not on curve");const wt=d(_t);let Gt=e.sqrt(wt);const ce=(Gt&he)===he;return($&1)===1!==ce&&(Gt=e.neg(Gt)),{x:_t,y:Gt}}else if(k===_&&$===4){const _t=e.fromBytes(pt.subarray(0,e.BYTES)),wt=e.fromBytes(pt.subarray(e.BYTES,2*e.BYTES));return{x:_t,y:wt}}else throw new Error(`Point of length ${k} was invalid. Expected ${s} compressed bytes or ${_} uncompressed bytes`)}}),S=N=>N_(K_(N,t.nByteLength));function R(N){const k=r>>he;return N>k}function m(N){return R(N)?c(-N):N}const P=(N,k,$)=>Fn(N.slice(k,$));class E{constructor(k,$,pt){this.r=k,this.s=$,this.recovery=pt,this.assertValidity()}static fromCompact(k){const $=t.nByteLength;return k=ti("compactSignature",k,$*2),new E(P(k,0,$),P(k,$,2*$))}static fromDER(k){const{r:$,s:pt}=Dn.toSig(ti("DER",k));return new E($,pt)}assertValidity(){if(!b(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!b(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(k){return new E(this.r,this.s,k)}recoverPublicKey(k){const{r:$,s:pt,recovery:_t}=this,wt=F(ti("msgHash",k));if(_t==null||![0,1,2,3].includes(_t))throw new Error("recovery id invalid");const Gt=_t===2||_t===3?$+t.n:$;if(Gt>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");const ce=(_t&1)===0?"02":"03",Un=p.fromHex(ce+S(Gt)),Tn=l(Gt),ho=c(-wt*Tn),da=c(pt*Tn),On=p.BASE.multiplyAndAddUnsafe(Un,ho,da);if(!On)throw new Error("point at infinify");return On.assertValidity(),On}hasHighS(){return R(this.s)}normalizeS(){return this.hasHighS()?new E(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return mo(this.toDERHex())}toDERHex(){return Dn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return mo(this.toCompactHex())}toCompactHex(){return S(this.r)+S(this.s)}}const B={isValidPrivateKey(N){try{return u(N),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const N=Uf(t.n);return Cy(t.randomBytes(N),t.n)},precompute(N=8,k=p.BASE){return k._setWindowSize(N),k.multiply(BigInt(3)),k}};function G(N,k=!0){return p.fromPrivateKey(N).toRawBytes(k)}function Y(N){const k=N instanceof Uint8Array,$=typeof N=="string",pt=(k||$)&&N.length;return k?pt===s||pt===_:$?pt===2*s||pt===2*_:N instanceof p}function T(N,k,$=!0){if(Y(N))throw new Error("first arg must be private key");if(!Y(k))throw new Error("second arg must be public key");return p.fromHex(k).multiply(u(N)).toRawBytes($)}const v=t.bits2int||function(N){const k=Fn(N),$=N.length*8-t.nBitLength;return $>0?k>>BigInt($):k},F=t.bits2int_modN||function(N){return c(v(N))},V=tl(t.nBitLength);function q(N){if(typeof N!="bigint")throw new Error("bigint expected");if(!(bi<=N&&N<V))throw new Error(`bigint expected < 2^${t.nBitLength}`);return K_(N,t.nByteLength)}function J(N,k,$=Z){if(["recovered","canonical"].some(C_=>C_ in $))throw new Error("sign() legacy options not supported");const{hash:pt,randomBytes:_t}=t;let{lowS:wt,prehash:Gt,extraEntropy:ce}=$;wt==null&&(wt=!0),N=ti("msgHash",N),Gt&&(N=ti("prehashed msgHash",pt(N)));const Un=F(N),Tn=u(k),ho=[q(Tn),q(Un)];if(ce!=null){const C_=ce===!0?_t(e.BYTES):ce;ho.push(ti("extraEntropy",C_))}const da=Ro(...ho),On=Un;function Kp(C_){const uo=v(C_);if(!b(uo))return;const ob=l(uo),di=p.BASE.multiply(uo).toAffine(),wo=c(di.x);if(wo===bi)return;const vc=c(ob*c(On+wo*Tn));if(vc===bi)return;let ab=(di.x===wo?0:2)|Number(di.y&he),cb=vc;return wt&&R(vc)&&(cb=m(vc),ab^=1),new E(wo,cb,ab)}return{seed:da,k2sig:Kp}}const Z={lowS:t.lowS,prehash:!1},st={lowS:t.lowS,prehash:!1};function nt(N,k,$=Z){const{seed:pt,k2sig:_t}=J(N,k,$),wt=t;return Bf(wt.hash.outputLen,wt.nByteLength,wt.hmac)(pt,_t)}p.BASE._setWindowSize(8);function se(N,k,$,pt=st){const _t=N;if(k=ti("msgHash",k),$=ti("publicKey",$),"strict"in pt)throw new Error("options.strict was renamed to lowS");const{lowS:wt,prehash:Gt}=pt;let ce,Un;try{if(typeof _t=="string"||_t instanceof Uint8Array)try{ce=E.fromDER(_t)}catch(di){if(!(di instanceof Dn.Err))throw di;ce=E.fromCompact(_t)}else if(typeof _t=="object"&&typeof _t.r=="bigint"&&typeof _t.s=="bigint"){const{r:di,s:wo}=_t;ce=new E(di,wo)}else throw new Error("PARSE");Un=p.fromHex($)}catch(di){if(di.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(wt&&ce.hasHighS())return!1;Gt&&(k=t.hash(k));const{r:Tn,s:ho}=ce,da=F(k),On=l(ho),Kp=c(da*On),C_=c(Tn*On),uo=p.BASE.multiplyAndAddUnsafe(Un,Kp,C_)?.toAffine();return uo?c(uo.x)===Tn:!1}return{CURVE:t,getPublicKey:G,getSharedSecret:T,sign:nt,verify:se,ProjectivePoint:p,Signature:E,utils:B}}function Uy(i){return{hash:i,hmac:(t,...e)=>cf(i,t,xb(...e)),randomBytes:Ub}}function Ty(i,t){const e=r=>xy({...i,...Uy(r)});return Object.freeze({...e(t),create:e})}const kf=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Vf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Oy=BigInt(1),nl=BigInt(2),Ff=(i,t)=>(i+t/nl)/t;function ky(i){const t=kf,e=BigInt(3),r=BigInt(6),s=BigInt(11),_=BigInt(22),a=BigInt(23),c=BigInt(44),l=BigInt(88),p=i*i*i%t,u=p*p*i%t,d=fe(u,e,t)*u%t,b=fe(d,e,t)*u%t,S=fe(b,nl,t)*p%t,R=fe(S,s,t)*S%t,m=fe(R,_,t)*R%t,P=fe(m,c,t)*m%t,E=fe(P,l,t)*P%t,B=fe(E,c,t)*m%t,G=fe(B,e,t)*u%t,Y=fe(G,a,t)*R%t,T=fe(Y,r,t)*p%t,v=fe(T,nl,t);if(!_l.eql(_l.sqr(v),i))throw new Error("Cannot find square root");return v}const _l=Ey(kf,void 0,void 0,{sqrt:ky}),Qi=Ty({a:BigInt(0),b:BigInt(7),Fp:_l,n:Vf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:i=>{const t=Vf,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Oy*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),_=e,a=BigInt("0x100000000000000000000000000000000"),c=Ff(_*i,t),l=Ff(-r*i,t);let p=Qt(i-c*e-l*s,t),u=Qt(-c*r-l*_,t);const d=p>a,b=u>a;if(d&&(p=t-p),b&&(u=t-u),p>a||u>a)throw new Error("splitScalar: Endomorphism failed, k="+i);return{k1neg:d,k1:p,k2neg:b,k2:u}}}},pf);BigInt(0),Qi.ProjectivePoint;const Mo="0x0000000000000000000000000000000000000000",Yf="0x0000000000000000000000000000000000000000000000000000000000000000",Df=BigInt(0),jf=BigInt(1),ol=BigInt(2),Lf=BigInt(27),Hf=BigInt(28),Ca=BigInt(35),Jf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Vy=Jf/ol,Fy=Symbol.for("nodejs.util.inspect.custom"),jn={};function al(i){return pe(Pt(i),32)}class bt{#t;#e;#r;#i;get r(){return this.#t}set r(t){y(kn(t)===32,"invalid r","value",t),this.#t=K(t)}get s(){return y(parseInt(this.#e.substring(0,3))<8,"non-canonical s; use ._s","s",this.#e),this.#e}set s(t){y(kn(t)===32,"invalid s","value",t),this.#e=K(t)}get _s(){return this.#e}isValid(){return BigInt(this.#e)<=Vy}get v(){return this.#r}set v(t){const e=W(t,"value");y(e===27||e===28,"invalid v","v",t),this.#r=e}get networkV(){return this.#i}get legacyChainId(){const t=this.networkV;return t==null?null:bt.getChainId(t)}get yParity(){return this.v===27?0:1}get yParityAndS(){const t=j(this.s);return this.yParity&&(t[0]|=128),K(t)}get compactSerialized(){return ot([this.r,this.yParityAndS])}get serialized(){return ot([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(t,e,r,s){ga(t,jn,"Signature"),this.#t=e,this.#e=r,this.#r=s,this.#i=null}getCanonical(){if(this.isValid())return this;const t=Jf-BigInt(this._s),e=55-this.v,r=new bt(jn,this.r,al(t),e);return this.networkV&&(r.#i=this.networkV),r}clone(){const t=new bt(jn,this.r,this._s,this.v);return this.networkV&&(t.#i=this.networkV),t}toJSON(){const t=this.networkV;return{_type:"signature",networkV:t!=null?t.toString():null,r:this.r,s:this._s,v:this.v}}[Fy](){return this.toString()}toString(){return this.isValid()?`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`:`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(t){const e=O(t,"v");return e==Lf||e==Hf?Df:(y(e>=Ca,"invalid EIP-155 v","v",t),(e-Ca)/ol)}static getChainIdV(t,e){return O(t)*ol+BigInt(35+e-27)}static getNormalizedV(t){const e=O(t);return e===Df||e===Lf?27:e===jf||e===Hf?28:(y(e>=Ca,"invalid v","v",t),e&jf?27:28)}static from(t){function e(p,u){y(p,u,"signature",t)}if(t==null)return new bt(jn,Yf,Yf,27);if(typeof t=="string"){const p=j(t,"signature");if(p.length===64){const u=K(p.slice(0,32)),d=p.slice(32,64),b=d[0]&128?28:27;return d[0]&=127,new bt(jn,u,K(d),b)}if(p.length===65){const u=K(p.slice(0,32)),d=K(p.slice(32,64)),b=bt.getNormalizedV(p[64]);return new bt(jn,u,d,b)}e(!1,"invalid raw signature length")}if(t instanceof bt)return t.clone();const r=t.r;e(r!=null,"missing r");const s=al(r),_=(function(p,u){if(p!=null)return al(p);if(u!=null){e(ht(u,32),"invalid yParityAndS");const d=j(u);return d[0]&=127,K(d)}e(!1,"missing s")})(t.s,t.yParityAndS),{networkV:a,v:c}=(function(p,u,d){if(p!=null){const b=O(p);return{networkV:b>=Ca?b:void 0,v:bt.getNormalizedV(b)}}if(u!=null)return e(ht(u,32),"invalid yParityAndS"),{v:j(u)[0]&128?28:27};if(d!=null){switch(W(d,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}e(!1,"invalid yParity")}e(!1,"missing v")})(t.v,t.yParityAndS,t.yParity),l=new bt(jn,s,_,c);return a&&(l.#i=a),e(t.yParity==null||W(t.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),e(t.yParityAndS==null||t.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}}class yi{#t;constructor(t){y(kn(t)===32,"invalid private key","privateKey","[REDACTED]"),this.#t=K(t)}get privateKey(){return this.#t}get publicKey(){return yi.computePublicKey(this.#t)}get compressedPublicKey(){return yi.computePublicKey(this.#t,!0)}sign(t){y(kn(t)===32,"invalid digest length","digest",t);const e=Qi.sign(Ft(t),Ft(this.#t),{lowS:!0});return bt.from({r:Yi(e.r,32),s:Yi(e.s,32),v:e.recovery?28:27})}computeSharedSecret(t){const e=yi.computePublicKey(t);return K(Qi.getSharedSecret(Ft(this.#t),j(e),!1))}static computePublicKey(t,e){let r=j(t,"key");if(r.length===32){const _=Qi.getPublicKey(r,!!e);return K(_)}if(r.length===64){const _=new Uint8Array(65);_[0]=4,_.set(r,1),r=_}const s=Qi.ProjectivePoint.fromHex(r);return K(s.toRawBytes(e))}static recoverPublicKey(t,e){y(kn(t)===32,"invalid digest length","digest",t);const r=bt.from(e);let s=Qi.Signature.fromCompact(Ft(ot([r.r,r.s])));s=s.addRecoveryBit(r.yParity);const _=s.recoverPublicKey(Ft(t));return y(_!=null,"invalid signature for digest","signature",e),"0x"+_.toHex(!1)}static addPoints(t,e,r){const s=Qi.ProjectivePoint.fromHex(yi.computePublicKey(t).substring(2)),_=Qi.ProjectivePoint.fromHex(yi.computePublicKey(e).substring(2));return"0x"+s.add(_).toHex(!!r)}}const Yy=BigInt(0),Dy=BigInt(36);function Qf(i){i=i.toLowerCase();const t=i.substring(2).split(""),e=new Uint8Array(40);for(let s=0;s<40;s++)e[s]=t[s].charCodeAt(0);const r=j(mt(e));for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&(t[s]=t[s].toUpperCase()),(r[s>>1]&15)>=8&&(t[s+1]=t[s+1].toUpperCase());return"0x"+t.join("")}const cl={};for(let i=0;i<10;i++)cl[String(i)]=String(i);for(let i=0;i<26;i++)cl[String.fromCharCode(65+i)]=String(10+i);const $f=15;function jy(i){i=i.toUpperCase(),i=i.substring(4)+i.substring(0,2)+"00";let t=i.split("").map(r=>cl[r]).join("");for(;t.length>=$f;){let r=t.substring(0,$f);t=parseInt(r,10)%97+t.substring(r.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}const Ly=(function(){const i={};for(let t=0;t<36;t++){const e="0123456789abcdefghijklmnopqrstuvwxyz"[t];i[e]=BigInt(t)}return i})();function Hy(i){i=i.toLowerCase();let t=Yy;for(let e=0;e<i.length;e++)t=t*Dy+Ly[i[e]];return t}function et(i){if(y(typeof i=="string","invalid address","address",i),i.match(/^(0x)?[0-9a-fA-F]{40}$/)){i.startsWith("0x")||(i="0x"+i);const t=Qf(i);return y(!i.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===i,"bad address checksum","address",i),t}if(i.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){y(i.substring(2,4)===jy(i),"bad icap checksum","address",i);let t=Hy(i.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return Qf("0x"+t)}y(!1,"invalid address","address",i)}function Jy(i){const t=et(i.from);let r=O(i.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,et(St(mt(wi([t,r])),12))}function Wf(i){return i&&typeof i.getAddress=="function"}function Qy(i){try{return et(i),!0}catch{}return!1}async function ll(i,t){const e=await t;return(e==null||e==="0x0000000000000000000000000000000000000000")&&(C(typeof i!="string","unconfigured name","UNCONFIGURED_NAME",{value:i}),y(!1,"invalid AddressLike value; did not resolve to a value address","target",i)),et(e)}function Dt(i,t){if(typeof i=="string")return i.match(/^0x[0-9a-f]{40}$/i)?et(i):(C(t!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),ll(i,t.resolveName(i)));if(Wf(i))return ll(i,i.getAddress());if(i&&typeof i.then=="function")return ll(i,i);y(!1,"unsupported addressable value","target",i)}const Si={};function U(i,t){let e=!1;return t<0&&(e=!0,t*=-1),new Rt(Si,`${e?"":"u"}int${t}`,i,{signed:e,width:t})}function rt(i,t){return new Rt(Si,`bytes${t||""}`,i,{size:t})}const Zf=Symbol.for("_ethers_typed");class Rt{type;value;#t;_typedSymbol;constructor(t,e,r,s){s==null&&(s=null),ga(Si,t,"Typed"),D(this,{_typedSymbol:Zf,type:e,value:r}),this.#t=s,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(t=>t.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#t}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#t===!0?-1:this.#t===!1?this.value.length:null}static from(t,e){return new Rt(Si,t,e)}static uint8(t){return U(t,8)}static uint16(t){return U(t,16)}static uint24(t){return U(t,24)}static uint32(t){return U(t,32)}static uint40(t){return U(t,40)}static uint48(t){return U(t,48)}static uint56(t){return U(t,56)}static uint64(t){return U(t,64)}static uint72(t){return U(t,72)}static uint80(t){return U(t,80)}static uint88(t){return U(t,88)}static uint96(t){return U(t,96)}static uint104(t){return U(t,104)}static uint112(t){return U(t,112)}static uint120(t){return U(t,120)}static uint128(t){return U(t,128)}static uint136(t){return U(t,136)}static uint144(t){return U(t,144)}static uint152(t){return U(t,152)}static uint160(t){return U(t,160)}static uint168(t){return U(t,168)}static uint176(t){return U(t,176)}static uint184(t){return U(t,184)}static uint192(t){return U(t,192)}static uint200(t){return U(t,200)}static uint208(t){return U(t,208)}static uint216(t){return U(t,216)}static uint224(t){return U(t,224)}static uint232(t){return U(t,232)}static uint240(t){return U(t,240)}static uint248(t){return U(t,248)}static uint256(t){return U(t,256)}static uint(t){return U(t,256)}static int8(t){return U(t,-8)}static int16(t){return U(t,-16)}static int24(t){return U(t,-24)}static int32(t){return U(t,-32)}static int40(t){return U(t,-40)}static int48(t){return U(t,-48)}static int56(t){return U(t,-56)}static int64(t){return U(t,-64)}static int72(t){return U(t,-72)}static int80(t){return U(t,-80)}static int88(t){return U(t,-88)}static int96(t){return U(t,-96)}static int104(t){return U(t,-104)}static int112(t){return U(t,-112)}static int120(t){return U(t,-120)}static int128(t){return U(t,-128)}static int136(t){return U(t,-136)}static int144(t){return U(t,-144)}static int152(t){return U(t,-152)}static int160(t){return U(t,-160)}static int168(t){return U(t,-168)}static int176(t){return U(t,-176)}static int184(t){return U(t,-184)}static int192(t){return U(t,-192)}static int200(t){return U(t,-200)}static int208(t){return U(t,-208)}static int216(t){return U(t,-216)}static int224(t){return U(t,-224)}static int232(t){return U(t,-232)}static int240(t){return U(t,-240)}static int248(t){return U(t,-248)}static int256(t){return U(t,-256)}static int(t){return U(t,-256)}static bytes1(t){return rt(t,1)}static bytes2(t){return rt(t,2)}static bytes3(t){return rt(t,3)}static bytes4(t){return rt(t,4)}static bytes5(t){return rt(t,5)}static bytes6(t){return rt(t,6)}static bytes7(t){return rt(t,7)}static bytes8(t){return rt(t,8)}static bytes9(t){return rt(t,9)}static bytes10(t){return rt(t,10)}static bytes11(t){return rt(t,11)}static bytes12(t){return rt(t,12)}static bytes13(t){return rt(t,13)}static bytes14(t){return rt(t,14)}static bytes15(t){return rt(t,15)}static bytes16(t){return rt(t,16)}static bytes17(t){return rt(t,17)}static bytes18(t){return rt(t,18)}static bytes19(t){return rt(t,19)}static bytes20(t){return rt(t,20)}static bytes21(t){return rt(t,21)}static bytes22(t){return rt(t,22)}static bytes23(t){return rt(t,23)}static bytes24(t){return rt(t,24)}static bytes25(t){return rt(t,25)}static bytes26(t){return rt(t,26)}static bytes27(t){return rt(t,27)}static bytes28(t){return rt(t,28)}static bytes29(t){return rt(t,29)}static bytes30(t){return rt(t,30)}static bytes31(t){return rt(t,31)}static bytes32(t){return rt(t,32)}static address(t){return new Rt(Si,"address",t)}static bool(t){return new Rt(Si,"bool",!!t)}static bytes(t){return new Rt(Si,"bytes",t)}static string(t){return new Rt(Si,"string",t)}static array(t,e){throw new Error("not implemented yet")}static tuple(t,e){throw new Error("not implemented yet")}static overrides(t){return new Rt(Si,"overrides",Object.assign({},t))}static isTyped(t){return t&&typeof t=="object"&&"_typedSymbol"in t&&t._typedSymbol===Zf}static dereference(t,e){if(Rt.isTyped(t)){if(t.type!==e)throw new Error(`invalid type: expecetd ${e}, got ${t.type}`);return t.value}return t}}class $y extends Ai{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let r=Rt.dereference(e,"string");try{r=et(r)}catch(s){return this._throwError(s.message,e)}return t.writeValue(r)}decode(t){return et(Yi(t.readValue(),20))}}class Wy extends Ai{coder;constructor(t){super(t.name,t.type,"_",t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}function qf(i,t,e){let r=[];if(Array.isArray(e))r=e;else if(e&&typeof e=="object"){let l={};r=t.map(p=>{const u=p.localName;return C(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:p},value:e}),C(!l[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:p},value:e}),l[u]=!0,e[u]})}else y(!1,"invalid tuple value","tuple",e);y(t.length===r.length,"types/value length mismatch","tuple",e);let s=new Yc,_=new Yc,a=[];t.forEach((l,p)=>{let u=r[p];if(l.dynamic){let d=_.length;l.encode(_,u);let b=s.writeUpdatableValue();a.push(S=>{b(S+d)})}else l.encode(s,u)}),a.forEach(l=>{l(s.length)});let c=i.appendWriter(s);return c+=i.appendWriter(_),c}function Xf(i,t){let e=[],r=[],s=i.subReader(0);return t.forEach(_=>{let a=null;if(_.dynamic){let c=i.readIndex(),l=s.subReader(c);try{a=_.decode(l)}catch(p){if(vt(p,"BUFFER_OVERRUN"))throw p;a=p,a.baseType=_.name,a.name=_.localName,a.type=_.type}}else try{a=_.decode(i)}catch(c){if(vt(c,"BUFFER_OVERRUN"))throw c;a=c,a.baseType=_.name,a.name=_.localName,a.type=_.type}if(a==null)throw new Error("investigate");e.push(a),r.push(_.localName||null)}),gi.fromItems(e,r)}class Zy extends Ai{coder;length;constructor(t,e,r){const s=t.type+"["+(e>=0?e:"")+"]",_=e===-1||t.dynamic;super("array",s,r,_),D(this,{coder:t,length:e})}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let r=0;r<this.length;r++)e.push(t);return e}encode(t,e){const r=Rt.dereference(e,"array");Array.isArray(r)||this._throwError("expected array value",r);let s=this.length;s===-1&&(s=r.length,t.writeValue(r.length)),vp(r.length,s,"coder array"+(this.localName?" "+this.localName:""));let _=[];for(let a=0;a<r.length;a++)_.push(this.coder);return qf(t,_,r)}decode(t){let e=this.length;e===-1&&(e=t.readIndex(),C(e*Yt<=t.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:t.bytes,offset:e*Yt,length:t.dataLength}));let r=[];for(let s=0;s<e;s++)r.push(new Wy(this.coder));return Xf(t,r)}}class qy extends Ai{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){const r=Rt.dereference(e,"bool");return t.writeValue(r?1:0)}decode(t){return!!t.readValue()}}class th extends Ai{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=Ft(e);let r=t.writeValue(e.length);return r+=t.writeBytes(e),r}decode(t){return t.readBytes(t.readIndex(),!0)}}class Xy extends th{constructor(t){super("bytes",t)}decode(t){return K(super.decode(t))}}class t0 extends Ai{size;constructor(t,e){let r="bytes"+String(t);super(r,r,e,!1),D(this,{size:t},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(t,e){let r=Ft(Rt.dereference(e,this.type));return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}decode(t){return K(t.readBytes(this.size))}}const e0=new Uint8Array([]);class r0 extends Ai{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return e!=null&&this._throwError("not null",e),t.writeBytes(e0)}decode(t){return t.readBytes(0),null}}const i0=BigInt(0),s0=BigInt(1),n0=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class _0 extends Ai{size;signed;constructor(t,e,r){const s=(e?"int":"uint")+t*8;super(s,s,r,!1),D(this,{size:t,signed:e},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(t,e){let r=O(Rt.dereference(e,this.type)),s=Ao(n0,Yt*8);if(this.signed){let _=Ao(s,this.size*8-1);(r>_||r<-(_+s0))&&this._throwError("value out-of-bounds",e),r=Tc(r,8*Yt)}else(r<i0||r>Ao(s,this.size*8))&&this._throwError("value out-of-bounds",e);return t.writeValue(r)}decode(t){let e=Ao(t.readValue(),this.size*8);return this.signed&&(e=hb(e,this.size*8)),e}}class o0 extends th{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,_i(Rt.dereference(e,"string")))}decode(t){return ba(super.decode(t))}}class za extends Ai{coders;constructor(t,e){let r=!1;const s=[];t.forEach(a=>{a.dynamic&&(r=!0),s.push(a.type)});const _="tuple("+s.join(",")+")";super("tuple",_,e,r),D(this,{coders:Object.freeze(t.slice())})}defaultValue(){const t=[];this.coders.forEach(r=>{t.push(r.defaultValue())});const e=this.coders.reduce((r,s)=>{const _=s.localName;return _&&(r[_]||(r[_]=0),r[_]++),r},{});return this.coders.forEach((r,s)=>{let _=r.localName;!_||e[_]!==1||(_==="length"&&(_="_length"),t[_]==null&&(t[_]=t[s]))}),Object.freeze(t)}encode(t,e){const r=Rt.dereference(e,"tuple");return qf(t,this.coders,r)}decode(t){return Xf(t,this.coders)}}function pl(i,t){return{address:et(i),storageKeys:t.map((e,r)=>(y(ht(e,32),"invalid slot",`storageKeys[${r}]`,e),e.toLowerCase()))}}function Ln(i){if(Array.isArray(i))return i.map((e,r)=>Array.isArray(e)?(y(e.length===2,"invalid slot set",`value[${r}]`,e),pl(e[0],e[1])):(y(e!=null&&typeof e=="object","invalid address-slot set","value",i),pl(e.address,e.storageKeys)));y(i!=null&&typeof i=="object","invalid access list","value",i);const t=Object.keys(i).map(e=>{const r=i[e].reduce((s,_)=>(s[_]=!0,s),{});return pl(e,Object.keys(r).sort())});return t.sort((e,r)=>e.address.localeCompare(r.address)),t}function eh(i){return{address:et(i.address),nonce:O(i.nonce!=null?i.nonce:0),chainId:O(i.chainId!=null?i.chainId:0),signature:bt.from(i.signature)}}function a0(i){let t;return typeof i=="string"?t=yi.computePublicKey(i,!1):t=i.publicKey,et(mt("0x"+t.substring(4)).substring(26))}function rh(i,t){return a0(yi.recoverPublicKey(i,t))}const Nt=BigInt(0),c0=BigInt(2),l0=BigInt(27),p0=BigInt(28),f0=BigInt(35),h0=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),u0=Symbol.for("nodejs.util.inspect.custom"),fl=4096*32,Ia=128;function d0(i){return{blobToKzgCommitment:r=>{if("computeBlobProof"in i){if("blobToKzgCommitment"in i&&typeof i.blobToKzgCommitment=="function")return j(i.blobToKzgCommitment(K(r)))}else if("blobToKzgCommitment"in i&&typeof i.blobToKzgCommitment=="function")return j(i.blobToKzgCommitment(r));if("blobToKZGCommitment"in i&&typeof i.blobToKZGCommitment=="function")return j(i.blobToKZGCommitment(K(r)));y(!1,"unsupported KZG library","kzg",i)},computeBlobKzgProof:(r,s)=>{if("computeBlobProof"in i&&typeof i.computeBlobProof=="function")return j(i.computeBlobProof(K(r),K(s)));if("computeBlobKzgProof"in i&&typeof i.computeBlobKzgProof=="function")return i.computeBlobKzgProof(r,s);if("computeBlobKZGProof"in i&&typeof i.computeBlobKZGProof=="function")return j(i.computeBlobKZGProof(K(r),K(s)));y(!1,"unsupported KZG library","kzg",i)}}}function ih(i,t){let e=i.toString(16);for(;e.length<2;)e="0"+e;return e+=B_(t).substring(4),"0x"+e}function v_(i){return i==="0x"?null:et(i)}function Ga(i,t){try{return Ln(i)}catch(e){y(!1,e.message,t,i)}}function w0(i,t){try{if(!Array.isArray(i))throw new Error("authorizationList: invalid array");const e=[];for(let r=0;r<i.length;r++){const s=i[r];if(!Array.isArray(s))throw new Error(`authorization[${r}]: invalid array`);if(s.length!==6)throw new Error(`authorization[${r}]: wrong length`);if(!s[1])throw new Error(`authorization[${r}]: null address`);e.push({address:v_(s[1]),nonce:at(s[2],"nonce"),chainId:at(s[0],"chainId"),signature:bt.from({yParity:Hn(s[3],"yParity"),r:pe(s[4],32),s:pe(s[5],32)})})}return e}catch(e){y(!1,e.message,t,i)}}function Hn(i,t){return i==="0x"?0:W(i,t)}function at(i,t){if(i==="0x")return Nt;const e=O(i,t);return y(e<=h0,"value exceeds uint size",t,e),e}function X(i,t){const e=O(i,"value"),r=Pt(e);return y(r.length<=32,"value too large",`tx.${t}`,e),r}function Ba(i){return Ln(i).map(t=>[t.address,t.storageKeys])}function g0(i){return i.map(t=>[X(t.chainId,"chainId"),t.address,X(t.nonce,"nonce"),X(t.signature.yParity,"yParity"),Pt(t.signature.r),Pt(t.signature._s)])}function A0(i,t){y(Array.isArray(i),`invalid ${t}`,"value",i);for(let e=0;e<i.length;e++)y(ht(i[e],32),"invalid ${ param } hash",`value[${e}]`,i[e]);return i}function b0(i){const t=bo(i);y(Array.isArray(t)&&(t.length===9||t.length===6),"invalid field count for legacy transaction","data",i);const e={type:0,nonce:Hn(t[0],"nonce"),gasPrice:at(t[1],"gasPrice"),gasLimit:at(t[2],"gasLimit"),to:v_(t[3]),value:at(t[4],"value"),data:K(t[5]),chainId:Nt};if(t.length===6)return e;const r=at(t[6],"v"),s=at(t[7],"r"),_=at(t[8],"s");if(s===Nt&&_===Nt)e.chainId=r;else{let a=(r-f0)/c0;a<Nt&&(a=Nt),e.chainId=a,y(a!==Nt||r===l0||r===p0,"non-canonical legacy v","v",t[6]),e.signature=bt.from({r:pe(t[7],32),s:pe(t[8],32),v:r})}return e}function y0(i,t){const e=[X(i.nonce,"nonce"),X(i.gasPrice||0,"gasPrice"),X(i.gasLimit,"gasLimit"),i.to||"0x",X(i.value,"value"),i.data];let r=Nt;if(i.chainId!=Nt)r=O(i.chainId,"tx.chainId"),y(!t||t.networkV==null||t.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",t);else if(i.signature){const _=i.signature.legacyChainId;_!=null&&(r=_)}if(!t)return r!==Nt&&(e.push(Pt(r)),e.push("0x"),e.push("0x")),wi(e);let s=BigInt(27+t.yParity);return r!==Nt?s=bt.getChainIdV(r,t.v):BigInt(t.v)!==s&&y(!1,"tx.chainId/sig.v mismatch","sig",t),e.push(Pt(s)),e.push(Pt(t.r)),e.push(Pt(t._s)),wi(e)}function Na(i,t){let e;try{if(e=Hn(t[0],"yParity"),e!==0&&e!==1)throw new Error("bad yParity")}catch{y(!1,"invalid yParity","yParity",t[0])}const r=pe(t[1],32),s=pe(t[2],32),_=bt.from({r,s,yParity:e});i.signature=_}function S0(i){const t=bo(j(i).slice(1));y(Array.isArray(t)&&(t.length===9||t.length===12),"invalid field count for transaction type: 2","data",K(i));const e={type:2,chainId:at(t[0],"chainId"),nonce:Hn(t[1],"nonce"),maxPriorityFeePerGas:at(t[2],"maxPriorityFeePerGas"),maxFeePerGas:at(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:at(t[4],"gasLimit"),to:v_(t[5]),value:at(t[6],"value"),data:K(t[7]),accessList:Ga(t[8],"accessList")};return t.length===9||Na(e,t.slice(9)),e}function m0(i,t){const e=[X(i.chainId,"chainId"),X(i.nonce,"nonce"),X(i.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),X(i.maxFeePerGas||0,"maxFeePerGas"),X(i.gasLimit,"gasLimit"),i.to||"0x",X(i.value,"value"),i.data,Ba(i.accessList||[])];return t&&(e.push(X(t.yParity,"yParity")),e.push(Pt(t.r)),e.push(Pt(t.s))),ot(["0x02",wi(e)])}function R0(i){const t=bo(j(i).slice(1));y(Array.isArray(t)&&(t.length===8||t.length===11),"invalid field count for transaction type: 1","data",K(i));const e={type:1,chainId:at(t[0],"chainId"),nonce:Hn(t[1],"nonce"),gasPrice:at(t[2],"gasPrice"),gasLimit:at(t[3],"gasLimit"),to:v_(t[4]),value:at(t[5],"value"),data:K(t[6]),accessList:Ga(t[7],"accessList")};return t.length===8||Na(e,t.slice(8)),e}function P0(i,t){const e=[X(i.chainId,"chainId"),X(i.nonce,"nonce"),X(i.gasPrice||0,"gasPrice"),X(i.gasLimit,"gasLimit"),i.to||"0x",X(i.value,"value"),i.data,Ba(i.accessList||[])];return t&&(e.push(X(t.yParity,"recoveryParam")),e.push(Pt(t.r)),e.push(Pt(t.s))),ot(["0x01",wi(e)])}function M0(i){let t=bo(j(i).slice(1)),e="3",r=null,s=null;if(t.length===4&&Array.isArray(t[0])){e="3 (network format)";const a=t[1],c=t[2],l=t[3];y(Array.isArray(a),"invalid network format: blobs not an array","fields[1]",a),y(Array.isArray(c),"invalid network format: commitments not an array","fields[2]",c),y(Array.isArray(l),"invalid network format: proofs not an array","fields[3]",l),y(a.length===c.length,"invalid network format: blobs/commitments length mismatch","fields",t),y(a.length===l.length,"invalid network format: blobs/proofs length mismatch","fields",t),s=[];for(let p=0;p<t[1].length;p++)s.push({data:a[p],commitment:c[p],proof:l[p]});t=t[0]}else if(t.length===5&&Array.isArray(t[0])){e="3 (EIP-7594 network format)",r=W(t[1]);const a=t[2],c=t[3],l=t[4];y(r===1,`unsupported EIP-7594 network format version: ${r}`,"fields[1]",r),y(Array.isArray(a),"invalid EIP-7594 network format: blobs not an array","fields[2]",a),y(Array.isArray(c),"invalid EIP-7594 network format: commitments not an array","fields[3]",c),y(Array.isArray(l),"invalid EIP-7594 network format: proofs not an array","fields[4]",l),y(a.length===c.length,"invalid network format: blobs/commitments length mismatch","fields",t),y(a.length*Ia===l.length,"invalid network format: blobs/proofs length mismatch","fields",t),s=[];for(let p=0;p<a.length;p++){const u=[];for(let d=0;d<Ia;d++)u.push(l[p*Ia+d]);s.push({data:a[p],commitment:c[p],proof:ot(u)})}t=t[0]}y(Array.isArray(t)&&(t.length===11||t.length===14),`invalid field count for transaction type: ${e}`,"data",K(i));const _={type:3,chainId:at(t[0],"chainId"),nonce:Hn(t[1],"nonce"),maxPriorityFeePerGas:at(t[2],"maxPriorityFeePerGas"),maxFeePerGas:at(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:at(t[4],"gasLimit"),to:v_(t[5]),value:at(t[6],"value"),data:K(t[7]),accessList:Ga(t[8],"accessList"),maxFeePerBlobGas:at(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10],blobWrapperVersion:r};s&&(_.blobs=s),y(_.to!=null,`invalid address for transaction type: ${e}`,"data",i),y(Array.isArray(_.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",i);for(let a=0;a<_.blobVersionedHashes.length;a++)y(ht(_.blobVersionedHashes[a],32),`invalid blobVersionedHash at index ${a}: must be length 32`,"data",i);return t.length===11||Na(_,t.slice(11)),_}function E0(i,t,e){const r=[X(i.chainId,"chainId"),X(i.nonce,"nonce"),X(i.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),X(i.maxFeePerGas||0,"maxFeePerGas"),X(i.gasLimit,"gasLimit"),i.to||Mo,X(i.value,"value"),i.data,Ba(i.accessList||[]),X(i.maxFeePerBlobGas||0,"maxFeePerBlobGas"),A0(i.blobVersionedHashes||[],"blobVersionedHashes")];if(t&&(r.push(X(t.yParity,"yParity")),r.push(Pt(t.r)),r.push(Pt(t.s)),e)){if(i.blobWrapperVersion!=null){const s=Pt(i.blobWrapperVersion),_=[];for(const{proof:a}of e){const c=j(a),l=c.length/Ia;for(let p=0;p<c.length;p+=l)_.push(c.subarray(p,p+l))}return ot(["0x03",wi([r,s,e.map(a=>a.data),e.map(a=>a.commitment),_])])}return ot(["0x03",wi([r,e.map(s=>s.data),e.map(s=>s.commitment),e.map(s=>s.proof)])])}return ot(["0x03",wi(r)])}function C0(i){const t=bo(j(i).slice(1));y(Array.isArray(t)&&(t.length===10||t.length===13),"invalid field count for transaction type: 4","data",K(i));const e={type:4,chainId:at(t[0],"chainId"),nonce:Hn(t[1],"nonce"),maxPriorityFeePerGas:at(t[2],"maxPriorityFeePerGas"),maxFeePerGas:at(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:at(t[4],"gasLimit"),to:v_(t[5]),value:at(t[6],"value"),data:K(t[7]),accessList:Ga(t[8],"accessList"),authorizationList:w0(t[9],"authorizationList")};return t.length===10||Na(e,t.slice(10)),e}function z0(i,t){const e=[X(i.chainId,"chainId"),X(i.nonce,"nonce"),X(i.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),X(i.maxFeePerGas||0,"maxFeePerGas"),X(i.gasLimit,"gasLimit"),i.to||"0x",X(i.value,"value"),i.data,Ba(i.accessList||[]),g0(i.authorizationList||[])];return t&&(e.push(X(t.yParity,"yParity")),e.push(Pt(t.r)),e.push(Pt(t.s))),ot(["0x04",wi(e)])}class ei{#t;#e;#r;#i;#s;#n;#_;#o;#u;#a;#p;#h;#c;#l;#f;#d;#A;#w;get type(){return this.#t}set type(t){switch(t){case null:this.#t=null;break;case 0:case"legacy":this.#t=0;break;case 1:case"berlin":case"eip-2930":this.#t=1;break;case 2:case"london":case"eip-1559":this.#t=2;break;case 3:case"cancun":case"eip-4844":this.#t=3;break;case 4:case"pectra":case"eip-7702":this.#t=4;break;default:y(!1,"unsupported transaction type","type",t)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const t=this.#e;return t==null&&this.type===3?Mo:t}set to(t){this.#e=t==null?null:et(t)}get nonce(){return this.#i}set nonce(t){this.#i=W(t,"value")}get gasLimit(){return this.#s}set gasLimit(t){this.#s=O(t)}get gasPrice(){const t=this.#n;return t==null&&(this.type===0||this.type===1)?Nt:t}set gasPrice(t){this.#n=t==null?null:O(t,"gasPrice")}get maxPriorityFeePerGas(){const t=this.#_;return t??(this.type===2||this.type===3?Nt:null)}set maxPriorityFeePerGas(t){this.#_=t==null?null:O(t,"maxPriorityFeePerGas")}get maxFeePerGas(){const t=this.#o;return t??(this.type===2||this.type===3?Nt:null)}set maxFeePerGas(t){this.#o=t==null?null:O(t,"maxFeePerGas")}get data(){return this.#r}set data(t){this.#r=K(t)}get value(){return this.#u}set value(t){this.#u=O(t,"value")}get chainId(){return this.#a}set chainId(t){this.#a=O(t)}get signature(){return this.#p||null}set signature(t){this.#p=t==null?null:bt.from(t)}isValid(){const t=this.signature;if(t&&!t.isValid())return!1;const e=this.authorizationList;if(e){for(const r of e)if(!r.signature.isValid())return!1}return!0}get accessList(){const t=this.#h||null;return t??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(t){this.#h=t==null?null:Ln(t)}get authorizationList(){const t=this.#A||null;return t==null&&this.type===4?[]:t}set authorizationList(t){this.#A=t==null?null:t.map(e=>eh(e))}get maxFeePerBlobGas(){const t=this.#c;return t==null&&this.type===3?Nt:t}set maxFeePerBlobGas(t){this.#c=t==null?null:O(t,"maxFeePerBlobGas")}get blobVersionedHashes(){let t=this.#l;return t==null&&this.type===3?[]:t}set blobVersionedHashes(t){if(t!=null){y(Array.isArray(t),"blobVersionedHashes must be an Array","value",t),t=t.slice();for(let e=0;e<t.length;e++)y(ht(t[e],32),"invalid blobVersionedHash",`value[${e}]`,t[e])}this.#l=t}get blobs(){return this.#d==null?null:this.#d.map(t=>Object.assign({},t))}set blobs(t){if(t==null){this.#d=null;return}const e=[],r=[];for(let s=0;s<t.length;s++){const _=t[s];if(Uc(_)){C(this.#f,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let a=j(_);if(y(a.length<=fl,"blob is too large",`blobs[${s}]`,_),a.length!==fl){const p=new Uint8Array(fl);p.set(a),a=p}const c=this.#f.blobToKzgCommitment(a),l=K(this.#f.computeBlobKzgProof(a,c));e.push({data:K(a),commitment:K(c),proof:l}),r.push(ih(1,c))}else{const a=K(_.data),c=K(_.commitment),l=K(_.proof);e.push({data:a,commitment:c,proof:l}),r.push(ih(1,c))}}this.#d=e,this.#l=r}get kzg(){return this.#f}set kzg(t){t==null?this.#f=null:this.#f=d0(t)}get blobWrapperVersion(){return this.#w}set blobWrapperVersion(t){this.#w=t}constructor(){this.#t=null,this.#e=null,this.#i=0,this.#s=Nt,this.#n=null,this.#_=null,this.#o=null,this.#r="0x",this.#u=Nt,this.#a=Nt,this.#p=null,this.#h=null,this.#c=null,this.#l=null,this.#f=null,this.#d=null,this.#A=null,this.#w=null}get hash(){return this.signature==null?null:mt(this.#g(!0,!1))}get unsignedHash(){return mt(this.unsignedSerialized)}get from(){return this.signature==null?null:rh(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){return this.signature==null?null:yi.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return this.signature!=null}#g(t,e){C(!t||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=t?this.signature:null;switch(this.inferType()){case 0:return y0(this,r);case 1:return P0(this,r);case 2:return m0(this,r);case 3:return E0(this,r,e?this.blobs:null);case 4:return z0(this,r)}C(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#g(!0,!0)}get unsignedSerialized(){return this.#g(!1,!1)}inferType(){const t=this.inferTypes();return t.indexOf(2)>=0?2:t.pop()}inferTypes(){const t=this.gasPrice!=null,e=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,s=this.#c!=null||this.#l;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&C(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),C(!e||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),C(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const _=[];return this.type!=null?_.push(this.type):this.authorizationList&&this.authorizationList.length?_.push(4):e?_.push(2):t?(_.push(1),r||_.push(0)):r?(_.push(1),_.push(2)):(s&&this.to||(_.push(0),_.push(1),_.push(2)),_.push(3)),_.sort(),_}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return ei.from(this)}toJSON(){const t=e=>e==null?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:t(this.gasLimit),gasPrice:t(this.gasPrice),maxPriorityFeePerGas:t(this.maxPriorityFeePerGas),maxFeePerGas:t(this.maxFeePerGas),value:t(this.value),chainId:t(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[u0](){return this.toString()}toString(){const t=[],e=s=>{let _=this[s];typeof _=="string"&&(_=JSON.stringify(_)),t.push(`${s}: ${_}`)};this.type&&e("type"),e("to"),e("data"),e("nonce"),e("gasLimit"),e("value"),this.chainId!=null&&e("chainId"),this.signature&&(e("from"),t.push(`signature: ${this.signature.toString()}`));const r=this.authorizationList;if(r){const s=[];for(const _ of r){const a=[];a.push(`address: ${JSON.stringify(_.address)}`),_.nonce!=null&&a.push(`nonce: ${_.nonce}`),_.chainId!=null&&a.push(`chainId: ${_.chainId}`),_.signature&&a.push(`signature: ${_.signature.toString()}`),s.push(`Authorization { ${a.join(", ")} }`)}t.push(`authorizations: [ ${s.join(", ")} ]`)}return`Transaction { ${t.join(", ")} }`}static from(t){if(t==null)return new ei;if(typeof t=="string"){const r=j(t);if(r[0]>=127)return ei.from(b0(r));switch(r[0]){case 1:return ei.from(R0(r));case 2:return ei.from(S0(r));case 3:return ei.from(M0(r));case 4:return ei.from(C0(r))}C(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const e=new ei;return t.type!=null&&(e.type=t.type),t.to!=null&&(e.to=t.to),t.nonce!=null&&(e.nonce=t.nonce),t.gasLimit!=null&&(e.gasLimit=t.gasLimit),t.gasPrice!=null&&(e.gasPrice=t.gasPrice),t.maxPriorityFeePerGas!=null&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas),t.maxFeePerGas!=null&&(e.maxFeePerGas=t.maxFeePerGas),t.maxFeePerBlobGas!=null&&(e.maxFeePerBlobGas=t.maxFeePerBlobGas),t.data!=null&&(e.data=t.data),t.value!=null&&(e.value=t.value),t.chainId!=null&&(e.chainId=t.chainId),t.signature!=null&&(e.signature=bt.from(t.signature)),t.accessList!=null&&(e.accessList=t.accessList),t.authorizationList!=null&&(e.authorizationList=t.authorizationList),t.blobVersionedHashes!=null&&(e.blobVersionedHashes=t.blobVersionedHashes),t.kzg!=null&&(e.kzg=t.kzg),t.blobWrapperVersion!=null&&(e.blobWrapperVersion=t.blobWrapperVersion),t.blobs!=null&&(e.blobs=t.blobs),t.hash!=null&&(y(e.isSigned(),"unsigned transaction cannot define '.hash'","tx",t),y(e.hash===t.hash,"hash mismatch","tx",t)),t.from!=null&&(y(e.isSigned(),"unsigned transaction cannot define '.from'","tx",t),y(e.from.toLowerCase()===(t.from||"").toLowerCase(),"from mismatch","tx",t)),e}}function Jn(i){return mt(_i(i))}var I0="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const sh=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),nh=4;function G0(i){let t=0;function e(){return i[t++]<<8|i[t++]}let r=e(),s=1,_=[0,1];for(let T=1;T<r;T++)_.push(s+=e());let a=e(),c=t;t+=a;let l=0,p=0;function u(){return l==0&&(p=p<<8|i[t++],l=8),p>>--l&1}const d=31,b=2**d,S=b>>>1,R=S>>1,m=b-1;let P=0;for(let T=0;T<d;T++)P=P<<1|u();let E=[],B=0,G=b;for(;;){let T=Math.floor(((P-B+1)*s-1)/G),v=0,F=r;for(;F-v>1;){let J=v+F>>>1;T<_[J]?F=J:v=J}if(v==0)break;E.push(v);let V=B+Math.floor(G*_[v]/s),q=B+Math.floor(G*_[v+1]/s)-1;for(;((V^q)&S)==0;)P=P<<1&m|u(),V=V<<1&m,q=q<<1&m|1;for(;V&~q&R;)P=P&S|P<<1&m>>>1|u(),V=V<<1^S,q=(q^S)<<1|S|1;B=V,G=1+q-V}let Y=r-4;return E.map(T=>{switch(T-Y){case 3:return Y+65792+(i[c++]<<16|i[c++]<<8|i[c++]);case 2:return Y+256+(i[c++]<<8|i[c++]);case 1:return Y+i[c++];default:return T-1}})}function B0(i){let t=0;return()=>i[t++]}function _h(i){return B0(G0(N0(i)))}function N0(i){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,_)=>t[s.charCodeAt(0)]=_);let e=i.length,r=new Uint8Array(6*e>>3);for(let s=0,_=0,a=0,c=0;s<e;s++)c=c<<6|t[i.charCodeAt(s)],a+=6,a>=8&&(r[_++]=c>>(a-=8));return r}function K0(i){return i&1?~i>>1:i>>1}function v0(i,t){let e=Array(i);for(let r=0,s=0;r<i;r++)e[r]=s+=K0(t());return e}function Eo(i,t=0){let e=[];for(;;){let r=i(),s=i();if(!s)break;t+=r;for(let _=0;_<s;_++)e.push(t+_);t+=s+1}return e}function oh(i){return Co(()=>{let t=Eo(i);if(t.length)return t})}function ah(i){let t=[];for(;;){let e=i();if(e==0)break;t.push(x0(e,i))}for(;;){let e=i()-1;if(e<0)break;t.push(U0(e,i))}return t.flat()}function Co(i){let t=[];for(;;){let e=i(t.length);if(!e)break;t.push(e)}return t}function ch(i,t,e){let r=Array(i).fill().map(()=>[]);for(let s=0;s<t;s++)v0(i,e).forEach((_,a)=>r[a].push(_));return r}function x0(i,t){let e=1+t(),r=t(),s=Co(t);return ch(s.length,1+i,t).flatMap((a,c)=>{let[l,...p]=a;return Array(s[c]).fill().map((u,d)=>{let b=d*r;return[l+d*e,p.map(S=>S+b)]})})}function U0(i,t){let e=1+t();return ch(e,1+i,t).map(s=>[s[0],s.slice(1)])}function T0(i){let t=[],e=Eo(i);return s(r([]),[]),t;function r(_){let a=i(),c=Co(()=>{let l=Eo(i).map(p=>e[p]);if(l.length)return r(l)});return{S:a,B:c,Q:_}}function s({S:_,B:a},c,l){if(!(_&4&&l===c[c.length-1])){_&2&&(l=c[c.length-1]),_&1&&t.push(c);for(let p of a)for(let u of p.Q)s(p,[...c,u],l)}}}function O0(i){return i.toString(16).toUpperCase().padStart(2,"0")}function lh(i){return`{${O0(i)}}`}function k0(i){let t=[];for(let e=0,r=i.length;e<r;){let s=i.codePointAt(e);e+=s<65536?1:2,t.push(s)}return t}function x_(i){let e=i.length;if(e<4096)return String.fromCodePoint(...i);let r=[];for(let s=0;s<e;)r.push(String.fromCodePoint(...i.slice(s,s+=4096)));return r.join("")}function V0(i,t){let e=i.length,r=e-t.length;for(let s=0;r==0&&s<e;s++)r=i[s]-t[s];return r}var F0="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const zo=44032,Ka=4352,va=4449,xa=4519,ph=19,fh=21,U_=28,Ua=fh*U_,Y0=ph*Ua,D0=zo+Y0,j0=Ka+ph,L0=va+fh,H0=xa+U_;function Io(i){return i>>24&255}function hh(i){return i&16777215}let hl,uh,ul,Ta;function J0(){let i=_h(F0);hl=new Map(oh(i).flatMap((t,e)=>t.map(r=>[r,e+1<<24]))),uh=new Set(Eo(i)),ul=new Map,Ta=new Map;for(let[t,e]of ah(i)){if(!uh.has(t)&&e.length==2){let[r,s]=e,_=Ta.get(r);_||(_=new Map,Ta.set(r,_)),_.set(s,t)}ul.set(t,e.reverse())}}function dh(i){return i>=zo&&i<D0}function Q0(i,t){if(i>=Ka&&i<j0&&t>=va&&t<L0)return zo+(i-Ka)*Ua+(t-va)*U_;if(dh(i)&&t>xa&&t<H0&&(i-zo)%U_==0)return i+(t-xa);{let e=Ta.get(i);return e&&(e=e.get(t),e)?e:-1}}function wh(i){hl||J0();let t=[],e=[],r=!1;function s(_){let a=hl.get(_);a&&(r=!0,_|=a),t.push(_)}for(let _ of i)for(;;){if(_<128)t.push(_);else if(dh(_)){let a=_-zo,c=a/Ua|0,l=a%Ua/U_|0,p=a%U_;s(Ka+c),s(va+l),p>0&&s(xa+p)}else{let a=ul.get(_);a?e.push(...a):s(_)}if(!e.length)break;_=e.pop()}if(r&&t.length>1){let _=Io(t[0]);for(let a=1;a<t.length;a++){let c=Io(t[a]);if(c==0||_<=c){_=c;continue}let l=a-1;for(;;){let p=t[l+1];if(t[l+1]=t[l],t[l]=p,!l||(_=Io(t[--l]),_<=c))break}_=Io(t[a])}}return t}function $0(i){let t=[],e=[],r=-1,s=0;for(let _ of i){let a=Io(_),c=hh(_);if(r==-1)a==0?r=c:t.push(c);else if(s>0&&s>=a)a==0?(t.push(r,...e),e.length=0,r=c):e.push(c),s=a;else{let l=Q0(r,c);l>=0?r=l:s==0&&a==0?(t.push(r),r=c):(e.push(c),s=a)}}return r>=0&&t.push(r,...e),t}function gh(i){return wh(i).map(hh)}function W0(i){return $0(wh(i))}const Ah=45,bh=".",yh=65039,Sh=1,Oa=i=>Array.from(i);function Go(i,t){return i.P.has(t)||i.Q.has(t)}class Z0 extends Array{get is_emoji(){return!0}}let dl,mh,Qn,wl,Rh,T_,gl,O_,$n,Ph,Al;function bl(){if(dl)return;let i=_h(I0);const t=()=>Eo(i),e=()=>new Set(t()),r=(u,d)=>d.forEach(b=>u.add(b));dl=new Map(ah(i)),mh=e(),Qn=t(),wl=new Set(t().map(u=>Qn[u])),Qn=new Set(Qn),Rh=e(),e();let s=oh(i),_=i();const a=()=>{let u=new Set;return t().forEach(d=>r(u,s[d])),r(u,t()),u};T_=Co(u=>{let d=Co(i).map(b=>b+96);if(d.length){let b=u>=_;d[0]-=32,d=x_(d),b&&(d=`Restricted[${d}]`);let S=a(),R=a(),m=!i();return{N:d,P:S,Q:R,M:m,R:b}}}),gl=e(),O_=new Map;let c=t().concat(Oa(gl)).sort((u,d)=>u-d);c.forEach((u,d)=>{let b=i(),S=c[d]=b?c[d-b]:{V:[],M:new Map};S.V.push(u),gl.has(u)||O_.set(u,S)});for(let{V:u,M:d}of new Set(O_.values())){let b=[];for(let R of u){let m=T_.filter(E=>Go(E,R)),P=b.find(({G:E})=>m.some(B=>E.has(B)));P||(P={G:new Set,V:[]},b.push(P)),P.V.push(R),r(P.G,m)}let S=b.flatMap(R=>Oa(R.G));for(let{G:R,V:m}of b){let P=new Set(S.filter(E=>!R.has(E)));for(let E of m)d.set(E,P)}}$n=new Set;let l=new Set;const p=u=>$n.has(u)?l.add(u):$n.add(u);for(let u of T_){for(let d of u.P)p(d);for(let d of u.Q)p(d)}for(let u of $n)!O_.has(u)&&!l.has(u)&&O_.set(u,Sh);r($n,gh($n)),Ph=T0(i).map(u=>Z0.from(u)).sort(V0),Al=new Map;for(let u of Ph){let d=[Al];for(let b of u){let S=d.map(R=>{let m=R.get(b);return m||(m=new Map,R.set(b,m)),m});b===yh?d.push(...S):d=S}for(let b of d)b.V=u}}function yl(i){return(Mh(i)?"":`${Sl(ka([i]))} `)+lh(i)}function Sl(i){return`"${i}"‎`}function q0(i){if(i.length>=4&&i[2]==Ah&&i[3]==Ah)throw new Error(`invalid label extension: "${x_(i.slice(0,4))}"`)}function X0(i){for(let e=i.lastIndexOf(95);e>0;)if(i[--e]!==95)throw new Error("underscore allowed only at start")}function tS(i){let t=i[0],e=sh.get(t);if(e)throw Bo(`leading ${e}`);let r=i.length,s=-1;for(let _=1;_<r;_++){t=i[_];let a=sh.get(t);if(a){if(s==_)throw Bo(`${e} + ${a}`);s=_+1,e=a}}if(s==r)throw Bo(`trailing ${e}`)}function ka(i,t=1/0,e=lh){let r=[];eS(i[0])&&r.push("◌"),i.length>t&&(t>>=1,i=[...i.slice(0,t),8230,...i.slice(-t)]);let s=0,_=i.length;for(let a=0;a<_;a++){let c=i[a];Mh(c)&&(r.push(x_(i.slice(s,a))),r.push(e(c)),s=a+1)}return r.push(x_(i.slice(s,_))),r.join("")}function eS(i){return bl(),Qn.has(i)}function Mh(i){return bl(),Rh.has(i)}function rS(i){return _S(iS(i,W0,cS))}function iS(i,t,e){if(!i)return[];bl();let r=0;return i.split(bh).map(s=>{let _=k0(s),a={input:_,offset:r};r+=_.length+1;try{let c=a.tokens=aS(_,t,e),l=c.length,p;if(!l)throw new Error("empty label");let u=a.output=c.flat();if(X0(u),!(a.emoji=l>1||c[0].is_emoji)&&u.every(b=>b<128))q0(u),p="ASCII";else{let b=c.flatMap(S=>S.is_emoji?[]:S);if(!b.length)p="Emoji";else{if(Qn.has(u[0]))throw Bo("leading combining mark");for(let m=1;m<l;m++){let P=c[m];if(!P.is_emoji&&Qn.has(P[0]))throw Bo(`emoji + combining mark: "${x_(c[m-1])} + ${ka([P[0]])}"`)}tS(u);let S=Oa(new Set(b)),[R]=nS(S);oS(R,b),sS(R,S),p=R.N}}a.type=p}catch(c){a.error=c}return a})}function sS(i,t){let e,r=[];for(let s of t){let _=O_.get(s);if(_===Sh)return;if(_){let a=_.M.get(s);if(e=e?e.filter(c=>a.has(c)):Oa(a),!e.length)return}else r.push(s)}if(e){for(let s of e)if(r.every(_=>Go(s,_)))throw new Error(`whole-script confusable: ${i.N}/${s.N}`)}}function nS(i){let t=T_;for(let e of i){let r=t.filter(s=>Go(s,e));if(!r.length)throw T_.some(s=>Go(s,e))?Ch(t[0],e):Eh(e);if(t=r,r.length==1)break}return t}function _S(i){return i.map(({input:t,error:e,output:r})=>{if(e){let s=e.message;throw new Error(i.length==1?s:`Invalid label ${Sl(ka(t,63))}: ${s}`)}return x_(r)}).join(bh)}function Eh(i){return new Error(`disallowed character: ${yl(i)}`)}function Ch(i,t){let e=yl(t),r=T_.find(s=>s.P.has(t));return r&&(e=`${r.N} ${e}`),new Error(`illegal mixture: ${i.N} + ${e}`)}function Bo(i){return new Error(`illegal placement: ${i}`)}function oS(i,t){for(let e of t)if(!Go(i,e))throw Ch(i,e);if(i.M){let e=gh(t);for(let r=1,s=e.length;r<s;r++)if(wl.has(e[r])){let _=r+1;for(let a;_<s&&wl.has(a=e[_]);_++)for(let c=r;c<_;c++)if(e[c]==a)throw new Error(`duplicate non-spacing marks: ${yl(a)}`);if(_-r>nh)throw new Error(`excessive non-spacing marks: ${Sl(ka(e.slice(r-1,_)))} (${_-r}/${nh})`);r=_}}}function aS(i,t,e){let r=[],s=[];for(i=i.slice().reverse();i.length;){let _=lS(i);if(_)s.length&&(r.push(t(s)),s=[]),r.push(e(_));else{let a=i.pop();if($n.has(a))s.push(a);else{let c=dl.get(a);if(c)s.push(...c);else if(!mh.has(a))throw Eh(a)}}}return s.length&&r.push(t(s)),r}function cS(i){return i.filter(t=>t!=yh)}function lS(i,t){let e=Al,r,s=i.length;for(;s&&(e=e.get(i[--s]),!!e);){let{V:_}=e;_&&(r=_,i.length=s)}return r}const zh=new Uint8Array(32);zh.fill(0);function Ih(i){return y(i.length!==0,"invalid ENS name; empty component","comp",i),i}function Gh(i){const t=_i(pS(i)),e=[];if(i.length===0)return e;let r=0;for(let s=0;s<t.length;s++)t[s]===46&&(e.push(Ih(t.slice(r,s))),r=s+1);return y(r<t.length,"invalid ENS name; empty component","name",i),e.push(Ih(t.slice(r))),e}function pS(i){try{if(i.length===0)throw new Error("empty label");return rS(i)}catch(t){y(!1,`invalid ENS name (${t.message})`,"name",i)}}function ml(i){y(typeof i=="string","invalid ENS name; not a string","name",i),y(i.length,"invalid ENS name (empty label)","name",i);let t=zh;const e=Gh(i);for(;e.length;)t=mt(ot([t,mt(e.pop())]));return K(t)}function fS(i,t){const e=t;return y(e<=255,"DNS encoded label cannot exceed 255","length",e),K(ot(Gh(i).map(r=>{y(r.length<=e,`label ${JSON.stringify(i)} exceeds ${e} bytes`,"name",i);const s=new Uint8Array(r.length+1);return s.set(r,1),s[0]=s.length-1,s})))+"00"}const hS=new RegExp("^bytes([0-9]+)$"),uS=new RegExp("^(u?int)([0-9]*)$"),dS=new RegExp("^(.*)\\[([0-9]*)\\]$");function Bh(i,t,e){switch(i){case"address":return j(e?pe(t,32):et(t));case"string":return _i(t);case"bytes":return j(t);case"bool":return t=t?"0x01":"0x00",j(e?pe(t,32):t)}let r=i.match(uS);if(r){let s=r[1]==="int",_=parseInt(r[2]||"256");return y((!r[2]||r[2]===String(_))&&_%8===0&&_!==0&&_<=256,"invalid number type","type",i),e&&(_=256),s&&(t=Tc(t,_)),j(pe(Pt(t),_/8))}if(r=i.match(hS),r){const s=parseInt(r[1]);return y(String(s)===r[1]&&s!==0&&s<=32,"invalid bytes type","type",i),y(kn(t)===s,`invalid value for ${i}`,"value",t),e?j(Op(t,32)):t}if(r=i.match(dS),r&&Array.isArray(t)){const s=r[1],_=parseInt(r[2]||String(t.length));y(_===t.length,`invalid array length for ${i}`,"value",t);const a=[];return t.forEach(function(c){a.push(Bh(s,c,!0))}),j(ot(a))}y(!1,"invalid type","type",i)}function Va(i,t){y(i.length===t.length,"wrong number of values; expected ${ types.length }","values",t);const e=[];return i.forEach(function(r,s){e.push(Bh(r,t[s]))}),K(ot(e))}const Nh=new Uint8Array(32);Nh.fill(0);const wS=BigInt(-1),Kh=BigInt(0),vh=BigInt(1),gS=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function AS(i){const t=j(i),e=t.length%32;return e?ot([t,Nh.slice(e)]):K(t)}const bS=Yi(vh,32),yS=Yi(Kh,32),xh={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Rl=["name","version","chainId","verifyingContract","salt"];function Uh(i){return function(t){return y(typeof t=="string",`invalid domain value for ${JSON.stringify(i)}`,`domain.${i}`,t),t}}const SS={name:Uh("name"),version:Uh("version"),chainId:function(i){const t=O(i,"domain.chainId");return y(t>=0,"invalid chain ID","domain.chainId",i),Number.isSafeInteger(t)?Number(t):Xr(t)},verifyingContract:function(i){try{return et(i).toLowerCase()}catch{}y(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",i)},salt:function(i){const t=j(i,"domain.salt");return y(t.length===32,'invalid domain value "salt"',"domain.salt",i),K(t)}};function Pl(i){{const t=i.match(/^(u?)int(\d+)$/);if(t){const e=t[1]==="",r=parseInt(t[2]);y(r%8===0&&r!==0&&r<=256&&t[2]===String(r),"invalid numeric width","type",i);const s=Ao(gS,e?r-1:r),_=e?(s+vh)*wS:Kh;return function(a){const c=O(a,"value");return y(c>=_&&c<=s,`value out-of-bounds for ${i}`,"value",c),Yi(e?Tc(c,256):c,32)}}}{const t=i.match(/^bytes(\d+)$/);if(t){const e=parseInt(t[1]);return y(e!==0&&e<=32&&t[1]===String(e),"invalid bytes width","type",i),function(r){const s=j(r);return y(s.length===e,`invalid length for ${i}`,"value",r),AS(r)}}}switch(i){case"address":return function(t){return pe(et(t),32)};case"bool":return function(t){return t?bS:yS};case"bytes":return function(t){return mt(t)};case"string":return function(t){return Jn(t)}}return null}function Th(i,t){return`${i}(${t.map(({name:e,type:r})=>r+" "+e).join(",")})`}function Fa(i){const t=i.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return t?{base:t[1],index:t[2]+t[4],array:{base:t[1],prefix:t[1]+t[2],count:t[5]?parseInt(t[5]):-1}}:{base:i}}class $t{primaryType;#t;get types(){return JSON.parse(this.#t)}#e;#r;constructor(t){this.#e=new Map,this.#r=new Map;const e=new Map,r=new Map,s=new Map,_={};Object.keys(t).forEach(l=>{_[l]=t[l].map(({name:p,type:u})=>{let{base:d,index:b}=Fa(u);return d==="int"&&!t.int&&(d="int256"),d==="uint"&&!t.uint&&(d="uint256"),{name:p,type:d+(b||"")}}),e.set(l,new Set),r.set(l,[]),s.set(l,new Set)}),this.#t=JSON.stringify(_);for(const l in _){const p=new Set;for(const u of _[l]){y(!p.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(l)}`,"types",t),p.add(u.name);const d=Fa(u.type).base;y(d!==l,`circular type reference to ${JSON.stringify(d)}`,"types",t),!Pl(d)&&(y(r.has(d),`unknown type ${JSON.stringify(d)}`,"types",t),r.get(d).push(l),e.get(l).add(d))}}const a=Array.from(r.keys()).filter(l=>r.get(l).length===0);y(a.length!==0,"missing primary type","types",t),y(a.length===1,`ambiguous primary types or unused types: ${a.map(l=>JSON.stringify(l)).join(", ")}`,"types",t),D(this,{primaryType:a[0]});function c(l,p){y(!p.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",t),p.add(l);for(const u of e.get(l))if(r.has(u)){c(u,p);for(const d of p)s.get(d).add(u)}p.delete(l)}c(this.primaryType,new Set);for(const[l,p]of s){const u=Array.from(p);u.sort(),this.#e.set(l,Th(l,_[l])+u.map(d=>Th(d,_[d])).join(""))}}getEncoder(t){let e=this.#r.get(t);return e||(e=this.#i(t),this.#r.set(t,e)),e}#i(t){{const s=Pl(t);if(s)return s}const e=Fa(t).array;if(e){const s=e.prefix,_=this.getEncoder(s);return a=>{y(e.count===-1||e.count===a.length,`array length mismatch; expected length ${e.count}`,"value",a);let c=a.map(_);return this.#e.has(s)&&(c=c.map(mt)),mt(ot(c))}}const r=this.types[t];if(r){const s=Jn(this.#e.get(t));return _=>{const a=r.map(({name:c,type:l})=>{const p=this.getEncoder(l)(_[c]);return this.#e.has(l)?mt(p):p});return a.unshift(s),ot(a)}}y(!1,`unknown type: ${t}`,"type",t)}encodeType(t){const e=this.#e.get(t);return y(e,`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return mt(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(Pl(t))return r(t,e);const s=Fa(t).array;if(s)return y(s.count===-1||s.count===e.length,`array length mismatch; expected length ${s.count}`,"value",e),e.map(a=>this._visit(s.prefix,a,r));const _=this.types[t];if(_)return _.reduce((a,{name:c,type:l})=>(a[c]=this._visit(l,e[c],r),a),{});y(!1,`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new $t(t)}static getPrimaryType(t){return $t.from(t).primaryType}static hashStruct(t,e,r){return $t.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){if(t[r]==null)continue;const s=xh[r];y(s,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:s})}return e.sort((r,s)=>Rl.indexOf(r.name)-Rl.indexOf(s.name)),$t.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return ot(["0x1901",$t.hashDomain(t),$t.from(e).hash(r)])}static hash(t,e,r){return mt($t.encode(t,e,r))}static async resolveNames(t,e,r,s){t=Object.assign({},t);for(const c in t)t[c]==null&&delete t[c];const _={};t.verifyingContract&&!ht(t.verifyingContract,20)&&(_[t.verifyingContract]="0x");const a=$t.from(e);a.visit(r,(c,l)=>(c==="address"&&!ht(l,20)&&(_[l]="0x"),l));for(const c in _)_[c]=await s(c);return t.verifyingContract&&_[t.verifyingContract]&&(t.verifyingContract=_[t.verifyingContract]),r=a.visit(r,(c,l)=>c==="address"&&_[l]?_[l]:l),{domain:t,value:r}}static getPayload(t,e,r){$t.hashDomain(t);const s={},_=[];Rl.forEach(l=>{const p=t[l];p!=null&&(s[l]=SS[l](p),_.push({name:l,type:xh[l]}))});const a=$t.from(e);e=a.types;const c=Object.assign({},e);return y(c.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",e),c.EIP712Domain=_,a.encode(r),{types:c,domain:s,primaryType:a.primaryType,message:a.visit(r,(l,p)=>{if(l.match(/^bytes(\d*)/))return K(j(p));if(l.match(/^u?int/))return O(p).toString();switch(l){case"address":return p.toLowerCase();case"bool":return!!p;case"string":return y(typeof p=="string","invalid string","value",p),p}y(!1,"unsupported type","type",l)})}}}function Oh(i,t,e,r){return rh($t.hash(i,t,e),r)}function jt(i){const t=new Set;return i.forEach(e=>t.add(e)),Object.freeze(t)}const mS=jt("external public payable override".split(" ")),kh="constant external internal payable private public pure view override",RS=jt(kh.split(" ")),Vh="constructor error event fallback function receive struct",Fh=jt(Vh.split(" ")),Yh="calldata memory storage payable indexed",PS=jt(Yh.split(" ")),MS=[Vh,Yh,"tuple returns",kh].join(" "),ES=jt(MS.split(" ")),CS={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},zS=new RegExp("^(\\s*)"),IS=new RegExp("^([0-9]+)"),GS=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),Dh=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),jh=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class ue{#t;#e;get offset(){return this.#t}get length(){return this.#e.length-this.#t}constructor(t){this.#t=0,this.#e=t.slice()}clone(){return new ue(this.#e)}reset(){this.#t=0}#r(t=0,e=0){return new ue(this.#e.slice(t,e).map(r=>Object.freeze(Object.assign({},r,{match:r.match-t,linkBack:r.linkBack-t,linkNext:r.linkNext-t}))))}popKeyword(t){const e=this.peek();if(e.type!=="KEYWORD"||!t.has(e.text))throw new Error(`expected keyword ${e.text}`);return this.pop().text}popType(t){if(this.peek().type!==t){const e=this.peek();throw new Error(`expected ${t}; got ${e.type} ${JSON.stringify(e.text)}`)}return this.pop().text}popParen(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const e=this.#r(this.#t+1,t.match+1);return this.#t=t.match+1,e}popParams(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const e=[];for(;this.#t<t.match-1;){const r=this.peek().linkNext;e.push(this.#r(this.#t+1,r)),this.#t=r}return this.#t=t.match+1,e}peek(){if(this.#t>=this.#e.length)throw new Error("out-of-bounds");return this.#e[this.#t]}peekKeyword(t){const e=this.peekType("KEYWORD");return e!=null&&t.has(e)?e:null}peekType(t){if(this.length===0)return null;const e=this.peek();return e.type===t?e.text:null}pop(){const t=this.peek();return this.#t++,t}toString(){const t=[];for(let e=this.#t;e<this.#e.length;e++){const r=this.#e[e];t.push(`${r.type}:${r.text}`)}return`<TokenString ${t.join(" ")}>`}}function $i(i){const t=[],e=a=>{const c=_<i.length?JSON.stringify(i[_]):"$EOI";throw new Error(`invalid token ${c} at ${_}: ${a}`)};let r=[],s=[],_=0;for(;_<i.length;){let a=i.substring(_),c=a.match(zS);c&&(_+=c[1].length,a=i.substring(_));const l={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:_,value:-1};t.push(l);let p=CS[a[0]]||"";if(p){if(l.type=p,l.text=a[0],_++,p==="OPEN_PAREN")r.push(t.length-1),s.push(t.length-1);else if(p=="CLOSE_PAREN")r.length===0&&e("no matching open bracket"),l.match=r.pop(),t[l.match].match=t.length-1,l.depth--,l.linkBack=s.pop(),t[l.linkBack].linkNext=t.length-1;else if(p==="COMMA")l.linkBack=s.pop(),t[l.linkBack].linkNext=t.length-1,s.push(t.length-1);else if(p==="OPEN_BRACKET")l.type="BRACKET";else if(p==="CLOSE_BRACKET"){let u=t.pop().text;if(t.length>0&&t[t.length-1].type==="NUMBER"){const d=t.pop().text;u=d+u,t[t.length-1].value=W(d)}if(t.length===0||t[t.length-1].type!=="BRACKET")throw new Error("missing opening bracket");t[t.length-1].text+=u}continue}if(c=a.match(GS),c){if(l.text=c[1],_+=l.text.length,ES.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(jh)){l.type="TYPE";continue}l.type="ID";continue}if(c=a.match(IS),c){l.text=c[1],l.type="NUMBER",_+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${_}`)}return new ue(t.map(a=>Object.freeze(a)))}function Lh(i,t){let e=[];for(const r in t.keys())i.has(r)&&e.push(r);if(e.length>1)throw new Error(`conflicting types: ${e.join(", ")}`)}function Ya(i,t){if(t.peekKeyword(Fh)){const e=t.pop().text;if(e!==i)throw new Error(`expected ${i}, got ${e}`)}return t.popType("ID")}function mi(i,t){const e=new Set;for(;;){const r=i.peekType("KEYWORD");if(r==null||t&&!t.has(r))break;if(i.pop(),e.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);e.add(r)}return Object.freeze(e)}function Hh(i){let t=mi(i,RS);return Lh(t,jt("constant payable nonpayable".split(" "))),Lh(t,jt("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function Ri(i,t){return i.popParams().map(e=>ut.from(e,t))}function Jh(i){if(i.peekType("AT")){if(i.pop(),i.peekType("NUMBER"))return O(i.pop().text);throw new Error("invalid gas")}return null}function Wn(i){if(i.length)throw new Error(`unexpected tokens at offset ${i.offset}: ${i.toString()}`)}const BS=new RegExp(/^(.*)\[([0-9]*)\]$/);function Qh(i){const t=i.match(jh);if(y(t,"invalid type","type",i),i==="uint")return"uint256";if(i==="int")return"int256";if(t[2]){const e=parseInt(t[2]);y(e!==0&&e<=32,"invalid bytes length","type",i)}else if(t[3]){const e=parseInt(t[3]);y(e!==0&&e<=256&&e%8===0,"invalid numeric width","type",i)}return i}const yt={},Wt=Symbol.for("_ethers_internal"),$h="_ParamTypeInternal",Wh="_ErrorInternal",Zh="_EventInternal",qh="_ConstructorInternal",Xh="_FallbackInternal",tu="_FunctionInternal",eu="_StructInternal";class ut{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(t,e,r,s,_,a,c,l){if(ga(t,yt,"ParamType"),Object.defineProperty(this,Wt,{value:$h}),a&&(a=Object.freeze(a.slice())),s==="array"){if(c==null||l==null)throw new Error("")}else if(c!=null||l!=null)throw new Error("");if(s==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");D(this,{name:e,type:r,baseType:s,indexed:_,components:a,arrayLength:c,arrayChildren:l})}format(t){if(t==null&&(t="sighash"),t==="json"){const r=this.name||"";if(this.isArray()){const _=JSON.parse(this.arrayChildren.format("json"));return _.name=r,_.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(_)}const s={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(_=>JSON.parse(_.format(t)))),JSON.stringify(s)}let e="";return this.isArray()?(e+=this.arrayChildren.format(t),e+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?e+="("+this.components.map(r=>r.format(t)).join(t==="full"?", ":",")+")":e+=this.type,t!=="sighash"&&(this.indexed===!0&&(e+=" indexed"),t==="full"&&this.name&&(e+=" "+this.name)),e}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(t,e){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return t.map(s=>r.arrayChildren.walk(s,e))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");const r=this;return t.map((s,_)=>r.components[_].walk(s,e))}return e(this.type,t)}#t(t,e,r,s){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,c=e.slice();c.forEach((l,p)=>{a.#t(t,l,r,u=>{c[p]=u})}),s(c);return}if(this.isTuple()){const a=this.components;let c;if(Array.isArray(e))c=e.slice();else{if(e==null||typeof e!="object")throw new Error("invalid tuple value");c=a.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in e))throw new Error(`missing value for component ${l.name}`);return e[l.name]})}if(c.length!==this.components.length)throw new Error("array is wrong length");c.forEach((l,p)=>{a[p].#t(t,l,r,u=>{c[p]=u})}),s(c);return}const _=r(this.type,e);_.then?t.push((async function(){s(await _)})()):s(_)}async walkAsync(t,e){const r=[],s=[t];return this.#t(r,t,e,_=>{s[0]=_}),r.length&&await Promise.all(r),s[0]}static from(t,e){if(ut.isParamType(t))return t;if(typeof t=="string")try{return ut.from($i(t),e)}catch{y(!1,"invalid param type","obj",t)}else if(t instanceof ue){let c="",l="",p=null;mi(t,jt(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(l="tuple",p=t.popParams().map(m=>ut.from(m)),c=`tuple(${p.map(m=>m.format()).join(",")})`):(c=Qh(t.popType("TYPE")),l=c);let u=null,d=null;for(;t.length&&t.peekType("BRACKET");){const m=t.pop();u=new ut(yt,"",c,l,null,p,d,u),d=m.value,c+=m.text,l="array",p=null}let b=null;if(mi(t,PS).has("indexed")){if(!e)throw new Error("");b=!0}const R=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new ut(yt,R,c,l,b,p,d,u)}const r=t.name;y(!r||typeof r=="string"&&r.match(Dh),"invalid name","obj.name",r);let s=t.indexed;s!=null&&(y(e,"parameter cannot be indexed","obj.indexed",t.indexed),s=!!s);let _=t.type,a=_.match(BS);if(a){const c=parseInt(a[2]||"-1"),l=ut.from({type:a[1],components:t.components});return new ut(yt,r||"",_,"array",s,null,c,l)}if(_==="tuple"||_.startsWith("tuple(")||_.startsWith("(")){const c=t.components!=null?t.components.map(p=>ut.from(p)):null;return new ut(yt,r||"",_,"tuple",s,c,null,null)}return _=Qh(t.type),new ut(yt,r||"",_,_,s,null,null,null)}static isParamType(t){return t&&t[Wt]===$h}}class Zn{type;inputs;constructor(t,e,r){ga(t,yt,"Fragment"),r=Object.freeze(r.slice()),D(this,{type:e,inputs:r})}static from(t){if(typeof t=="string"){try{Zn.from(JSON.parse(t))}catch{}return Zn.from($i(t))}if(t instanceof ue)switch(t.peekKeyword(Fh)){case"constructor":return Pi.from(t);case"error":return Zt.from(t);case"event":return ci.from(t);case"fallback":case"receive":return Mi.from(t);case"function":return li.from(t);case"struct":return qn.from(t)}else if(typeof t=="object"){switch(t.type){case"constructor":return Pi.from(t);case"error":return Zt.from(t);case"event":return ci.from(t);case"fallback":case"receive":return Mi.from(t);case"function":return li.from(t);case"struct":return qn.from(t)}C(!1,`unsupported type: ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}y(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return Pi.isFragment(t)}static isError(t){return Zt.isFragment(t)}static isEvent(t){return ci.isFragment(t)}static isFunction(t){return li.isFragment(t)}static isStruct(t){return qn.isFragment(t)}}class Da extends Zn{name;constructor(t,e,r,s){super(t,e,s),y(typeof r=="string"&&r.match(Dh),"invalid identifier","name",r),s=Object.freeze(s.slice()),D(this,{name:r})}}function No(i,t){return"("+t.map(e=>e.format(i)).join(i==="full"?", ":",")+")"}class Zt extends Da{constructor(t,e,r){super(t,"error",e,r),Object.defineProperty(this,Wt,{value:Wh})}get selector(){return Jn(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});const e=[];return t!=="sighash"&&e.push("error"),e.push(this.name+No(t,this.inputs)),e.join(" ")}static from(t){if(Zt.isFragment(t))return t;if(typeof t=="string")return Zt.from($i(t));if(t instanceof ue){const e=Ya("error",t),r=Ri(t);return Wn(t),new Zt(yt,e,r)}return new Zt(yt,t.name,t.inputs?t.inputs.map(ut.from):[])}static isFragment(t){return t&&t[Wt]===Wh}}class ci extends Da{anonymous;constructor(t,e,r,s){super(t,"event",e,r),Object.defineProperty(this,Wt,{value:Zh}),D(this,{anonymous:s})}get topicHash(){return Jn(this.format("sighash"))}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});const e=[];return t!=="sighash"&&e.push("event"),e.push(this.name+No(t,this.inputs)),t!=="sighash"&&this.anonymous&&e.push("anonymous"),e.join(" ")}static getTopicHash(t,e){return e=(e||[]).map(s=>ut.from(s)),new ci(yt,t,e,!1).topicHash}static from(t){if(ci.isFragment(t))return t;if(typeof t=="string")try{return ci.from($i(t))}catch{y(!1,"invalid event fragment","obj",t)}else if(t instanceof ue){const e=Ya("event",t),r=Ri(t,!0),s=!!mi(t,jt(["anonymous"])).has("anonymous");return Wn(t),new ci(yt,e,r,s)}return new ci(yt,t.name,t.inputs?t.inputs.map(e=>ut.from(e,!0)):[],!!t.anonymous)}static isFragment(t){return t&&t[Wt]===Zh}}class Pi extends Zn{payable;gas;constructor(t,e,r,s,_){super(t,e,r),Object.defineProperty(this,Wt,{value:qh}),D(this,{payable:s,gas:_})}format(t){if(C(t!=null&&t!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});const e=[`constructor${No(t,this.inputs)}`];return this.payable&&e.push("payable"),this.gas!=null&&e.push(`@${this.gas.toString()}`),e.join(" ")}static from(t){if(Pi.isFragment(t))return t;if(typeof t=="string")try{return Pi.from($i(t))}catch{y(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof ue){mi(t,jt(["constructor"]));const e=Ri(t),r=!!mi(t,mS).has("payable"),s=Jh(t);return Wn(t),new Pi(yt,"constructor",e,r,s)}return new Pi(yt,"constructor",t.inputs?t.inputs.map(ut.from):[],!!t.payable,t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[Wt]===qh}}class Mi extends Zn{payable;constructor(t,e,r){super(t,"fallback",e),Object.defineProperty(this,Wt,{value:Xh}),D(this,{payable:r})}format(t){const e=this.inputs.length===0?"receive":"fallback";if(t==="json"){const r=this.payable?"payable":"nonpayable";return JSON.stringify({type:e,stateMutability:r})}return`${e}()${this.payable?" payable":""}`}static from(t){if(Mi.isFragment(t))return t;if(typeof t=="string")try{return Mi.from($i(t))}catch{y(!1,"invalid fallback fragment","obj",t)}else if(t instanceof ue){const e=t.toString(),r=t.peekKeyword(jt(["fallback","receive"]));if(y(r,"type must be fallback or receive","obj",e),t.popKeyword(jt(["fallback","receive"]))==="receive"){const c=Ri(t);return y(c.length===0,"receive cannot have arguments","obj.inputs",c),mi(t,jt(["payable"])),Wn(t),new Mi(yt,[],!0)}let _=Ri(t);_.length?y(_.length===1&&_[0].type==="bytes","invalid fallback inputs","obj.inputs",_.map(c=>c.format("minimal")).join(", ")):_=[ut.from("bytes")];const a=Hh(t);if(y(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),mi(t,jt(["returns"])).has("returns")){const c=Ri(t);y(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(l=>l.format("minimal")).join(", "))}return Wn(t),new Mi(yt,_,a==="payable")}if(t.type==="receive")return new Mi(yt,[],!0);if(t.type==="fallback"){const e=[ut.from("bytes")],r=t.stateMutability==="payable";return new Mi(yt,e,r)}y(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[Wt]===Xh}}class li extends Da{constant;outputs;stateMutability;payable;gas;constructor(t,e,r,s,_,a){super(t,"function",e,s),Object.defineProperty(this,Wt,{value:tu}),_=Object.freeze(_.slice()),D(this,{constant:r==="view"||r==="pure",gas:a,outputs:_,payable:r==="payable",stateMutability:r})}get selector(){return Jn(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t))),outputs:this.outputs.map(r=>JSON.parse(r.format(t)))});const e=[];return t!=="sighash"&&e.push("function"),e.push(this.name+No(t,this.inputs)),t!=="sighash"&&(this.stateMutability!=="nonpayable"&&e.push(this.stateMutability),this.outputs&&this.outputs.length&&(e.push("returns"),e.push(No(t,this.outputs))),this.gas!=null&&e.push(`@${this.gas.toString()}`)),e.join(" ")}static getSelector(t,e){return e=(e||[]).map(s=>ut.from(s)),new li(yt,t,"view",e,[],null).selector}static from(t){if(li.isFragment(t))return t;if(typeof t=="string")try{return li.from($i(t))}catch{y(!1,"invalid function fragment","obj",t)}else if(t instanceof ue){const r=Ya("function",t),s=Ri(t),_=Hh(t);let a=[];mi(t,jt(["returns"])).has("returns")&&(a=Ri(t));const c=Jh(t);return Wn(t),new li(yt,r,_,s,a,c)}let e=t.stateMutability;return e==null&&(e="payable",typeof t.constant=="boolean"?(e="view",t.constant||(e="payable",typeof t.payable=="boolean"&&!t.payable&&(e="nonpayable"))):typeof t.payable=="boolean"&&!t.payable&&(e="nonpayable")),new li(yt,t.name,e,t.inputs?t.inputs.map(ut.from):[],t.outputs?t.outputs.map(ut.from):[],t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[Wt]===tu}}class qn extends Da{constructor(t,e,r){super(t,"struct",e,r),Object.defineProperty(this,Wt,{value:eu})}format(){throw new Error("@TODO")}static from(t){if(typeof t=="string")try{return qn.from($i(t))}catch{y(!1,"invalid struct fragment","obj",t)}else if(t instanceof ue){const e=Ya("struct",t),r=Ri(t);return Wn(t),new qn(yt,e,r)}return new qn(yt,t.name,t.inputs?t.inputs.map(ut.from):[])}static isFragment(t){return t&&t[Wt]===eu}}const ri=new Map;ri.set(0,"GENERIC_PANIC"),ri.set(1,"ASSERT_FALSE"),ri.set(17,"OVERFLOW"),ri.set(18,"DIVIDE_BY_ZERO"),ri.set(33,"ENUM_RANGE_ERROR"),ri.set(34,"BAD_STORAGE_DATA"),ri.set(49,"STACK_UNDERFLOW"),ri.set(50,"ARRAY_RANGE_ERROR"),ri.set(65,"OUT_OF_MEMORY"),ri.set(81,"UNINITIALIZED_FUNCTION_CALL");const NS=new RegExp(/^bytes([0-9]*)$/),KS=new RegExp(/^(u?int)([0-9]*)$/);let Ml=null,ru=1024;function vS(i,t,e,r){let s="missing revert data",_=null;const a=null;let c=null;if(e){s="execution reverted";const p=j(e);if(e=K(e),p.length===0)s+=" (no data present; likely require(false) occurred",_="require(false)";else if(p.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(K(p.slice(0,4))==="0x08c379a0")try{_=r.decode(["string"],p.slice(4))[0],c={signature:"Error(string)",name:"Error",args:[_]},s+=`: ${JSON.stringify(_)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(K(p.slice(0,4))==="0x4e487b71")try{const u=Number(r.decode(["uint256"],p.slice(4))[0]);c={signature:"Panic(uint256)",name:"Panic",args:[u]},_=`Panic due to ${ri.get(u)||"UNKNOWN"}(${u})`,s+=`: ${_}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const l={to:t.to?et(t.to):null,data:t.data||"0x"};return t.from&&(l.from=et(t.from)),gt(s,"CALL_EXCEPTION",{action:i,data:e,reason:_,transaction:l,invocation:a,revert:c})}class pi{#t(t){if(t.isArray())return new Zy(this.#t(t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new za(t.components.map(r=>this.#t(r)),t.name);switch(t.baseType){case"address":return new $y(t.name);case"bool":return new qy(t.name);case"string":return new o0(t.name);case"bytes":return new Xy(t.name);case"":return new r0(t.name)}let e=t.type.match(KS);if(e){let r=parseInt(e[2]||"256");return y(r!==0&&r<=256&&r%8===0,"invalid "+e[1]+" bit length","param",t),new _0(r/8,e[1]==="int",t.name)}if(e=t.type.match(NS),e){let r=parseInt(e[1]);return y(r!==0&&r<=32,"invalid bytes length","param",t),new t0(r,t.name)}y(!1,"invalid type","type",t.type)}getDefaultValue(t){const e=t.map(s=>this.#t(ut.from(s)));return new za(e,"_").defaultValue()}encode(t,e){vp(e.length,t.length,"types/values length mismatch");const r=t.map(a=>this.#t(ut.from(a))),s=new za(r,"_"),_=new Yc;return s.encode(_,e),_.data}decode(t,e,r){const s=t.map(a=>this.#t(ut.from(a)));return new za(s,"_").decode(new Dc(e,r,ru))}static _setDefaultMaxInflation(t){y(typeof t=="number"&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),ru=t}static defaultAbiCoder(){return Ml==null&&(Ml=new pi),Ml}static getBuiltinCallException(t,e,r){return vS(t,e,r,pi.defaultAbiCoder())}}class xS{fragment;name;signature;topic;args;constructor(t,e,r){const s=t.name,_=t.format();D(this,{fragment:t,name:s,signature:_,topic:e,args:r})}}class US{fragment;name;args;signature;selector;value;constructor(t,e,r,s){const _=t.name,a=t.format();D(this,{fragment:t,name:_,args:r,signature:a,selector:e,value:s})}}class TS{fragment;name;args;signature;selector;constructor(t,e,r){const s=t.name,_=t.format();D(this,{fragment:t,name:s,args:r,signature:_,selector:e})}}class iu{hash;_isIndexed;static isIndexed(t){return!!(t&&t._isIndexed)}constructor(t){D(this,{hash:t,_isIndexed:!0})}}const su={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},nu={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:i=>`reverted with reason string ${JSON.stringify(i)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:i=>{let t="unknown panic code";return i>=0&&i<=255&&su[i.toString()]&&(t=su[i.toString()]),`reverted with panic code 0x${i.toString(16)} (${t})`}}};class Xn{fragments;deploy;fallback;receive;#t;#e;#r;#i;constructor(t){let e=[];typeof t=="string"?e=JSON.parse(t):e=t,this.#r=new Map,this.#t=new Map,this.#e=new Map;const r=[];for(const a of e)try{r.push(Zn.from(a))}catch(c){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,c.message)}D(this,{fragments:Object.freeze(r)});let s=null,_=!1;this.#i=this.getAbiCoder(),this.fragments.forEach((a,c)=>{let l;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}D(this,{deploy:a});return;case"fallback":a.inputs.length===0?_=!0:(y(!s||a.payable!==s.payable,"conflicting fallback fragments",`fragments[${c}]`,a),s=a,_=s.payable);return;case"function":l=this.#r;break;case"event":l=this.#e;break;case"error":l=this.#t;break;default:return}const p=a.format();l.has(p)||l.set(p,a)}),this.deploy||D(this,{deploy:Pi.from("constructor()")}),D(this,{fallback:s,receive:_})}format(t){const e=t?"minimal":"full";return this.fragments.map(s=>s.format(e))}formatJson(){const t=this.fragments.map(e=>e.format("json"));return JSON.stringify(t.map(e=>JSON.parse(e)))}getAbiCoder(){return pi.defaultAbiCoder()}#s(t,e,r){if(ht(t)){const _=t.toLowerCase();for(const a of this.#r.values())if(_===a.selector)return a;return null}if(t.indexOf("(")===-1){const _=[];for(const[a,c]of this.#r)a.split("(")[0]===t&&_.push(c);if(e){const a=e.length>0?e[e.length-1]:null;let c=e.length,l=!0;Rt.isTyped(a)&&a.type==="overrides"&&(l=!1,c--);for(let p=_.length-1;p>=0;p--){const u=_[p].inputs.length;u!==c&&(!l||u!==c-1)&&_.splice(p,1)}for(let p=_.length-1;p>=0;p--){const u=_[p].inputs;for(let d=0;d<e.length;d++)if(Rt.isTyped(e[d])){if(d>=u.length){if(e[d].type==="overrides")continue;_.splice(p,1);break}if(e[d].type!==u[d].baseType){_.splice(p,1);break}}}}if(_.length===1&&e&&e.length!==_[0].inputs.length){const a=e[e.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&_.splice(0,1)}if(_.length===0)return null;if(_.length>1&&r){const a=_.map(c=>JSON.stringify(c.format())).join(", ");y(!1,`ambiguous function description (i.e. matches ${a})`,"key",t)}return _[0]}const s=this.#r.get(li.from(t).format());return s||null}getFunctionName(t){const e=this.#s(t,null,!1);return y(e,"no matching function","key",t),e.name}hasFunction(t){return!!this.#s(t,null,!1)}getFunction(t,e){return this.#s(t,e||null,!0)}forEachFunction(t){const e=Array.from(this.#r.keys());e.sort((r,s)=>r.localeCompare(s));for(let r=0;r<e.length;r++){const s=e[r];t(this.#r.get(s),r)}}#n(t,e,r){if(ht(t)){const _=t.toLowerCase();for(const a of this.#e.values())if(_===a.topicHash)return a;return null}if(t.indexOf("(")===-1){const _=[];for(const[a,c]of this.#e)a.split("(")[0]===t&&_.push(c);if(e){for(let a=_.length-1;a>=0;a--)_[a].inputs.length<e.length&&_.splice(a,1);for(let a=_.length-1;a>=0;a--){const c=_[a].inputs;for(let l=0;l<e.length;l++)if(Rt.isTyped(e[l])&&e[l].type!==c[l].baseType){_.splice(a,1);break}}}if(_.length===0)return null;if(_.length>1&&r){const a=_.map(c=>JSON.stringify(c.format())).join(", ");y(!1,`ambiguous event description (i.e. matches ${a})`,"key",t)}return _[0]}const s=this.#e.get(ci.from(t).format());return s||null}getEventName(t){const e=this.#n(t,null,!1);return y(e,"no matching event","key",t),e.name}hasEvent(t){return!!this.#n(t,null,!1)}getEvent(t,e){return this.#n(t,e||null,!0)}forEachEvent(t){const e=Array.from(this.#e.keys());e.sort((r,s)=>r.localeCompare(s));for(let r=0;r<e.length;r++){const s=e[r];t(this.#e.get(s),r)}}getError(t,e){if(ht(t)){const s=t.toLowerCase();if(nu[s])return Zt.from(nu[s].signature);for(const _ of this.#t.values())if(s===_.selector)return _;return null}if(t.indexOf("(")===-1){const s=[];for(const[_,a]of this.#t)_.split("(")[0]===t&&s.push(a);if(s.length===0)return t==="Error"?Zt.from("error Error(string)"):t==="Panic"?Zt.from("error Panic(uint256)"):null;if(s.length>1){const _=s.map(a=>JSON.stringify(a.format())).join(", ");y(!1,`ambiguous error description (i.e. ${_})`,"name",t)}return s[0]}if(t=Zt.from(t).format(),t==="Error(string)")return Zt.from("error Error(string)");if(t==="Panic(uint256)")return Zt.from("error Panic(uint256)");const r=this.#t.get(t);return r||null}forEachError(t){const e=Array.from(this.#t.keys());e.sort((r,s)=>r.localeCompare(s));for(let r=0;r<e.length;r++){const s=e[r];t(this.#t.get(s),r)}}_decodeParams(t,e){return this.#i.decode(t,e)}_encodeParams(t,e){return this.#i.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){if(typeof t=="string"){const r=this.getError(t);y(r,"unknown error","fragment",t),t=r}return y(St(e,0,4)===t.selector,`data signature does not match error ${t.name}.`,"data",e),this._decodeParams(t.inputs,St(e,4))}encodeErrorResult(t,e){if(typeof t=="string"){const r=this.getError(t);y(r,"unknown error","fragment",t),t=r}return ot([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionData(t,e){if(typeof t=="string"){const r=this.getFunction(t);y(r,"unknown function","fragment",t),t=r}return y(St(e,0,4)===t.selector,`data signature does not match function ${t.name}.`,"data",e),this._decodeParams(t.inputs,St(e,4))}encodeFunctionData(t,e){if(typeof t=="string"){const r=this.getFunction(t);y(r,"unknown function","fragment",t),t=r}return ot([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionResult(t,e){if(typeof t=="string"){const _=this.getFunction(t);y(_,"unknown function","fragment",t),t=_}let r="invalid length for result data";const s=Ft(e);if(s.length%32===0)try{return this.#i.decode(t.outputs,s)}catch{r="could not decode result data"}C(!1,r,"BAD_DATA",{value:K(s),info:{method:t.name,signature:t.format()}})}makeError(t,e){const r=j(t,"data"),s=pi.getBuiltinCallException("call",e,r);if(s.message.startsWith("execution reverted (unknown custom error)")){const c=K(r.slice(0,4)),l=this.getError(c);if(l)try{const p=this.#i.decode(l.inputs,r.slice(4));s.revert={name:l.name,signature:l.format(),args:p},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}const a=this.parseTransaction(e);return a&&(s.invocation={method:a.name,signature:a.signature,args:a.args}),s}encodeFunctionResult(t,e){if(typeof t=="string"){const r=this.getFunction(t);y(r,"unknown function","fragment",t),t=r}return K(this.#i.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){if(typeof t=="string"){const _=this.getEvent(t);y(_,"unknown event","eventFragment",t),t=_}C(e.length<=t.inputs.length,`too many arguments for ${t.format()}`,"UNEXPECTED_ARGUMENT",{count:e.length,expectedCount:t.inputs.length});const r=[];t.anonymous||r.push(t.topicHash);const s=(_,a)=>_.type==="string"?Jn(a):_.type==="bytes"?mt(K(a)):(_.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":_.type.match(/^u?int/)?a=Yi(a):_.type.match(/^bytes/)?a=Op(a,32):_.type==="address"&&this.#i.encode(["address"],[a]),pe(K(a),32));for(e.forEach((_,a)=>{const c=t.inputs[a];if(!c.indexed){y(_==null,"cannot filter non-indexed parameters; must be null","contract."+c.name,_);return}_==null?r.push(null):c.baseType==="array"||c.baseType==="tuple"?y(!1,"filtering with tuples or arrays not supported","contract."+c.name,_):Array.isArray(_)?r.push(_.map(l=>s(c,l))):r.push(s(c,_))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(t,e){if(typeof t=="string"){const a=this.getEvent(t);y(a,"unknown event","eventFragment",t),t=a}const r=[],s=[],_=[];return t.anonymous||r.push(t.topicHash),y(e.length===t.inputs.length,"event arguments/values mismatch","values",e),t.inputs.forEach((a,c)=>{const l=e[c];if(a.indexed)if(a.type==="string")r.push(Jn(l));else if(a.type==="bytes")r.push(mt(l));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");r.push(this.#i.encode([a.type],[l]))}else s.push(a),_.push(l)}),{data:this.#i.encode(s,_),topics:r}}decodeEventLog(t,e,r){if(typeof t=="string"){const S=this.getEvent(t);y(S,"unknown event","eventFragment",t),t=S}if(r!=null&&!t.anonymous){const S=t.topicHash;y(ht(r[0],32)&&r[0].toLowerCase()===S,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const s=[],_=[],a=[];t.inputs.forEach((S,R)=>{S.indexed?S.type==="string"||S.type==="bytes"||S.baseType==="tuple"||S.baseType==="array"?(s.push(ut.from({type:"bytes32",name:S.name})),a.push(!0)):(s.push(S),a.push(!1)):(_.push(S),a.push(!1))});const c=r!=null?this.#i.decode(s,ot(r)):null,l=this.#i.decode(_,e,!0),p=[],u=[];let d=0,b=0;return t.inputs.forEach((S,R)=>{let m=null;if(S.indexed)if(c==null)m=new iu(null);else if(a[R])m=new iu(c[b++]);else try{m=c[b++]}catch(P){m=P}else try{m=l[d++]}catch(P){m=P}p.push(m),u.push(S.name||null)}),gi.fromItems(p,u)}parseTransaction(t){const e=j(t.data,"tx.data"),r=O(t.value!=null?t.value:0,"tx.value"),s=this.getFunction(K(e.slice(0,4)));if(!s)return null;const _=this.#i.decode(s.inputs,e.slice(4));return new US(s,s.selector,_,r)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){const e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new xS(e,e.topicHash,this.decodeEventLog(e,t.data,t.topics))}parseError(t){const e=K(t),r=this.getError(St(e,0,4));if(!r)return null;const s=this.#i.decode(r.inputs,St(e,4));return new TS(r,r.selector,s)}static from(t){return t instanceof Xn?t:typeof t=="string"?new Xn(JSON.parse(t)):typeof t.formatJson=="function"?new Xn(t.formatJson()):typeof t.format=="function"?new Xn(t.format("json")):new Xn(t)}}const _u=BigInt(0);function k_(i){return i??null}function Et(i){return i==null?null:i.toString()}class ou{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(t,e,r){D(this,{gasPrice:k_(t),maxFeePerGas:k_(e),maxPriorityFeePerGas:k_(r)})}toJSON(){const{gasPrice:t,maxFeePerGas:e,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Et(t),maxFeePerGas:Et(e),maxPriorityFeePerGas:Et(r)}}}function ja(i){const t={};i.to&&(t.to=i.to),i.from&&(t.from=i.from),i.data&&(t.data=K(i.data));const e="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of e)!(s in i)||i[s]==null||(t[s]=O(i[s],`request.${s}`));const r="type,nonce".split(/,/);for(const s of r)!(s in i)||i[s]==null||(t[s]=W(i[s],`request.${s}`));return i.accessList&&(t.accessList=Ln(i.accessList)),i.authorizationList&&(t.authorizationList=i.authorizationList.slice()),"blockTag"in i&&(t.blockTag=i.blockTag),"enableCcipRead"in i&&(t.enableCcipRead=!!i.enableCcipRead),"customData"in i&&(t.customData=i.customData),"blobVersionedHashes"in i&&i.blobVersionedHashes&&(t.blobVersionedHashes=i.blobVersionedHashes.slice()),"kzg"in i&&(t.kzg=i.kzg),"blobWrapperVersion"in i&&(t.blobWrapperVersion=i.blobWrapperVersion),"blobs"in i&&i.blobs&&(t.blobs=i.blobs.map(s=>Uc(s)?K(s):Object.assign({},s))),t}class OS{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#t;constructor(t,e){this.#t=t.transactions.map(r=>typeof r!="string"?new vo(r,e):r),D(this,{provider:e,hash:k_(t.hash),number:t.number,timestamp:t.timestamp,parentHash:t.parentHash,parentBeaconBlockRoot:t.parentBeaconBlockRoot,nonce:t.nonce,difficulty:t.difficulty,gasLimit:t.gasLimit,gasUsed:t.gasUsed,blobGasUsed:t.blobGasUsed,excessBlobGas:t.excessBlobGas,miner:t.miner,prevRandao:k_(t.prevRandao),extraData:t.extraData,baseFeePerGas:k_(t.baseFeePerGas),stateRoot:t.stateRoot,receiptsRoot:t.receiptsRoot})}get transactions(){return this.#t.map(t=>typeof t=="string"?t:t.hash)}get prefetchedTransactions(){const t=this.#t.slice();return t.length===0?[]:(C(typeof t[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),t)}toJSON(){const{baseFeePerGas:t,difficulty:e,extraData:r,gasLimit:s,gasUsed:_,hash:a,miner:c,prevRandao:l,nonce:p,number:u,parentHash:d,parentBeaconBlockRoot:b,stateRoot:S,receiptsRoot:R,timestamp:m,transactions:P}=this;return{_type:"Block",baseFeePerGas:Et(t),difficulty:Et(e),extraData:r,gasLimit:Et(s),gasUsed:Et(_),blobGasUsed:Et(this.blobGasUsed),excessBlobGas:Et(this.excessBlobGas),hash:a,miner:c,prevRandao:l,nonce:p,number:u,parentHash:d,timestamp:m,parentBeaconBlockRoot:b,stateRoot:S,receiptsRoot:R,transactions:P}}[Symbol.iterator](){let t=0;const e=this.transactions;return{next:()=>t<this.length?{value:e[t++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#t.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(t){let e;if(typeof t=="number")e=this.#t[t];else{const r=t.toLowerCase();for(const s of this.#t)if(typeof s=="string"){if(s!==r)continue;e=s;break}else{if(s.hash!==r)continue;e=s;break}}if(e==null)throw new Error("no such tx");return typeof e=="string"?await this.provider.getTransaction(e):e}getPrefetchedTransaction(t){const e=this.prefetchedTransactions;if(typeof t=="number")return e[t];t=t.toLowerCase();for(const r of e)if(r.hash===t)return r;y(!1,"no matching transaction","indexOrHash",t)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return kS(this)}}class Ko{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(t,e){this.provider=e;const r=Object.freeze(t.topics.slice());D(this,{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,removed:t.removed,address:t.address,data:t.data,topics:r,index:t.index,transactionIndex:t.transactionIndex})}toJSON(){const{address:t,blockHash:e,blockNumber:r,data:s,index:_,removed:a,topics:c,transactionHash:l,transactionIndex:p}=this;return{_type:"log",address:t,blockHash:e,blockNumber:r,data:s,index:_,removed:a,topics:c,transactionHash:l,transactionIndex:p}}async getBlock(){const t=await this.provider.getBlock(this.blockHash);return C(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransaction(){const t=await this.provider.getTransaction(this.transactionHash);return C(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransactionReceipt(){const t=await this.provider.getTransactionReceipt(this.transactionHash);return C(!!t,"failed to find transaction receipt","UNKNOWN_ERROR",{}),t}removedEvent(){return VS(this)}}class au{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#t;constructor(t,e){this.#t=Object.freeze(t.logs.map(s=>new Ko(s,e)));let r=_u;t.effectiveGasPrice!=null?r=t.effectiveGasPrice:t.gasPrice!=null&&(r=t.gasPrice),D(this,{provider:e,to:t.to,from:t.from,contractAddress:t.contractAddress,hash:t.hash,index:t.index,blockHash:t.blockHash,blockNumber:t.blockNumber,logsBloom:t.logsBloom,gasUsed:t.gasUsed,cumulativeGasUsed:t.cumulativeGasUsed,blobGasUsed:t.blobGasUsed,gasPrice:r,blobGasPrice:t.blobGasPrice,type:t.type,status:t.status,root:t.root})}get logs(){return this.#t}toJSON(){const{to:t,from:e,contractAddress:r,hash:s,index:_,blockHash:a,blockNumber:c,logsBloom:l,logs:p,status:u,root:d}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:c,contractAddress:r,cumulativeGasUsed:Et(this.cumulativeGasUsed),from:e,gasPrice:Et(this.gasPrice),blobGasUsed:Et(this.blobGasUsed),blobGasPrice:Et(this.blobGasPrice),gasUsed:Et(this.gasUsed),hash:s,index:_,logs:p,logsBloom:l,root:d,status:u,to:t}}get length(){return this.logs.length}[Symbol.iterator](){let t=0;return{next:()=>t<this.length?{value:this.logs[t++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const t=await this.provider.getBlock(this.blockHash);if(t==null)throw new Error("TODO");return t}async getTransaction(){const t=await this.provider.getTransaction(this.hash);if(t==null)throw new Error("TODO");return t}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return lu(this)}reorderedEvent(t){return C(!t||t.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),cu(this,t)}}class vo{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;authorizationList;#t;constructor(t,e){this.provider=e,this.blockNumber=t.blockNumber!=null?t.blockNumber:null,this.blockHash=t.blockHash!=null?t.blockHash:null,this.hash=t.hash,this.index=t.index,this.type=t.type,this.from=t.from,this.to=t.to||null,this.gasLimit=t.gasLimit,this.nonce=t.nonce,this.data=t.data,this.value=t.value,this.gasPrice=t.gasPrice,this.maxPriorityFeePerGas=t.maxPriorityFeePerGas!=null?t.maxPriorityFeePerGas:null,this.maxFeePerGas=t.maxFeePerGas!=null?t.maxFeePerGas:null,this.maxFeePerBlobGas=t.maxFeePerBlobGas!=null?t.maxFeePerBlobGas:null,this.chainId=t.chainId,this.signature=t.signature,this.accessList=t.accessList!=null?t.accessList:null,this.blobVersionedHashes=t.blobVersionedHashes!=null?t.blobVersionedHashes:null,this.authorizationList=t.authorizationList!=null?t.authorizationList:null,this.#t=-1}toJSON(){const{blockNumber:t,blockHash:e,index:r,hash:s,type:_,to:a,from:c,nonce:l,data:p,signature:u,accessList:d,blobVersionedHashes:b}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:t,blockHash:e,blobVersionedHashes:b,chainId:Et(this.chainId),data:p,from:c,gasLimit:Et(this.gasLimit),gasPrice:Et(this.gasPrice),hash:s,maxFeePerGas:Et(this.maxFeePerGas),maxPriorityFeePerGas:Et(this.maxPriorityFeePerGas),maxFeePerBlobGas:Et(this.maxFeePerBlobGas),nonce:l,signature:u,to:a,index:r,type:_,value:Et(this.value)}}async getBlock(){let t=this.blockNumber;if(t==null){const r=await this.getTransaction();r&&(t=r.blockNumber)}if(t==null)return null;const e=this.provider.getBlock(t);if(e==null)throw new Error("TODO");return e}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:e,blockNumber:r}=await Vt({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return e==null||e.blockNumber==null?0:r-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(t,e){const r=t??1,s=e??0;let _=this.#t,a=-1,c=_===-1;const l=async()=>{if(c)return null;const{blockNumber:b,nonce:S}=await Vt({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(S<this.nonce){_=b;return}if(c)return null;const R=await this.getTransaction();if(!(R&&R.blockNumber!=null))for(a===-1&&(a=_-3,a<this.#t&&(a=this.#t));a<=b;){if(c)return null;const m=await this.provider.getBlock(a,!0);if(m==null)return;for(const P of m)if(P===this.hash)return;for(let P=0;P<m.length;P++){const E=await m.getTransaction(P);if(E.from===this.from&&E.nonce===this.nonce){if(c)return null;const B=await this.provider.getTransactionReceipt(E.hash);if(B==null||b-B.blockNumber+1<r)return;let G="replaced";E.data===this.data&&E.to===this.to&&E.value===this.value?G="repriced":E.data==="0x"&&E.from===E.to&&E.value===_u&&(G="cancelled"),C(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:G==="replaced"||G==="cancelled",reason:G,replacement:E.replaceableTransaction(_),hash:E.hash,receipt:B})}}a++}},p=b=>{if(b==null||b.status!==0)return b;C(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:b.to,from:b.from,data:""},receipt:b})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return p(u);if(u){if(r===1||await u.confirmations()>=r)return p(u)}else if(await l(),r===0)return null;return await new Promise((b,S)=>{const R=[],m=()=>{R.forEach(E=>E())};if(R.push(()=>{c=!0}),s>0){const E=setTimeout(()=>{m(),S(gt("wait for transaction timeout","TIMEOUT"))},s);R.push(()=>{clearTimeout(E)})}const P=async E=>{if(await E.confirmations()>=r){m();try{b(p(E))}catch(B){S(B)}}};if(R.push(()=>{this.provider.off(this.hash,P)}),this.provider.on(this.hash,P),_>=0){const E=async()=>{try{await l()}catch(B){if(vt(B,"TRANSACTION_REPLACED")){m(),S(B);return}}c||this.provider.once("block",E)};R.push(()=>{this.provider.off("block",E)}),this.provider.once("block",E)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return C(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),lu(this)}reorderedEvent(t){return C(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),C(!t||t.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),cu(this,t)}replaceableTransaction(t){y(Number.isInteger(t)&&t>=0,"invalid startBlock","startBlock",t);const e=new vo(this,this.provider);return e.#t=t,e}}function kS(i){return{orphan:"drop-block",hash:i.hash,number:i.number}}function cu(i,t){return{orphan:"reorder-transaction",tx:i,other:t}}function lu(i){return{orphan:"drop-transaction",tx:i}}function VS(i){return{orphan:"drop-log",log:{transactionHash:i.transactionHash,blockHash:i.blockHash,blockNumber:i.blockNumber,address:i.address,data:i.data,topics:Object.freeze(i.topics.slice()),index:i.index}}}class El extends Ko{interface;fragment;args;constructor(t,e,r){super(t,t.provider);const s=e.decodeEventLog(r,t.data,t.topics);D(this,{args:s,fragment:r,interface:e})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class pu extends Ko{error;constructor(t,e){super(t,t.provider),D(this,{error:e})}}class FS extends au{#t;constructor(t,e,r){super(r,e),this.#t=t}get logs(){return super.logs.map(t=>{const e=t.topics.length?this.#t.getEvent(t.topics[0]):null;if(e)try{return new El(t,this.#t,e)}catch(r){return new pu(t,r)}return t})}}class Cl extends vo{#t;constructor(t,e,r){super(r,e),this.#t=t}async wait(t,e){const r=await super.wait(t,e);return r==null?null:new FS(this.#t,this.provider,r)}}class fu extends Yp{log;constructor(t,e,r,s){super(t,e,r),D(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class YS extends fu{constructor(t,e,r,s,_){super(t,e,r,new El(_,t.interface,s));const a=t.interface.decodeEventLog(s,this.log.data,this.log.topics);D(this,{args:a,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const hu=BigInt(0);function uu(i){return i&&typeof i.call=="function"}function du(i){return i&&typeof i.estimateGas=="function"}function La(i){return i&&typeof i.resolveName=="function"}function wu(i){return i&&typeof i.sendTransaction=="function"}function gu(i){if(i!=null){if(La(i))return i;if(i.provider)return i.provider}}class DS{#t;fragment;constructor(t,e,r){if(D(this,{fragment:e}),e.inputs.length<r.length)throw new Error("too many arguments");const s=t_(t.runner,"resolveName"),_=La(s)?s:null;this.#t=(async function(){const a=await Promise.all(e.inputs.map((c,l)=>r[l]==null?null:c.walkAsync(r[l],(u,d)=>u==="address"?Array.isArray(d)?Promise.all(d.map(b=>Dt(b,_))):Dt(d,_):d)));return t.interface.encodeFilterTopics(e,a)})()}getTopicFilter(){return this.#t}}function t_(i,t){return i==null?null:typeof i[t]=="function"?i:i.provider&&typeof i.provider[t]=="function"?i.provider:null}function e_(i){return i==null?null:i.provider||null}async function Au(i,t){const e=Rt.dereference(i,"overrides");y(typeof e=="object","invalid overrides parameter","overrides",i);const r=ja(e);return y(r.to==null||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),y(r.data==null||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function jS(i,t,e){const r=t_(i,"resolveName"),s=La(r)?r:null;return await Promise.all(t.map((_,a)=>_.walkAsync(e[a],(c,l)=>(l=Rt.dereference(l,c),c==="address"?Dt(l,s):l))))}function LS(i){const t=async function(a){const c=await Au(a,["data"]);c.to=await i.getAddress(),c.from&&(c.from=await Dt(c.from,gu(i.runner)));const l=i.interface,p=O(c.value||hu,"overrides.value")===hu,u=(c.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!p&&y(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),y(l.fallback||u,"cannot send data to receive-only contract","overrides.data",c.data);const d=l.receive||l.fallback&&l.fallback.payable;return y(d||p,"cannot send value to non-payable fallback","overrides.value",c.value),y(l.fallback||u,"cannot send data to receive-only contract","overrides.data",c.data),c},e=async function(a){const c=t_(i.runner,"call");C(uu(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await t(a);try{return await c.call(l)}catch(p){throw xc(p)&&p.data?i.interface.makeError(p.data,l):p}},r=async function(a){const c=i.runner;C(wu(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await c.sendTransaction(await t(a)),p=e_(i.runner);return new Cl(i.interface,p,l)},s=async function(a){const c=t_(i.runner,"estimateGas");return C(du(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await t(a))},_=async a=>await r(a);return D(_,{_contract:i,estimateGas:s,populateTransaction:t,send:r,staticCall:e}),_}function HS(i,t){const e=function(...p){const u=i.interface.getFunction(t,p);return C(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:p}}),u},r=async function(...p){const u=e(...p);let d={};if(u.inputs.length+1===p.length&&(d=await Au(p.pop()),d.from&&(d.from=await Dt(d.from,gu(i.runner)))),u.inputs.length!==p.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const b=await jS(i.runner,u.inputs,p);return Object.assign({},d,await Vt({to:i.getAddress(),data:i.interface.encodeFunctionData(u,b)}))},s=async function(...p){const u=await c(...p);return u.length===1?u[0]:u},_=async function(...p){const u=i.runner;C(wu(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const d=await u.sendTransaction(await r(...p)),b=e_(i.runner);return new Cl(i.interface,b,d)},a=async function(...p){const u=t_(i.runner,"estimateGas");return C(du(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...p))},c=async function(...p){const u=t_(i.runner,"call");C(uu(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const d=await r(...p);let b="0x";try{b=await u.call(d)}catch(R){throw xc(R)&&R.data?i.interface.makeError(R.data,d):R}const S=e(...p);return i.interface.decodeFunctionResult(S,b)},l=async(...p)=>e(...p).constant?await s(...p):await _(...p);return D(l,{name:i.interface.getFunctionName(t),_contract:i,_key:t,getFragment:e,estimateGas:a,populateTransaction:r,send:_,staticCall:s,staticCallResult:c}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const p=i.interface.getFunction(t);return C(p,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),p}}),l}function JS(i,t){const e=function(...s){const _=i.interface.getEvent(t,s);return C(_,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:s}}),_},r=function(...s){return new DS(i,e(...s),s)};return D(r,{name:i.interface.getEventName(t),_contract:i,_key:t,getFragment:e}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const s=i.interface.getEvent(t);return C(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),s}}),r}const Ha=Symbol.for("_ethersInternal_contract"),bu=new WeakMap;function QS(i,t){bu.set(i[Ha],t)}function ne(i){return bu.get(i[Ha])}function $S(i){return i&&typeof i=="object"&&"getTopicFilter"in i&&typeof i.getTopicFilter=="function"&&i.fragment}async function zl(i,t){let e,r=null;if(Array.isArray(t)){const _=function(a){if(ht(a,32))return a;const c=i.interface.getEvent(a);return y(c,"unknown fragment","name",a),c.topicHash};e=t.map(a=>a==null?null:Array.isArray(a)?a.map(_):_(a))}else t==="*"?e=[null]:typeof t=="string"?ht(t,32)?e=[t]:(r=i.interface.getEvent(t),y(r,"unknown fragment","event",t),e=[r.topicHash]):$S(t)?e=await t.getTopicFilter():"fragment"in t?(r=t.fragment,e=[r.topicHash]):y(!1,"unknown event name","event",t);e=e.map(_=>{if(_==null)return null;if(Array.isArray(_)){const a=Array.from(new Set(_.map(c=>c.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return _.toLowerCase()});const s=e.map(_=>_==null?"null":Array.isArray(_)?_.join("|"):_).join("&");return{fragment:r,tag:s,topics:e}}async function xo(i,t){const{subs:e}=ne(i);return e.get((await zl(i,t)).tag)||null}async function yu(i,t,e){const r=e_(i.runner);C(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:s,tag:_,topics:a}=await zl(i,e),{addr:c,subs:l}=ne(i);let p=l.get(_);if(!p){const d={address:c||i,topics:a},b=P=>{let E=s;if(E==null)try{E=i.interface.getEvent(P.topics[0])}catch{}if(E){const B=E,G=s?i.interface.decodeEventLog(s,P.data,P.topics):[];Gl(i,e,G,Y=>new YS(i,Y,e,B,P))}else Gl(i,e,[],B=>new fu(i,B,e,P))};let S=[];p={tag:_,listeners:[],start:()=>{S.length||S.push(r.on(d,b))},stop:async()=>{if(S.length==0)return;let P=S;S=[],await Promise.all(P),r.off(d,b)}},l.set(_,p)}return p}let Il=Promise.resolve();async function WS(i,t,e,r){await Il;const s=await xo(i,t);if(!s)return!1;const _=s.listeners.length;return s.listeners=s.listeners.filter(({listener:a,once:c})=>{const l=Array.from(e);r&&l.push(r(c?null:a));try{a.call(i,...l)}catch{}return!c}),s.listeners.length===0&&(s.stop(),ne(i).subs.delete(s.tag)),_>0}async function Gl(i,t,e,r){try{await Il}catch{}const s=WS(i,t,e,r);return Il=s,await s}const Ja=["then"];class Uo{target;interface;runner;filters;[Ha];fallback;constructor(t,e,r,s){y(typeof t=="string"||Wf(t),"invalid value for Contract target","target",t),r==null&&(r=null);const _=Xn.from(e);D(this,{target:t,runner:r,interface:_}),Object.defineProperty(this,Ha,{value:{}});let a,c=null,l=null;if(s){const d=e_(r);l=new Cl(this.interface,d,s)}let p=new Map;if(typeof t=="string")if(ht(t))c=t,a=Promise.resolve(t);else{const d=t_(r,"resolveName");if(!La(d))throw gt("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=d.resolveName(t).then(b=>{if(b==null)throw gt("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:t});return ne(this).addr=b,b})}else a=t.getAddress().then(d=>{if(d==null)throw new Error("TODO");return ne(this).addr=d,d});QS(this,{addrPromise:a,addr:c,deployTx:l,subs:p});const u=new Proxy({},{get:(d,b,S)=>{if(typeof b=="symbol"||Ja.indexOf(b)>=0)return Reflect.get(d,b,S);try{return this.getEvent(b)}catch(R){if(!vt(R,"INVALID_ARGUMENT")||R.argument!=="key")throw R}},has:(d,b)=>Ja.indexOf(b)>=0?Reflect.has(d,b):Reflect.has(d,b)||this.interface.hasEvent(String(b))});return D(this,{filters:u}),D(this,{fallback:_.receive||_.fallback?LS(this):null}),new Proxy(this,{get:(d,b,S)=>{if(typeof b=="symbol"||b in d||Ja.indexOf(b)>=0)return Reflect.get(d,b,S);try{return d.getFunction(b)}catch(R){if(!vt(R,"INVALID_ARGUMENT")||R.argument!=="key")throw R}},has:(d,b)=>typeof b=="symbol"||b in d||Ja.indexOf(b)>=0?Reflect.has(d,b):d.interface.hasFunction(b)})}connect(t){return new Uo(this.target,this.interface,t)}attach(t){return new Uo(t,this.interface,this.runner)}async getAddress(){return await ne(this).addrPromise}async getDeployedCode(){const t=e_(this.runner);C(t,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const e=await t.getCode(await this.getAddress());return e==="0x"?null:e}async waitForDeployment(){const t=this.deploymentTransaction();if(t)return await t.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=e_(this.runner);return C(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,_)=>{const a=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);r.once("block",a)}catch(c){_(c)}};a()})}deploymentTransaction(){return ne(this).deployTx}getFunction(t){return typeof t!="string"&&(t=t.format()),HS(this,t)}getEvent(t){return typeof t!="string"&&(t=t.format()),JS(this,t)}async queryTransaction(t){throw new Error("@TODO")}async queryFilter(t,e,r){e==null&&(e=0),r==null&&(r="latest");const{addr:s,addrPromise:_}=ne(this),a=s||await _,{fragment:c,topics:l}=await zl(this,t),p={address:a,topics:l,fromBlock:e,toBlock:r},u=e_(this.runner);return C(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(p)).map(d=>{let b=c;if(b==null)try{b=this.interface.getEvent(d.topics[0])}catch{}if(b)try{return new El(d,this.interface,b)}catch(S){return new pu(d,S)}return new Ko(d,u)})}async on(t,e){const r=await yu(this,"on",t);return r.listeners.push({listener:e,once:!1}),r.start(),this}async once(t,e){const r=await yu(this,"once",t);return r.listeners.push({listener:e,once:!0}),r.start(),this}async emit(t,...e){return await Gl(this,t,e,null)}async listenerCount(t){if(t){const s=await xo(this,t);return s?s.listeners.length:0}const{subs:e}=ne(this);let r=0;for(const{listeners:s}of e.values())r+=s.length;return r}async listeners(t){if(t){const s=await xo(this,t);return s?s.listeners.map(({listener:_})=>_):[]}const{subs:e}=ne(this);let r=[];for(const{listeners:s}of e.values())r=r.concat(s.map(({listener:_})=>_));return r}async off(t,e){const r=await xo(this,t);if(!r)return this;if(e){const s=r.listeners.map(({listener:_})=>_).indexOf(e);s>=0&&r.listeners.splice(s,1)}return(e==null||r.listeners.length===0)&&(r.stop(),ne(this).subs.delete(r.tag)),this}async removeAllListeners(t){if(t){const e=await xo(this,t);if(!e)return this;e.stop(),ne(this).subs.delete(e.tag)}else{const{subs:e}=ne(this);for(const{tag:r,stop:s}of e.values())s(),e.delete(r)}return this}async addListener(t,e){return await this.on(t,e)}async removeListener(t,e){return await this.off(t,e)}static buildClass(t){class e extends Uo{constructor(s,_=null){super(s,t,_)}}return e}static from(t,e,r){return r==null&&(r=null),new this(t,e,r)}}function ZS(){return Uo}class de extends ZS(){}function Bl(i){return i.match(/^ipfs:\/\/ipfs\//i)?i=i.substring(12):i.match(/^ipfs:\/\//i)?i=i.substring(7):y(!1,"unsupported IPFS format","link",i),`https://gateway.ipfs.io/ipfs/${i}`}class qS{name;constructor(t){D(this,{name:t})}connect(t){return this}supportsCoinType(t){return!1}async encodeAddress(t,e){throw new Error("unsupported coin")}async decodeAddress(t,e){throw new Error("unsupported coin")}}const Su=new RegExp("^(ipfs)://(.*)$","i"),mu=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Su,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class V_{provider;address;name;#t;#e;constructor(t,e,r){D(this,{provider:t,address:e,name:r}),this.#t=null,this.#e=new de(e,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],t)}async supportsWildcard(){return this.#t==null&&(this.#t=(async()=>{try{return await this.#e.supportsInterface("0x9061b923")}catch(t){if(vt(t,"CALL_EXCEPTION"))return!1;throw this.#t=null,t}})()),await this.#t}async#r(t,e){e=(e||[]).slice();const r=this.#e.interface;e.unshift(ml(this.name));let s=null;await this.supportsWildcard()&&(s=r.getFunction(t),C(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:t}}),e=[fS(this.name,255),r.encodeFunctionData(s,e)],t="resolve(bytes,bytes)"),e.push({enableCcipRead:!0});try{const _=await this.#e[t](...e);return s?r.decodeFunctionResult(s,_)[0]:_}catch(_){if(!vt(_,"CALL_EXCEPTION"))throw _}return null}async getAddress(t){if(t==null&&(t=60),t===60)try{const _=await this.#r("addr(bytes32)");return _==null||_===Mo?null:_}catch(_){if(vt(_,"CALL_EXCEPTION"))return null;throw _}if(t>=0&&t<2147483648){let _=t+2147483648;const a=await this.#r("addr(bytes32,uint)",[_]);if(ht(a,20))return et(a)}let e=null;for(const _ of this.provider.plugins)if(_ instanceof qS&&_.supportsCoinType(t)){e=_;break}if(e==null)return null;const r=await this.#r("addr(bytes32,uint)",[t]);if(r==null||r==="0x")return null;const s=await e.decodeAddress(t,r);if(s!=null)return s;C(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${t})`,info:{coinType:t,data:r}})}async getText(t){const e=await this.#r("text(bytes32,string)",[t]);return e==null||e==="0x"?null:e}async getContentHash(){const t=await this.#r("contenthash(bytes32)");if(t==null||t==="0x")return null;const e=t.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const s=e[1]==="e3010170"?"ipfs":"ipns",_=parseInt(e[4],16);if(e[5].length===_*2)return`${s}://${db("0x"+e[2])}`}const r=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;C(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:t}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const t=[{type:"name",value:this.name}];try{const e=await this.getText("avatar");if(e==null)return t.push({type:"!avatar",value:""}),{url:null,linkage:t};t.push({type:"avatar",value:e});for(let r=0;r<mu.length;r++){const s=e.match(mu[r]);if(s==null)continue;const _=s[1].toLowerCase();switch(_){case"https":case"data":return t.push({type:"url",value:e}),{linkage:t,url:e};case"ipfs":{const a=Bl(e);return t.push({type:"ipfs",value:e}),t.push({type:"url",value:a}),{linkage:t,url:a}}case"erc721":case"erc1155":{const a=_==="erc721"?"tokenURI(uint256)":"uri(uint256)";t.push({type:_,value:e});const c=await this.getAddress();if(c==null)return t.push({type:"!owner",value:""}),{url:null,linkage:t};const l=(s[2]||"").split("/");if(l.length!==2)return t.push({type:`!${_}caip`,value:s[2]||""}),{url:null,linkage:t};const p=l[1],u=new de(l[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(_==="erc721"){const m=await u.ownerOf(p);if(c!==m)return t.push({type:"!owner",value:m}),{url:null,linkage:t};t.push({type:"owner",value:m})}else if(_==="erc1155"){const m=await u.balanceOf(c,p);if(!m)return t.push({type:"!balance",value:"0"}),{url:null,linkage:t};t.push({type:"balance",value:m.toString()})}let d=await u[a](p);if(d==null||d==="0x")return t.push({type:"!metadata-url",value:""}),{url:null,linkage:t};t.push({type:"metadata-url-base",value:d}),_==="erc1155"&&(d=d.replace("{id}",Yi(p,32).substring(2)),t.push({type:"metadata-url-expanded",value:d})),d.match(/^ipfs:/i)&&(d=Bl(d)),t.push({type:"metadata-url",value:d});let b={};const S=await new oi(d).send();S.assertOk();try{b=S.bodyJson}catch{try{t.push({type:"!metadata",value:S.bodyText})}catch{const E=S.body;return E&&t.push({type:"!metadata",value:K(E)}),{url:null,linkage:t}}return{url:null,linkage:t}}if(!b)return t.push({type:"!metadata",value:""}),{url:null,linkage:t};t.push({type:"metadata",value:JSON.stringify(b)});let R=b.image;if(typeof R!="string")return t.push({type:"!imageUrl",value:""}),{url:null,linkage:t};if(!R.match(/^(https:\/\/|data:)/i)){if(R.match(Su)==null)return t.push({type:"!imageUrl-ipfs",value:R}),{url:null,linkage:t};t.push({type:"imageUrl-ipfs",value:R}),R=Bl(R)}return t.push({type:"url",value:R}),{linkage:t,url:R}}}}}catch{}return{linkage:t,url:null}}static async getEnsAddress(t){const e=await t.getNetwork(),r=e.getPlugin("org.ethers.plugins.network.Ens");return C(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:e}}),r.address}static async#i(t,e){const r=await V_.getEnsAddress(t);try{const _=await new de(r,["function resolver(bytes32) view returns (address)"],t).resolver(ml(e),{enableCcipRead:!0});return _===Mo?null:_}catch(s){throw s}return null}static async fromName(t,e){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const s=await V_.#i(t,r);if(s!=null){const _=new V_(t,s,e);return r!==e&&!await _.supportsWildcard()?null:_}r=r.split(".").slice(1).join(".")}}}const Ru=BigInt(0);function tt(i,t){return(function(e){return e==null?t:i(e)})}function To(i,t){return(e=>{if(t&&e==null)return null;if(!Array.isArray(e))throw new Error("not an array");return e.map(r=>i(r))})}function Oo(i,t){return(e=>{const r={};for(const s in i){let _=s;if(t&&s in t&&!(_ in e)){for(const a of t[s])if(a in e){_=a;break}}try{const a=i[s](e[_]);a!==void 0&&(r[s]=a)}catch(a){const c=a instanceof Error?a.message:"not-an-error";C(!1,`invalid value for value.${s} (${c})`,"BAD_DATA",{value:e})}}return r})}function XS(i){switch(i){case!0:case"true":return!0;case!1:case"false":return!1}y(!1,`invalid boolean; ${JSON.stringify(i)}`,"value",i)}function F_(i){return y(ht(i,!0),"invalid data","value",i),i}function xt(i){return y(ht(i,32),"invalid hash","value",i),i}const t2=Oo({address:et,blockHash:xt,blockNumber:W,data:F_,index:W,removed:tt(XS,!1),topics:To(xt),transactionHash:xt,transactionIndex:W},{index:["logIndex"]});function e2(i){return t2(i)}const r2=Oo({hash:tt(xt),parentHash:xt,parentBeaconBlockRoot:tt(xt,null),number:W,timestamp:W,nonce:tt(F_),difficulty:O,gasLimit:O,gasUsed:O,stateRoot:tt(xt,null),receiptsRoot:tt(xt,null),blobGasUsed:tt(O,null),excessBlobGas:tt(O,null),miner:tt(et),prevRandao:tt(xt,null),extraData:F_,baseFeePerGas:tt(O)},{prevRandao:["mixHash"]});function i2(i){const t=r2(i);return t.transactions=i.transactions.map(e=>typeof e=="string"?e:Pu(e)),t}const s2=Oo({transactionIndex:W,blockNumber:W,transactionHash:xt,address:et,topics:To(xt),data:F_,index:W,blockHash:xt},{index:["logIndex"]});function n2(i){return s2(i)}const _2=Oo({to:tt(et,null),from:tt(et,null),contractAddress:tt(et,null),index:W,root:tt(K),gasUsed:O,blobGasUsed:tt(O,null),logsBloom:tt(F_),blockHash:xt,hash:xt,logs:To(n2),blockNumber:W,cumulativeGasUsed:O,effectiveGasPrice:tt(O),blobGasPrice:tt(O,null),status:tt(W),type:tt(W,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function o2(i){return _2(i)}function Pu(i){i.to&&O(i.to)===Ru&&(i.to="0x0000000000000000000000000000000000000000");const t=Oo({hash:xt,index:tt(W,void 0),type:e=>e==="0x"||e==null?0:W(e),accessList:tt(Ln,null),blobVersionedHashes:tt(To(xt,!0),null),authorizationList:tt(To(e=>{let r;if(e.signature)r=e.signature;else{let s=e.yParity;s==="0x1b"?s=0:s==="0x1c"&&(s=1),r=Object.assign({},e,{yParity:s})}return{address:et(e.address),chainId:O(e.chainId),nonce:O(e.nonce),signature:bt.from(r)}},!1),null),blockHash:tt(xt,null),blockNumber:tt(W,null),transactionIndex:tt(W,null),from:et,gasPrice:tt(O),maxPriorityFeePerGas:tt(O),maxFeePerGas:tt(O),maxFeePerBlobGas:tt(O,null),gasLimit:O,to:tt(et,null),value:O,nonce:W,data:F_,creates:tt(et,null),chainId:tt(O,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(i);if(t.to==null&&t.creates==null&&(t.creates=Jy(t)),(i.type===1||i.type===2)&&i.accessList==null&&(t.accessList=[]),i.signature?t.signature=bt.from(i.signature):t.signature=bt.from(i),t.chainId==null){const e=t.signature.legacyChainId;e!=null&&(t.chainId=e)}return t.blockHash&&O(t.blockHash)===Ru&&(t.blockHash=null),t}const a2="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class ko{name;constructor(t){D(this,{name:t})}clone(){return new ko(this.name)}}class Qa extends ko{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(t,e){t==null&&(t=0),super(`org.ethers.network.plugins.GasCost#${t||0}`);const r={effectiveBlock:t};function s(_,a){let c=(e||{})[_];c==null&&(c=a),y(typeof c=="number",`invalud value for ${_}`,"costs",e),r[_]=c}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),D(this,r)}clone(){return new Qa(this.effectiveBlock,this)}}class $a extends ko{address;targetNetwork;constructor(t,e){super("org.ethers.plugins.network.Ens"),D(this,{address:t||a2,targetNetwork:e??1})}clone(){return new $a(this.address,this.targetNetwork)}}class c2 extends ko{#t;#e;get url(){return this.#t}get processFunc(){return this.#e}constructor(t,e){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#t=t,this.#e=e}clone(){return this}}const Nl=new Map;class _e{#t;#e;#r;constructor(t,e){this.#t=t,this.#e=O(e),this.#r=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#t}set name(t){this.#t=t}get chainId(){return this.#e}set chainId(t){this.#e=O(t,"chainId")}matches(t){if(t==null)return!1;if(typeof t=="string"){try{return this.chainId===O(t)}catch{}return this.name===t}if(typeof t=="number"||typeof t=="bigint"){try{return this.chainId===O(t)}catch{}return!1}if(typeof t=="object"){if(t.chainId!=null){try{return this.chainId===O(t.chainId)}catch{}return!1}return t.name!=null?this.name===t.name:!1}return!1}get plugins(){return Array.from(this.#r.values())}attachPlugin(t){if(this.#r.get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return this.#r.set(t.name,t.clone()),this}getPlugin(t){return this.#r.get(t)||null}getPlugins(t){return this.plugins.filter(e=>e.name.split("#")[0]===t)}clone(){const t=new _e(this.name,this.chainId);return this.plugins.forEach(e=>{t.attachPlugin(e.clone())}),t}computeIntrinsicGas(t){const e=this.getPlugin("org.ethers.plugins.network.GasCost")||new Qa;let r=e.txBase;if(t.to==null&&(r+=e.txCreate),t.data)for(let s=2;s<t.data.length;s+=2)t.data.substring(s,s+2)==="00"?r+=e.txDataZero:r+=e.txDataNonzero;if(t.accessList){const s=Ln(t.accessList);for(const _ in s)r+=e.txAccessListAddress+e.txAccessListStorageKey*s[_].storageKeys.length}return r}static from(t){if(l2(),t==null)return _e.from("mainnet");if(typeof t=="number"&&(t=BigInt(t)),typeof t=="string"||typeof t=="bigint"){const e=Nl.get(t);if(e)return e();if(typeof t=="bigint")return new _e("unknown",t);y(!1,"unknown network","network",t)}if(typeof t.clone=="function")return t.clone();if(typeof t=="object"){y(typeof t.name=="string"&&typeof t.chainId=="number","invalid network object name or chainId","network",t);const e=new _e(t.name,t.chainId);return(t.ensAddress||t.ensNetwork!=null)&&e.attachPlugin(new $a(t.ensAddress,t.ensNetwork)),e}y(!1,"invalid network","network",t)}static register(t,e){typeof t=="number"&&(t=BigInt(t));const r=Nl.get(t);r&&y(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",t),Nl.set(t,e)}}function Mu(i,t){const e=String(i);if(!e.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${i}`);const r=e.split(".");if(r.length===1&&r.push(""),r.length!==2)throw new Error(`invalid gwei value: ${i}`);for(;r[1].length<t;)r[1]+="0";if(r[1].length>9){let s=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||s++,r[1]=s.toString()}return BigInt(r[0]+r[1])}function Eu(i){return new c2(i,async(t,e,r)=>{r.setHeader("User-Agent","ethers");let s;try{const[_,a]=await Promise.all([r.send(),t()]);s=_;const c=s.bodyJson.standard;return{gasPrice:a.gasPrice,maxFeePerGas:Mu(c.maxFee,9),maxPriorityFeePerGas:Mu(c.maxPriorityFee,9)}}catch(_){C(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:s,error:_})}})}let Cu=!1;function l2(){if(Cu)return;Cu=!0;function i(t,e,r){const s=function(){const _=new _e(t,e);return r.ensNetwork!=null&&_.attachPlugin(new $a(null,r.ensNetwork)),_.attachPlugin(new Qa),(r.plugins||[]).forEach(a=>{_.attachPlugin(a)}),_};_e.register(t,s),_e.register(e,s),r.altNames&&r.altNames.forEach(_=>{_e.register(_,s)})}i("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),i("ropsten",3,{ensNetwork:3}),i("rinkeby",4,{ensNetwork:4}),i("goerli",5,{ensNetwork:5}),i("kovan",42,{ensNetwork:42}),i("sepolia",11155111,{ensNetwork:11155111}),i("holesky",17e3,{ensNetwork:17e3}),i("classic",61,{}),i("classicKotti",6,{}),i("arbitrum",42161,{ensNetwork:1}),i("arbitrum-goerli",421613,{}),i("arbitrum-sepolia",421614,{}),i("base",8453,{ensNetwork:1}),i("base-goerli",84531,{}),i("base-sepolia",84532,{}),i("bnb",56,{ensNetwork:1}),i("bnbt",97,{}),i("filecoin",314,{}),i("filecoin-calibration",314159,{}),i("linea",59144,{ensNetwork:1}),i("linea-goerli",59140,{}),i("linea-sepolia",59141,{}),i("matic",137,{ensNetwork:1,plugins:[Eu("https://gasstation.polygon.technology/v2")]}),i("matic-amoy",80002,{}),i("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Eu("https://gasstation-testnet.polygon.technology/v2")]}),i("optimism",10,{ensNetwork:1,plugins:[]}),i("optimism-goerli",420,{}),i("optimism-sepolia",11155420,{}),i("xdai",100,{ensNetwork:1})}function Kl(i){return JSON.parse(JSON.stringify(i))}class p2{#t;#e;#r;#i;constructor(t){this.#t=t,this.#e=null,this.#r=4e3,this.#i=-2}get pollingInterval(){return this.#r}set pollingInterval(t){this.#r=t}async#s(){try{const t=await this.#t.getBlockNumber();if(this.#i===-2){this.#i=t;return}if(t!==this.#i){for(let e=this.#i+1;e<=t;e++){if(this.#e==null)return;await this.#t.emit("block",e)}this.#i=t}}catch{}this.#e!=null&&(this.#e=this.#t._setTimeout(this.#s.bind(this),this.#r))}start(){this.#e||(this.#e=this.#t._setTimeout(this.#s.bind(this),this.#r),this.#s())}stop(){this.#e&&(this.#t._clearTimeout(this.#e),this.#e=null)}pause(t){this.stop(),t&&(this.#i=-2)}resume(){this.start()}}class vl{#t;#e;#r;constructor(t){this.#t=t,this.#r=!1,this.#e=e=>{this._poll(e,this.#t)}}async _poll(t,e){throw new Error("sub-classes must override this")}start(){this.#r||(this.#r=!0,this.#e(-2),this.#t.on("block",this.#e))}stop(){this.#r&&(this.#r=!1,this.#t.off("block",this.#e))}pause(t){this.stop()}resume(){this.start()}}class f2 extends vl{#t;#e;constructor(t,e){super(t),this.#t=e,this.#e=-2}pause(t){t&&(this.#e=-2),super.pause(t)}async _poll(t,e){const r=await e.getBlock(this.#t);r!=null&&(this.#e===-2?this.#e=r.number:r.number>this.#e&&(e.emit(this.#t,r.number),this.#e=r.number))}}class h2 extends vl{#t;constructor(t,e){super(t),this.#t=Kl(e)}async _poll(t,e){throw new Error("@TODO")}}class u2 extends vl{#t;constructor(t,e){super(t),this.#t=e}async _poll(t,e){const r=await e.getTransactionReceipt(this.#t);r&&e.emit(this.#t,r)}}class xl{#t;#e;#r;#i;#s;constructor(t,e){this.#t=t,this.#e=Kl(e),this.#r=this.#n.bind(this),this.#i=!1,this.#s=-2}async#n(t){if(this.#s===-2)return;const e=Kl(this.#e);e.fromBlock=this.#s+1,e.toBlock=t;const r=await this.#t.getLogs(e);if(r.length===0){this.#s<t-60&&(this.#s=t-60);return}for(const s of r)this.#t.emit(this.#e,s),this.#s=s.blockNumber}start(){this.#i||(this.#i=!0,this.#s===-2&&this.#t.getBlockNumber().then(t=>{this.#s=t}),this.#t.on("block",this.#r))}stop(){this.#i&&(this.#i=!1,this.#t.off("block",this.#r))}pause(t){this.stop(),t&&(this.#s=-2)}resume(){this.start()}}const d2=BigInt(2),w2=10;function Wa(i){return i&&typeof i.then=="function"}function Za(i,t){return i+":"+JSON.stringify(t,(e,r)=>{if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const s=Object.keys(r);return s.sort(),s.reduce((_,a)=>(_[a]=r[a],_),{})}return r})}class zu{name;constructor(t){D(this,{name:t})}start(){}stop(){}pause(t){}resume(){}}function g2(i){return JSON.parse(JSON.stringify(i))}function Ul(i){return i=Array.from(new Set(i).values()),i.sort(),i}async function Tl(i,t){if(i==null)throw new Error("invalid event");if(Array.isArray(i)&&(i={topics:i}),typeof i=="string")switch(i){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:i,tag:i}}if(ht(i,32)){const e=i.toLowerCase();return{type:"transaction",tag:Za("tx",{hash:e}),hash:e}}if(i.orphan){const e=i;return{type:"orphan",tag:Za("orphan",e),filter:g2(e)}}if(i.address||i.topics){const e=i,r={topics:(e.topics||[]).map(s=>s==null?null:Array.isArray(s)?Ul(s.map(_=>_.toLowerCase())):s.toLowerCase())};if(e.address){const s=[],_=[],a=c=>{ht(c)?s.push(c):_.push((async()=>{s.push(await Dt(c,t))})())};Array.isArray(e.address)?e.address.forEach(a):a(e.address),_.length&&await Promise.all(_),r.address=Ul(s.map(c=>c.toLowerCase()))}return{filter:r,tag:Za("event",r),type:"event"}}y(!1,"unknown ProviderEvent","event",i)}function Ol(){return new Date().getTime()}const A2={cacheTimeout:250,pollingInterval:4e3};class b2{#t;#e;#r;#i;#s;#n;#_;#o;#u;#a;#p;#h;constructor(t,e){if(this.#h=Object.assign({},A2,e||{}),t==="any")this.#n=!0,this.#s=null;else if(t){const r=_e.from(t);this.#n=!1,this.#s=Promise.resolve(r),setTimeout(()=>{this.emit("network",r,null)},0)}else this.#n=!1,this.#s=null;this.#o=-1,this.#_=new Map,this.#t=new Map,this.#e=new Map,this.#r=null,this.#i=!1,this.#u=1,this.#a=new Map,this.#p=!1}get pollingInterval(){return this.#h.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#e.values())}attachPlugin(t){if(this.#e.get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return this.#e.set(t.name,t.connect(this)),this}getPlugin(t){return this.#e.get(t)||null}get disableCcipRead(){return this.#p}set disableCcipRead(t){this.#p=!!t}async#c(t){const e=this.#h.cacheTimeout;if(e<0)return await this._perform(t);const r=Za(t.method,t);let s=this.#_.get(r);return s||(s=this._perform(t),this.#_.set(r,s),setTimeout(()=>{this.#_.get(r)===s&&this.#_.delete(r)},e)),await s}async ccipReadFetch(t,e,r){if(this.disableCcipRead||r.length===0||t.to==null)return null;const s=t.to.toLowerCase(),_=e.toLowerCase(),a=[];for(let c=0;c<r.length;c++){const l=r[c],p=l.replace("{sender}",s).replace("{data}",_),u=new oi(p);l.indexOf("{data}")===-1&&(u.body={data:_,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:u,index:c,urls:r});let d="unknown error",b;try{b=await u.send()}catch(S){a.push(S.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:{error:S}});continue}try{const S=b.bodyJson;if(S.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:u,result:S}),S.data;S.message&&(d=S.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:S})}catch{}C(b.statusCode<400||b.statusCode>=500,`response not found during CCIP fetch: ${d}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:t,info:{url:l,errorMessage:d}}),a.push(d)}C(!1,`error encountered during CCIP fetch: ${a.map(c=>JSON.stringify(c)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:t,info:{urls:r,errorMessages:a}})}_wrapBlock(t,e){return new OS(i2(t),this)}_wrapLog(t,e){return new Ko(e2(t),this)}_wrapTransactionReceipt(t,e){return new au(o2(t),this)}_wrapTransactionResponse(t,e){return new vo(Pu(t),this)}_detectNetwork(){C(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(t){C(!1,`unsupported method: ${t.method}`,"UNSUPPORTED_OPERATION",{operation:t.method,info:t})}async getBlockNumber(){const t=W(await this.#c({method:"getBlockNumber"}),"%response");return this.#o>=0&&(this.#o=t),t}_getAddress(t){return Dt(t,this)}_getBlockTag(t){if(t==null)return"latest";switch(t){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return t}if(ht(t))return ht(t,32)?t:Xr(t);if(typeof t=="bigint"&&(t=W(t,"blockTag")),typeof t=="number")return t>=0?Xr(t):this.#o>=0?Xr(this.#o+t):this.getBlockNumber().then(e=>Xr(e+t));y(!1,"invalid blockTag","blockTag",t)}_getFilter(t){const e=(t.topics||[]).map(l=>l==null?null:Array.isArray(l)?Ul(l.map(p=>p.toLowerCase())):l.toLowerCase()),r="blockHash"in t?t.blockHash:void 0,s=(l,p,u)=>{let d;switch(l.length){case 0:break;case 1:d=l[0];break;default:l.sort(),d=l}if(r&&(p!=null||u!=null))throw new Error("invalid filter");const b={};return d&&(b.address=d),e.length&&(b.topics=e),p&&(b.fromBlock=p),u&&(b.toBlock=u),r&&(b.blockHash=r),b};let _=[];if(t.address)if(Array.isArray(t.address))for(const l of t.address)_.push(this._getAddress(l));else _.push(this._getAddress(t.address));let a;"fromBlock"in t&&(a=this._getBlockTag(t.fromBlock));let c;return"toBlock"in t&&(c=this._getBlockTag(t.toBlock)),_.filter(l=>typeof l!="string").length||a!=null&&typeof a!="string"||c!=null&&typeof c!="string"?Promise.all([Promise.all(_),a,c]).then(l=>s(l[0],l[1],l[2])):s(_,a,c)}_getTransactionRequest(t){const e=ja(t),r=[];if(["to","from"].forEach(s=>{if(e[s]==null)return;const _=Dt(e[s],this);Wa(_)?r.push((async function(){e[s]=await _})()):e[s]=_}),e.blockTag!=null){const s=this._getBlockTag(e.blockTag);Wa(s)?r.push((async function(){e.blockTag=await s})()):e.blockTag=s}return r.length?(async function(){return await Promise.all(r),e})():e}async getNetwork(){if(this.#s==null){const s=(async()=>{try{const _=await this._detectNetwork();return this.emit("network",_,null),_}catch(_){throw this.#s===s&&(this.#s=null),_}})();return this.#s=s,(await s).clone()}const t=this.#s,[e,r]=await Promise.all([t,this._detectNetwork()]);return e.chainId!==r.chainId&&(this.#n?(this.emit("network",r,e),this.#s===t&&(this.#s=Promise.resolve(r))):C(!1,`network changed: ${e.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),e.clone()}async getFeeData(){const t=await this.getNetwork(),e=async()=>{const{_block:s,gasPrice:_,priorityFee:a}=await Vt({_block:this.#A("latest",!1),gasPrice:(async()=>{try{const u=await this.#c({method:"getGasPrice"});return O(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const u=await this.#c({method:"getPriorityFee"});return O(u,"%response")}catch{}return null})()});let c=null,l=null;const p=this._wrapBlock(s,t);return p&&p.baseFeePerGas&&(l=a??BigInt("1000000000"),c=p.baseFeePerGas*d2+l),new ou(_,c,l)},r=t.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const s=new oi(r.url),_=await r.processFunc(e,this,s);return new ou(_.gasPrice,_.maxFeePerGas,_.maxPriorityFeePerGas)}return await e()}async estimateGas(t){let e=this._getTransactionRequest(t);return Wa(e)&&(e=await e),O(await this.#c({method:"estimateGas",transaction:e}),"%response")}async#l(t,e,r){C(r<w2,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},t,{blockTag:e,enableCcipRead:!0})});const s=ja(t);try{return K(await this._perform({method:"call",transaction:s,blockTag:e}))}catch(_){if(!this.disableCcipRead&&xc(_)&&_.data&&r>=0&&e==="latest"&&s.to!=null&&St(_.data,0,4)==="0x556f1830"){const a=_.data,c=await Dt(s.to,this);let l;try{l=P2(St(_.data,4))}catch(d){C(!1,d.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:a}})}C(l.sender.toLowerCase()===c.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:a,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const p=await this.ccipReadFetch(s,l.calldata,l.urls);C(p!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:_.data,errorArgs:l.errorArgs}});const u={to:c,data:ot([l.selector,R2([p,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const d=await this.#l(u,e,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:d}),d}catch(d){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:d}),d}}throw _}}async#f(t){const{value:e}=await Vt({network:this.getNetwork(),value:t});return e}async call(t){const{tx:e,blockTag:r}=await Vt({tx:this._getTransactionRequest(t),blockTag:this._getBlockTag(t.blockTag)});return await this.#f(this.#l(e,r,t.enableCcipRead?0:-1))}async#d(t,e,r){let s=this._getAddress(e),_=this._getBlockTag(r);return(typeof s!="string"||typeof _!="string")&&([s,_]=await Promise.all([s,_])),await this.#f(this.#c(Object.assign(t,{address:s,blockTag:_})))}async getBalance(t,e){return O(await this.#d({method:"getBalance"},t,e),"%response")}async getTransactionCount(t,e){return W(await this.#d({method:"getTransactionCount"},t,e),"%response")}async getCode(t,e){return K(await this.#d({method:"getCode"},t,e))}async getStorage(t,e,r){const s=O(e,"position");return K(await this.#d({method:"getStorage",position:s},t,r))}async broadcastTransaction(t){const{blockNumber:e,hash:r,network:s}=await Vt({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:t}),network:this.getNetwork()}),_=ei.from(t);if(_.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(_,s).replaceableTransaction(e)}async#A(t,e){if(ht(t,32))return await this.#c({method:"getBlock",blockHash:t,includeTransactions:e});let r=this._getBlockTag(t);return typeof r!="string"&&(r=await r),await this.#c({method:"getBlock",blockTag:r,includeTransactions:e})}async getBlock(t,e){const{network:r,params:s}=await Vt({network:this.getNetwork(),params:this.#A(t,!!e)});return s==null?null:this._wrapBlock(s,r)}async getTransaction(t){const{network:e,params:r}=await Vt({network:this.getNetwork(),params:this.#c({method:"getTransaction",hash:t})});return r==null?null:this._wrapTransactionResponse(r,e)}async getTransactionReceipt(t){const{network:e,params:r}=await Vt({network:this.getNetwork(),params:this.#c({method:"getTransactionReceipt",hash:t})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const s=await this.#c({method:"getTransaction",hash:t});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(r,e)}async getTransactionResult(t){const{result:e}=await Vt({network:this.getNetwork(),result:this.#c({method:"getTransactionResult",hash:t})});return e==null?null:K(e)}async getLogs(t){let e=this._getFilter(t);Wa(e)&&(e=await e);const{network:r,params:s}=await Vt({network:this.getNetwork(),params:this.#c({method:"getLogs",filter:e})});return s.map(_=>this._wrapLog(_,r))}_getProvider(t){C(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(t){return await V_.fromName(this,t)}async getAvatar(t){const e=await this.getResolver(t);return e?await e.getAvatar():null}async resolveName(t){const e=await this.getResolver(t);return e?await e.getAddress():null}async lookupAddress(t){t=et(t);const e=ml(t.substring(2).toLowerCase()+".addr.reverse");try{const r=await V_.getEnsAddress(this),_=await new de(r,["function resolver(bytes32) view returns (address)"],this).resolver(e);if(_==null||_===Mo)return null;const c=await new de(_,["function name(bytes32) view returns (string)"],this).name(e);return await this.resolveName(c)!==t?null:c}catch(r){if(vt(r,"BAD_DATA")&&r.value==="0x"||vt(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(t,e,r){const s=e??1;return s===0?this.getTransactionReceipt(t):new Promise(async(_,a)=>{let c=null;const l=(async p=>{try{const u=await this.getTransactionReceipt(t);if(u!=null&&p-u.blockNumber+1>=s){_(u),c&&(clearTimeout(c),c=null);return}}catch(u){console.log("EEE",u)}this.once("block",l)});r!=null&&(c=setTimeout(()=>{c!=null&&(c=null,this.off("block",l),a(gt("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(t){C(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(t){const e=this.#a.get(t);e&&(e.timer&&clearTimeout(e.timer),this.#a.delete(t))}_setTimeout(t,e){e==null&&(e=0);const r=this.#u++,s=()=>{this.#a.delete(r),t()};if(this.paused)this.#a.set(r,{timer:null,func:s,time:e});else{const _=setTimeout(s,e);this.#a.set(r,{timer:_,func:s,time:Ol()})}return r}_forEachSubscriber(t){for(const e of this.#t.values())t(e.subscriber)}_getSubscriber(t){switch(t.type){case"debug":case"error":case"network":return new zu(t.type);case"block":{const e=new p2(this);return e.pollingInterval=this.pollingInterval,e}case"safe":case"finalized":return new f2(this,t.type);case"event":return new xl(this,t.filter);case"transaction":return new u2(this,t.hash);case"orphan":return new h2(this,t.filter)}throw new Error(`unsupported event: ${t.type}`)}_recoverSubscriber(t,e){for(const r of this.#t.values())if(r.subscriber===t){r.started&&r.subscriber.stop(),r.subscriber=e,r.started&&e.start(),this.#r!=null&&e.pause(this.#r);break}}async#w(t,e){let r=await Tl(t,this);return r.type==="event"&&e&&e.length>0&&e[0].removed===!0&&(r=await Tl({orphan:"drop-log",log:e[0]},this)),this.#t.get(r.tag)||null}async#g(t){const e=await Tl(t,this),r=e.tag;let s=this.#t.get(r);return s||(s={subscriber:this._getSubscriber(e),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#t.set(r,s)),s}async on(t,e){const r=await this.#g(t);return r.listeners.push({listener:e,once:!1}),r.started||(r.subscriber.start(),r.started=!0,this.#r!=null&&r.subscriber.pause(this.#r)),this}async once(t,e){const r=await this.#g(t);return r.listeners.push({listener:e,once:!0}),r.started||(r.subscriber.start(),r.started=!0,this.#r!=null&&r.subscriber.pause(this.#r)),this}async emit(t,...e){const r=await this.#w(t,e);if(!r||r.listeners.length===0)return!1;const s=r.listeners.length;return r.listeners=r.listeners.filter(({listener:_,once:a})=>{const c=new Yp(this,a?null:_,t);try{_.call(this,...e,c)}catch{}return!a}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),this.#t.delete(r.tag)),s>0}async listenerCount(t){if(t){const r=await this.#w(t);return r?r.listeners.length:0}let e=0;for(const{listeners:r}of this.#t.values())e+=r.length;return e}async listeners(t){if(t){const r=await this.#w(t);return r?r.listeners.map(({listener:s})=>s):[]}let e=[];for(const{listeners:r}of this.#t.values())e=e.concat(r.map(({listener:s})=>s));return e}async off(t,e){const r=await this.#w(t);if(!r)return this;if(e){const s=r.listeners.map(({listener:_})=>_).indexOf(e);s>=0&&r.listeners.splice(s,1)}return(!e||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),this.#t.delete(r.tag)),this}async removeAllListeners(t){if(t){const{tag:e,started:r,subscriber:s}=await this.#g(t);r&&s.stop(),this.#t.delete(e)}else for(const[e,{started:r,subscriber:s}]of this.#t)r&&s.stop(),this.#t.delete(e);return this}async addListener(t,e){return await this.on(t,e)}async removeListener(t,e){return this.off(t,e)}get destroyed(){return this.#i}destroy(){this.removeAllListeners();for(const t of this.#a.keys())this._clearTimeout(t);this.#i=!0}get paused(){return this.#r!=null}set paused(t){!!t!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(t){if(this.#o=-1,this.#r!=null){if(this.#r==!!t)return;C(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(e=>e.pause(t)),this.#r=!!t;for(const e of this.#a.values())e.timer&&clearTimeout(e.timer),e.time=Ol()-e.time}resume(){if(this.#r!=null){this._forEachSubscriber(t=>t.resume()),this.#r=null;for(const t of this.#a.values()){let e=t.time;e<0&&(e=0),t.time=Ol(),setTimeout(t.func,e)}}}}function y2(i,t){try{const e=kl(i,t);if(e)return ba(e)}catch{}return null}function kl(i,t){if(i==="0x")return null;try{const e=W(St(i,t,t+32)),r=W(St(i,e,e+32));return St(i,e+32,e+32+r)}catch{}return null}function Iu(i){const t=Pt(i);if(t.length>32)throw new Error("internal; should not happen");const e=new Uint8Array(32);return e.set(t,32-t.length),e}function S2(i){if(i.length%32===0)return i;const t=new Uint8Array(Math.ceil(i.length/32)*32);return t.set(i),t}const m2=new Uint8Array([]);function R2(i){const t=[];let e=0;for(let r=0;r<i.length;r++)t.push(m2),e+=32;for(let r=0;r<i.length;r++){const s=j(i[r]);t[r]=Iu(e),t.push(Iu(s.length)),t.push(S2(s)),e+=32+Math.ceil(s.length/32)*32}return ot(t)}const Gu="0x0000000000000000000000000000000000000000000000000000000000000000";function P2(i){const t={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};C(kn(i)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const e=St(i,0,32);C(St(e,0,12)===St(Gu,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),t.sender=St(e,12);try{const r=[],s=W(St(i,32,64)),_=W(St(i,s,s+32)),a=St(i,s+32);for(let c=0;c<_;c++){const l=y2(a,c*32);if(l==null)throw new Error("abort");r.push(l)}t.urls=r}catch{C(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=kl(i,64);if(r==null)throw new Error("abort");t.calldata=r}catch{C(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}C(St(i,100,128)===St(Gu,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),t.selector=St(i,96,100);try{const r=kl(i,128);if(r==null)throw new Error("abort");t.extraData=r}catch{C(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return t.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(r=>t[r]),t}function r_(i,t){if(i.provider)return i.provider;C(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function Bu(i,t){let e=ja(t);if(e.to!=null&&(e.to=Dt(e.to,i)),e.from!=null){const r=e.from;e.from=Promise.all([i.getAddress(),Dt(r,i)]).then(([s,_])=>(y(s.toLowerCase()===_.toLowerCase(),"transaction from mismatch","tx.from",_),s))}else e.from=i.getAddress();return await Vt(e)}class M2{provider;constructor(t){D(this,{provider:t||null})}async getNonce(t){return r_(this,"getTransactionCount").getTransactionCount(await this.getAddress(),t)}async populateCall(t){return await Bu(this,t)}async populateTransaction(t){const e=r_(this,"populateTransaction"),r=await Bu(this,t);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const s=await this.provider.getNetwork();if(r.chainId!=null){const a=O(r.chainId);y(a===s.chainId,"transaction chainId mismatch","tx.chainId",t.chainId)}else r.chainId=s.chainId;const _=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||_)?y(!1,"eip-1559 transaction do not support gasPrice","tx",t):(r.type===0||r.type===1)&&_&&y(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",t),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const a=await e.getFeeData();C(a.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=a.gasPrice)}else{const a=await e.getFeeData();if(r.type==null)if(a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)if(r.authorizationList&&r.authorizationList.length?r.type=4:r.type=2,r.gasPrice!=null){const c=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=c,r.maxPriorityFeePerGas=c}else r.maxFeePerGas==null&&(r.maxFeePerGas=a.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?(C(!_,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=a.gasPrice),r.type=0):C(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(r.type===2||r.type===3||r.type===4)&&(r.maxFeePerGas==null&&(r.maxFeePerGas=a.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return await Vt(r)}async populateAuthorization(t){const e=Object.assign({},t);return e.chainId==null&&(e.chainId=(await r_(this,"getNetwork").getNetwork()).chainId),e.nonce==null&&(e.nonce=await this.getNonce()),e}async estimateGas(t){return r_(this,"estimateGas").estimateGas(await this.populateCall(t))}async call(t){return r_(this,"call").call(await this.populateCall(t))}async resolveName(t){return await r_(this,"resolveName").resolveName(t)}async sendTransaction(t){const e=r_(this,"sendTransaction"),r=await this.populateTransaction(t);delete r.from;const s=ei.from(r);return await e.broadcastTransaction(await this.signTransaction(s))}authorize(t){C(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}function E2(i){return JSON.parse(JSON.stringify(i))}class Nu{#t;#e;#r;#i;#s;#n;constructor(t){this.#t=t,this.#e=null,this.#r=this.#_.bind(this),this.#i=!1,this.#s=null,this.#n=!1}_subscribe(t){throw new Error("subclasses must override this")}_emitResults(t,e){throw new Error("subclasses must override this")}_recover(t){throw new Error("subclasses must override this")}async#_(t){try{this.#e==null&&(this.#e=this._subscribe(this.#t));let e=null;try{e=await this.#e}catch(_){if(!vt(_,"UNSUPPORTED_OPERATION")||_.operation!=="eth_newFilter")throw _}if(e==null){this.#e=null,this.#t._recoverSubscriber(this,this._recover(this.#t));return}const r=await this.#t.getNetwork();if(this.#s||(this.#s=r),this.#s.chainId!==r.chainId)throw new Error("chaid changed");if(this.#n)return;const s=await this.#t.send("eth_getFilterChanges",[e]);await this._emitResults(this.#t,s)}catch(e){console.log("@TODO",e)}this.#t.once("block",this.#r)}#o(){const t=this.#e;t&&(this.#e=null,t.then(e=>{this.#t.destroyed||this.#t.send("eth_uninstallFilter",[e])}))}start(){this.#i||(this.#i=!0,this.#_(-2))}stop(){this.#i&&(this.#i=!1,this.#n=!0,this.#o(),this.#t.off("block",this.#r))}pause(t){t&&this.#o(),this.#t.off("block",this.#r)}resume(){this.start()}}class C2 extends Nu{#t;constructor(t,e){super(t),this.#t=E2(e)}_recover(t){return new xl(t,this.#t)}async _subscribe(t){return await t.send("eth_newFilter",[this.#t])}async _emitResults(t,e){for(const r of e)t.emit(this.#t,t._wrapLog(r,t._network))}}class z2 extends Nu{async _subscribe(t){return await t.send("eth_newPendingTransactionFilter",[])}async _emitResults(t,e){for(const r of e)t.emit("pending",r)}}const I2="bigint,boolean,function,number,string,symbol".split(/,/g);function qa(i){if(i==null||I2.indexOf(typeof i)>=0||typeof i.getAddress=="function")return i;if(Array.isArray(i))return i.map(qa);if(typeof i=="object")return Object.keys(i).reduce((t,e)=>(t[e]=i[e],t),{});throw new Error(`should not happen: ${i} (${typeof i})`)}function G2(i){return new Promise(t=>{setTimeout(t,i)})}function Y_(i){return i&&i.toLowerCase()}function Ku(i){return i&&typeof i.pollingInterval=="number"}const vu={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class Vl extends M2{address;constructor(t,e){super(t),e=et(e),D(this,{address:e})}connect(t){C(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(t){return await this.populateCall(t)}async sendUncheckedTransaction(t){const e=qa(t),r=[];if(e.from){const _=e.from;r.push((async()=>{const a=await Dt(_,this.provider);y(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),e.from=a})())}else e.from=this.address;if(e.gasLimit==null&&r.push((async()=>{e.gasLimit=await this.provider.estimateGas({...e,from:this.address})})()),e.to!=null){const _=e.to;r.push((async()=>{e.to=await Dt(_,this.provider)})())}r.length&&await Promise.all(r);const s=this.provider.getRpcTransaction(e);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(t){const e=await this.provider.getBlockNumber(),r=await this.sendUncheckedTransaction(t);return await new Promise((s,_)=>{const a=[1e3,100];let c=0;const l=async()=>{try{const p=await this.provider.getTransaction(r);if(p!=null){s(p.replaceableTransaction(e));return}}catch(p){if(vt(p,"CANCELLED")||vt(p,"BAD_DATA")||vt(p,"NETWORK_ERROR")||vt(p,"UNSUPPORTED_OPERATION")){p.info==null&&(p.info={}),p.info.sendTransactionHash=r,_(p);return}if(vt(p,"INVALID_ARGUMENT")&&(c++,p.info==null&&(p.info={}),p.info.sendTransactionHash=r,c>10)){_(p);return}this.provider.emit("error",gt("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:p}))}this.provider._setTimeout(()=>{l()},a.pop()||4e3)};l()})}async signTransaction(t){const e=qa(t);if(e.from){const s=await Dt(e.from,this.provider);y(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),e.from=s}else e.from=this.address;const r=this.provider.getRpcTransaction(e);return await this.provider.send("eth_signTransaction",[r])}async signMessage(t){const e=typeof t=="string"?_i(t):t;return await this.provider.send("personal_sign",[K(e),this.address.toLowerCase()])}async signTypedData(t,e,r){const s=qa(r),_=await $t.resolveNames(t,e,s,async a=>{const c=await Dt(a);return y(c!=null,"TypedData does not support null address","value",a),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify($t.getPayload(_.domain,e,_.value))])}async unlock(t){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),t,null])}async _legacySignMessage(t){const e=typeof t=="string"?_i(t):t;return await this.provider.send("eth_sign",[this.address.toLowerCase(),K(e)])}}class B2 extends b2{#t;#e;#r;#i;#s;#n;#_;#o(){if(this.#i)return;const t=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#i=setTimeout(()=>{this.#i=null;const e=this.#r;for(this.#r=[];e.length;){const r=[e.shift()];for(;e.length&&r.length!==this.#t.batchMaxCount;)if(r.push(e.shift()),JSON.stringify(r.map(_=>_.payload)).length>this.#t.batchMaxSize){e.unshift(r.pop());break}(async()=>{const s=r.length===1?r[0].payload:r.map(_=>_.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{const _=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:_});for(const{resolve:a,reject:c,payload:l}of r){if(this.destroyed){c(gt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:l.method}));continue}const p=_.filter(u=>u.id===l.id)[0];if(p==null){const u=gt("missing response for request","BAD_DATA",{value:_,info:{payload:l}});this.emit("error",u),c(u);continue}if("error"in p){c(this.getRpcError(l,p));continue}a(p.result)}}catch(_){this.emit("debug",{action:"receiveRpcError",error:_});for(const{reject:a}of r)a(_)}})()}},t)}constructor(t,e){super(t,e),this.#e=1,this.#t=Object.assign({},vu,e||{}),this.#r=[],this.#i=null,this.#n=null,this.#_=null;{let s=null;const _=new Promise(a=>{s=a});this.#s={promise:_,resolve:s}}const r=this._getOption("staticNetwork");typeof r=="boolean"?(y(!r||t!=="any","staticNetwork cannot be used on special network 'any'","options",e),r&&t!=null&&(this.#n=_e.from(t))):r&&(y(t==null||r.matches(t),"staticNetwork MUST match network object","options",e),this.#n=r)}_getOption(t){return this.#t[t]}get _network(){return C(this.#n,"network is not available yet","NETWORK_ERROR"),this.#n}async _perform(t){if(t.method==="call"||t.method==="estimateGas"){let r=t.transaction;if(r&&r.type!=null&&O(r.type)&&r.maxFeePerGas==null&&r.maxPriorityFeePerGas==null){const s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(t=Object.assign({},t,{transaction:Object.assign({},r,{type:void 0})}))}}const e=this.getRpcRequest(t);return e!=null?await this.send(e.method,e.args):super._perform(t)}async _detectNetwork(){const t=this._getOption("staticNetwork");if(t)if(t===!0){if(this.#n)return this.#n}else return t;return this.#_?await this.#_:this.ready?(this.#_=(async()=>{try{const e=_e.from(O(await this.send("eth_chainId",[])));return this.#_=null,e}catch(e){throw this.#_=null,e}})(),await this.#_):(this.#_=(async()=>{const e={id:this.#e++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:e});let r;try{r=(await this._send(e))[0],this.#_=null}catch(s){throw this.#_=null,this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:r}),"result"in r)return _e.from(O(r.result));throw this.getRpcError(e,r)})(),await this.#_)}_start(){this.#s==null||this.#s.resolve==null||(this.#s.resolve(),this.#s=null,(async()=>{for(;this.#n==null&&!this.destroyed;)try{this.#n=await this._detectNetwork()}catch(t){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",gt("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:t}})),await G2(1e3)}this.#o()})())}async _waitUntilReady(){if(this.#s!=null)return await this.#s.promise}_getSubscriber(t){return t.type==="pending"?new z2(this):t.type==="event"?this._getOption("polling")?new xl(this,t.filter):new C2(this,t.filter):t.type==="orphan"&&t.filter.orphan==="drop-log"?new zu("orphan"):super._getSubscriber(t)}get ready(){return this.#s==null}getRpcTransaction(t){const e={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(r=>{if(t[r]==null)return;let s=r;r==="gasLimit"&&(s="gas"),e[s]=Xr(O(t[r],`tx.${r}`))}),["from","to","data"].forEach(r=>{t[r]!=null&&(e[r]=K(t[r]))}),t.accessList&&(e.accessList=Ln(t.accessList)),t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.map(r=>r.toLowerCase())),t.authorizationList&&(e.authorizationList=t.authorizationList.map(r=>{const s=eh(r);return{address:s.address,nonce:Xr(s.nonce),chainId:Xr(s.chainId),yParity:Xr(s.signature.yParity),r:Xr(s.signature.r),s:Xr(s.signature.s)}})),e}getRpcRequest(t){switch(t.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Y_(t.address),t.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Y_(t.address),t.blockTag]};case"getCode":return{method:"eth_getCode",args:[Y_(t.address),t.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Y_(t.address),"0x"+t.position.toString(16),t.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[t.signedTransaction]};case"getBlock":if("blockTag"in t)return{method:"eth_getBlockByNumber",args:[t.blockTag,!!t.includeTransactions]};if("blockHash"in t)return{method:"eth_getBlockByHash",args:[t.blockHash,!!t.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[t.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[t.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(t.transaction),t.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(t.transaction)]};case"getLogs":return t.filter&&t.filter.address!=null&&(Array.isArray(t.filter.address)?t.filter.address=t.filter.address.map(Y_):t.filter.address=Y_(t.filter.address)),{method:"eth_getLogs",args:[t.filter]}}return null}getRpcError(t,e){const{method:r}=t,{error:s}=e;if(r==="eth_estimateGas"&&s.message){const c=s.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return gt("insufficient funds","INSUFFICIENT_FUNDS",{transaction:t.params[0],info:{payload:t,error:s}});if(c.match(/nonce/i)&&c.match(/too low/i))return gt("nonce has already been used","NONCE_EXPIRED",{transaction:t.params[0],info:{payload:t,error:s}})}if(r==="eth_call"||r==="eth_estimateGas"){const c=Fl(s),l=pi.getBuiltinCallException(r==="eth_call"?"call":"estimateGas",t.params[0],c?c.data:null);return l.info={error:s,payload:t},l}const _=JSON.stringify(K2(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i))return gt("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[r]||"unknown",reason:"rejected",info:{payload:t,error:s}});if(r==="eth_sendRawTransaction"||r==="eth_sendTransaction"){const c=t.params[0];if(_.match(/insufficient funds|base fee exceeds gas limit/i))return gt("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:s}});if(_.match(/nonce/i)&&_.match(/too low/i))return gt("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:s}});if(_.match(/replacement transaction/i)&&_.match(/underpriced/i))return gt("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:s}});if(_.match(/only replay-protected/i))return gt("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:r,info:{transaction:c,info:{error:s}}})}let a=!!_.match(/the method .* does not exist/i);return a||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(a=!0),a?gt("unsupported operation","UNSUPPORTED_OPERATION",{operation:t.method,info:{error:s,payload:t}}):gt("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:t})}send(t,e){if(this.destroyed)return Promise.reject(gt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t}));const r=this.#e++,s=new Promise((_,a)=>{this.#r.push({resolve:_,reject:a,payload:{method:t,params:e,id:r,jsonrpc:"2.0"}})});return this.#o(),s}async getSigner(t){t==null&&(t=0);const e=this.send("eth_accounts",[]);if(typeof t=="number"){const s=await e;if(t>=s.length)throw new Error("no such account");return new Vl(this,s[t])}const{accounts:r}=await Vt({network:this.getNetwork(),accounts:e});t=et(t);for(const s of r)if(et(s)===t)return new Vl(this,t);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(e=>new Vl(this,e))}destroy(){this.#i&&(clearTimeout(this.#i),this.#i=null);for(const{payload:t,reject:e}of this.#r)e(gt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t.method}));this.#r=[],super.destroy()}}class xu extends B2{#t;constructor(t,e){super(t,e);let r=this._getOption("pollingInterval");r==null&&(r=vu.pollingInterval),this.#t=r}_getSubscriber(t){const e=super._getSubscriber(t);return Ku(e)&&(e.pollingInterval=this.#t),e}get pollingInterval(){return this.#t}set pollingInterval(t){if(!Number.isInteger(t)||t<0)throw new Error("invalid interval");this.#t=t,this._forEachSubscriber(e=>{Ku(e)&&(e.pollingInterval=this.#t)})}}class N2 extends xu{#t;constructor(t,e,r){t==null&&(t="http://localhost:8545"),super(e,r),typeof t=="string"?this.#t=new oi(t):this.#t=t.clone()}_getConnection(){return this.#t.clone()}async send(t,e){return await this._start(),await super.send(t,e)}async _send(t){const e=this._getConnection();e.body=JSON.stringify(t),e.setHeader("content-type","application/json");const r=await e.send();r.assertOk();let s=r.bodyJson;return Array.isArray(s)||(s=[s]),s}}function Fl(i){if(i==null)return null;if(typeof i.message=="string"&&i.message.match(/revert/i)&&ht(i.data))return{message:i.message,data:i.data};if(typeof i=="object"){for(const t in i){const e=Fl(i[t]);if(e)return e}return null}if(typeof i=="string")try{return Fl(JSON.parse(i))}catch{}return null}function Yl(i,t){if(i!=null){if(typeof i.message=="string"&&t.push(i.message),typeof i=="object")for(const e in i)Yl(i[e],t);if(typeof i=="string")try{return Yl(JSON.parse(i),t)}catch{}}}function K2(i){const t=[];return Yl(i,t),t}class i_ extends xu{#t;#e;constructor(t,e,r){const s=Object.assign({},r??{},{batchMaxCount:1});y(t&&t.request,"invalid EIP-1193 provider","ethereum",t),super(e,s),this.#e=null,r&&r.providerInfo&&(this.#e=r.providerInfo),this.#t=async(_,a)=>{const c={method:_,params:a};this.emit("debug",{action:"sendEip1193Request",payload:c});try{const l=await t.request(c);return this.emit("debug",{action:"receiveEip1193Result",result:l}),l}catch(l){const p=new Error(l.message);throw p.code=l.code,p.data=l.data,p.payload=c,this.emit("debug",{action:"receiveEip1193Error",error:p}),p}}}get providerInfo(){return this.#e}async send(t,e){return await this._start(),await super.send(t,e)}async _send(t){y(!Array.isArray(t),"EIP-1193 does not support batch request","payload",t);try{const e=await this.#t(t.method,t.params||[]);return[{id:t.id,result:e}]}catch(e){return[{id:t.id,error:{code:e.code,data:e.data,message:e.message}}]}}getRpcError(t,e){switch(e=JSON.parse(JSON.stringify(e)),e.error.code||-1){case 4001:e.error.message=`ethers-user-denied: ${e.error.message}`;break;case 4200:e.error.message=`ethers-unsupported: ${e.error.message}`;break}return super.getRpcError(t,e)}async hasSigner(t){t==null&&(t=0);const e=await this.send("eth_accounts",[]);return typeof t=="number"?e.length>t:(t=t.toLowerCase(),e.filter(r=>r.toLowerCase()===t).length!==0)}async getSigner(t){if(t==null&&(t=0),!await this.hasSigner(t))try{await this.#t("eth_requestAccounts",[])}catch(e){const r=e.payload;throw this.getRpcError(r,{id:r.id,error:e})}return await super.getSigner(t)}static async discover(t){if(t==null&&(t={}),t.provider)return new i_(t.provider);const e=t.window?t.window:typeof window<"u"?window:null;if(e==null)return null;const r=t.anyProvider;if(r&&e.ethereum)return new i_(e.ethereum);if(!("addEventListener"in e&&"dispatchEvent"in e&&"removeEventListener"in e))return null;const s=t.timeout?t.timeout:300;return s===0?null:await new Promise((_,a)=>{let c=[];const l=d=>{c.push(d.detail),r&&p()},p=()=>{if(clearTimeout(u),c.length)if(t&&t.filter){const d=t.filter(c.map(b=>Object.assign({},b.info)));if(d==null)_(null);else if(d instanceof i_)_(d);else{let b=null;if(d.uuid&&(b=c.filter(R=>d.uuid===R.info.uuid)[0]),b){const{provider:S,info:R}=b;_(new i_(S,void 0,{providerInfo:R}))}else a(gt("filter returned unknown info","UNSUPPORTED_OPERATION",{value:d}))}}else{const{provider:d,info:b}=c[0];_(new i_(d,void 0,{providerInfo:b}))}else _(null);e.removeEventListener("eip6963:announceProvider",l)},u=setTimeout(()=>{p()},s);e.addEventListener("eip6963:announceProvider",l),e.dispatchEvent(new Event("eip6963:requestProvider"))})}}const v2=()=>(async i=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(i)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));class x2{#t=null;#e=null;#r=null;#i=null;#s=null;#n=null;#_=null;#o=null;#u=null;#a=!1;#p=!1;#h=!1;init(t){if(this.#p){console.log("TFHE module already initializing");return}if(this.#a){console.log("TFHE module already initialized");return}this.#p=!0;try{this.#c(t),this.#a=!0}finally{this.#p=!1}}initMock(t){if(this.#p){console.log("TFHE module already initializing");return}if(this.#a){console.log("TFHE module already initialized");return}this.#p=!0;try{this.#h=!0,this.#c(t),this.#a=!0}finally{this.#p=!1}}#c(t){this.#t=t.default,this.#i=t.TfheCompactPublicKey,this.#s=t.CompactPkeCrs,this.#n=t.CompactCiphertextList,this.#e=t.init_panic_hook.bind(t),this.#r=t.initThreadPool?.bind(t),this.#_=t.ZkComputeLoad.Verify,this.#o=t.ZkComputeLoad.Proof,this.#u=t.ProvenCompactCiphertextList}#l(t){if(this.#p)throw new Error("Cannot access TFHE module during initialization");if(!this.#a||t===null)throw new Error("TFHE module not initialized. Call setTFHE() first.");return t}get initTFHE(){return this.#l(this.#t)}get init_panic_hook(){return this.#l(this.#e)}get initThreadPool(){return this.#l(this.#r)}get TfheCompactPublicKey(){return this.#l(this.#i)}get CompactPkeCrs(){return this.#l(this.#s)}get CompactCiphertextList(){return this.#l(this.#n)}get ZkComputeLoadVerify(){return this.#l(this.#_)}get ZkComputeLoadProof(){return this.#l(this.#o)}get ProvenCompactCiphertextList(){return this.#l(this.#u)}get isInitializing(){return this.#p}get isInitialized(){return this.#a}get isMockMode(){return this.#h}}class U2{#t=null;#e=null;#r=null;#i=null;#s=null;#n=null;#_=null;#o=null;#u=null;#a=null;#p=!1;#h=!1;#c=!1;init(t){if(this.#h){console.log("TKMS module already initializing");return}if(this.#p){console.log("TKMS module already initialized");return}this.#h=!0;try{this.#l(t),this.#p=!0}finally{this.#h=!1}}initMock(t){if(this.#h){console.log("TKMS module already initialized");return}if(this.#p){console.log("TKMS module already initialized");return}this.#h=!0;try{this.#c=!0,this.#l(t),this.#p=!0}finally{this.#h=!1}}#l(t){this.#t=t.default,this.#e=t.u8vec_to_ml_kem_pke_pk.bind(t),this.#r=t.u8vec_to_ml_kem_pke_sk.bind(t),this.#i=t.new_client.bind(t),this.#s=t.new_server_id_addr.bind(t),this.#n=t.process_user_decryption_resp_from_js.bind(t),this.#_=t.ml_kem_pke_keygen.bind(t),this.#o=t.ml_kem_pke_pk_to_u8vec.bind(t),this.#u=t.ml_kem_pke_sk_to_u8vec.bind(t),this.#a=t.ml_kem_pke_get_pk.bind(t)}#f(t){if(this.#h)throw new Error("Cannot access TKMS module during initialization");if(!this.#p||t===null)throw new Error("TKMS module not initialized. Call setTKMS() first.");return t}get initTKMS(){return this.#f(this.#t)}get u8vec_to_ml_kem_pke_pk(){return this.#f(this.#e)}get u8vec_to_ml_kem_pke_sk(){return this.#f(this.#r)}get new_client(){return this.#f(this.#i)}get new_server_id_addr(){return this.#f(this.#s)}get process_user_decryption_resp_from_js(){return this.#f(this.#n)}get ml_kem_pke_keygen(){return this.#f(this.#_)}get ml_kem_pke_pk_to_u8vec(){return this.#f(this.#o)}get ml_kem_pke_sk_to_u8vec(){return this.#f(this.#u)}get ml_kem_pke_get_pk(){return this.#f(this.#a)}get isInitializing(){return this.#h}get isInitialized(){return this.#p}get isMockMode(){return this.#c}}const Ut=new x2,It=new U2;function T2(i){Ut.init(i)}function O2(i){It.init(i)}var Xa=typeof kt<"u"?kt:typeof self<"u"?self:typeof window<"u"?window:{};function Uu(i,t){return new Promise(e=>{i.addEventListener("message",function r({data:s}){s?.type===t&&(i.removeEventListener("message",r),e(s))})})}Uu(self,"wasm_bindgen_worker_init").then(async({init:i,receiver:t})=>{const e=await Promise.resolve().then(function(){return nm});await e.default(i),postMessage({type:"wasm_bindgen_worker_ready"}),e.wbg_rayon_start_worker(t)});async function k2(i,t,e){if(e.numThreads()===0)throw new Error("num_threads must be > 0.");const r={type:"wasm_bindgen_worker_init",init:{module_or_path:i,memory:t},receiver:e.receiver()};await Promise.all(Array.from({length:e.numThreads()},async()=>{let s;try{s=new Worker(new URL("/workerHelpers.js",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ft&&ft.tagName.toUpperCase()==="SCRIPT"&&ft.src||new URL("relayer-sdk-js.umd.cjs",document.baseURI).href),{type:"module"})}catch{const c=await(await fetch("/workerHelpers.js")).blob(),l=URL.createObjectURL(c);s=new Worker(l)}return s.postMessage(r),await Uu(s,"wasm_bindgen_worker_ready"),s})),e.build()}let n;function Vo(i){const t=n.__externref_table_alloc();return n.__wbindgen_export_2.set(t,i),t}function D_(i,t){try{return i.apply(this,t)}catch(e){const r=Vo(e);n.__wbindgen_exn_store(r)}}let Fo=null;function j_(){return(Fo===null||Fo.buffer!==n.memory.buffer)&&(Fo=new Uint8Array(n.memory.buffer)),Fo}let tc=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});tc.decode();const V2=2146435072;let Dl=0;function F2(i,t){return Dl+=t,Dl>=V2&&(tc=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),tc.decode(),Dl=t),tc.decode(j_().slice(i,i+t))}function s_(i,t){return i=i>>>0,F2(i,t)}function g(i,t){return i=i>>>0,j_().subarray(i/1,i/1+t)}let h=0;const ec=new TextEncoder;ec.encodeInto=function(i,t){const e=ec.encode(i);return t.set(e),{read:i.length,written:e.length}};function rc(i,t,e){if(e===void 0){const c=ec.encode(i),l=t(c.length,1)>>>0;return j_().subarray(l,l+c.length).set(c),h=c.length,l}let r=i.length,s=t(r,1)>>>0;const _=j_();let a=0;for(;a<r;a++){const c=i.charCodeAt(a);if(c>127)break;_[s+a]=c}if(a!==r){a!==0&&(i=i.slice(a)),s=e(s,r,r=a+i.length*3,1)>>>0;const c=j_().subarray(s+a,s+r),l=ec.encodeInto(i,c);a+=l.written,s=e(s,r,a,1)>>>0}return h=a,s}let Yo=null;function fi(){return(Yo===null||Yo.buffer!==n.memory.buffer)&&(Yo=new DataView(n.memory.buffer)),Yo}function n_(i){return i==null}function jl(i){const t=typeof i;if(t=="number"||t=="boolean"||i==null)return`${i}`;if(t=="string")return`"${i}"`;if(t=="symbol"){const s=i.description;return s==null?"Symbol":`Symbol(${s})`}if(t=="function"){const s=i.name;return typeof s=="string"&&s.length>0?`Function(${s})`:"Function"}if(Array.isArray(i)){const s=i.length;let _="[";s>0&&(_+=jl(i[0]));for(let a=1;a<s;a++)_+=", "+jl(i[a]);return _+="]",_}const e=/\[object ([^\]]+)\]/.exec(toString.call(i));let r;if(e&&e.length>1)r=e[1];else return toString.call(i);if(r=="Object")try{return"Object("+JSON.stringify(i)+")"}catch{return"Object"}return i instanceof Error?`${i.name}: ${i.message}
2
2
  ${i.stack}`:r}function w(i,t){const e=t(i.length*1,1)>>>0;return j_().set(i,e/1),h=i.length,e}function o(i){const t=n.__wbindgen_export_2.get(i);return n.__externref_table_dealloc(i),t}function f(i,t){if(!(i instanceof t))throw new Error(`expected instance of ${t.name}`)}function Tu(){n.init_panic_hook()}function Y2(i){f(i,o_);const t=n.set_server_key(i.__wbg_ptr);if(t[1])throw o(t[0])}function D2(i){let t,e;try{const r=n.shortint_params_name(i);return t=r[0],e=r[1],s_(r[0],r[1])}finally{n.__wbindgen_free(t,e,1)}}function j2(i){let t,e;try{const r=n.shortint_pke_params_name(i);return t=r[0],e=r[1],s_(r[0],r[1])}finally{n.__wbindgen_free(t,e,1)}}function L2(i){n.wbg_rayon_start_worker(i)}function Ou(i){return n.initThreadPool(i)}const H2=Object.freeze({Big:0,0:"Big",Small:1,1:"Small"}),J2=Object.freeze({Default:0,0:"Default",TfheLib:1,1:"TfheLib",DefaultKsPbs:2,2:"DefaultKsPbs",TfheLibKsPbs:3,3:"TfheLibKsPbs"}),Q2=Object.freeze({Bool:0,0:"Bool",Uint4:1,1:"Uint4",Uint8:2,2:"Uint8",Uint16:3,3:"Uint16",Uint32:4,4:"Uint32",Uint64:5,5:"Uint64",Uint128:6,6:"Uint128",Uint160:7,7:"Uint160",Uint256:8,8:"Uint256",Uint512:9,9:"Uint512",Uint1024:10,10:"Uint1024",Uint2048:11,11:"Uint2048",Uint2:12,12:"Uint2",Uint6:13,13:"Uint6",Uint10:14,14:"Uint10",Uint12:15,15:"Uint12",Uint14:16,16:"Uint14",Int2:17,17:"Int2",Int4:18,18:"Int4",Int6:19,19:"Int6",Int8:20,20:"Int8",Int10:21,21:"Int10",Int12:22,22:"Int12",Int14:23,23:"Int14",Int16:24,24:"Int16",Int32:25,25:"Int32",Int64:26,26:"Int64",Int128:27,27:"Int128",Int160:28,28:"Int160",Int256:29,29:"Int256",AsciiString:30,30:"AsciiString",Int512:31,31:"Int512",Int1024:32,32:"Int1024",Int2048:33,33:"Int2048",Uint24:34,34:"Uint24",Uint40:35,35:"Uint40",Uint48:36,36:"Uint48",Uint56:37,37:"Uint56",Uint72:38,38:"Uint72",Uint80:39,39:"Uint80",Uint88:40,40:"Uint88",Uint96:41,41:"Uint96",Uint104:42,42:"Uint104",Uint112:43,43:"Uint112",Uint120:44,44:"Uint120",Uint136:45,45:"Uint136",Uint144:46,46:"Uint144",Uint152:47,47:"Uint152",Uint168:48,48:"Uint168",Uint176:49,49:"Uint176",Uint184:50,50:"Uint184",Uint192:51,51:"Uint192",Uint200:52,52:"Uint200",Uint208:53,53:"Uint208",Uint216:54,54:"Uint216",Uint224:55,55:"Uint224",Uint232:56,56:"Uint232",Uint240:57,57:"Uint240",Uint248:58,58:"Uint248",Int24:59,59:"Int24",Int40:60,60:"Int40",Int48:61,61:"Int48",Int56:62,62:"Int56",Int72:63,63:"Int72",Int80:64,64:"Int80",Int88:65,65:"Int88",Int96:66,66:"Int96",Int104:67,67:"Int104",Int112:68,68:"Int112",Int120:69,69:"Int120",Int136:70,70:"Int136",Int144:71,71:"Int144",Int152:72,72:"Int152",Int168:73,73:"Int168",Int176:74,74:"Int176",Int184:75,75:"Int184",Int192:76,76:"Int192",Int200:77,77:"Int200",Int208:78,78:"Int208",Int216:79,79:"Int216",Int224:80,80:"Int224",Int232:81,81:"Int232",Int240:82,82:"Int240",Int248:83,83:"Int248"}),$2=Object.freeze({PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128:0,0:"PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128",V1_1_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128:1,1:"V1_1_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128",V1_1_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128_ZKV1:2,2:"V1_1_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128_ZKV1",V1_0_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128:3,3:"V1_0_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128",V1_0_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128_ZKV1:4,4:"V1_0_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128_ZKV1",V0_11_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64:5,5:"V0_11_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64",V0_11_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64_ZKV1:6,6:"V0_11_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64_ZKV1",V1_2_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128:7,7:"V1_2_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128",V1_2_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128_ZKV1:8,8:"V1_2_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128_ZKV1",V1_3_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128:9,9:"V1_3_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128",V1_3_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128_ZKV1:10,10:"V1_3_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128_ZKV1",V1_4_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128:11,11:"V1_4_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128",V1_4_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128_ZKV1:12,12:"V1_4_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128_ZKV1"}),W2=Object.freeze({Big:0,0:"Big",Small:1,1:"Small"}),Z2=Object.freeze({KeyswitchBootstrap:0,0:"KeyswitchBootstrap",BootstrapKeyswitch:1,1:"BootstrapKeyswitch"}),q2=Object.freeze({PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128:0,0:"PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M128",V1_1_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M128:1,1:"V1_1_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128:2,2:"V1_1_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M128:3,3:"V1_1_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M128:4,4:"V1_1_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M128:5,5:"V1_1_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M128:6,6:"V1_1_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M128:7,7:"V1_1_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128:8,8:"V1_1_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M128:9,9:"V1_1_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M128:10,10:"V1_1_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M128:11,11:"V1_1_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M128:12,12:"V1_1_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M128:13,13:"V1_1_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M128:14,14:"V1_1_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M128:15,15:"V1_1_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M128:16,16:"V1_1_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M128:17,17:"V1_1_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M128:18,18:"V1_1_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M128:19,19:"V1_1_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M128:20,20:"V1_1_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M128:21,21:"V1_1_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M128:22,22:"V1_1_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M128:23,23:"V1_1_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M128:24,24:"V1_1_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M128:25,25:"V1_1_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M128:26,26:"V1_1_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M128:27,27:"V1_1_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M128:28,28:"V1_1_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M128:29,29:"V1_1_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M128:30,30:"V1_1_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M128:31,31:"V1_1_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M128:32,32:"V1_1_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M128:33,33:"V1_1_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M128:34,34:"V1_1_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M128:35,35:"V1_1_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M128:36,36:"V1_1_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M128:37,37:"V1_1_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M128:38,38:"V1_1_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M128:39,39:"V1_1_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M128:40,40:"V1_1_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:41,41:"V1_1_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:42,42:"V1_1_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:43,43:"V1_1_PARAM_MESSAGE_1_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:44,44:"V1_1_PARAM_MESSAGE_1_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:45,45:"V1_1_PARAM_MESSAGE_1_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_7_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:46,46:"V1_1_PARAM_MESSAGE_1_CARRY_7_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:47,47:"V1_1_PARAM_MESSAGE_2_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:48,48:"V1_1_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:49,49:"V1_1_PARAM_MESSAGE_2_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:50,50:"V1_1_PARAM_MESSAGE_2_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:51,51:"V1_1_PARAM_MESSAGE_2_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:52,52:"V1_1_PARAM_MESSAGE_2_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:53,53:"V1_1_PARAM_MESSAGE_3_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:54,54:"V1_1_PARAM_MESSAGE_3_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:55,55:"V1_1_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:56,56:"V1_1_PARAM_MESSAGE_3_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:57,57:"V1_1_PARAM_MESSAGE_3_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_4_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:58,58:"V1_1_PARAM_MESSAGE_4_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_4_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:59,59:"V1_1_PARAM_MESSAGE_4_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_4_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:60,60:"V1_1_PARAM_MESSAGE_4_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:61,61:"V1_1_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_5_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:62,62:"V1_1_PARAM_MESSAGE_5_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_5_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:63,63:"V1_1_PARAM_MESSAGE_5_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_5_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:64,64:"V1_1_PARAM_MESSAGE_5_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_6_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:65,65:"V1_1_PARAM_MESSAGE_6_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_6_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:66,66:"V1_1_PARAM_MESSAGE_6_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_7_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:67,67:"V1_1_PARAM_MESSAGE_7_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:68,68:"V1_1_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:69,69:"V1_1_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:70,70:"V1_1_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_1_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:71,71:"V1_1_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M128:72,72:"V1_0_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128:73,73:"V1_0_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M128:74,74:"V1_0_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M128:75,75:"V1_0_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M128:76,76:"V1_0_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M128:77,77:"V1_0_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M128:78,78:"V1_0_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128:79,79:"V1_0_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M128:80,80:"V1_0_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M128:81,81:"V1_0_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M128:82,82:"V1_0_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M128:83,83:"V1_0_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M128:84,84:"V1_0_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M128:85,85:"V1_0_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M128:86,86:"V1_0_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M128:87,87:"V1_0_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M128:88,88:"V1_0_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M128:89,89:"V1_0_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M128:90,90:"V1_0_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M128:91,91:"V1_0_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M128:92,92:"V1_0_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M128:93,93:"V1_0_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M128:94,94:"V1_0_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M128:95,95:"V1_0_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M128:96,96:"V1_0_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M128:97,97:"V1_0_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M128:98,98:"V1_0_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M128:99,99:"V1_0_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M128:100,100:"V1_0_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M128:101,101:"V1_0_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M128:102,102:"V1_0_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M128:103,103:"V1_0_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M128:104,104:"V1_0_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M128:105,105:"V1_0_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M128:106,106:"V1_0_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M128:107,107:"V1_0_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M128:108,108:"V1_0_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M128:109,109:"V1_0_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M128:110,110:"V1_0_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M128:111,111:"V1_0_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:112,112:"V1_0_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:113,113:"V1_0_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:114,114:"V1_0_PARAM_MESSAGE_1_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:115,115:"V1_0_PARAM_MESSAGE_1_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:116,116:"V1_0_PARAM_MESSAGE_1_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_7_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:117,117:"V1_0_PARAM_MESSAGE_1_CARRY_7_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:118,118:"V1_0_PARAM_MESSAGE_2_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:119,119:"V1_0_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:120,120:"V1_0_PARAM_MESSAGE_2_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:121,121:"V1_0_PARAM_MESSAGE_2_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:122,122:"V1_0_PARAM_MESSAGE_2_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:123,123:"V1_0_PARAM_MESSAGE_2_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:124,124:"V1_0_PARAM_MESSAGE_3_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:125,125:"V1_0_PARAM_MESSAGE_3_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:126,126:"V1_0_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:127,127:"V1_0_PARAM_MESSAGE_3_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:128,128:"V1_0_PARAM_MESSAGE_3_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_4_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:129,129:"V1_0_PARAM_MESSAGE_4_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_4_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:130,130:"V1_0_PARAM_MESSAGE_4_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_4_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:131,131:"V1_0_PARAM_MESSAGE_4_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:132,132:"V1_0_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_5_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:133,133:"V1_0_PARAM_MESSAGE_5_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_5_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:134,134:"V1_0_PARAM_MESSAGE_5_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_5_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:135,135:"V1_0_PARAM_MESSAGE_5_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_6_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:136,136:"V1_0_PARAM_MESSAGE_6_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_6_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:137,137:"V1_0_PARAM_MESSAGE_6_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_7_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:138,138:"V1_0_PARAM_MESSAGE_7_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:139,139:"V1_0_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:140,140:"V1_0_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:141,141:"V1_0_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_0_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:142,142:"V1_0_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V0_11_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64:143,143:"V0_11_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64:144,144:"V0_11_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64:145,145:"V0_11_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64:146,146:"V0_11_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64:147,147:"V0_11_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64:148,148:"V0_11_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64:149,149:"V0_11_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64:150,150:"V0_11_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64:151,151:"V0_11_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64:152,152:"V0_11_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64:153,153:"V0_11_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64:154,154:"V0_11_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64:155,155:"V0_11_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64:156,156:"V0_11_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64:157,157:"V0_11_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64:158,158:"V0_11_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64:159,159:"V0_11_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64:160,160:"V0_11_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M64:161,161:"V0_11_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64:162,162:"V0_11_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64:163,163:"V0_11_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64:164,164:"V0_11_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64:165,165:"V0_11_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M64:166,166:"V0_11_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64:167,167:"V0_11_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64:168,168:"V0_11_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64:169,169:"V0_11_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64:170,170:"V0_11_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M64:171,171:"V0_11_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64:172,172:"V0_11_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64:173,173:"V0_11_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64:174,174:"V0_11_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64:175,175:"V0_11_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64:176,176:"V0_11_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M64:177,177:"V0_11_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64:178,178:"V0_11_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64:179,179:"V0_11_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64:180,180:"V0_11_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M64:181,181:"V0_11_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M64:182,182:"V0_11_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:183,183:"V0_11_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:184,184:"V0_11_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:185,185:"V0_11_PARAM_MESSAGE_1_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:186,186:"V0_11_PARAM_MESSAGE_1_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:187,187:"V0_11_PARAM_MESSAGE_1_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_7_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:188,188:"V0_11_PARAM_MESSAGE_1_CARRY_7_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:189,189:"V0_11_PARAM_MESSAGE_2_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:190,190:"V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:191,191:"V0_11_PARAM_MESSAGE_2_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:192,192:"V0_11_PARAM_MESSAGE_2_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:193,193:"V0_11_PARAM_MESSAGE_2_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:194,194:"V0_11_PARAM_MESSAGE_2_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:195,195:"V0_11_PARAM_MESSAGE_3_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:196,196:"V0_11_PARAM_MESSAGE_3_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:197,197:"V0_11_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:198,198:"V0_11_PARAM_MESSAGE_3_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:199,199:"V0_11_PARAM_MESSAGE_3_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_4_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:200,200:"V0_11_PARAM_MESSAGE_4_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_4_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:201,201:"V0_11_PARAM_MESSAGE_4_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_4_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:202,202:"V0_11_PARAM_MESSAGE_4_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:203,203:"V0_11_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_5_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:204,204:"V0_11_PARAM_MESSAGE_5_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_5_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:205,205:"V0_11_PARAM_MESSAGE_5_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_5_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:206,206:"V0_11_PARAM_MESSAGE_5_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_6_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:207,207:"V0_11_PARAM_MESSAGE_6_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_6_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:208,208:"V0_11_PARAM_MESSAGE_6_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_7_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64:209,209:"V0_11_PARAM_MESSAGE_7_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_PBS_KS_GAUSSIAN_2M64:210,210:"V0_11_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_PBS_KS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64:211,211:"V0_11_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_PBS_KS_GAUSSIAN_2M64:212,212:"V0_11_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_PBS_KS_GAUSSIAN_2M64",V0_11_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_PBS_KS_GAUSSIAN_2M64:213,213:"V0_11_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_PBS_KS_GAUSSIAN_2M64",V1_2_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M128:214,214:"V1_2_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128:215,215:"V1_2_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M128:216,216:"V1_2_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M128:217,217:"V1_2_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M128:218,218:"V1_2_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M128:219,219:"V1_2_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M128:220,220:"V1_2_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128:221,221:"V1_2_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M128:222,222:"V1_2_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M128:223,223:"V1_2_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M128:224,224:"V1_2_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M128:225,225:"V1_2_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M128:226,226:"V1_2_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M128:227,227:"V1_2_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M128:228,228:"V1_2_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M128:229,229:"V1_2_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M128:230,230:"V1_2_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M128:231,231:"V1_2_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M128:232,232:"V1_2_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M128:233,233:"V1_2_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M128:234,234:"V1_2_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M128:235,235:"V1_2_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M128:236,236:"V1_2_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M128:237,237:"V1_2_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M128:238,238:"V1_2_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M128:239,239:"V1_2_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M128:240,240:"V1_2_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M128:241,241:"V1_2_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M128:242,242:"V1_2_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M128:243,243:"V1_2_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M128:244,244:"V1_2_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M128:245,245:"V1_2_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M128:246,246:"V1_2_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M128:247,247:"V1_2_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M128:248,248:"V1_2_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M128:249,249:"V1_2_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M128:250,250:"V1_2_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M128:251,251:"V1_2_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M128:252,252:"V1_2_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M128:253,253:"V1_2_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:254,254:"V1_2_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:255,255:"V1_2_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:256,256:"V1_2_PARAM_MESSAGE_1_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:257,257:"V1_2_PARAM_MESSAGE_1_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:258,258:"V1_2_PARAM_MESSAGE_1_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_7_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:259,259:"V1_2_PARAM_MESSAGE_1_CARRY_7_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:260,260:"V1_2_PARAM_MESSAGE_2_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:261,261:"V1_2_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:262,262:"V1_2_PARAM_MESSAGE_2_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:263,263:"V1_2_PARAM_MESSAGE_2_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:264,264:"V1_2_PARAM_MESSAGE_2_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:265,265:"V1_2_PARAM_MESSAGE_2_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:266,266:"V1_2_PARAM_MESSAGE_3_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:267,267:"V1_2_PARAM_MESSAGE_3_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:268,268:"V1_2_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:269,269:"V1_2_PARAM_MESSAGE_3_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:270,270:"V1_2_PARAM_MESSAGE_3_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_4_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:271,271:"V1_2_PARAM_MESSAGE_4_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_4_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:272,272:"V1_2_PARAM_MESSAGE_4_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_4_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:273,273:"V1_2_PARAM_MESSAGE_4_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:274,274:"V1_2_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_5_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:275,275:"V1_2_PARAM_MESSAGE_5_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_5_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:276,276:"V1_2_PARAM_MESSAGE_5_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_5_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:277,277:"V1_2_PARAM_MESSAGE_5_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_6_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:278,278:"V1_2_PARAM_MESSAGE_6_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_6_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:279,279:"V1_2_PARAM_MESSAGE_6_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_7_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:280,280:"V1_2_PARAM_MESSAGE_7_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:281,281:"V1_2_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:282,282:"V1_2_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:283,283:"V1_2_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_2_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:284,284:"V1_2_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M128:285,285:"V1_3_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128:286,286:"V1_3_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M128:287,287:"V1_3_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M128:288,288:"V1_3_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M128:289,289:"V1_3_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M128:290,290:"V1_3_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M128:291,291:"V1_3_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128:292,292:"V1_3_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M128:293,293:"V1_3_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M128:294,294:"V1_3_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M128:295,295:"V1_3_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M128:296,296:"V1_3_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M128:297,297:"V1_3_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M128:298,298:"V1_3_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M128:299,299:"V1_3_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M128:300,300:"V1_3_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M128:301,301:"V1_3_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M128:302,302:"V1_3_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M128:303,303:"V1_3_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M128:304,304:"V1_3_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M128:305,305:"V1_3_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M128:306,306:"V1_3_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M128:307,307:"V1_3_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M128:308,308:"V1_3_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M128:309,309:"V1_3_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M128:310,310:"V1_3_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M128:311,311:"V1_3_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M128:312,312:"V1_3_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M128:313,313:"V1_3_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M128:314,314:"V1_3_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M128:315,315:"V1_3_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M128:316,316:"V1_3_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M128:317,317:"V1_3_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M128:318,318:"V1_3_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M128:319,319:"V1_3_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M128:320,320:"V1_3_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M128:321,321:"V1_3_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M128:322,322:"V1_3_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M128:323,323:"V1_3_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M128:324,324:"V1_3_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:325,325:"V1_3_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:326,326:"V1_3_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:327,327:"V1_3_PARAM_MESSAGE_1_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:328,328:"V1_3_PARAM_MESSAGE_1_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:329,329:"V1_3_PARAM_MESSAGE_1_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_7_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:330,330:"V1_3_PARAM_MESSAGE_1_CARRY_7_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:331,331:"V1_3_PARAM_MESSAGE_2_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:332,332:"V1_3_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:333,333:"V1_3_PARAM_MESSAGE_2_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:334,334:"V1_3_PARAM_MESSAGE_2_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:335,335:"V1_3_PARAM_MESSAGE_2_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:336,336:"V1_3_PARAM_MESSAGE_2_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:337,337:"V1_3_PARAM_MESSAGE_3_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:338,338:"V1_3_PARAM_MESSAGE_3_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:339,339:"V1_3_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:340,340:"V1_3_PARAM_MESSAGE_3_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:341,341:"V1_3_PARAM_MESSAGE_3_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_4_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:342,342:"V1_3_PARAM_MESSAGE_4_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_4_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:343,343:"V1_3_PARAM_MESSAGE_4_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_4_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:344,344:"V1_3_PARAM_MESSAGE_4_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:345,345:"V1_3_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_5_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:346,346:"V1_3_PARAM_MESSAGE_5_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_5_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:347,347:"V1_3_PARAM_MESSAGE_5_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_5_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:348,348:"V1_3_PARAM_MESSAGE_5_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_6_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:349,349:"V1_3_PARAM_MESSAGE_6_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_6_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:350,350:"V1_3_PARAM_MESSAGE_6_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_7_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:351,351:"V1_3_PARAM_MESSAGE_7_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:352,352:"V1_3_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:353,353:"V1_3_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:354,354:"V1_3_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_3_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:355,355:"V1_3_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M128:356,356:"V1_4_PARAM_MESSAGE_1_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128:357,357:"V1_4_PARAM_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M128:358,358:"V1_4_PARAM_MESSAGE_2_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M128:359,359:"V1_4_PARAM_MESSAGE_1_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M128:360,360:"V1_4_PARAM_MESSAGE_2_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M128:361,361:"V1_4_PARAM_MESSAGE_3_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M128:362,362:"V1_4_PARAM_MESSAGE_1_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128:363,363:"V1_4_PARAM_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M128:364,364:"V1_4_PARAM_MESSAGE_3_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M128:365,365:"V1_4_PARAM_MESSAGE_4_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M128:366,366:"V1_4_PARAM_MESSAGE_1_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M128:367,367:"V1_4_PARAM_MESSAGE_2_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M128:368,368:"V1_4_PARAM_MESSAGE_3_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M128:369,369:"V1_4_PARAM_MESSAGE_4_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M128:370,370:"V1_4_PARAM_MESSAGE_5_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M128:371,371:"V1_4_PARAM_MESSAGE_1_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M128:372,372:"V1_4_PARAM_MESSAGE_2_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M128:373,373:"V1_4_PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M128:374,374:"V1_4_PARAM_MESSAGE_4_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M128:375,375:"V1_4_PARAM_MESSAGE_5_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M128:376,376:"V1_4_PARAM_MESSAGE_6_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M128:377,377:"V1_4_PARAM_MESSAGE_1_CARRY_6_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M128:378,378:"V1_4_PARAM_MESSAGE_2_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M128:379,379:"V1_4_PARAM_MESSAGE_3_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M128:380,380:"V1_4_PARAM_MESSAGE_4_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M128:381,381:"V1_4_PARAM_MESSAGE_5_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M128:382,382:"V1_4_PARAM_MESSAGE_6_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M128:383,383:"V1_4_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M128:384,384:"V1_4_PARAM_MESSAGE_1_CARRY_7_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M128:385,385:"V1_4_PARAM_MESSAGE_2_CARRY_6_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M128:386,386:"V1_4_PARAM_MESSAGE_3_CARRY_5_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M128:387,387:"V1_4_PARAM_MESSAGE_4_CARRY_4_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M128:388,388:"V1_4_PARAM_MESSAGE_5_CARRY_3_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M128:389,389:"V1_4_PARAM_MESSAGE_6_CARRY_2_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M128:390,390:"V1_4_PARAM_MESSAGE_7_CARRY_1_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M128:391,391:"V1_4_PARAM_MESSAGE_8_CARRY_0_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M128:392,392:"V1_4_PARAM_MESSAGE_1_CARRY_1_PBS_KS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M128:393,393:"V1_4_PARAM_MESSAGE_2_CARRY_2_PBS_KS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M128:394,394:"V1_4_PARAM_MESSAGE_3_CARRY_3_PBS_KS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M128:395,395:"V1_4_PARAM_MESSAGE_4_CARRY_4_PBS_KS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:396,396:"V1_4_PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:397,397:"V1_4_PARAM_MESSAGE_1_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:398,398:"V1_4_PARAM_MESSAGE_1_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:399,399:"V1_4_PARAM_MESSAGE_1_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:400,400:"V1_4_PARAM_MESSAGE_1_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_7_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:401,401:"V1_4_PARAM_MESSAGE_1_CARRY_7_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:402,402:"V1_4_PARAM_MESSAGE_2_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:403,403:"V1_4_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:404,404:"V1_4_PARAM_MESSAGE_2_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:405,405:"V1_4_PARAM_MESSAGE_2_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:406,406:"V1_4_PARAM_MESSAGE_2_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:407,407:"V1_4_PARAM_MESSAGE_2_CARRY_6_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:408,408:"V1_4_PARAM_MESSAGE_3_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:409,409:"V1_4_PARAM_MESSAGE_3_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:410,410:"V1_4_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:411,411:"V1_4_PARAM_MESSAGE_3_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:412,412:"V1_4_PARAM_MESSAGE_3_CARRY_5_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_4_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:413,413:"V1_4_PARAM_MESSAGE_4_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_4_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:414,414:"V1_4_PARAM_MESSAGE_4_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_4_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:415,415:"V1_4_PARAM_MESSAGE_4_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:416,416:"V1_4_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_5_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:417,417:"V1_4_PARAM_MESSAGE_5_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_5_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:418,418:"V1_4_PARAM_MESSAGE_5_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_5_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:419,419:"V1_4_PARAM_MESSAGE_5_CARRY_3_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_6_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:420,420:"V1_4_PARAM_MESSAGE_6_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_6_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:421,421:"V1_4_PARAM_MESSAGE_6_CARRY_2_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_7_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128:422,422:"V1_4_PARAM_MESSAGE_7_CARRY_1_COMPACT_PK_KS_PBS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:423,423:"V1_4_PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:424,424:"V1_4_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:425,425:"V1_4_PARAM_MESSAGE_3_CARRY_3_COMPACT_PK_PBS_KS_GAUSSIAN_2M128",V1_4_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_PBS_KS_GAUSSIAN_2M128:426,426:"V1_4_PARAM_MESSAGE_4_CARRY_4_COMPACT_PK_PBS_KS_GAUSSIAN_2M128"}),ku=Object.freeze({Proof:0,0:"Proof",Verify:1,1:"Verify"}),X2=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_boolean_free(i>>>0,1));class Ll{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,X2.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_boolean_free(t,0)}static get_parameters(t){const e=n.boolean_get_parameters(t);if(e[2])throw o(e[1]);return zi.__wrap(e[0])}static new_client_key(t){f(t,zi);const e=n.boolean_new_client_key(t.__wbg_ptr);return qt.__wrap(e)}static new_parameters(t,e,r,s,_,a,c,l,p,u){f(s,Ci),f(_,Ci);const d=n.boolean_new_parameters(t,e,r,s.__wbg_ptr,_.__wbg_ptr,a,c,l,p,u);return zi.__wrap(d)}static new_public_key(t){f(t,qt);const e=n.boolean_new_public_key(t.__wbg_ptr);return Ii.__wrap(e)}static trivial_encrypt(t){const e=n.boolean_trivial_encrypt(t);return we.__wrap(e)}static try_new_t_uniform(t){const e=n.boolean_try_new_t_uniform(t);if(e[2])throw o(e[1]);return Ci.__wrap(e[0])}static encrypt_compressed(t,e){f(t,qt);const r=n.boolean_encrypt_compressed(t.__wbg_ptr,e);return Ei.__wrap(r)}static serialize_ciphertext(t){f(t,we);const e=n.boolean_serialize_ciphertext(t.__wbg_ptr);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static serialize_client_key(t){f(t,qt);const e=n.boolean_serialize_client_key(t.__wbg_ptr);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static serialize_public_key(t){f(t,Ii);const e=n.boolean_serialize_public_key(t.__wbg_ptr);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static decompress_ciphertext(t){f(t,Ei);const e=n.boolean_decompress_ciphertext(t.__wbg_ptr);return we.__wrap(e)}static deserialize_ciphertext(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.boolean_deserialize_ciphertext(e,r);if(s[2])throw o(s[1]);return we.__wrap(s[0])}static deserialize_client_key(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.boolean_deserialize_client_key(e,r);if(s[2])throw o(s[1]);return qt.__wrap(s[0])}static deserialize_public_key(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.boolean_deserialize_public_key(e,r);if(s[2])throw o(s[1]);return Ii.__wrap(s[0])}static encrypt_with_public_key(t,e){f(t,Ii);const r=n.boolean_encrypt_with_public_key(t.__wbg_ptr,e);return we.__wrap(r)}static new_compressed_server_key(t){f(t,qt);const e=n.boolean_new_compressed_server_key(t.__wbg_ptr);return Wi.__wrap(e)}static new_gaussian_from_std_dev(t){const e=n.boolean_new_gaussian_from_std_dev(t);return Ci.__wrap(e)}static serialize_compressed_ciphertext(t){f(t,Ei);const e=n.boolean_serialize_compressed_ciphertext(t.__wbg_ptr);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static serialize_compressed_server_key(t){f(t,Wi);const e=n.boolean_serialize_compressed_server_key(t.__wbg_ptr);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static deserialize_compressed_ciphertext(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.boolean_deserialize_compressed_ciphertext(e,r);if(s[2])throw o(s[1]);return Ei.__wrap(s[0])}static deserialize_compressed_server_key(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.boolean_deserialize_compressed_server_key(e,r);if(s[2])throw o(s[1]);return Wi.__wrap(s[0])}static new_client_key_from_seed_and_parameters(t,e,r){f(r,zi);const s=n.boolean_new_client_key_from_seed_and_parameters(t,e,r.__wbg_ptr);return qt.__wrap(s)}static decrypt(t,e){return f(t,qt),f(e,we),n.boolean_decrypt(t.__wbg_ptr,e.__wbg_ptr)!==0}static encrypt(t,e){f(t,qt);const r=n.boolean_encrypt(t.__wbg_ptr,e);return we.__wrap(r)}}Symbol.dispose&&(Ll.prototype[Symbol.dispose]=Ll.prototype.free);const Vu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_booleanciphertext_free(i>>>0,1));class we{static __wrap(t){t=t>>>0;const e=Object.create(we.prototype);return e.__wbg_ptr=t,Vu.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Vu.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_booleanciphertext_free(t,0)}}Symbol.dispose&&(we.prototype[Symbol.dispose]=we.prototype.free);const Fu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_booleanclientkey_free(i>>>0,1));class qt{static __wrap(t){t=t>>>0;const e=Object.create(qt.prototype);return e.__wbg_ptr=t,Fu.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Fu.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_booleanclientkey_free(t,0)}}Symbol.dispose&&(qt.prototype[Symbol.dispose]=qt.prototype.free);const Yu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_booleancompressedciphertext_free(i>>>0,1));class Ei{static __wrap(t){t=t>>>0;const e=Object.create(Ei.prototype);return e.__wbg_ptr=t,Yu.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Yu.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_booleancompressedciphertext_free(t,0)}}Symbol.dispose&&(Ei.prototype[Symbol.dispose]=Ei.prototype.free);const Du=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_booleancompressedserverkey_free(i>>>0,1));class Wi{static __wrap(t){t=t>>>0;const e=Object.create(Wi.prototype);return e.__wbg_ptr=t,Du.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Du.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_booleancompressedserverkey_free(t,0)}}Symbol.dispose&&(Wi.prototype[Symbol.dispose]=Wi.prototype.free);const ju=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_booleannoisedistribution_free(i>>>0,1));class Ci{static __wrap(t){t=t>>>0;const e=Object.create(Ci.prototype);return e.__wbg_ptr=t,ju.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ju.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_booleannoisedistribution_free(t,0)}}Symbol.dispose&&(Ci.prototype[Symbol.dispose]=Ci.prototype.free);const Lu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_booleanparameters_free(i>>>0,1));class zi{static __wrap(t){t=t>>>0;const e=Object.create(zi.prototype);return e.__wbg_ptr=t,Lu.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Lu.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_booleanparameters_free(t,0)}}Symbol.dispose&&(zi.prototype[Symbol.dispose]=zi.prototype.free);const Hu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_booleanpublickey_free(i>>>0,1));class Ii{static __wrap(t){t=t>>>0;const e=Object.create(Ii.prototype);return e.__wbg_ptr=t,Hu.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Hu.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_booleanpublickey_free(t,0)}}Symbol.dispose&&(Ii.prototype[Symbol.dispose]=Ii.prototype.free);const Ju=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compactciphertextlist_free(i>>>0,1));class hi{static __wrap(t){t=t>>>0;const e=Object.create(hi.prototype);return e.__wbg_ptr=t,Ju.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ju.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compactciphertextlist_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compactciphertextlist_deserialize(e,r);if(s[2])throw o(s[1]);return hi.__wrap(s[0])}get_kind_of(t){const e=n.compactciphertextlist_get_kind_of(this.__wbg_ptr,t);return e===84?void 0:e}safe_serialize(t){const e=n.compactciphertextlist_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compactciphertextlist_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return hi.__wrap(_[0])}len(){return n.compactciphertextlist_len(this.__wbg_ptr)>>>0}expand(){const t=n.compactciphertextlist_expand(this.__wbg_ptr);if(t[2])throw o(t[1]);return Zi.__wrap(t[0])}static builder(t){f(t,te);const e=n.compactciphertextlist_builder(t.__wbg_ptr);if(e[2])throw o(e[1]);return __.__wrap(e[0])}is_empty(){return n.compactciphertextlist_is_empty(this.__wbg_ptr)!==0}serialize(){const t=n.compactciphertextlist_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(hi.prototype[Symbol.dispose]=hi.prototype.free);const Qu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compactciphertextlistbuilder_free(i>>>0,1));class __{static __wrap(t){t=t>>>0;const e=Object.create(__.prototype);return e.__wbg_ptr=t,Qu.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Qu.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compactciphertextlistbuilder_free(t,0)}push_i1024(t){const e=n.compactciphertextlistbuilder_push_i1024(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i2048(t){const e=n.compactciphertextlistbuilder_push_i2048(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u1024(t){const e=n.compactciphertextlistbuilder_push_u1024(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u2048(t){const e=n.compactciphertextlistbuilder_push_u2048(this.__wbg_ptr,t);if(e[1])throw o(e[0])}build_packed(){const t=n.compactciphertextlistbuilder_build_packed(this.__wbg_ptr);if(t[2])throw o(t[1]);return hi.__wrap(t[0])}push_boolean(t){const e=n.compactciphertextlistbuilder_push_boolean(this.__wbg_ptr,t);if(e[1])throw o(e[0])}build_with_proof_packed(t,e,r){f(t,oe);const s=w(e,n.__wbindgen_malloc),_=h,a=n.compactciphertextlistbuilder_build_with_proof_packed(this.__wbg_ptr,t.__wbg_ptr,s,_,r);if(a[2])throw o(a[1]);return Gi.__wrap(a[0])}build(){const t=n.compactciphertextlistbuilder_build(this.__wbg_ptr);if(t[2])throw o(t[1]);return hi.__wrap(t[0])}push_i2(t){const e=n.compactciphertextlistbuilder_push_i2(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i4(t){const e=n.compactciphertextlistbuilder_push_i4(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i6(t){const e=n.compactciphertextlistbuilder_push_i6(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i8(t){const e=n.compactciphertextlistbuilder_push_i8(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u2(t){const e=n.compactciphertextlistbuilder_push_u2(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u4(t){const e=n.compactciphertextlistbuilder_push_u4(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u6(t){const e=n.compactciphertextlistbuilder_push_u6(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u8(t){const e=n.compactciphertextlistbuilder_push_u8(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i10(t){const e=n.compactciphertextlistbuilder_push_i10(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i12(t){const e=n.compactciphertextlistbuilder_push_i12(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i14(t){const e=n.compactciphertextlistbuilder_push_i14(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i16(t){const e=n.compactciphertextlistbuilder_push_i16(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i24(t){const e=n.compactciphertextlistbuilder_push_i24(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i32(t){const e=n.compactciphertextlistbuilder_push_i32(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i40(t){const e=n.compactciphertextlistbuilder_push_i40(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i48(t){const e=n.compactciphertextlistbuilder_push_i48(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i56(t){const e=n.compactciphertextlistbuilder_push_i56(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i64(t){const e=n.compactciphertextlistbuilder_push_i64(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i72(t){const e=n.compactciphertextlistbuilder_push_i72(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i80(t){const e=n.compactciphertextlistbuilder_push_i80(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i88(t){const e=n.compactciphertextlistbuilder_push_i88(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i96(t){const e=n.compactciphertextlistbuilder_push_i96(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u10(t){const e=n.compactciphertextlistbuilder_push_u10(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u12(t){const e=n.compactciphertextlistbuilder_push_u12(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u14(t){const e=n.compactciphertextlistbuilder_push_u14(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u16(t){const e=n.compactciphertextlistbuilder_push_u16(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u24(t){const e=n.compactciphertextlistbuilder_push_u24(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u32(t){const e=n.compactciphertextlistbuilder_push_u32(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u40(t){const e=n.compactciphertextlistbuilder_push_u40(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u48(t){const e=n.compactciphertextlistbuilder_push_u48(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u56(t){const e=n.compactciphertextlistbuilder_push_u56(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u64(t){const e=n.compactciphertextlistbuilder_push_u64(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u72(t){const e=n.compactciphertextlistbuilder_push_u72(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u80(t){const e=n.compactciphertextlistbuilder_push_u80(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u88(t){const e=n.compactciphertextlistbuilder_push_u88(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u96(t){const e=n.compactciphertextlistbuilder_push_u96(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i104(t){const e=n.compactciphertextlistbuilder_push_i104(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i112(t){const e=n.compactciphertextlistbuilder_push_i112(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i120(t){const e=n.compactciphertextlistbuilder_push_i120(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i128(t){const e=n.compactciphertextlistbuilder_push_i128(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i136(t){const e=n.compactciphertextlistbuilder_push_i136(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i144(t){const e=n.compactciphertextlistbuilder_push_i144(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i152(t){const e=n.compactciphertextlistbuilder_push_i152(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i160(t){const e=n.compactciphertextlistbuilder_push_i160(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i168(t){const e=n.compactciphertextlistbuilder_push_i168(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i176(t){const e=n.compactciphertextlistbuilder_push_i176(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i184(t){const e=n.compactciphertextlistbuilder_push_i184(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i192(t){const e=n.compactciphertextlistbuilder_push_i192(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i200(t){const e=n.compactciphertextlistbuilder_push_i200(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i208(t){const e=n.compactciphertextlistbuilder_push_i208(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i216(t){const e=n.compactciphertextlistbuilder_push_i216(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i224(t){const e=n.compactciphertextlistbuilder_push_i224(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i232(t){const e=n.compactciphertextlistbuilder_push_i232(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i240(t){const e=n.compactciphertextlistbuilder_push_i240(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i248(t){const e=n.compactciphertextlistbuilder_push_i248(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i256(t){const e=n.compactciphertextlistbuilder_push_i256(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_i512(t){const e=n.compactciphertextlistbuilder_push_i512(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u104(t){const e=n.compactciphertextlistbuilder_push_u104(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u112(t){const e=n.compactciphertextlistbuilder_push_u112(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u120(t){const e=n.compactciphertextlistbuilder_push_u120(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u128(t){const e=n.compactciphertextlistbuilder_push_u128(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u136(t){const e=n.compactciphertextlistbuilder_push_u136(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u144(t){const e=n.compactciphertextlistbuilder_push_u144(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u152(t){const e=n.compactciphertextlistbuilder_push_u152(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u160(t){const e=n.compactciphertextlistbuilder_push_u160(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u168(t){const e=n.compactciphertextlistbuilder_push_u168(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u176(t){const e=n.compactciphertextlistbuilder_push_u176(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u184(t){const e=n.compactciphertextlistbuilder_push_u184(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u192(t){const e=n.compactciphertextlistbuilder_push_u192(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u200(t){const e=n.compactciphertextlistbuilder_push_u200(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u208(t){const e=n.compactciphertextlistbuilder_push_u208(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u216(t){const e=n.compactciphertextlistbuilder_push_u216(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u224(t){const e=n.compactciphertextlistbuilder_push_u224(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u232(t){const e=n.compactciphertextlistbuilder_push_u232(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u240(t){const e=n.compactciphertextlistbuilder_push_u240(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u248(t){const e=n.compactciphertextlistbuilder_push_u248(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u256(t){const e=n.compactciphertextlistbuilder_push_u256(this.__wbg_ptr,t);if(e[1])throw o(e[0])}push_u512(t){const e=n.compactciphertextlistbuilder_push_u512(this.__wbg_ptr,t);if(e[1])throw o(e[0])}}Symbol.dispose&&(__.prototype[Symbol.dispose]=__.prototype.free);const $u=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compactciphertextlistexpander_free(i>>>0,1));class Zi{static __wrap(t){t=t>>>0;const e=Object.create(Zi.prototype);return e.__wbg_ptr=t,$u.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,$u.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compactciphertextlistexpander_free(t,0)}get_int104(t){const e=n.compactciphertextlistexpander_get_int104(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return ye.__wrap(e[0])}get_int112(t){const e=n.compactciphertextlistexpander_get_int112(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Se.__wrap(e[0])}get_int120(t){const e=n.compactciphertextlistexpander_get_int120(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Re.__wrap(e[0])}get_int128(t){const e=n.compactciphertextlistexpander_get_int128(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Pe.__wrap(e[0])}get_int136(t){const e=n.compactciphertextlistexpander_get_int136(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Me.__wrap(e[0])}get_int144(t){const e=n.compactciphertextlistexpander_get_int144(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ce.__wrap(e[0])}get_int152(t){const e=n.compactciphertextlistexpander_get_int152(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return ze.__wrap(e[0])}get_int160(t){const e=n.compactciphertextlistexpander_get_int160(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ge.__wrap(e[0])}get_int168(t){const e=n.compactciphertextlistexpander_get_int168(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Be.__wrap(e[0])}get_int176(t){const e=n.compactciphertextlistexpander_get_int176(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ne.__wrap(e[0])}get_int184(t){const e=n.compactciphertextlistexpander_get_int184(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ke.__wrap(e[0])}get_int192(t){const e=n.compactciphertextlistexpander_get_int192(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return ve.__wrap(e[0])}get_int200(t){const e=n.compactciphertextlistexpander_get_int200(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ue.__wrap(e[0])}get_int208(t){const e=n.compactciphertextlistexpander_get_int208(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Oe.__wrap(e[0])}get_int216(t){const e=n.compactciphertextlistexpander_get_int216(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return ke.__wrap(e[0])}get_int224(t){const e=n.compactciphertextlistexpander_get_int224(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ve.__wrap(e[0])}get_int232(t){const e=n.compactciphertextlistexpander_get_int232(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Fe.__wrap(e[0])}get_int240(t){const e=n.compactciphertextlistexpander_get_int240(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return De.__wrap(e[0])}get_int248(t){const e=n.compactciphertextlistexpander_get_int248(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return je.__wrap(e[0])}get_int256(t){const e=n.compactciphertextlistexpander_get_int256(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Le.__wrap(e[0])}get_int512(t){const e=n.compactciphertextlistexpander_get_int512(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return We.__wrap(e[0])}get_uint10(t){const e=n.compactciphertextlistexpander_get_uint10(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return nr.__wrap(e[0])}get_uint12(t){const e=n.compactciphertextlistexpander_get_uint12(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return cr.__wrap(e[0])}get_uint14(t){const e=n.compactciphertextlistexpander_get_uint14(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return hr.__wrap(e[0])}get_uint16(t){const e=n.compactciphertextlistexpander_get_uint16(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return wr.__wrap(e[0])}get_uint24(t){const e=n.compactciphertextlistexpander_get_uint24(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ir.__wrap(e[0])}get_uint32(t){const e=n.compactciphertextlistexpander_get_uint32(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Kr.__wrap(e[0])}get_uint40(t){const e=n.compactciphertextlistexpander_get_uint40(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return xr.__wrap(e[0])}get_uint48(t){const e=n.compactciphertextlistexpander_get_uint48(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ur.__wrap(e[0])}get_uint56(t){const e=n.compactciphertextlistexpander_get_uint56(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Or.__wrap(e[0])}get_uint64(t){const e=n.compactciphertextlistexpander_get_uint64(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Vr.__wrap(e[0])}get_uint72(t){const e=n.compactciphertextlistexpander_get_uint72(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Fr.__wrap(e[0])}get_uint80(t){const e=n.compactciphertextlistexpander_get_uint80(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Dr.__wrap(e[0])}get_uint88(t){const e=n.compactciphertextlistexpander_get_uint88(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return jr.__wrap(e[0])}get_uint96(t){const e=n.compactciphertextlistexpander_get_uint96(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Lr.__wrap(e[0])}get_int1024(t){const e=n.compactciphertextlistexpander_get_int1024(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return be.__wrap(e[0])}get_int2048(t){const e=n.compactciphertextlistexpander_get_int2048(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Te.__wrap(e[0])}get_kind_of(t){const e=n.compactciphertextlistexpander_get_kind_of(this.__wbg_ptr,t);return e===84?void 0:e}get_uint104(t){const e=n.compactciphertextlistexpander_get_uint104(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return or.__wrap(e[0])}get_uint112(t){const e=n.compactciphertextlistexpander_get_uint112(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return ar.__wrap(e[0])}get_uint120(t){const e=n.compactciphertextlistexpander_get_uint120(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return lr.__wrap(e[0])}get_uint128(t){const e=n.compactciphertextlistexpander_get_uint128(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return pr.__wrap(e[0])}get_uint136(t){const e=n.compactciphertextlistexpander_get_uint136(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return fr.__wrap(e[0])}get_uint144(t){const e=n.compactciphertextlistexpander_get_uint144(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return ur.__wrap(e[0])}get_uint152(t){const e=n.compactciphertextlistexpander_get_uint152(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return dr.__wrap(e[0])}get_uint160(t){const e=n.compactciphertextlistexpander_get_uint160(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return gr.__wrap(e[0])}get_uint168(t){const e=n.compactciphertextlistexpander_get_uint168(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ar.__wrap(e[0])}get_uint176(t){const e=n.compactciphertextlistexpander_get_uint176(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return br.__wrap(e[0])}get_uint184(t){const e=n.compactciphertextlistexpander_get_uint184(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return yr.__wrap(e[0])}get_uint192(t){const e=n.compactciphertextlistexpander_get_uint192(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Sr.__wrap(e[0])}get_uint200(t){const e=n.compactciphertextlistexpander_get_uint200(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Rr.__wrap(e[0])}get_uint208(t){const e=n.compactciphertextlistexpander_get_uint208(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Mr.__wrap(e[0])}get_uint216(t){const e=n.compactciphertextlistexpander_get_uint216(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Er.__wrap(e[0])}get_uint224(t){const e=n.compactciphertextlistexpander_get_uint224(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Cr.__wrap(e[0])}get_uint232(t){const e=n.compactciphertextlistexpander_get_uint232(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return zr.__wrap(e[0])}get_uint240(t){const e=n.compactciphertextlistexpander_get_uint240(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Gr.__wrap(e[0])}get_uint248(t){const e=n.compactciphertextlistexpander_get_uint248(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Br.__wrap(e[0])}get_uint256(t){const e=n.compactciphertextlistexpander_get_uint256(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Nr.__wrap(e[0])}get_uint512(t){const e=n.compactciphertextlistexpander_get_uint512(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Tr.__wrap(e[0])}get_uint1024(t){const e=n.compactciphertextlistexpander_get_uint1024(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return _r.__wrap(e[0])}get_uint2048(t){const e=n.compactciphertextlistexpander_get_uint2048(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Pr.__wrap(e[0])}len(){return n.compactciphertextlistexpander_len(this.__wbg_ptr)>>>0}get_bool(t){const e=n.compactciphertextlistexpander_get_bool(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return ge.__wrap(e[0])}get_int2(t){const e=n.compactciphertextlistexpander_get_int2(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return xe.__wrap(e[0])}get_int4(t){const e=n.compactciphertextlistexpander_get_int4(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Je.__wrap(e[0])}get_int6(t){const e=n.compactciphertextlistexpander_get_int6(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return qe.__wrap(e[0])}get_int8(t){const e=n.compactciphertextlistexpander_get_int8(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return er.__wrap(e[0])}is_empty(){return n.compactciphertextlistexpander_is_empty(this.__wbg_ptr)!==0}get_int10(t){const e=n.compactciphertextlistexpander_get_int10(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ae.__wrap(e[0])}get_int12(t){const e=n.compactciphertextlistexpander_get_int12(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return me.__wrap(e[0])}get_int14(t){const e=n.compactciphertextlistexpander_get_int14(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ee.__wrap(e[0])}get_int16(t){const e=n.compactciphertextlistexpander_get_int16(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ie.__wrap(e[0])}get_int24(t){const e=n.compactciphertextlistexpander_get_int24(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ye.__wrap(e[0])}get_int32(t){const e=n.compactciphertextlistexpander_get_int32(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return He.__wrap(e[0])}get_int40(t){const e=n.compactciphertextlistexpander_get_int40(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Qe.__wrap(e[0])}get_int48(t){const e=n.compactciphertextlistexpander_get_int48(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return $e.__wrap(e[0])}get_int56(t){const e=n.compactciphertextlistexpander_get_int56(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Ze.__wrap(e[0])}get_int64(t){const e=n.compactciphertextlistexpander_get_int64(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Xe.__wrap(e[0])}get_int72(t){const e=n.compactciphertextlistexpander_get_int72(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return tr.__wrap(e[0])}get_int80(t){const e=n.compactciphertextlistexpander_get_int80(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return rr.__wrap(e[0])}get_int88(t){const e=n.compactciphertextlistexpander_get_int88(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return ir.__wrap(e[0])}get_int96(t){const e=n.compactciphertextlistexpander_get_int96(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return sr.__wrap(e[0])}get_uint2(t){const e=n.compactciphertextlistexpander_get_uint2(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return mr.__wrap(e[0])}get_uint4(t){const e=n.compactciphertextlistexpander_get_uint4(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return vr.__wrap(e[0])}get_uint6(t){const e=n.compactciphertextlistexpander_get_uint6(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return kr.__wrap(e[0])}get_uint8(t){const e=n.compactciphertextlistexpander_get_uint8(this.__wbg_ptr,t);if(e[2])throw o(e[1]);return Yr.__wrap(e[0])}}Symbol.dispose&&(Zi.prototype[Symbol.dispose]=Zi.prototype.free);const Wu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compactpkecrs_free(i>>>0,1));class oe{static __wrap(t){t=t>>>0;const e=Object.create(oe.prototype);return e.__wbg_ptr=t,Wu.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Wu.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compactpkecrs_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compactpkecrs_deserialize(e,r);if(s[2])throw o(s[1]);return oe.__wrap(s[0])}static from_config(t,e){f(t,Ui);const r=n.compactpkecrs_from_config(t.__wbg_ptr,e);if(r[2])throw o(r[1]);return oe.__wrap(r[0])}safe_serialize(t){const e=n.compactpkecrs_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compactpkecrs_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return oe.__wrap(_[0])}static deserialize_from_public_params(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compactpkecrs_deserialize_from_public_params(e,r);if(s[2])throw o(s[1]);return oe.__wrap(s[0])}static safe_deserialize_from_public_params(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compactpkecrs_safe_deserialize_from_public_params(r,s,e);if(_[2])throw o(_[1]);return oe.__wrap(_[0])}serialize(t){const e=n.compactpkecrs_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}}Symbol.dispose&&(oe.prototype[Symbol.dispose]=oe.prototype.free);const Zu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfhebool_free(i>>>0,1));class qi{static __wrap(t){t=t>>>0;const e=Object.create(qi.prototype);return e.__wbg_ptr=t,Zu.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Zu.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfhebool_free(t,0)}decompress(){const t=n.compressedfhebool_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return ge.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfhebool_deserialize(e,r);if(s[2])throw o(s[1]);return qi.__wrap(s[0])}safe_serialize(t){const e=n.compressedfhebool_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfhebool_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return qi.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfhebool_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return qi.__wrap(r[0])}serialize(){const t=n.compressedfhebool_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(qi.prototype[Symbol.dispose]=qi.prototype.free);const qu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint10_free(i>>>0,1));class Xi{static __wrap(t){t=t>>>0;const e=Object.create(Xi.prototype);return e.__wbg_ptr=t,qu.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,qu.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint10_free(t,0)}decompress(){const t=n.compressedfheint10_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ae.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint10_deserialize(e,r);if(s[2])throw o(s[1]);return Xi.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint10_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint10_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Xi.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint10_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Xi.__wrap(r[0])}serialize(){const t=n.compressedfheint10_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Xi.prototype[Symbol.dispose]=Xi.prototype.free);const Xu=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint1024_free(i>>>0,1));class ts{static __wrap(t){t=t>>>0;const e=Object.create(ts.prototype);return e.__wbg_ptr=t,Xu.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Xu.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint1024_free(t,0)}decompress(){const t=n.compressedfheint1024_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return be.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint1024_deserialize(e,r);if(s[2])throw o(s[1]);return ts.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint1024_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint1024_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ts.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint1024_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ts.__wrap(r[0])}serialize(){const t=n.compressedfheint1024_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ts.prototype[Symbol.dispose]=ts.prototype.free);const td=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint104_free(i>>>0,1));class es{static __wrap(t){t=t>>>0;const e=Object.create(es.prototype);return e.__wbg_ptr=t,td.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,td.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint104_free(t,0)}decompress(){const t=n.compressedfheint104_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return ye.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint104_deserialize(e,r);if(s[2])throw o(s[1]);return es.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint104_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint104_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return es.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint104_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return es.__wrap(r[0])}serialize(){const t=n.compressedfheint104_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(es.prototype[Symbol.dispose]=es.prototype.free);const ed=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint112_free(i>>>0,1));class rs{static __wrap(t){t=t>>>0;const e=Object.create(rs.prototype);return e.__wbg_ptr=t,ed.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ed.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint112_free(t,0)}decompress(){const t=n.compressedfheint112_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Se.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint112_deserialize(e,r);if(s[2])throw o(s[1]);return rs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint112_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint112_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return rs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint112_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return rs.__wrap(r[0])}serialize(){const t=n.compressedfheint112_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(rs.prototype[Symbol.dispose]=rs.prototype.free);const rd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint12_free(i>>>0,1));class is{static __wrap(t){t=t>>>0;const e=Object.create(is.prototype);return e.__wbg_ptr=t,rd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,rd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint12_free(t,0)}decompress(){const t=n.compressedfheint12_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return me.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint12_deserialize(e,r);if(s[2])throw o(s[1]);return is.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint12_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint12_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return is.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint12_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return is.__wrap(r[0])}serialize(){const t=n.compressedfheint12_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(is.prototype[Symbol.dispose]=is.prototype.free);const id=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint120_free(i>>>0,1));class ss{static __wrap(t){t=t>>>0;const e=Object.create(ss.prototype);return e.__wbg_ptr=t,id.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,id.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint120_free(t,0)}decompress(){const t=n.compressedfheint120_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Re.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint120_deserialize(e,r);if(s[2])throw o(s[1]);return ss.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint120_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint120_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ss.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint120_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ss.__wrap(r[0])}serialize(){const t=n.compressedfheint120_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ss.prototype[Symbol.dispose]=ss.prototype.free);const sd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint128_free(i>>>0,1));class ns{static __wrap(t){t=t>>>0;const e=Object.create(ns.prototype);return e.__wbg_ptr=t,sd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,sd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint128_free(t,0)}decompress(){const t=n.compressedfheint128_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Pe.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint128_deserialize(e,r);if(s[2])throw o(s[1]);return ns.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint128_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint128_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ns.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint128_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ns.__wrap(r[0])}serialize(){const t=n.compressedfheint128_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ns.prototype[Symbol.dispose]=ns.prototype.free);const nd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint136_free(i>>>0,1));class _s{static __wrap(t){t=t>>>0;const e=Object.create(_s.prototype);return e.__wbg_ptr=t,nd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,nd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint136_free(t,0)}decompress(){const t=n.compressedfheint136_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Me.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint136_deserialize(e,r);if(s[2])throw o(s[1]);return _s.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint136_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint136_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return _s.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint136_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return _s.__wrap(r[0])}serialize(){const t=n.compressedfheint136_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(_s.prototype[Symbol.dispose]=_s.prototype.free);const _d=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint14_free(i>>>0,1));class os{static __wrap(t){t=t>>>0;const e=Object.create(os.prototype);return e.__wbg_ptr=t,_d.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,_d.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint14_free(t,0)}decompress(){const t=n.compressedfheint14_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ee.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint14_deserialize(e,r);if(s[2])throw o(s[1]);return os.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint14_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint14_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return os.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint14_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return os.__wrap(r[0])}serialize(){const t=n.compressedfheint14_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(os.prototype[Symbol.dispose]=os.prototype.free);const od=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint144_free(i>>>0,1));class as{static __wrap(t){t=t>>>0;const e=Object.create(as.prototype);return e.__wbg_ptr=t,od.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,od.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint144_free(t,0)}decompress(){const t=n.compressedfheint144_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ce.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint144_deserialize(e,r);if(s[2])throw o(s[1]);return as.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint144_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint144_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return as.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint144_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return as.__wrap(r[0])}serialize(){const t=n.compressedfheint144_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(as.prototype[Symbol.dispose]=as.prototype.free);const ad=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint152_free(i>>>0,1));class cs{static __wrap(t){t=t>>>0;const e=Object.create(cs.prototype);return e.__wbg_ptr=t,ad.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ad.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint152_free(t,0)}decompress(){const t=n.compressedfheint152_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return ze.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint152_deserialize(e,r);if(s[2])throw o(s[1]);return cs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint152_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint152_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return cs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint152_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return cs.__wrap(r[0])}serialize(){const t=n.compressedfheint152_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(cs.prototype[Symbol.dispose]=cs.prototype.free);const cd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint16_free(i>>>0,1));class ls{static __wrap(t){t=t>>>0;const e=Object.create(ls.prototype);return e.__wbg_ptr=t,cd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,cd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint16_free(t,0)}decompress(){const t=n.compressedfheint16_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ie.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint16_deserialize(e,r);if(s[2])throw o(s[1]);return ls.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint16_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint16_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ls.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint16_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ls.__wrap(r[0])}serialize(){const t=n.compressedfheint16_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ls.prototype[Symbol.dispose]=ls.prototype.free);const ld=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint160_free(i>>>0,1));class ps{static __wrap(t){t=t>>>0;const e=Object.create(ps.prototype);return e.__wbg_ptr=t,ld.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ld.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint160_free(t,0)}decompress(){const t=n.compressedfheint160_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ge.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint160_deserialize(e,r);if(s[2])throw o(s[1]);return ps.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint160_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint160_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ps.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint160_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ps.__wrap(r[0])}serialize(){const t=n.compressedfheint160_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ps.prototype[Symbol.dispose]=ps.prototype.free);const pd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint168_free(i>>>0,1));class fs{static __wrap(t){t=t>>>0;const e=Object.create(fs.prototype);return e.__wbg_ptr=t,pd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,pd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint168_free(t,0)}decompress(){const t=n.compressedfheint168_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Be.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint168_deserialize(e,r);if(s[2])throw o(s[1]);return fs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint168_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint168_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return fs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint168_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return fs.__wrap(r[0])}serialize(){const t=n.compressedfheint168_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(fs.prototype[Symbol.dispose]=fs.prototype.free);const fd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint176_free(i>>>0,1));class hs{static __wrap(t){t=t>>>0;const e=Object.create(hs.prototype);return e.__wbg_ptr=t,fd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,fd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint176_free(t,0)}decompress(){const t=n.compressedfheint176_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ne.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint176_deserialize(e,r);if(s[2])throw o(s[1]);return hs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint176_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint176_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return hs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint176_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return hs.__wrap(r[0])}serialize(){const t=n.compressedfheint176_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(hs.prototype[Symbol.dispose]=hs.prototype.free);const hd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint184_free(i>>>0,1));class us{static __wrap(t){t=t>>>0;const e=Object.create(us.prototype);return e.__wbg_ptr=t,hd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,hd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint184_free(t,0)}decompress(){const t=n.compressedfheint184_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ke.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint184_deserialize(e,r);if(s[2])throw o(s[1]);return us.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint184_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint184_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return us.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint184_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return us.__wrap(r[0])}serialize(){const t=n.compressedfheint184_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(us.prototype[Symbol.dispose]=us.prototype.free);const ud=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint192_free(i>>>0,1));class ds{static __wrap(t){t=t>>>0;const e=Object.create(ds.prototype);return e.__wbg_ptr=t,ud.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ud.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint192_free(t,0)}decompress(){const t=n.compressedfheint192_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return ve.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint192_deserialize(e,r);if(s[2])throw o(s[1]);return ds.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint192_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint192_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ds.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint192_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ds.__wrap(r[0])}serialize(){const t=n.compressedfheint192_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ds.prototype[Symbol.dispose]=ds.prototype.free);const dd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint2_free(i>>>0,1));class ws{static __wrap(t){t=t>>>0;const e=Object.create(ws.prototype);return e.__wbg_ptr=t,dd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,dd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint2_free(t,0)}decompress(){const t=n.compressedfheint2_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return xe.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint2_deserialize(e,r);if(s[2])throw o(s[1]);return ws.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint2_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint2_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ws.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint2_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ws.__wrap(r[0])}serialize(){const t=n.compressedfheint2_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ws.prototype[Symbol.dispose]=ws.prototype.free);const wd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint200_free(i>>>0,1));class gs{static __wrap(t){t=t>>>0;const e=Object.create(gs.prototype);return e.__wbg_ptr=t,wd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,wd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint200_free(t,0)}decompress(){const t=n.compressedfheint200_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ue.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint200_deserialize(e,r);if(s[2])throw o(s[1]);return gs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint200_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint200_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return gs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint200_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return gs.__wrap(r[0])}serialize(){const t=n.compressedfheint200_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(gs.prototype[Symbol.dispose]=gs.prototype.free);const gd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint2048_free(i>>>0,1));class As{static __wrap(t){t=t>>>0;const e=Object.create(As.prototype);return e.__wbg_ptr=t,gd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,gd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint2048_free(t,0)}decompress(){const t=n.compressedfheint2048_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Te.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint2048_deserialize(e,r);if(s[2])throw o(s[1]);return As.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint2048_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint2048_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return As.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint2048_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return As.__wrap(r[0])}serialize(){const t=n.compressedfheint2048_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(As.prototype[Symbol.dispose]=As.prototype.free);const Ad=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint208_free(i>>>0,1));class bs{static __wrap(t){t=t>>>0;const e=Object.create(bs.prototype);return e.__wbg_ptr=t,Ad.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ad.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint208_free(t,0)}decompress(){const t=n.compressedfheint208_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Oe.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint208_deserialize(e,r);if(s[2])throw o(s[1]);return bs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint208_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint208_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return bs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint208_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return bs.__wrap(r[0])}serialize(){const t=n.compressedfheint208_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(bs.prototype[Symbol.dispose]=bs.prototype.free);const bd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint216_free(i>>>0,1));class ys{static __wrap(t){t=t>>>0;const e=Object.create(ys.prototype);return e.__wbg_ptr=t,bd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,bd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint216_free(t,0)}decompress(){const t=n.compressedfheint216_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return ke.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint216_deserialize(e,r);if(s[2])throw o(s[1]);return ys.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint216_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint216_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ys.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint216_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ys.__wrap(r[0])}serialize(){const t=n.compressedfheint216_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ys.prototype[Symbol.dispose]=ys.prototype.free);const yd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint224_free(i>>>0,1));class Ss{static __wrap(t){t=t>>>0;const e=Object.create(Ss.prototype);return e.__wbg_ptr=t,yd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,yd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint224_free(t,0)}decompress(){const t=n.compressedfheint224_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ve.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint224_deserialize(e,r);if(s[2])throw o(s[1]);return Ss.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint224_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint224_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ss.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint224_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ss.__wrap(r[0])}serialize(){const t=n.compressedfheint224_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ss.prototype[Symbol.dispose]=Ss.prototype.free);const Sd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint232_free(i>>>0,1));class ms{static __wrap(t){t=t>>>0;const e=Object.create(ms.prototype);return e.__wbg_ptr=t,Sd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Sd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint232_free(t,0)}decompress(){const t=n.compressedfheint232_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Fe.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint232_deserialize(e,r);if(s[2])throw o(s[1]);return ms.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint232_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint232_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ms.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint232_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ms.__wrap(r[0])}serialize(){const t=n.compressedfheint232_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ms.prototype[Symbol.dispose]=ms.prototype.free);const md=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint24_free(i>>>0,1));class Rs{static __wrap(t){t=t>>>0;const e=Object.create(Rs.prototype);return e.__wbg_ptr=t,md.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,md.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint24_free(t,0)}decompress(){const t=n.compressedfheint24_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ye.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint24_deserialize(e,r);if(s[2])throw o(s[1]);return Rs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint24_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint24_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Rs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint24_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Rs.__wrap(r[0])}serialize(){const t=n.compressedfheint24_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Rs.prototype[Symbol.dispose]=Rs.prototype.free);const Rd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint240_free(i>>>0,1));class Ps{static __wrap(t){t=t>>>0;const e=Object.create(Ps.prototype);return e.__wbg_ptr=t,Rd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Rd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint240_free(t,0)}decompress(){const t=n.compressedfheint240_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return De.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint240_deserialize(e,r);if(s[2])throw o(s[1]);return Ps.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint240_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint240_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ps.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint240_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ps.__wrap(r[0])}serialize(){const t=n.compressedfheint240_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ps.prototype[Symbol.dispose]=Ps.prototype.free);const Pd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint248_free(i>>>0,1));class Ms{static __wrap(t){t=t>>>0;const e=Object.create(Ms.prototype);return e.__wbg_ptr=t,Pd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Pd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint248_free(t,0)}decompress(){const t=n.compressedfheint248_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return je.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint248_deserialize(e,r);if(s[2])throw o(s[1]);return Ms.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint248_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint248_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ms.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint248_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ms.__wrap(r[0])}serialize(){const t=n.compressedfheint248_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ms.prototype[Symbol.dispose]=Ms.prototype.free);const Md=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint256_free(i>>>0,1));class Es{static __wrap(t){t=t>>>0;const e=Object.create(Es.prototype);return e.__wbg_ptr=t,Md.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Md.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint256_free(t,0)}decompress(){const t=n.compressedfheint256_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Le.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint256_deserialize(e,r);if(s[2])throw o(s[1]);return Es.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint256_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint256_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Es.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint256_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Es.__wrap(r[0])}serialize(){const t=n.compressedfheint256_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Es.prototype[Symbol.dispose]=Es.prototype.free);const Ed=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint32_free(i>>>0,1));class Cs{static __wrap(t){t=t>>>0;const e=Object.create(Cs.prototype);return e.__wbg_ptr=t,Ed.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ed.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint32_free(t,0)}decompress(){const t=n.compressedfheint32_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return He.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint32_deserialize(e,r);if(s[2])throw o(s[1]);return Cs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint32_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint32_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Cs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint32_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Cs.__wrap(r[0])}serialize(){const t=n.compressedfheint32_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Cs.prototype[Symbol.dispose]=Cs.prototype.free);const Cd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint4_free(i>>>0,1));class zs{static __wrap(t){t=t>>>0;const e=Object.create(zs.prototype);return e.__wbg_ptr=t,Cd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Cd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint4_free(t,0)}decompress(){const t=n.compressedfheint4_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Je.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint4_deserialize(e,r);if(s[2])throw o(s[1]);return zs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint4_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint4_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return zs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint4_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return zs.__wrap(r[0])}serialize(){const t=n.compressedfheint4_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(zs.prototype[Symbol.dispose]=zs.prototype.free);const zd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint40_free(i>>>0,1));class Is{static __wrap(t){t=t>>>0;const e=Object.create(Is.prototype);return e.__wbg_ptr=t,zd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,zd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint40_free(t,0)}decompress(){const t=n.compressedfheint40_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Qe.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint40_deserialize(e,r);if(s[2])throw o(s[1]);return Is.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint40_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint40_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Is.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint40_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Is.__wrap(r[0])}serialize(){const t=n.compressedfheint40_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Is.prototype[Symbol.dispose]=Is.prototype.free);const Id=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint48_free(i>>>0,1));class Gs{static __wrap(t){t=t>>>0;const e=Object.create(Gs.prototype);return e.__wbg_ptr=t,Id.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Id.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint48_free(t,0)}decompress(){const t=n.compressedfheint48_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return $e.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint48_deserialize(e,r);if(s[2])throw o(s[1]);return Gs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint48_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint48_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Gs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint48_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Gs.__wrap(r[0])}serialize(){const t=n.compressedfheint48_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Gs.prototype[Symbol.dispose]=Gs.prototype.free);const Gd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint512_free(i>>>0,1));class Bs{static __wrap(t){t=t>>>0;const e=Object.create(Bs.prototype);return e.__wbg_ptr=t,Gd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Gd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint512_free(t,0)}decompress(){const t=n.compressedfheint512_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return We.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint512_deserialize(e,r);if(s[2])throw o(s[1]);return Bs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint512_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint512_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Bs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint512_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Bs.__wrap(r[0])}serialize(){const t=n.compressedfheint512_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Bs.prototype[Symbol.dispose]=Bs.prototype.free);const Bd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint56_free(i>>>0,1));class Ns{static __wrap(t){t=t>>>0;const e=Object.create(Ns.prototype);return e.__wbg_ptr=t,Bd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Bd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint56_free(t,0)}decompress(){const t=n.compressedfheint56_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ze.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint56_deserialize(e,r);if(s[2])throw o(s[1]);return Ns.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint56_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint56_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ns.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint56_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ns.__wrap(r[0])}serialize(){const t=n.compressedfheint56_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ns.prototype[Symbol.dispose]=Ns.prototype.free);const Nd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint6_free(i>>>0,1));class Ks{static __wrap(t){t=t>>>0;const e=Object.create(Ks.prototype);return e.__wbg_ptr=t,Nd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Nd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint6_free(t,0)}decompress(){const t=n.compressedfheint6_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return qe.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint6_deserialize(e,r);if(s[2])throw o(s[1]);return Ks.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint6_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint6_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ks.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint6_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ks.__wrap(r[0])}serialize(){const t=n.compressedfheint6_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ks.prototype[Symbol.dispose]=Ks.prototype.free);const Kd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint64_free(i>>>0,1));class vs{static __wrap(t){t=t>>>0;const e=Object.create(vs.prototype);return e.__wbg_ptr=t,Kd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Kd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint64_free(t,0)}decompress(){const t=n.compressedfheint64_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Xe.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint64_deserialize(e,r);if(s[2])throw o(s[1]);return vs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint64_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint64_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return vs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint64_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return vs.__wrap(r[0])}serialize(){const t=n.compressedfheint64_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(vs.prototype[Symbol.dispose]=vs.prototype.free);const vd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint72_free(i>>>0,1));class xs{static __wrap(t){t=t>>>0;const e=Object.create(xs.prototype);return e.__wbg_ptr=t,vd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,vd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint72_free(t,0)}decompress(){const t=n.compressedfheint72_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return tr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint72_deserialize(e,r);if(s[2])throw o(s[1]);return xs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint72_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint72_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return xs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint72_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return xs.__wrap(r[0])}serialize(){const t=n.compressedfheint72_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(xs.prototype[Symbol.dispose]=xs.prototype.free);const xd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint8_free(i>>>0,1));class Us{static __wrap(t){t=t>>>0;const e=Object.create(Us.prototype);return e.__wbg_ptr=t,xd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,xd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint8_free(t,0)}decompress(){const t=n.compressedfheint8_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return er.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint8_deserialize(e,r);if(s[2])throw o(s[1]);return Us.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint8_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint8_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Us.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint8_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Us.__wrap(r[0])}serialize(){const t=n.compressedfheint8_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Us.prototype[Symbol.dispose]=Us.prototype.free);const Ud=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint80_free(i>>>0,1));class Ts{static __wrap(t){t=t>>>0;const e=Object.create(Ts.prototype);return e.__wbg_ptr=t,Ud.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ud.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint80_free(t,0)}decompress(){const t=n.compressedfheint80_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return rr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint80_deserialize(e,r);if(s[2])throw o(s[1]);return Ts.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint80_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint80_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ts.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint80_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ts.__wrap(r[0])}serialize(){const t=n.compressedfheint80_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ts.prototype[Symbol.dispose]=Ts.prototype.free);const Td=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint88_free(i>>>0,1));class Os{static __wrap(t){t=t>>>0;const e=Object.create(Os.prototype);return e.__wbg_ptr=t,Td.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Td.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint88_free(t,0)}decompress(){const t=n.compressedfheint88_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return ir.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint88_deserialize(e,r);if(s[2])throw o(s[1]);return Os.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint88_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint88_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Os.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint88_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Os.__wrap(r[0])}serialize(){const t=n.compressedfheint88_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Os.prototype[Symbol.dispose]=Os.prototype.free);const Od=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheint96_free(i>>>0,1));class ks{static __wrap(t){t=t>>>0;const e=Object.create(ks.prototype);return e.__wbg_ptr=t,Od.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Od.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheint96_free(t,0)}decompress(){const t=n.compressedfheint96_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return sr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheint96_deserialize(e,r);if(s[2])throw o(s[1]);return ks.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheint96_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheint96_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ks.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheint96_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ks.__wrap(r[0])}serialize(){const t=n.compressedfheint96_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ks.prototype[Symbol.dispose]=ks.prototype.free);const kd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint10_free(i>>>0,1));class Vs{static __wrap(t){t=t>>>0;const e=Object.create(Vs.prototype);return e.__wbg_ptr=t,kd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,kd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint10_free(t,0)}decompress(){const t=n.compressedfheuint10_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return nr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint10_deserialize(e,r);if(s[2])throw o(s[1]);return Vs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint10_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint10_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Vs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint10_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Vs.__wrap(r[0])}serialize(){const t=n.compressedfheuint10_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Vs.prototype[Symbol.dispose]=Vs.prototype.free);const Vd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint1024_free(i>>>0,1));class Fs{static __wrap(t){t=t>>>0;const e=Object.create(Fs.prototype);return e.__wbg_ptr=t,Vd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Vd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint1024_free(t,0)}decompress(){const t=n.compressedfheuint1024_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return _r.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint1024_deserialize(e,r);if(s[2])throw o(s[1]);return Fs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint1024_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint1024_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Fs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint1024_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Fs.__wrap(r[0])}serialize(){const t=n.compressedfheuint1024_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Fs.prototype[Symbol.dispose]=Fs.prototype.free);const Fd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint104_free(i>>>0,1));class Ys{static __wrap(t){t=t>>>0;const e=Object.create(Ys.prototype);return e.__wbg_ptr=t,Fd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Fd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint104_free(t,0)}decompress(){const t=n.compressedfheuint104_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return or.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint104_deserialize(e,r);if(s[2])throw o(s[1]);return Ys.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint104_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint104_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ys.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint104_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ys.__wrap(r[0])}serialize(){const t=n.compressedfheuint104_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ys.prototype[Symbol.dispose]=Ys.prototype.free);const Yd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint112_free(i>>>0,1));class Ds{static __wrap(t){t=t>>>0;const e=Object.create(Ds.prototype);return e.__wbg_ptr=t,Yd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Yd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint112_free(t,0)}decompress(){const t=n.compressedfheuint112_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return ar.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint112_deserialize(e,r);if(s[2])throw o(s[1]);return Ds.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint112_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint112_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ds.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint112_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ds.__wrap(r[0])}serialize(){const t=n.compressedfheuint112_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ds.prototype[Symbol.dispose]=Ds.prototype.free);const Dd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint12_free(i>>>0,1));class js{static __wrap(t){t=t>>>0;const e=Object.create(js.prototype);return e.__wbg_ptr=t,Dd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Dd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint12_free(t,0)}decompress(){const t=n.compressedfheuint12_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return cr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint12_deserialize(e,r);if(s[2])throw o(s[1]);return js.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint12_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint12_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return js.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint12_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return js.__wrap(r[0])}serialize(){const t=n.compressedfheuint12_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(js.prototype[Symbol.dispose]=js.prototype.free);const jd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint120_free(i>>>0,1));class Ls{static __wrap(t){t=t>>>0;const e=Object.create(Ls.prototype);return e.__wbg_ptr=t,jd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,jd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint120_free(t,0)}decompress(){const t=n.compressedfheuint120_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return lr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint120_deserialize(e,r);if(s[2])throw o(s[1]);return Ls.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint120_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint120_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ls.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint120_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ls.__wrap(r[0])}serialize(){const t=n.compressedfheuint120_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ls.prototype[Symbol.dispose]=Ls.prototype.free);const Ld=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint128_free(i>>>0,1));class Hs{static __wrap(t){t=t>>>0;const e=Object.create(Hs.prototype);return e.__wbg_ptr=t,Ld.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ld.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint128_free(t,0)}decompress(){const t=n.compressedfheuint128_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return pr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint128_deserialize(e,r);if(s[2])throw o(s[1]);return Hs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint128_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint128_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Hs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint128_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Hs.__wrap(r[0])}serialize(){const t=n.compressedfheuint128_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Hs.prototype[Symbol.dispose]=Hs.prototype.free);const Hd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint136_free(i>>>0,1));class Js{static __wrap(t){t=t>>>0;const e=Object.create(Js.prototype);return e.__wbg_ptr=t,Hd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Hd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint136_free(t,0)}decompress(){const t=n.compressedfheuint136_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return fr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint136_deserialize(e,r);if(s[2])throw o(s[1]);return Js.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint136_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint136_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Js.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint136_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Js.__wrap(r[0])}serialize(){const t=n.compressedfheuint136_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Js.prototype[Symbol.dispose]=Js.prototype.free);const Jd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint14_free(i>>>0,1));class Qs{static __wrap(t){t=t>>>0;const e=Object.create(Qs.prototype);return e.__wbg_ptr=t,Jd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Jd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint14_free(t,0)}decompress(){const t=n.compressedfheuint14_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return hr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint14_deserialize(e,r);if(s[2])throw o(s[1]);return Qs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint14_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint14_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Qs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint14_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Qs.__wrap(r[0])}serialize(){const t=n.compressedfheuint14_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Qs.prototype[Symbol.dispose]=Qs.prototype.free);const Qd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint144_free(i>>>0,1));class $s{static __wrap(t){t=t>>>0;const e=Object.create($s.prototype);return e.__wbg_ptr=t,Qd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Qd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint144_free(t,0)}decompress(){const t=n.compressedfheuint144_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return ur.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint144_deserialize(e,r);if(s[2])throw o(s[1]);return $s.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint144_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint144_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return $s.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint144_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return $s.__wrap(r[0])}serialize(){const t=n.compressedfheuint144_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&($s.prototype[Symbol.dispose]=$s.prototype.free);const $d=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint152_free(i>>>0,1));class Ws{static __wrap(t){t=t>>>0;const e=Object.create(Ws.prototype);return e.__wbg_ptr=t,$d.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,$d.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint152_free(t,0)}decompress(){const t=n.compressedfheuint152_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return dr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint152_deserialize(e,r);if(s[2])throw o(s[1]);return Ws.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint152_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint152_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ws.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint152_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ws.__wrap(r[0])}serialize(){const t=n.compressedfheuint152_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ws.prototype[Symbol.dispose]=Ws.prototype.free);const Wd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint16_free(i>>>0,1));class Zs{static __wrap(t){t=t>>>0;const e=Object.create(Zs.prototype);return e.__wbg_ptr=t,Wd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Wd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint16_free(t,0)}decompress(){const t=n.compressedfheuint16_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return wr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint16_deserialize(e,r);if(s[2])throw o(s[1]);return Zs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint16_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint16_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Zs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint16_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Zs.__wrap(r[0])}serialize(){const t=n.compressedfheuint16_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Zs.prototype[Symbol.dispose]=Zs.prototype.free);const Zd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint160_free(i>>>0,1));class qs{static __wrap(t){t=t>>>0;const e=Object.create(qs.prototype);return e.__wbg_ptr=t,Zd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Zd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint160_free(t,0)}decompress(){const t=n.compressedfheuint160_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return gr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint160_deserialize(e,r);if(s[2])throw o(s[1]);return qs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint160_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint160_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return qs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint160_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return qs.__wrap(r[0])}serialize(){const t=n.compressedfheuint160_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(qs.prototype[Symbol.dispose]=qs.prototype.free);const qd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint168_free(i>>>0,1));class Xs{static __wrap(t){t=t>>>0;const e=Object.create(Xs.prototype);return e.__wbg_ptr=t,qd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,qd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint168_free(t,0)}decompress(){const t=n.compressedfheuint168_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ar.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint168_deserialize(e,r);if(s[2])throw o(s[1]);return Xs.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint168_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint168_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Xs.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint168_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Xs.__wrap(r[0])}serialize(){const t=n.compressedfheuint168_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Xs.prototype[Symbol.dispose]=Xs.prototype.free);const Xd=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint176_free(i>>>0,1));class tn{static __wrap(t){t=t>>>0;const e=Object.create(tn.prototype);return e.__wbg_ptr=t,Xd.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Xd.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint176_free(t,0)}decompress(){const t=n.compressedfheuint176_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return br.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint176_deserialize(e,r);if(s[2])throw o(s[1]);return tn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint176_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint176_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return tn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint176_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return tn.__wrap(r[0])}serialize(){const t=n.compressedfheuint176_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(tn.prototype[Symbol.dispose]=tn.prototype.free);const tw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint184_free(i>>>0,1));class en{static __wrap(t){t=t>>>0;const e=Object.create(en.prototype);return e.__wbg_ptr=t,tw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,tw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint184_free(t,0)}decompress(){const t=n.compressedfheuint184_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return yr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint184_deserialize(e,r);if(s[2])throw o(s[1]);return en.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint184_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint184_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return en.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint184_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return en.__wrap(r[0])}serialize(){const t=n.compressedfheuint184_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(en.prototype[Symbol.dispose]=en.prototype.free);const ew=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint192_free(i>>>0,1));class rn{static __wrap(t){t=t>>>0;const e=Object.create(rn.prototype);return e.__wbg_ptr=t,ew.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ew.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint192_free(t,0)}decompress(){const t=n.compressedfheuint192_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Sr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint192_deserialize(e,r);if(s[2])throw o(s[1]);return rn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint192_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint192_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return rn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint192_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return rn.__wrap(r[0])}serialize(){const t=n.compressedfheuint192_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(rn.prototype[Symbol.dispose]=rn.prototype.free);const rw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint2_free(i>>>0,1));class sn{static __wrap(t){t=t>>>0;const e=Object.create(sn.prototype);return e.__wbg_ptr=t,rw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,rw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint2_free(t,0)}decompress(){const t=n.compressedfheuint2_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return mr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint2_deserialize(e,r);if(s[2])throw o(s[1]);return sn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint2_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint2_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return sn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint2_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return sn.__wrap(r[0])}serialize(){const t=n.compressedfheuint2_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(sn.prototype[Symbol.dispose]=sn.prototype.free);const iw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint200_free(i>>>0,1));class nn{static __wrap(t){t=t>>>0;const e=Object.create(nn.prototype);return e.__wbg_ptr=t,iw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,iw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint200_free(t,0)}decompress(){const t=n.compressedfheuint200_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Rr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint200_deserialize(e,r);if(s[2])throw o(s[1]);return nn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint200_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint200_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return nn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint200_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return nn.__wrap(r[0])}serialize(){const t=n.compressedfheuint200_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(nn.prototype[Symbol.dispose]=nn.prototype.free);const sw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint2048_free(i>>>0,1));class _n{static __wrap(t){t=t>>>0;const e=Object.create(_n.prototype);return e.__wbg_ptr=t,sw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,sw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint2048_free(t,0)}decompress(){const t=n.compressedfheuint2048_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Pr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint2048_deserialize(e,r);if(s[2])throw o(s[1]);return _n.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint2048_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint2048_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return _n.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint2048_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return _n.__wrap(r[0])}serialize(){const t=n.compressedfheuint2048_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(_n.prototype[Symbol.dispose]=_n.prototype.free);const nw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint208_free(i>>>0,1));class on{static __wrap(t){t=t>>>0;const e=Object.create(on.prototype);return e.__wbg_ptr=t,nw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,nw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint208_free(t,0)}decompress(){const t=n.compressedfheuint208_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Mr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint208_deserialize(e,r);if(s[2])throw o(s[1]);return on.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint208_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint208_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return on.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint208_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return on.__wrap(r[0])}serialize(){const t=n.compressedfheuint208_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(on.prototype[Symbol.dispose]=on.prototype.free);const _w=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint216_free(i>>>0,1));class an{static __wrap(t){t=t>>>0;const e=Object.create(an.prototype);return e.__wbg_ptr=t,_w.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,_w.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint216_free(t,0)}decompress(){const t=n.compressedfheuint216_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Er.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint216_deserialize(e,r);if(s[2])throw o(s[1]);return an.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint216_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint216_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return an.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint216_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return an.__wrap(r[0])}serialize(){const t=n.compressedfheuint216_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(an.prototype[Symbol.dispose]=an.prototype.free);const ow=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint224_free(i>>>0,1));class cn{static __wrap(t){t=t>>>0;const e=Object.create(cn.prototype);return e.__wbg_ptr=t,ow.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ow.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint224_free(t,0)}decompress(){const t=n.compressedfheuint224_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Cr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint224_deserialize(e,r);if(s[2])throw o(s[1]);return cn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint224_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint224_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return cn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint224_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return cn.__wrap(r[0])}serialize(){const t=n.compressedfheuint224_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(cn.prototype[Symbol.dispose]=cn.prototype.free);const aw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint232_free(i>>>0,1));class ln{static __wrap(t){t=t>>>0;const e=Object.create(ln.prototype);return e.__wbg_ptr=t,aw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,aw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint232_free(t,0)}decompress(){const t=n.compressedfheuint232_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return zr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint232_deserialize(e,r);if(s[2])throw o(s[1]);return ln.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint232_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint232_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ln.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint232_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ln.__wrap(r[0])}serialize(){const t=n.compressedfheuint232_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ln.prototype[Symbol.dispose]=ln.prototype.free);const cw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint24_free(i>>>0,1));class pn{static __wrap(t){t=t>>>0;const e=Object.create(pn.prototype);return e.__wbg_ptr=t,cw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,cw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint24_free(t,0)}decompress(){const t=n.compressedfheuint24_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ir.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint24_deserialize(e,r);if(s[2])throw o(s[1]);return pn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint24_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint24_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return pn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint24_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return pn.__wrap(r[0])}serialize(){const t=n.compressedfheuint24_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(pn.prototype[Symbol.dispose]=pn.prototype.free);const lw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint240_free(i>>>0,1));class fn{static __wrap(t){t=t>>>0;const e=Object.create(fn.prototype);return e.__wbg_ptr=t,lw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,lw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint240_free(t,0)}decompress(){const t=n.compressedfheuint240_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Gr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint240_deserialize(e,r);if(s[2])throw o(s[1]);return fn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint240_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint240_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return fn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint240_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return fn.__wrap(r[0])}serialize(){const t=n.compressedfheuint240_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(fn.prototype[Symbol.dispose]=fn.prototype.free);const pw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint248_free(i>>>0,1));class hn{static __wrap(t){t=t>>>0;const e=Object.create(hn.prototype);return e.__wbg_ptr=t,pw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,pw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint248_free(t,0)}decompress(){const t=n.compressedfheuint248_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Br.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint248_deserialize(e,r);if(s[2])throw o(s[1]);return hn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint248_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint248_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return hn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint248_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return hn.__wrap(r[0])}serialize(){const t=n.compressedfheuint248_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(hn.prototype[Symbol.dispose]=hn.prototype.free);const fw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint256_free(i>>>0,1));class un{static __wrap(t){t=t>>>0;const e=Object.create(un.prototype);return e.__wbg_ptr=t,fw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,fw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint256_free(t,0)}decompress(){const t=n.compressedfheuint256_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Nr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint256_deserialize(e,r);if(s[2])throw o(s[1]);return un.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint256_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint256_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return un.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint256_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return un.__wrap(r[0])}serialize(){const t=n.compressedfheuint256_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(un.prototype[Symbol.dispose]=un.prototype.free);const hw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint32_free(i>>>0,1));class dn{static __wrap(t){t=t>>>0;const e=Object.create(dn.prototype);return e.__wbg_ptr=t,hw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,hw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint32_free(t,0)}decompress(){const t=n.compressedfheuint32_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Kr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint32_deserialize(e,r);if(s[2])throw o(s[1]);return dn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint32_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint32_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return dn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint32_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return dn.__wrap(r[0])}serialize(){const t=n.compressedfheuint32_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(dn.prototype[Symbol.dispose]=dn.prototype.free);const uw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint4_free(i>>>0,1));class wn{static __wrap(t){t=t>>>0;const e=Object.create(wn.prototype);return e.__wbg_ptr=t,uw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,uw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint4_free(t,0)}decompress(){const t=n.compressedfheuint4_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return vr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint4_deserialize(e,r);if(s[2])throw o(s[1]);return wn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint4_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint4_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return wn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint4_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return wn.__wrap(r[0])}serialize(){const t=n.compressedfheuint4_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(wn.prototype[Symbol.dispose]=wn.prototype.free);const dw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint40_free(i>>>0,1));class gn{static __wrap(t){t=t>>>0;const e=Object.create(gn.prototype);return e.__wbg_ptr=t,dw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,dw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint40_free(t,0)}decompress(){const t=n.compressedfheuint40_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return xr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint40_deserialize(e,r);if(s[2])throw o(s[1]);return gn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint40_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint40_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return gn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint40_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return gn.__wrap(r[0])}serialize(){const t=n.compressedfheuint40_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(gn.prototype[Symbol.dispose]=gn.prototype.free);const ww=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint48_free(i>>>0,1));class An{static __wrap(t){t=t>>>0;const e=Object.create(An.prototype);return e.__wbg_ptr=t,ww.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ww.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint48_free(t,0)}decompress(){const t=n.compressedfheuint48_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Ur.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint48_deserialize(e,r);if(s[2])throw o(s[1]);return An.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint48_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint48_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return An.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint48_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return An.__wrap(r[0])}serialize(){const t=n.compressedfheuint48_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(An.prototype[Symbol.dispose]=An.prototype.free);const gw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint512_free(i>>>0,1));class bn{static __wrap(t){t=t>>>0;const e=Object.create(bn.prototype);return e.__wbg_ptr=t,gw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,gw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint512_free(t,0)}decompress(){const t=n.compressedfheuint512_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Tr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint512_deserialize(e,r);if(s[2])throw o(s[1]);return bn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint512_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint512_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return bn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint512_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return bn.__wrap(r[0])}serialize(){const t=n.compressedfheuint512_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(bn.prototype[Symbol.dispose]=bn.prototype.free);const Aw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint56_free(i>>>0,1));class yn{static __wrap(t){t=t>>>0;const e=Object.create(yn.prototype);return e.__wbg_ptr=t,Aw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Aw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint56_free(t,0)}decompress(){const t=n.compressedfheuint56_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Or.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint56_deserialize(e,r);if(s[2])throw o(s[1]);return yn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint56_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint56_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return yn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint56_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return yn.__wrap(r[0])}serialize(){const t=n.compressedfheuint56_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(yn.prototype[Symbol.dispose]=yn.prototype.free);const bw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint6_free(i>>>0,1));class Sn{static __wrap(t){t=t>>>0;const e=Object.create(Sn.prototype);return e.__wbg_ptr=t,bw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,bw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint6_free(t,0)}decompress(){const t=n.compressedfheuint6_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return kr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint6_deserialize(e,r);if(s[2])throw o(s[1]);return Sn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint6_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint6_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Sn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint6_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Sn.__wrap(r[0])}serialize(){const t=n.compressedfheuint6_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Sn.prototype[Symbol.dispose]=Sn.prototype.free);const yw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint64_free(i>>>0,1));class mn{static __wrap(t){t=t>>>0;const e=Object.create(mn.prototype);return e.__wbg_ptr=t,yw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,yw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint64_free(t,0)}decompress(){const t=n.compressedfheuint64_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Vr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint64_deserialize(e,r);if(s[2])throw o(s[1]);return mn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint64_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint64_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return mn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint64_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return mn.__wrap(r[0])}serialize(){const t=n.compressedfheuint64_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(mn.prototype[Symbol.dispose]=mn.prototype.free);const Sw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint72_free(i>>>0,1));class Rn{static __wrap(t){t=t>>>0;const e=Object.create(Rn.prototype);return e.__wbg_ptr=t,Sw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Sw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint72_free(t,0)}decompress(){const t=n.compressedfheuint72_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Fr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint72_deserialize(e,r);if(s[2])throw o(s[1]);return Rn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint72_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint72_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Rn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint72_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Rn.__wrap(r[0])}serialize(){const t=n.compressedfheuint72_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Rn.prototype[Symbol.dispose]=Rn.prototype.free);const mw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint8_free(i>>>0,1));class Pn{static __wrap(t){t=t>>>0;const e=Object.create(Pn.prototype);return e.__wbg_ptr=t,mw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,mw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint8_free(t,0)}decompress(){const t=n.compressedfheuint8_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Yr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint8_deserialize(e,r);if(s[2])throw o(s[1]);return Pn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint8_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint8_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Pn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint8_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Pn.__wrap(r[0])}serialize(){const t=n.compressedfheuint8_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Pn.prototype[Symbol.dispose]=Pn.prototype.free);const Rw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint80_free(i>>>0,1));class Mn{static __wrap(t){t=t>>>0;const e=Object.create(Mn.prototype);return e.__wbg_ptr=t,Rw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Rw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint80_free(t,0)}decompress(){const t=n.compressedfheuint80_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Dr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint80_deserialize(e,r);if(s[2])throw o(s[1]);return Mn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint80_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint80_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Mn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint80_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Mn.__wrap(r[0])}serialize(){const t=n.compressedfheuint80_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Mn.prototype[Symbol.dispose]=Mn.prototype.free);const Pw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint88_free(i>>>0,1));class En{static __wrap(t){t=t>>>0;const e=Object.create(En.prototype);return e.__wbg_ptr=t,Pw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Pw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint88_free(t,0)}decompress(){const t=n.compressedfheuint88_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return jr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint88_deserialize(e,r);if(s[2])throw o(s[1]);return En.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint88_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint88_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return En.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint88_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return En.__wrap(r[0])}serialize(){const t=n.compressedfheuint88_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(En.prototype[Symbol.dispose]=En.prototype.free);const Mw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_compressedfheuint96_free(i>>>0,1));class Cn{static __wrap(t){t=t>>>0;const e=Object.create(Cn.prototype);return e.__wbg_ptr=t,Mw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Mw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_compressedfheuint96_free(t,0)}decompress(){const t=n.compressedfheuint96_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return Lr.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.compressedfheuint96_deserialize(e,r);if(s[2])throw o(s[1]);return Cn.__wrap(s[0])}safe_serialize(t){const e=n.compressedfheuint96_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.compressedfheuint96_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Cn.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.compressedfheuint96_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Cn.__wrap(r[0])}serialize(){const t=n.compressedfheuint96_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Cn.prototype[Symbol.dispose]=Cn.prototype.free);const Ew=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fhebool_free(i>>>0,1));class ge{static __wrap(t){t=t>>>0;const e=Object.create(ge.prototype);return e.__wbg_ptr=t,Ew.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ew.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fhebool_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fhebool_deserialize(e,r);if(s[2])throw o(s[1]);return ge.__wrap(s[0])}safe_serialize(t){const e=n.fhebool_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fhebool_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ge.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fhebool_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ge.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fhebool_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ge.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fhebool_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ge.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fhebool_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]!==0}serialize(){const t=n.fhebool_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ge.prototype[Symbol.dispose]=ge.prototype.free);const Cw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint10_free(i>>>0,1));class Ae{static __wrap(t){t=t>>>0;const e=Object.create(Ae.prototype);return e.__wbg_ptr=t,Cw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Cw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint10_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint10_deserialize(e,r);if(s[2])throw o(s[1]);return Ae.__wrap(s[0])}safe_serialize(t){const e=n.fheint10_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint10_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ae.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint10_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ae.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint10_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ae.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint10_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ae.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint10_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint10_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ae.prototype[Symbol.dispose]=Ae.prototype.free);const zw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint1024_free(i>>>0,1));class be{static __wrap(t){t=t>>>0;const e=Object.create(be.prototype);return e.__wbg_ptr=t,zw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,zw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint1024_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint1024_deserialize(e,r);if(s[2])throw o(s[1]);return be.__wrap(s[0])}safe_serialize(t){const e=n.fheint1024_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint1024_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return be.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint1024_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return be.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint1024_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return be.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint1024_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return be.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint1024_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint1024_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(be.prototype[Symbol.dispose]=be.prototype.free);const Iw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint104_free(i>>>0,1));class ye{static __wrap(t){t=t>>>0;const e=Object.create(ye.prototype);return e.__wbg_ptr=t,Iw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Iw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint104_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint104_deserialize(e,r);if(s[2])throw o(s[1]);return ye.__wrap(s[0])}safe_serialize(t){const e=n.fheint104_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint104_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ye.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint104_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ye.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint104_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ye.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint104_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ye.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint104_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint104_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ye.prototype[Symbol.dispose]=ye.prototype.free);const Gw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint112_free(i>>>0,1));class Se{static __wrap(t){t=t>>>0;const e=Object.create(Se.prototype);return e.__wbg_ptr=t,Gw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Gw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint112_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint112_deserialize(e,r);if(s[2])throw o(s[1]);return Se.__wrap(s[0])}safe_serialize(t){const e=n.fheint112_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint112_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Se.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint112_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Se.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint112_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Se.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint112_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Se.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint112_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint112_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Se.prototype[Symbol.dispose]=Se.prototype.free);const Bw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint12_free(i>>>0,1));class me{static __wrap(t){t=t>>>0;const e=Object.create(me.prototype);return e.__wbg_ptr=t,Bw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Bw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint12_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint12_deserialize(e,r);if(s[2])throw o(s[1]);return me.__wrap(s[0])}safe_serialize(t){const e=n.fheint12_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint12_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return me.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint12_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return me.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint12_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return me.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint12_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return me.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint12_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint12_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(me.prototype[Symbol.dispose]=me.prototype.free);const Nw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint120_free(i>>>0,1));class Re{static __wrap(t){t=t>>>0;const e=Object.create(Re.prototype);return e.__wbg_ptr=t,Nw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Nw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint120_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint120_deserialize(e,r);if(s[2])throw o(s[1]);return Re.__wrap(s[0])}safe_serialize(t){const e=n.fheint120_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint120_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Re.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint120_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Re.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint120_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Re.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint120_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Re.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint120_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint120_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Re.prototype[Symbol.dispose]=Re.prototype.free);const Kw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint128_free(i>>>0,1));class Pe{static __wrap(t){t=t>>>0;const e=Object.create(Pe.prototype);return e.__wbg_ptr=t,Kw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Kw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint128_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint128_deserialize(e,r);if(s[2])throw o(s[1]);return Pe.__wrap(s[0])}safe_serialize(t){const e=n.fheint128_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint128_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Pe.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint128_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Pe.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint128_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Pe.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint128_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Pe.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint128_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint128_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Pe.prototype[Symbol.dispose]=Pe.prototype.free);const vw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint136_free(i>>>0,1));class Me{static __wrap(t){t=t>>>0;const e=Object.create(Me.prototype);return e.__wbg_ptr=t,vw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,vw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint136_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint136_deserialize(e,r);if(s[2])throw o(s[1]);return Me.__wrap(s[0])}safe_serialize(t){const e=n.fheint136_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint136_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Me.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint136_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Me.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint136_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Me.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint136_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Me.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint136_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint136_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Me.prototype[Symbol.dispose]=Me.prototype.free);const xw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint14_free(i>>>0,1));class Ee{static __wrap(t){t=t>>>0;const e=Object.create(Ee.prototype);return e.__wbg_ptr=t,xw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,xw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint14_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint14_deserialize(e,r);if(s[2])throw o(s[1]);return Ee.__wrap(s[0])}safe_serialize(t){const e=n.fheint14_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint14_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ee.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint14_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ee.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint14_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ee.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint14_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ee.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint14_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint14_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ee.prototype[Symbol.dispose]=Ee.prototype.free);const Uw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint144_free(i>>>0,1));class Ce{static __wrap(t){t=t>>>0;const e=Object.create(Ce.prototype);return e.__wbg_ptr=t,Uw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Uw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint144_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint144_deserialize(e,r);if(s[2])throw o(s[1]);return Ce.__wrap(s[0])}safe_serialize(t){const e=n.fheint144_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint144_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ce.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint144_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ce.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint144_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ce.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint144_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ce.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint144_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint144_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ce.prototype[Symbol.dispose]=Ce.prototype.free);const Tw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint152_free(i>>>0,1));class ze{static __wrap(t){t=t>>>0;const e=Object.create(ze.prototype);return e.__wbg_ptr=t,Tw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Tw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint152_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint152_deserialize(e,r);if(s[2])throw o(s[1]);return ze.__wrap(s[0])}safe_serialize(t){const e=n.fheint152_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint152_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ze.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint152_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ze.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint152_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ze.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint152_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ze.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint152_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint152_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ze.prototype[Symbol.dispose]=ze.prototype.free);const Ow=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint16_free(i>>>0,1));class Ie{static __wrap(t){t=t>>>0;const e=Object.create(Ie.prototype);return e.__wbg_ptr=t,Ow.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ow.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint16_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint16_deserialize(e,r);if(s[2])throw o(s[1]);return Ie.__wrap(s[0])}safe_serialize(t){const e=n.fheint16_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint16_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ie.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint16_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ie.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint16_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ie.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint16_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ie.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint16_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint16_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ie.prototype[Symbol.dispose]=Ie.prototype.free);const kw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint160_free(i>>>0,1));class Ge{static __wrap(t){t=t>>>0;const e=Object.create(Ge.prototype);return e.__wbg_ptr=t,kw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,kw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint160_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint160_deserialize(e,r);if(s[2])throw o(s[1]);return Ge.__wrap(s[0])}safe_serialize(t){const e=n.fheint160_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint160_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ge.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint160_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ge.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint160_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ge.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint160_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ge.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint160_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint160_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ge.prototype[Symbol.dispose]=Ge.prototype.free);const Vw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint168_free(i>>>0,1));class Be{static __wrap(t){t=t>>>0;const e=Object.create(Be.prototype);return e.__wbg_ptr=t,Vw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Vw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint168_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint168_deserialize(e,r);if(s[2])throw o(s[1]);return Be.__wrap(s[0])}safe_serialize(t){const e=n.fheint168_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint168_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Be.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint168_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Be.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint168_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Be.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint168_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Be.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint168_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint168_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Be.prototype[Symbol.dispose]=Be.prototype.free);const Fw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint176_free(i>>>0,1));class Ne{static __wrap(t){t=t>>>0;const e=Object.create(Ne.prototype);return e.__wbg_ptr=t,Fw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Fw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint176_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint176_deserialize(e,r);if(s[2])throw o(s[1]);return Ne.__wrap(s[0])}safe_serialize(t){const e=n.fheint176_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint176_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ne.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint176_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ne.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint176_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ne.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint176_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ne.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint176_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint176_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ne.prototype[Symbol.dispose]=Ne.prototype.free);const Yw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint184_free(i>>>0,1));class Ke{static __wrap(t){t=t>>>0;const e=Object.create(Ke.prototype);return e.__wbg_ptr=t,Yw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Yw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint184_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint184_deserialize(e,r);if(s[2])throw o(s[1]);return Ke.__wrap(s[0])}safe_serialize(t){const e=n.fheint184_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint184_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ke.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint184_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ke.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint184_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ke.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint184_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ke.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint184_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint184_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ke.prototype[Symbol.dispose]=Ke.prototype.free);const Dw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint192_free(i>>>0,1));class ve{static __wrap(t){t=t>>>0;const e=Object.create(ve.prototype);return e.__wbg_ptr=t,Dw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Dw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint192_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint192_deserialize(e,r);if(s[2])throw o(s[1]);return ve.__wrap(s[0])}safe_serialize(t){const e=n.fheint192_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint192_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ve.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint192_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ve.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint192_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ve.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint192_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ve.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint192_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint192_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ve.prototype[Symbol.dispose]=ve.prototype.free);const jw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint2_free(i>>>0,1));class xe{static __wrap(t){t=t>>>0;const e=Object.create(xe.prototype);return e.__wbg_ptr=t,jw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,jw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint2_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint2_deserialize(e,r);if(s[2])throw o(s[1]);return xe.__wrap(s[0])}safe_serialize(t){const e=n.fheint2_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint2_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return xe.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint2_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return xe.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint2_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return xe.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint2_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return xe.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint2_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint2_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(xe.prototype[Symbol.dispose]=xe.prototype.free);const Lw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint200_free(i>>>0,1));class Ue{static __wrap(t){t=t>>>0;const e=Object.create(Ue.prototype);return e.__wbg_ptr=t,Lw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Lw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint200_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint200_deserialize(e,r);if(s[2])throw o(s[1]);return Ue.__wrap(s[0])}safe_serialize(t){const e=n.fheint200_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint200_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ue.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint200_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ue.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint200_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ue.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint200_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ue.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint200_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint200_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ue.prototype[Symbol.dispose]=Ue.prototype.free);const Hw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint2048_free(i>>>0,1));class Te{static __wrap(t){t=t>>>0;const e=Object.create(Te.prototype);return e.__wbg_ptr=t,Hw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Hw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint2048_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint2048_deserialize(e,r);if(s[2])throw o(s[1]);return Te.__wrap(s[0])}safe_serialize(t){const e=n.fheint2048_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint2048_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Te.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint2048_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Te.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint2048_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Te.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint2048_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Te.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint2048_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint2048_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Te.prototype[Symbol.dispose]=Te.prototype.free);const Jw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint208_free(i>>>0,1));class Oe{static __wrap(t){t=t>>>0;const e=Object.create(Oe.prototype);return e.__wbg_ptr=t,Jw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Jw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint208_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint208_deserialize(e,r);if(s[2])throw o(s[1]);return Oe.__wrap(s[0])}safe_serialize(t){const e=n.fheint208_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint208_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Oe.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint208_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Oe.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint208_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Oe.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint208_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Oe.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint208_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint208_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Oe.prototype[Symbol.dispose]=Oe.prototype.free);const Qw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint216_free(i>>>0,1));class ke{static __wrap(t){t=t>>>0;const e=Object.create(ke.prototype);return e.__wbg_ptr=t,Qw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Qw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint216_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint216_deserialize(e,r);if(s[2])throw o(s[1]);return ke.__wrap(s[0])}safe_serialize(t){const e=n.fheint216_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint216_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ke.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint216_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ke.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint216_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ke.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint216_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ke.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint216_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint216_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ke.prototype[Symbol.dispose]=ke.prototype.free);const $w=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint224_free(i>>>0,1));class Ve{static __wrap(t){t=t>>>0;const e=Object.create(Ve.prototype);return e.__wbg_ptr=t,$w.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,$w.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint224_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint224_deserialize(e,r);if(s[2])throw o(s[1]);return Ve.__wrap(s[0])}safe_serialize(t){const e=n.fheint224_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint224_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ve.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint224_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ve.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint224_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ve.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint224_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ve.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint224_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint224_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ve.prototype[Symbol.dispose]=Ve.prototype.free);const Ww=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint232_free(i>>>0,1));class Fe{static __wrap(t){t=t>>>0;const e=Object.create(Fe.prototype);return e.__wbg_ptr=t,Ww.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ww.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint232_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint232_deserialize(e,r);if(s[2])throw o(s[1]);return Fe.__wrap(s[0])}safe_serialize(t){const e=n.fheint232_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint232_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Fe.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint232_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Fe.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint232_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Fe.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint232_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Fe.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint232_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint232_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Fe.prototype[Symbol.dispose]=Fe.prototype.free);const Zw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint24_free(i>>>0,1));class Ye{static __wrap(t){t=t>>>0;const e=Object.create(Ye.prototype);return e.__wbg_ptr=t,Zw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Zw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint24_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint24_deserialize(e,r);if(s[2])throw o(s[1]);return Ye.__wrap(s[0])}safe_serialize(t){const e=n.fheint24_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint24_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ye.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint24_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ye.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint24_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ye.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint24_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ye.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint24_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint24_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ye.prototype[Symbol.dispose]=Ye.prototype.free);const qw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint240_free(i>>>0,1));class De{static __wrap(t){t=t>>>0;const e=Object.create(De.prototype);return e.__wbg_ptr=t,qw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,qw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint240_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint240_deserialize(e,r);if(s[2])throw o(s[1]);return De.__wrap(s[0])}safe_serialize(t){const e=n.fheint240_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint240_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return De.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint240_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return De.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint240_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return De.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint240_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return De.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint240_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint240_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(De.prototype[Symbol.dispose]=De.prototype.free);const Xw=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint248_free(i>>>0,1));class je{static __wrap(t){t=t>>>0;const e=Object.create(je.prototype);return e.__wbg_ptr=t,Xw.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Xw.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint248_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint248_deserialize(e,r);if(s[2])throw o(s[1]);return je.__wrap(s[0])}safe_serialize(t){const e=n.fheint248_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint248_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return je.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint248_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return je.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint248_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return je.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint248_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return je.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint248_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint248_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(je.prototype[Symbol.dispose]=je.prototype.free);const tg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint256_free(i>>>0,1));class Le{static __wrap(t){t=t>>>0;const e=Object.create(Le.prototype);return e.__wbg_ptr=t,tg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,tg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint256_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint256_deserialize(e,r);if(s[2])throw o(s[1]);return Le.__wrap(s[0])}safe_serialize(t){const e=n.fheint256_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint256_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Le.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint256_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Le.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint256_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Le.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint256_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Le.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint256_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint256_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Le.prototype[Symbol.dispose]=Le.prototype.free);const eg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint32_free(i>>>0,1));class He{static __wrap(t){t=t>>>0;const e=Object.create(He.prototype);return e.__wbg_ptr=t,eg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,eg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint32_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint32_deserialize(e,r);if(s[2])throw o(s[1]);return He.__wrap(s[0])}safe_serialize(t){const e=n.fheint32_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint32_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return He.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint32_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return He.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint32_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return He.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint32_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return He.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint32_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint32_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(He.prototype[Symbol.dispose]=He.prototype.free);const rg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint4_free(i>>>0,1));class Je{static __wrap(t){t=t>>>0;const e=Object.create(Je.prototype);return e.__wbg_ptr=t,rg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,rg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint4_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint4_deserialize(e,r);if(s[2])throw o(s[1]);return Je.__wrap(s[0])}safe_serialize(t){const e=n.fheint4_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint4_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Je.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint4_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Je.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint4_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Je.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint4_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Je.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint4_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint4_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Je.prototype[Symbol.dispose]=Je.prototype.free);const ig=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint40_free(i>>>0,1));class Qe{static __wrap(t){t=t>>>0;const e=Object.create(Qe.prototype);return e.__wbg_ptr=t,ig.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ig.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint40_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint40_deserialize(e,r);if(s[2])throw o(s[1]);return Qe.__wrap(s[0])}safe_serialize(t){const e=n.fheint40_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint40_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Qe.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint40_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Qe.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint40_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Qe.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint40_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Qe.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint40_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint40_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Qe.prototype[Symbol.dispose]=Qe.prototype.free);const sg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint48_free(i>>>0,1));class $e{static __wrap(t){t=t>>>0;const e=Object.create($e.prototype);return e.__wbg_ptr=t,sg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,sg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint48_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint48_deserialize(e,r);if(s[2])throw o(s[1]);return $e.__wrap(s[0])}safe_serialize(t){const e=n.fheint48_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint48_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return $e.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint48_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return $e.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint48_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return $e.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint48_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return $e.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint48_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint48_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&($e.prototype[Symbol.dispose]=$e.prototype.free);const ng=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint512_free(i>>>0,1));class We{static __wrap(t){t=t>>>0;const e=Object.create(We.prototype);return e.__wbg_ptr=t,ng.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ng.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint512_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint512_deserialize(e,r);if(s[2])throw o(s[1]);return We.__wrap(s[0])}safe_serialize(t){const e=n.fheint512_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint512_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return We.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint512_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return We.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint512_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return We.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint512_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return We.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint512_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint512_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(We.prototype[Symbol.dispose]=We.prototype.free);const _g=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint56_free(i>>>0,1));class Ze{static __wrap(t){t=t>>>0;const e=Object.create(Ze.prototype);return e.__wbg_ptr=t,_g.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,_g.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint56_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint56_deserialize(e,r);if(s[2])throw o(s[1]);return Ze.__wrap(s[0])}safe_serialize(t){const e=n.fheint56_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint56_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ze.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint56_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ze.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint56_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ze.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint56_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ze.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint56_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint56_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ze.prototype[Symbol.dispose]=Ze.prototype.free);const og=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint6_free(i>>>0,1));class qe{static __wrap(t){t=t>>>0;const e=Object.create(qe.prototype);return e.__wbg_ptr=t,og.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,og.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint6_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint6_deserialize(e,r);if(s[2])throw o(s[1]);return qe.__wrap(s[0])}safe_serialize(t){const e=n.fheint6_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint6_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return qe.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint6_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return qe.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint6_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return qe.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint6_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return qe.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint6_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint6_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(qe.prototype[Symbol.dispose]=qe.prototype.free);const ag=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint64_free(i>>>0,1));class Xe{static __wrap(t){t=t>>>0;const e=Object.create(Xe.prototype);return e.__wbg_ptr=t,ag.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ag.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint64_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint64_deserialize(e,r);if(s[2])throw o(s[1]);return Xe.__wrap(s[0])}safe_serialize(t){const e=n.fheint64_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint64_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Xe.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint64_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Xe.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint64_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Xe.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint64_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Xe.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint64_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint64_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Xe.prototype[Symbol.dispose]=Xe.prototype.free);const cg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint72_free(i>>>0,1));class tr{static __wrap(t){t=t>>>0;const e=Object.create(tr.prototype);return e.__wbg_ptr=t,cg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,cg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint72_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint72_deserialize(e,r);if(s[2])throw o(s[1]);return tr.__wrap(s[0])}safe_serialize(t){const e=n.fheint72_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint72_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return tr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint72_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return tr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint72_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return tr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint72_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return tr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint72_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint72_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(tr.prototype[Symbol.dispose]=tr.prototype.free);const lg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint8_free(i>>>0,1));class er{static __wrap(t){t=t>>>0;const e=Object.create(er.prototype);return e.__wbg_ptr=t,lg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,lg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint8_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint8_deserialize(e,r);if(s[2])throw o(s[1]);return er.__wrap(s[0])}safe_serialize(t){const e=n.fheint8_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint8_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return er.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint8_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return er.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint8_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return er.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint8_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return er.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint8_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheint8_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(er.prototype[Symbol.dispose]=er.prototype.free);const pg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint80_free(i>>>0,1));class rr{static __wrap(t){t=t>>>0;const e=Object.create(rr.prototype);return e.__wbg_ptr=t,pg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,pg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint80_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint80_deserialize(e,r);if(s[2])throw o(s[1]);return rr.__wrap(s[0])}safe_serialize(t){const e=n.fheint80_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint80_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return rr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint80_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return rr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint80_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return rr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint80_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return rr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint80_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint80_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(rr.prototype[Symbol.dispose]=rr.prototype.free);const fg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint88_free(i>>>0,1));class ir{static __wrap(t){t=t>>>0;const e=Object.create(ir.prototype);return e.__wbg_ptr=t,fg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,fg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint88_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint88_deserialize(e,r);if(s[2])throw o(s[1]);return ir.__wrap(s[0])}safe_serialize(t){const e=n.fheint88_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint88_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ir.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint88_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ir.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint88_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ir.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint88_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ir.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint88_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint88_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ir.prototype[Symbol.dispose]=ir.prototype.free);const hg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheint96_free(i>>>0,1));class sr{static __wrap(t){t=t>>>0;const e=Object.create(sr.prototype);return e.__wbg_ptr=t,hg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,hg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheint96_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheint96_deserialize(e,r);if(s[2])throw o(s[1]);return sr.__wrap(s[0])}safe_serialize(t){const e=n.fheint96_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheint96_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return sr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheint96_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return sr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheint96_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return sr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheint96_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return sr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheint96_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheint96_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(sr.prototype[Symbol.dispose]=sr.prototype.free);const ug=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint10_free(i>>>0,1));class nr{static __wrap(t){t=t>>>0;const e=Object.create(nr.prototype);return e.__wbg_ptr=t,ug.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ug.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint10_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint10_deserialize(e,r);if(s[2])throw o(s[1]);return nr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint10_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint10_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return nr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint10_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return nr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint10_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return nr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint10_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return nr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint10_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheuint10_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(nr.prototype[Symbol.dispose]=nr.prototype.free);const dg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint1024_free(i>>>0,1));class _r{static __wrap(t){t=t>>>0;const e=Object.create(_r.prototype);return e.__wbg_ptr=t,dg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,dg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint1024_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint1024_deserialize(e,r);if(s[2])throw o(s[1]);return _r.__wrap(s[0])}safe_serialize(t){const e=n.fheuint1024_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint1024_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return _r.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint1024_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return _r.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint1024_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return _r.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint1024_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return _r.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint1024_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint1024_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(_r.prototype[Symbol.dispose]=_r.prototype.free);const wg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint104_free(i>>>0,1));class or{static __wrap(t){t=t>>>0;const e=Object.create(or.prototype);return e.__wbg_ptr=t,wg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,wg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint104_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint104_deserialize(e,r);if(s[2])throw o(s[1]);return or.__wrap(s[0])}safe_serialize(t){const e=n.fheuint104_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint104_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return or.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint104_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return or.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint104_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return or.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint104_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return or.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint104_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint104_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(or.prototype[Symbol.dispose]=or.prototype.free);const gg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint112_free(i>>>0,1));class ar{static __wrap(t){t=t>>>0;const e=Object.create(ar.prototype);return e.__wbg_ptr=t,gg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,gg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint112_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint112_deserialize(e,r);if(s[2])throw o(s[1]);return ar.__wrap(s[0])}safe_serialize(t){const e=n.fheuint112_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint112_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ar.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint112_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ar.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint112_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ar.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint112_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ar.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint112_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint112_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ar.prototype[Symbol.dispose]=ar.prototype.free);const Ag=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint12_free(i>>>0,1));class cr{static __wrap(t){t=t>>>0;const e=Object.create(cr.prototype);return e.__wbg_ptr=t,Ag.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ag.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint12_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint12_deserialize(e,r);if(s[2])throw o(s[1]);return cr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint12_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint12_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return cr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint12_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return cr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint12_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return cr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint12_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return cr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint12_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheuint12_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(cr.prototype[Symbol.dispose]=cr.prototype.free);const bg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint120_free(i>>>0,1));class lr{static __wrap(t){t=t>>>0;const e=Object.create(lr.prototype);return e.__wbg_ptr=t,bg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,bg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint120_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint120_deserialize(e,r);if(s[2])throw o(s[1]);return lr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint120_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint120_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return lr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint120_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return lr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint120_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return lr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint120_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return lr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint120_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint120_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(lr.prototype[Symbol.dispose]=lr.prototype.free);const yg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint128_free(i>>>0,1));class pr{static __wrap(t){t=t>>>0;const e=Object.create(pr.prototype);return e.__wbg_ptr=t,yg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,yg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint128_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint128_deserialize(e,r);if(s[2])throw o(s[1]);return pr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint128_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint128_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return pr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint128_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return pr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint128_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return pr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint128_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return pr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint128_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint128_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(pr.prototype[Symbol.dispose]=pr.prototype.free);const Sg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint136_free(i>>>0,1));class fr{static __wrap(t){t=t>>>0;const e=Object.create(fr.prototype);return e.__wbg_ptr=t,Sg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Sg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint136_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint136_deserialize(e,r);if(s[2])throw o(s[1]);return fr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint136_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint136_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return fr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint136_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return fr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint136_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return fr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint136_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return fr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint136_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint136_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(fr.prototype[Symbol.dispose]=fr.prototype.free);const mg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint14_free(i>>>0,1));class hr{static __wrap(t){t=t>>>0;const e=Object.create(hr.prototype);return e.__wbg_ptr=t,mg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,mg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint14_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint14_deserialize(e,r);if(s[2])throw o(s[1]);return hr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint14_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint14_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return hr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint14_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return hr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint14_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return hr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint14_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return hr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint14_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheuint14_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(hr.prototype[Symbol.dispose]=hr.prototype.free);const Rg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint144_free(i>>>0,1));class ur{static __wrap(t){t=t>>>0;const e=Object.create(ur.prototype);return e.__wbg_ptr=t,Rg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Rg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint144_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint144_deserialize(e,r);if(s[2])throw o(s[1]);return ur.__wrap(s[0])}safe_serialize(t){const e=n.fheuint144_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint144_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return ur.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint144_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ur.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint144_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ur.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint144_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return ur.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint144_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint144_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(ur.prototype[Symbol.dispose]=ur.prototype.free);const Pg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint152_free(i>>>0,1));class dr{static __wrap(t){t=t>>>0;const e=Object.create(dr.prototype);return e.__wbg_ptr=t,Pg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Pg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint152_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint152_deserialize(e,r);if(s[2])throw o(s[1]);return dr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint152_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint152_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return dr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint152_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return dr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint152_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return dr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint152_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return dr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint152_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint152_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(dr.prototype[Symbol.dispose]=dr.prototype.free);const Mg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint16_free(i>>>0,1));class wr{static __wrap(t){t=t>>>0;const e=Object.create(wr.prototype);return e.__wbg_ptr=t,Mg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Mg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint16_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint16_deserialize(e,r);if(s[2])throw o(s[1]);return wr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint16_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint16_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return wr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint16_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return wr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint16_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return wr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint16_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return wr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint16_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheuint16_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(wr.prototype[Symbol.dispose]=wr.prototype.free);const Eg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint160_free(i>>>0,1));class gr{static __wrap(t){t=t>>>0;const e=Object.create(gr.prototype);return e.__wbg_ptr=t,Eg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Eg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint160_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint160_deserialize(e,r);if(s[2])throw o(s[1]);return gr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint160_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint160_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return gr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint160_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return gr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint160_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return gr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint160_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return gr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint160_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint160_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(gr.prototype[Symbol.dispose]=gr.prototype.free);const Cg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint168_free(i>>>0,1));class Ar{static __wrap(t){t=t>>>0;const e=Object.create(Ar.prototype);return e.__wbg_ptr=t,Cg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Cg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint168_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint168_deserialize(e,r);if(s[2])throw o(s[1]);return Ar.__wrap(s[0])}safe_serialize(t){const e=n.fheuint168_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint168_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ar.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint168_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ar.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint168_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ar.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint168_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ar.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint168_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint168_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ar.prototype[Symbol.dispose]=Ar.prototype.free);const zg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint176_free(i>>>0,1));class br{static __wrap(t){t=t>>>0;const e=Object.create(br.prototype);return e.__wbg_ptr=t,zg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,zg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint176_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint176_deserialize(e,r);if(s[2])throw o(s[1]);return br.__wrap(s[0])}safe_serialize(t){const e=n.fheuint176_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint176_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return br.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint176_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return br.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint176_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return br.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint176_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return br.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint176_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint176_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(br.prototype[Symbol.dispose]=br.prototype.free);const Ig=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint184_free(i>>>0,1));class yr{static __wrap(t){t=t>>>0;const e=Object.create(yr.prototype);return e.__wbg_ptr=t,Ig.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ig.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint184_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint184_deserialize(e,r);if(s[2])throw o(s[1]);return yr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint184_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint184_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return yr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint184_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return yr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint184_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return yr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint184_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return yr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint184_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint184_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(yr.prototype[Symbol.dispose]=yr.prototype.free);const Gg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint192_free(i>>>0,1));class Sr{static __wrap(t){t=t>>>0;const e=Object.create(Sr.prototype);return e.__wbg_ptr=t,Gg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Gg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint192_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint192_deserialize(e,r);if(s[2])throw o(s[1]);return Sr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint192_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint192_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Sr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint192_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Sr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint192_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Sr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint192_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Sr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint192_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint192_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Sr.prototype[Symbol.dispose]=Sr.prototype.free);const Bg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint2_free(i>>>0,1));class mr{static __wrap(t){t=t>>>0;const e=Object.create(mr.prototype);return e.__wbg_ptr=t,Bg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Bg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint2_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint2_deserialize(e,r);if(s[2])throw o(s[1]);return mr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint2_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint2_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return mr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint2_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return mr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint2_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return mr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint2_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return mr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint2_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheuint2_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(mr.prototype[Symbol.dispose]=mr.prototype.free);const Ng=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint200_free(i>>>0,1));class Rr{static __wrap(t){t=t>>>0;const e=Object.create(Rr.prototype);return e.__wbg_ptr=t,Ng.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ng.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint200_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint200_deserialize(e,r);if(s[2])throw o(s[1]);return Rr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint200_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint200_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Rr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint200_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Rr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint200_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Rr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint200_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Rr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint200_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint200_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Rr.prototype[Symbol.dispose]=Rr.prototype.free);const Kg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint2048_free(i>>>0,1));class Pr{static __wrap(t){t=t>>>0;const e=Object.create(Pr.prototype);return e.__wbg_ptr=t,Kg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Kg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint2048_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint2048_deserialize(e,r);if(s[2])throw o(s[1]);return Pr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint2048_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint2048_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Pr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint2048_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Pr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint2048_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Pr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint2048_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Pr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint2048_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint2048_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Pr.prototype[Symbol.dispose]=Pr.prototype.free);const vg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint208_free(i>>>0,1));class Mr{static __wrap(t){t=t>>>0;const e=Object.create(Mr.prototype);return e.__wbg_ptr=t,vg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,vg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint208_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint208_deserialize(e,r);if(s[2])throw o(s[1]);return Mr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint208_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint208_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Mr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint208_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Mr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint208_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Mr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint208_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Mr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint208_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint208_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Mr.prototype[Symbol.dispose]=Mr.prototype.free);const xg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint216_free(i>>>0,1));class Er{static __wrap(t){t=t>>>0;const e=Object.create(Er.prototype);return e.__wbg_ptr=t,xg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,xg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint216_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint216_deserialize(e,r);if(s[2])throw o(s[1]);return Er.__wrap(s[0])}safe_serialize(t){const e=n.fheuint216_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint216_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Er.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint216_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Er.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint216_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Er.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint216_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Er.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint216_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint216_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Er.prototype[Symbol.dispose]=Er.prototype.free);const Ug=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint224_free(i>>>0,1));class Cr{static __wrap(t){t=t>>>0;const e=Object.create(Cr.prototype);return e.__wbg_ptr=t,Ug.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ug.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint224_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint224_deserialize(e,r);if(s[2])throw o(s[1]);return Cr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint224_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint224_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Cr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint224_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Cr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint224_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Cr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint224_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Cr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint224_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint224_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Cr.prototype[Symbol.dispose]=Cr.prototype.free);const Tg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint232_free(i>>>0,1));class zr{static __wrap(t){t=t>>>0;const e=Object.create(zr.prototype);return e.__wbg_ptr=t,Tg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Tg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint232_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint232_deserialize(e,r);if(s[2])throw o(s[1]);return zr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint232_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint232_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return zr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint232_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return zr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint232_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return zr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint232_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return zr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint232_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint232_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(zr.prototype[Symbol.dispose]=zr.prototype.free);const Og=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint24_free(i>>>0,1));class Ir{static __wrap(t){t=t>>>0;const e=Object.create(Ir.prototype);return e.__wbg_ptr=t,Og.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Og.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint24_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint24_deserialize(e,r);if(s[2])throw o(s[1]);return Ir.__wrap(s[0])}safe_serialize(t){const e=n.fheuint24_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint24_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ir.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint24_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ir.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint24_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ir.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint24_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ir.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint24_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]>>>0}serialize(){const t=n.fheuint24_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ir.prototype[Symbol.dispose]=Ir.prototype.free);const kg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint240_free(i>>>0,1));class Gr{static __wrap(t){t=t>>>0;const e=Object.create(Gr.prototype);return e.__wbg_ptr=t,kg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,kg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint240_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint240_deserialize(e,r);if(s[2])throw o(s[1]);return Gr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint240_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint240_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Gr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint240_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Gr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint240_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Gr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint240_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Gr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint240_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint240_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Gr.prototype[Symbol.dispose]=Gr.prototype.free);const Vg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint248_free(i>>>0,1));class Br{static __wrap(t){t=t>>>0;const e=Object.create(Br.prototype);return e.__wbg_ptr=t,Vg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Vg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint248_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint248_deserialize(e,r);if(s[2])throw o(s[1]);return Br.__wrap(s[0])}safe_serialize(t){const e=n.fheuint248_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint248_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Br.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint248_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Br.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint248_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Br.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint248_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Br.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint248_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint248_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Br.prototype[Symbol.dispose]=Br.prototype.free);const Fg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint256_free(i>>>0,1));class Nr{static __wrap(t){t=t>>>0;const e=Object.create(Nr.prototype);return e.__wbg_ptr=t,Fg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Fg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint256_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint256_deserialize(e,r);if(s[2])throw o(s[1]);return Nr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint256_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint256_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Nr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint256_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Nr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint256_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Nr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint256_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Nr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint256_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint256_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Nr.prototype[Symbol.dispose]=Nr.prototype.free);const Yg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint32_free(i>>>0,1));class Kr{static __wrap(t){t=t>>>0;const e=Object.create(Kr.prototype);return e.__wbg_ptr=t,Yg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Yg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint32_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint32_deserialize(e,r);if(s[2])throw o(s[1]);return Kr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint32_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint32_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Kr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint32_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Kr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint32_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Kr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint32_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Kr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint32_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]>>>0}serialize(){const t=n.fheuint32_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Kr.prototype[Symbol.dispose]=Kr.prototype.free);const Dg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint4_free(i>>>0,1));class vr{static __wrap(t){t=t>>>0;const e=Object.create(vr.prototype);return e.__wbg_ptr=t,Dg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Dg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint4_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint4_deserialize(e,r);if(s[2])throw o(s[1]);return vr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint4_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint4_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return vr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint4_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return vr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint4_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return vr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint4_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return vr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint4_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheuint4_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(vr.prototype[Symbol.dispose]=vr.prototype.free);const jg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint40_free(i>>>0,1));class xr{static __wrap(t){t=t>>>0;const e=Object.create(xr.prototype);return e.__wbg_ptr=t,jg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,jg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint40_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint40_deserialize(e,r);if(s[2])throw o(s[1]);return xr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint40_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint40_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return xr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint40_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return xr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint40_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return xr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint40_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return xr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint40_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return BigInt.asUintN(64,e[0])}serialize(){const t=n.fheuint40_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(xr.prototype[Symbol.dispose]=xr.prototype.free);const Lg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint48_free(i>>>0,1));class Ur{static __wrap(t){t=t>>>0;const e=Object.create(Ur.prototype);return e.__wbg_ptr=t,Lg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Lg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint48_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint48_deserialize(e,r);if(s[2])throw o(s[1]);return Ur.__wrap(s[0])}safe_serialize(t){const e=n.fheuint48_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint48_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Ur.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint48_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ur.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint48_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ur.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint48_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Ur.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint48_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return BigInt.asUintN(64,e[0])}serialize(){const t=n.fheuint48_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Ur.prototype[Symbol.dispose]=Ur.prototype.free);const Hg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint512_free(i>>>0,1));class Tr{static __wrap(t){t=t>>>0;const e=Object.create(Tr.prototype);return e.__wbg_ptr=t,Hg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Hg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint512_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint512_deserialize(e,r);if(s[2])throw o(s[1]);return Tr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint512_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint512_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Tr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint512_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Tr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint512_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Tr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint512_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Tr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint512_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint512_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Tr.prototype[Symbol.dispose]=Tr.prototype.free);const Jg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint56_free(i>>>0,1));class Or{static __wrap(t){t=t>>>0;const e=Object.create(Or.prototype);return e.__wbg_ptr=t,Jg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Jg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint56_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint56_deserialize(e,r);if(s[2])throw o(s[1]);return Or.__wrap(s[0])}safe_serialize(t){const e=n.fheuint56_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint56_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Or.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint56_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Or.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint56_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Or.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint56_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Or.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint56_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return BigInt.asUintN(64,e[0])}serialize(){const t=n.fheuint56_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Or.prototype[Symbol.dispose]=Or.prototype.free);const Qg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint6_free(i>>>0,1));class kr{static __wrap(t){t=t>>>0;const e=Object.create(kr.prototype);return e.__wbg_ptr=t,Qg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Qg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint6_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint6_deserialize(e,r);if(s[2])throw o(s[1]);return kr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint6_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint6_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return kr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint6_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return kr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint6_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return kr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint6_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return kr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint6_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheuint6_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(kr.prototype[Symbol.dispose]=kr.prototype.free);const $g=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint64_free(i>>>0,1));class Vr{static __wrap(t){t=t>>>0;const e=Object.create(Vr.prototype);return e.__wbg_ptr=t,$g.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,$g.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint64_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint64_deserialize(e,r);if(s[2])throw o(s[1]);return Vr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint64_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint64_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Vr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint64_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Vr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint64_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Vr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint64_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Vr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint64_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return BigInt.asUintN(64,e[0])}serialize(){const t=n.fheuint64_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Vr.prototype[Symbol.dispose]=Vr.prototype.free);const Wg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint72_free(i>>>0,1));class Fr{static __wrap(t){t=t>>>0;const e=Object.create(Fr.prototype);return e.__wbg_ptr=t,Wg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Wg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint72_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint72_deserialize(e,r);if(s[2])throw o(s[1]);return Fr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint72_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint72_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Fr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint72_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Fr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint72_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Fr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint72_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Fr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint72_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint72_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Fr.prototype[Symbol.dispose]=Fr.prototype.free);const Zg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint8_free(i>>>0,1));class Yr{static __wrap(t){t=t>>>0;const e=Object.create(Yr.prototype);return e.__wbg_ptr=t,Zg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Zg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint8_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint8_deserialize(e,r);if(s[2])throw o(s[1]);return Yr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint8_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint8_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Yr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint8_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Yr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint8_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Yr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint8_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Yr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint8_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return e[0]}serialize(){const t=n.fheuint8_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Yr.prototype[Symbol.dispose]=Yr.prototype.free);const qg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint80_free(i>>>0,1));class Dr{static __wrap(t){t=t>>>0;const e=Object.create(Dr.prototype);return e.__wbg_ptr=t,qg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,qg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint80_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint80_deserialize(e,r);if(s[2])throw o(s[1]);return Dr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint80_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint80_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Dr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint80_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Dr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint80_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Dr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint80_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Dr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint80_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint80_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Dr.prototype[Symbol.dispose]=Dr.prototype.free);const Xg=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint88_free(i>>>0,1));class jr{static __wrap(t){t=t>>>0;const e=Object.create(jr.prototype);return e.__wbg_ptr=t,Xg.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Xg.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint88_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint88_deserialize(e,r);if(s[2])throw o(s[1]);return jr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint88_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint88_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return jr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint88_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return jr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint88_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return jr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint88_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return jr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint88_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint88_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(jr.prototype[Symbol.dispose]=jr.prototype.free);const t1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_fheuint96_free(i>>>0,1));class Lr{static __wrap(t){t=t>>>0;const e=Object.create(Lr.prototype);return e.__wbg_ptr=t,t1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,t1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_fheuint96_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.fheuint96_deserialize(e,r);if(s[2])throw o(s[1]);return Lr.__wrap(s[0])}safe_serialize(t){const e=n.fheuint96_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.fheuint96_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Lr.__wrap(_[0])}static encrypt_with_client_key(t,e){f(e,A);const r=n.fheuint96_encrypt_with_client_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Lr.__wrap(r[0])}static encrypt_with_public_key(t,e){f(e,z);const r=n.fheuint96_encrypt_with_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Lr.__wrap(r[0])}static encrypt_with_compressed_public_key(t,e){f(e,I);const r=n.fheuint96_encrypt_with_compressed_public_key(t,e.__wbg_ptr);if(r[2])throw o(r[1]);return Lr.__wrap(r[0])}decrypt(t){f(t,A);const e=n.fheuint96_decrypt(this.__wbg_ptr,t.__wbg_ptr);if(e[2])throw o(e[1]);return o(e[0])}serialize(){const t=n.fheuint96_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Lr.prototype[Symbol.dispose]=Lr.prototype.free);const e1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_provencompactciphertextlist_free(i>>>0,1));class Gi{static __wrap(t){t=t>>>0;const e=Object.create(Gi.prototype);return e.__wbg_ptr=t,e1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,e1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_provencompactciphertextlist_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.provencompactciphertextlist_deserialize(e,r);if(s[2])throw o(s[1]);return Gi.__wrap(s[0])}get_kind_of(t){const e=n.provencompactciphertextlist_get_kind_of(this.__wbg_ptr,t);return e===84?void 0:e}safe_serialize(t){const e=n.provencompactciphertextlist_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.provencompactciphertextlist_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return Gi.__wrap(_[0])}verify_and_expand(t,e,r){f(t,oe),f(e,te);const s=w(r,n.__wbindgen_malloc),_=h,a=n.provencompactciphertextlist_verify_and_expand(this.__wbg_ptr,t.__wbg_ptr,e.__wbg_ptr,s,_);if(a[2])throw o(a[1]);return Zi.__wrap(a[0])}expand_without_verification(){const t=n.provencompactciphertextlist_expand_without_verification(this.__wbg_ptr);if(t[2])throw o(t[1]);return Zi.__wrap(t[0])}len(){return n.compactciphertextlistexpander_len(this.__wbg_ptr)>>>0}static builder(t){f(t,te);const e=n.provencompactciphertextlist_builder(t.__wbg_ptr);if(e[2])throw o(e[1]);return __.__wrap(e[0])}is_empty(){return n.compactciphertextlistexpander_is_empty(this.__wbg_ptr)!==0}serialize(){const t=n.provencompactciphertextlist_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(Gi.prototype[Symbol.dispose]=Gi.prototype.free);const tm=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_shortint_free(i>>>0,1));class Hl{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,tm.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_shortint_free(t,0)}static new_client_key(t){f(t,ui);const e=n.shortint_new_client_key(t.__wbg_ptr);return Lt.__wrap(e)}static new_parameters(t,e,r,s,_,a,c,l,p,u,d,b,S,R,m){f(s,Xt),f(_,Xt);const P=n.shortint_new_parameters(t,e,r,s.__wbg_ptr,_.__wbg_ptr,a,c,l,p,u,d,b,S,R,m);return ui.__wrap(P)}static new_public_key(t){f(t,Lt);const e=n.shortint_new_public_key(t.__wbg_ptr);return vi.__wrap(e)}static try_new_t_uniform(t){const e=n.shortint_try_new_t_uniform(t);if(e[2])throw o(e[1]);return Xt.__wrap(e[0])}static encrypt_compressed(t,e){f(t,Lt);const r=n.shortint_encrypt_compressed(t.__wbg_ptr,e);return Ni.__wrap(r)}static serialize_ciphertext(t){f(t,Hr);const e=n.shortint_serialize_ciphertext(t.__wbg_ptr);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static serialize_client_key(t){f(t,Lt);const e=n.shortint_serialize_client_key(t.__wbg_ptr);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static serialize_public_key(t){f(t,vi);const e=n.shortint_serialize_public_key(t.__wbg_ptr);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static decompress_ciphertext(t){f(t,Ni);const e=n.shortint_decompress_ciphertext(t.__wbg_ptr);return Hr.__wrap(e)}static deserialize_ciphertext(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.shortint_deserialize_ciphertext(e,r);if(s[2])throw o(s[1]);return Hr.__wrap(s[0])}static deserialize_client_key(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.shortint_deserialize_client_key(e,r);if(s[2])throw o(s[1]);return Lt.__wrap(s[0])}static deserialize_public_key(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.shortint_deserialize_public_key(e,r);if(s[2])throw o(s[1]);return vi.__wrap(s[0])}static encrypt_with_public_key(t,e){f(t,vi);const r=n.shortint_encrypt_with_public_key(t.__wbg_ptr,e);return Hr.__wrap(r)}static new_compressed_public_key(t){f(t,Lt);const e=n.shortint_new_compressed_public_key(t.__wbg_ptr);return Ki.__wrap(e)}static new_compressed_server_key(t){f(t,Lt);const e=n.shortint_new_compressed_server_key(t.__wbg_ptr);return zn.__wrap(e)}static new_gaussian_from_std_dev(t){const e=n.shortint_new_gaussian_from_std_dev(t);return Xt.__wrap(e)}static serialize_compressed_ciphertext(t){f(t,Ni);const e=n.shortint_serialize_compressed_ciphertext(t.__wbg_ptr);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static serialize_compressed_public_key(t){f(t,Ki);const e=n.shortint_serialize_compressed_public_key(t.__wbg_ptr);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static serialize_compressed_server_key(t){f(t,zn);const e=n.shortint_serialize_compressed_server_key(t.__wbg_ptr);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static deserialize_compressed_ciphertext(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.shortint_deserialize_compressed_ciphertext(e,r);if(s[2])throw o(s[1]);return Ni.__wrap(s[0])}static deserialize_compressed_public_key(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.shortint_deserialize_compressed_public_key(e,r);if(s[2])throw o(s[1]);return Ki.__wrap(s[0])}static deserialize_compressed_server_key(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.shortint_deserialize_compressed_server_key(e,r);if(s[2])throw o(s[1]);return zn.__wrap(s[0])}static encrypt_with_compressed_public_key(t,e){f(t,Ki);const r=n.shortint_encrypt_with_compressed_public_key(t.__wbg_ptr,e);return Hr.__wrap(r)}static new_client_key_from_seed_and_parameters(t,e,r){f(r,ui);const s=n.shortint_new_client_key_from_seed_and_parameters(t,e,r.__wbg_ptr);return Lt.__wrap(s)}static decrypt(t,e){f(t,Lt),f(e,Hr);const r=n.shortint_decrypt(t.__wbg_ptr,e.__wbg_ptr);return BigInt.asUintN(64,r)}static encrypt(t,e){f(t,Lt);const r=n.shortint_encrypt(t.__wbg_ptr,e);return Hr.__wrap(r)}}Symbol.dispose&&(Hl.prototype[Symbol.dispose]=Hl.prototype.free);const r1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_shortintciphertext_free(i>>>0,1));class Hr{static __wrap(t){t=t>>>0;const e=Object.create(Hr.prototype);return e.__wbg_ptr=t,r1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,r1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_shortintciphertext_free(t,0)}}Symbol.dispose&&(Hr.prototype[Symbol.dispose]=Hr.prototype.free);const i1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_shortintclientkey_free(i>>>0,1));class Lt{static __wrap(t){t=t>>>0;const e=Object.create(Lt.prototype);return e.__wbg_ptr=t,i1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,i1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_shortintclientkey_free(t,0)}}Symbol.dispose&&(Lt.prototype[Symbol.dispose]=Lt.prototype.free);const Jl=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_shortintcompactpublickeyencryptionparameters_free(i>>>0,1));class Bi{static __wrap(t){t=t>>>0;const e=Object.create(Bi.prototype);return e.__wbg_ptr=t,Jl.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Jl.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_shortintcompactpublickeyencryptionparameters_free(t,0)}static new_parameters(t,e,r,s,_,a,c,l){f(e,Xt);const p=n.shortintcompactpublickeyencryptionparameters_new_parameters(t,e.__wbg_ptr,r,s,_,a,c,l);if(p[2])throw o(p[1]);return Bi.__wrap(p[0])}constructor(t){const e=n.shortintcompactpublickeyencryptionparameters_new(t);return this.__wbg_ptr=e>>>0,Jl.register(this,this.__wbg_ptr,this),this}}Symbol.dispose&&(Bi.prototype[Symbol.dispose]=Bi.prototype.free);const s1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_shortintcompressedciphertext_free(i>>>0,1));class Ni{static __wrap(t){t=t>>>0;const e=Object.create(Ni.prototype);return e.__wbg_ptr=t,s1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,s1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_shortintcompressedciphertext_free(t,0)}}Symbol.dispose&&(Ni.prototype[Symbol.dispose]=Ni.prototype.free);const n1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_shortintcompressedpublickey_free(i>>>0,1));class Ki{static __wrap(t){t=t>>>0;const e=Object.create(Ki.prototype);return e.__wbg_ptr=t,n1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,n1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_shortintcompressedpublickey_free(t,0)}}Symbol.dispose&&(Ki.prototype[Symbol.dispose]=Ki.prototype.free);const _1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_shortintcompressedserverkey_free(i>>>0,1));class zn{static __wrap(t){t=t>>>0;const e=Object.create(zn.prototype);return e.__wbg_ptr=t,_1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,_1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_shortintcompressedserverkey_free(t,0)}}Symbol.dispose&&(zn.prototype[Symbol.dispose]=zn.prototype.free);const o1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_shortintnoisedistribution_free(i>>>0,1));class Xt{static __wrap(t){t=t>>>0;const e=Object.create(Xt.prototype);return e.__wbg_ptr=t,o1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,o1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_shortintnoisedistribution_free(t,0)}}Symbol.dispose&&(Xt.prototype[Symbol.dispose]=Xt.prototype.free);const Ql=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_shortintparameters_free(i>>>0,1));class ui{static __wrap(t){t=t>>>0;const e=Object.create(ui.prototype);return e.__wbg_ptr=t,Ql.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ql.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_shortintparameters_free(t,0)}ks_base_log(){return n.shortintparameters_ks_base_log(this.__wbg_ptr)>>>0}pbs_base_log(){return n.shortintparameters_pbs_base_log(this.__wbg_ptr)>>>0}set_ks_level(t){n.shortintparameters_set_ks_level(this.__wbg_ptr,t)}carry_modulus(){const t=n.shortintparameters_carry_modulus(this.__wbg_ptr);return BigInt.asUintN(64,t)}lwe_dimension(){return n.shortintparameters_lwe_dimension(this.__wbg_ptr)>>>0}set_pbs_level(t){n.shortintparameters_set_pbs_level(this.__wbg_ptr,t)}glwe_dimension(){return n.shortintparameters_glwe_dimension(this.__wbg_ptr)>>>0}message_modulus(){const t=n.shortintparameters_message_modulus(this.__wbg_ptr);return BigInt.asUintN(64,t)}polynomial_size(){return n.shortintparameters_polynomial_size(this.__wbg_ptr)>>>0}set_ks_base_log(t){n.shortintparameters_set_ks_base_log(this.__wbg_ptr,t)}set_pbs_base_log(t){n.shortintparameters_set_pbs_base_log(this.__wbg_ptr,t)}set_carry_modulus(t){n.shortintparameters_set_carry_modulus(this.__wbg_ptr,t)}set_lwe_dimension(t){n.shortintparameters_set_lwe_dimension(this.__wbg_ptr,t)}set_glwe_dimension(t){n.shortintparameters_set_glwe_dimension(this.__wbg_ptr,t)}set_message_modulus(t){n.shortintparameters_set_message_modulus(this.__wbg_ptr,t)}set_polynomial_size(t){n.shortintparameters_set_polynomial_size(this.__wbg_ptr,t)}encryption_key_choice(){return n.shortintparameters_encryption_key_choice(this.__wbg_ptr)}lwe_noise_distribution(){const t=n.shortintparameters_glwe_noise_distribution(this.__wbg_ptr);return Xt.__wrap(t)}glwe_noise_distribution(){const t=n.shortintparameters_glwe_noise_distribution(this.__wbg_ptr);return Xt.__wrap(t)}set_encryption_key_choice(t){n.shortintparameters_set_encryption_key_choice(this.__wbg_ptr,t)}set_lwe_noise_distribution(t){f(t,Xt),n.shortintparameters_set_lwe_noise_distribution(this.__wbg_ptr,t.__wbg_ptr)}set_glwe_noise_distribution(t){f(t,Xt),n.shortintparameters_set_glwe_noise_distribution(this.__wbg_ptr,t.__wbg_ptr)}constructor(t){const e=n.shortintparameters_new(t);return this.__wbg_ptr=e>>>0,Ql.register(this,this.__wbg_ptr,this),this}ks_level(){return n.shortintparameters_ks_level(this.__wbg_ptr)>>>0}pbs_level(){return n.shortintparameters_pbs_level(this.__wbg_ptr)>>>0}}Symbol.dispose&&(ui.prototype[Symbol.dispose]=ui.prototype.free);const a1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_shortintpublickey_free(i>>>0,1));class vi{static __wrap(t){t=t>>>0;const e=Object.create(vi.prototype);return e.__wbg_ptr=t,a1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,a1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_shortintpublickey_free(t,0)}}Symbol.dispose&&(vi.prototype[Symbol.dispose]=vi.prototype.free);const c1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_tfheclientkey_free(i>>>0,1));class A{static __wrap(t){t=t>>>0;const e=Object.create(A.prototype);return e.__wbg_ptr=t,c1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,c1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_tfheclientkey_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.tfheclientkey_deserialize(e,r);if(s[2])throw o(s[1]);return A.__wrap(s[0])}safe_serialize(t){const e=n.tfheclientkey_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.tfheclientkey_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return A.__wrap(_[0])}static generate_with_seed(t,e){f(t,Ui);const r=n.tfheclientkey_generate_with_seed(t.__wbg_ptr,e);if(r[2])throw o(r[1]);return A.__wrap(r[0])}static generate(t){f(t,Ui);const e=n.tfheclientkey_generate(t.__wbg_ptr);if(e[2])throw o(e[1]);return A.__wrap(e[0])}serialize(){const t=n.tfheclientkey_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(A.prototype[Symbol.dispose]=A.prototype.free);const l1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_tfhecompactpublickey_free(i>>>0,1));class te{static __wrap(t){t=t>>>0;const e=Object.create(te.prototype);return e.__wbg_ptr=t,l1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,l1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_tfhecompactpublickey_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.tfhecompactpublickey_deserialize(e,r);if(s[2])throw o(s[1]);return te.__wrap(s[0])}safe_serialize(t){const e=n.tfhecompactpublickey_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.tfhecompactpublickey_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return te.__wrap(_[0])}static safe_deserialize_conformant(t,e,r){const s=w(t,n.__wbindgen_malloc),_=h;f(r,Bi);const a=n.tfhecompactpublickey_safe_deserialize_conformant(s,_,e,r.__wbg_ptr);if(a[2])throw o(a[1]);return te.__wrap(a[0])}static new(t){f(t,A);const e=n.tfhecompactpublickey_new(t.__wbg_ptr);if(e[2])throw o(e[1]);return te.__wrap(e[0])}serialize(){const t=n.tfhecompactpublickey_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(te.prototype[Symbol.dispose]=te.prototype.free);const p1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_tfhecompressedcompactpublickey_free(i>>>0,1));class xi{static __wrap(t){t=t>>>0;const e=Object.create(xi.prototype);return e.__wbg_ptr=t,p1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,p1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_tfhecompressedcompactpublickey_free(t,0)}decompress(){const t=n.tfhecompressedcompactpublickey_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return te.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.tfhecompressedcompactpublickey_deserialize(e,r);if(s[2])throw o(s[1]);return xi.__wrap(s[0])}safe_serialize(t){const e=n.tfhecompressedcompactpublickey_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.tfhecompressedcompactpublickey_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return xi.__wrap(_[0])}static safe_deserialize_conformant(t,e,r){const s=w(t,n.__wbindgen_malloc),_=h;f(r,Bi);const a=n.tfhecompressedcompactpublickey_safe_deserialize_conformant(s,_,e,r.__wbg_ptr);if(a[2])throw o(a[1]);return xi.__wrap(a[0])}static new(t){f(t,A);const e=n.tfhecompressedcompactpublickey_new(t.__wbg_ptr);if(e[2])throw o(e[1]);return xi.__wrap(e[0])}serialize(){const t=n.tfhecompressedcompactpublickey_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(xi.prototype[Symbol.dispose]=xi.prototype.free);const f1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_tfhecompressedpublickey_free(i>>>0,1));class I{static __wrap(t){t=t>>>0;const e=Object.create(I.prototype);return e.__wbg_ptr=t,f1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,f1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_tfhecompressedpublickey_free(t,0)}decompress(){const t=n.tfhecompressedpublickey_decompress(this.__wbg_ptr);if(t[2])throw o(t[1]);return z.__wrap(t[0])}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.tfhecompressedpublickey_deserialize(e,r);if(s[2])throw o(s[1]);return I.__wrap(s[0])}safe_serialize(t){const e=n.tfhecompressedpublickey_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.tfhecompressedpublickey_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return I.__wrap(_[0])}static new(t){f(t,A);const e=n.tfhecompressedpublickey_new(t.__wbg_ptr);if(e[2])throw o(e[1]);return I.__wrap(e[0])}serialize(){const t=n.tfhecompressedpublickey_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(I.prototype[Symbol.dispose]=I.prototype.free);const h1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_tfhecompressedserverkey_free(i>>>0,1));class In{static __wrap(t){t=t>>>0;const e=Object.create(In.prototype);return e.__wbg_ptr=t,h1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,h1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_tfhecompressedserverkey_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.tfhecompressedserverkey_deserialize(e,r);if(s[2])throw o(s[1]);return In.__wrap(s[0])}safe_serialize(t){const e=n.tfhecompressedserverkey_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.tfhecompressedserverkey_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return In.__wrap(_[0])}static new(t){f(t,A);const e=n.tfhecompressedserverkey_new(t.__wbg_ptr);if(e[2])throw o(e[1]);return In.__wrap(e[0])}serialize(){const t=n.tfhecompressedserverkey_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(In.prototype[Symbol.dispose]=In.prototype.free);const u1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_tfheconfig_free(i>>>0,1));class Ui{static __wrap(t){t=t>>>0;const e=Object.create(Ui.prototype);return e.__wbg_ptr=t,u1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,u1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_tfheconfig_free(t,0)}}Symbol.dispose&&(Ui.prototype[Symbol.dispose]=Ui.prototype.free);const d1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_tfheconfigbuilder_free(i>>>0,1));class Ti{static __wrap(t){t=t>>>0;const e=Object.create(Ti.prototype);return e.__wbg_ptr=t,d1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,d1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_tfheconfigbuilder_free(t,0)}use_custom_parameters(t){const e=this.__destroy_into_raw();f(t,ui);const r=n.tfheconfigbuilder_use_custom_parameters(e,t.__wbg_ptr);return Ti.__wrap(r)}static with_custom_parameters(t){f(t,ui);const e=n.tfheconfigbuilder_with_custom_parameters(t.__wbg_ptr);return Ti.__wrap(e)}use_dedicated_compact_public_key_parameters(t){const e=this.__destroy_into_raw();f(t,Bi);const r=n.tfheconfigbuilder_use_dedicated_compact_public_key_parameters(e,t.__wbg_ptr);return Ti.__wrap(r)}build(){const t=this.__destroy_into_raw(),e=n.tfheconfigbuilder_build(t);return Ui.__wrap(e)}static default(){const t=n.tfheconfigbuilder_default();return Ti.__wrap(t)}}Symbol.dispose&&(Ti.prototype[Symbol.dispose]=Ti.prototype.free);const w1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_tfhepublickey_free(i>>>0,1));class z{static __wrap(t){t=t>>>0;const e=Object.create(z.prototype);return e.__wbg_ptr=t,w1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,w1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_tfhepublickey_free(t,0)}static deserialize(t){const e=w(t,n.__wbindgen_malloc),r=h,s=n.tfhepublickey_deserialize(e,r);if(s[2])throw o(s[1]);return z.__wrap(s[0])}safe_serialize(t){const e=n.tfhepublickey_safe_serialize(this.__wbg_ptr,t);if(e[3])throw o(e[2]);var r=g(e[0],e[1]).slice();return n.__wbindgen_free(e[0],e[1]*1,1),r}static safe_deserialize(t,e){const r=w(t,n.__wbindgen_malloc),s=h,_=n.tfhepublickey_safe_deserialize(r,s,e);if(_[2])throw o(_[1]);return z.__wrap(_[0])}static new(t){f(t,A);const e=n.tfhepublickey_new(t.__wbg_ptr);if(e[2])throw o(e[1]);return z.__wrap(e[0])}serialize(){const t=n.tfhepublickey_serialize(this.__wbg_ptr);if(t[3])throw o(t[2]);var e=g(t[0],t[1]).slice();return n.__wbindgen_free(t[0],t[1]*1,1),e}}Symbol.dispose&&(z.prototype[Symbol.dispose]=z.prototype.free);const g1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_tfheserverkey_free(i>>>0,1));class o_{static __wrap(t){t=t>>>0;const e=Object.create(o_.prototype);return e.__wbg_ptr=t,g1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,g1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_tfheserverkey_free(t,0)}static new(t){f(t,A);const e=n.tfheserverkey_new(t.__wbg_ptr);if(e[2])throw o(e[1]);return o_.__wrap(e[0])}}Symbol.dispose&&(o_.prototype[Symbol.dispose]=o_.prototype.free);const em=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_tfhe_free(i>>>0,1));class $l{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,em.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_tfhe_free(t,0)}}Symbol.dispose&&($l.prototype[Symbol.dispose]=$l.prototype.free);const A1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>n.__wbg_wbg_rayon_poolbuilder_free(i>>>0,1));class L_{static __wrap(t){t=t>>>0;const e=Object.create(L_.prototype);return e.__wbg_ptr=t,A1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,A1.unregister(this),t}free(){const t=this.__destroy_into_raw();n.__wbg_wbg_rayon_poolbuilder_free(t,0)}numThreads(){return n.wbg_rayon_poolbuilder_numThreads(this.__wbg_ptr)>>>0}build(){n.wbg_rayon_poolbuilder_build(this.__wbg_ptr)}receiver(){return n.wbg_rayon_poolbuilder_receiver(this.__wbg_ptr)>>>0}}Symbol.dispose&&(L_.prototype[Symbol.dispose]=L_.prototype.free);const rm=new Set(["basic","cors","default"]);async function im(i,t){if(typeof Response=="function"&&i instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(i,t)}catch(r){if(i.ok&&rm.has(i.type)&&i.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const e=await i.arrayBuffer();return await WebAssembly.instantiate(e,t)}else{const e=await WebAssembly.instantiate(i,t);return e instanceof WebAssembly.Instance?{instance:e,module:i}:e}}function b1(){const i={};return i.wbg={},i.wbg.__wbg_BigInt_40a77d45cca49470=function(){return D_(function(t){return BigInt(t)},arguments)},i.wbg.__wbg_BigInt_6adbfd8eb0f7ec07=function(t){return BigInt(t)},i.wbg.__wbg_Error_e17e777aac105295=function(t,e){return Error(s_(t,e))},i.wbg.__wbg_call_13410aac570ffff7=function(){return D_(function(t,e){return t.call(e)},arguments)},i.wbg.__wbg_call_a5400b25a865cfd8=function(){return D_(function(t,e,r){return t.call(e,r)},arguments)},i.wbg.__wbg_crypto_574e78ad8b13b65f=function(t){return t.crypto},i.wbg.__wbg_error_7534b8e9a36f1ab4=function(t,e){let r,s;try{r=t,s=e,console.error(s_(t,e))}finally{n.__wbindgen_free(r,s,1)}},i.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e=function(){return D_(function(t,e){t.getRandomValues(e)},arguments)},i.wbg.__wbg_getTime_6bb3f64e0f18f817=function(t){return t.getTime()},i.wbg.__wbg_instanceof_Window_12d20d558ef92592=function(t){let e;try{e=t instanceof Window}catch{e=!1}return e},i.wbg.__wbg_length_6bb7e81f9d7713e4=function(t){return t.length},i.wbg.__wbg_msCrypto_a61aeb35a24c1329=function(t){return t.msCrypto},i.wbg.__wbg_new0_b0a0a38c201e6df5=function(){return new Date},i.wbg.__wbg_new_8a6f238a6ece86ea=function(){return new Error},i.wbg.__wbg_newnoargs_254190557c45b4ec=function(t,e){return new Function(s_(t,e))},i.wbg.__wbg_newwithlength_a167dcc7aaa3ba77=function(t){return new Uint8Array(t>>>0)},i.wbg.__wbg_node_905d3e251edff8a2=function(t){return t.node},i.wbg.__wbg_process_dc0fbacc7c1c06f7=function(t){return t.process},i.wbg.__wbg_prototypesetcall_3d4a26c1ed734349=function(t,e,r){Uint8Array.prototype.set.call(g(t,e),r)},i.wbg.__wbg_randomFillSync_ac0988aba3254290=function(){return D_(function(t,e){t.randomFillSync(e)},arguments)},i.wbg.__wbg_require_60cc747a6bc5215a=function(){return D_(function(){return module.require},arguments)},i.wbg.__wbg_stack_0ed75d68575b0f3c=function(t,e){const r=e.stack,s=rc(r,n.__wbindgen_malloc,n.__wbindgen_realloc),_=h;fi().setInt32(t+4,_,!0),fi().setInt32(t+0,s,!0)},i.wbg.__wbg_startWorkers_2ca11761e08ff5d5=function(t,e,r){return k2(t,e,L_.__wrap(r))},i.wbg.__wbg_static_accessor_GLOBAL_8921f820c2ce3f12=function(){const t=typeof Xa>"u"?null:Xa;return n_(t)?0:Vo(t)},i.wbg.__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184=function(){const t=typeof globalThis>"u"?null:globalThis;return n_(t)?0:Vo(t)},i.wbg.__wbg_static_accessor_SELF_995b214ae681ff99=function(){const t=typeof self>"u"?null:self;return n_(t)?0:Vo(t)},i.wbg.__wbg_static_accessor_WINDOW_cde3890479c675ea=function(){const t=typeof window>"u"?null:window;return n_(t)?0:Vo(t)},i.wbg.__wbg_subarray_70fd07feefe14294=function(t,e,r){return t.subarray(e>>>0,r>>>0)},i.wbg.__wbg_toString_1f1286a7a97689fe=function(t,e,r){const s=e.toString(r),_=rc(s,n.__wbindgen_malloc,n.__wbindgen_realloc),a=h;fi().setInt32(t+4,a,!0),fi().setInt32(t+0,_,!0)},i.wbg.__wbg_toString_d8f537919ef401d6=function(t){return t.toString()},i.wbg.__wbg_versions_c01dfd4722a88165=function(t){return t.versions},i.wbg.__wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1=function(t,e){const r=e,s=typeof r=="bigint"?r:void 0;fi().setBigInt64(t+8,n_(s)?BigInt(0):s,!0),fi().setInt32(t+0,!n_(s),!0)},i.wbg.__wbg_wbindgenbitand_24bfc92ff26d44cb=function(t,e){return t&e},i.wbg.__wbg_wbindgenbitor_87169f71f306a104=function(t,e){return t|e},i.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d=function(t,e){const r=jl(e),s=rc(r,n.__wbindgen_malloc,n.__wbindgen_realloc),_=h;fi().setInt32(t+4,_,!0),fi().setInt32(t+0,s,!0)},i.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74=function(t){return typeof t=="function"},i.wbg.__wbg_wbindgenisobject_307a53c6bd97fbf8=function(t){const e=t;return typeof e=="object"&&e!==null},i.wbg.__wbg_wbindgenisstring_d4fa939789f003b0=function(t){return typeof t=="string"},i.wbg.__wbg_wbindgenisundefined_c4b71d073b92f3c5=function(t){return t===void 0},i.wbg.__wbg_wbindgenjsvaleq_e6f2ad59ccae1b58=function(t,e){return t===e},i.wbg.__wbg_wbindgenlt_544155a2b3097bd5=function(t,e){return t<e},i.wbg.__wbg_wbindgenmemory_d84da70f7c42d172=function(){return n.memory},i.wbg.__wbg_wbindgenmodule_7e59019f6366ff9c=function(){return ic.__wbindgen_wasm_module},i.wbg.__wbg_wbindgenneg_3577d8a6fd6fd98b=function(t){return-t},i.wbg.__wbg_wbindgenshl_54c6fe049ff902f0=function(t,e){return t<<e},i.wbg.__wbg_wbindgenshr_7d2aae6044c0dab1=function(t,e){return t>>e},i.wbg.__wbg_wbindgenstringget_0f16a6ddddef376f=function(t,e){const r=e,s=typeof r=="string"?r:void 0;var _=n_(s)?0:rc(s,n.__wbindgen_malloc,n.__wbindgen_realloc),a=h;fi().setInt32(t+4,a,!0),fi().setInt32(t+0,_,!0)},i.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6=function(t,e){throw new Error(s_(t,e))},i.wbg.__wbindgen_cast_2241b6af4c4b2941=function(t,e){return s_(t,e)},i.wbg.__wbindgen_cast_2ddd8a25ff58642a=function(t,e){return BigInt.asUintN(64,t)|e<<BigInt(64)},i.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(t){return BigInt.asUintN(64,t)},i.wbg.__wbindgen_cast_9ae0607507abb057=function(t){return t},i.wbg.__wbindgen_cast_cb9088102bce6b30=function(t,e){return g(t,e)},i.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(t){return t},i.wbg.__wbindgen_cast_e7b45dd881f38ce3=function(t,e){return BigInt.asUintN(64,t)|BigInt.asUintN(64,e)<<BigInt(64)},i.wbg.__wbindgen_init_externref_table=function(){const t=n.__wbindgen_export_2,e=t.grow(4);t.set(0,void 0),t.set(e+0,void 0),t.set(e+1,null),t.set(e+2,!0),t.set(e+3,!1)},i}function y1(i,t){i.wbg.memory=t||new WebAssembly.Memory({initial:21,maximum:16384,shared:!0})}function S1(i,t,e){if(n=i.exports,ic.__wbindgen_wasm_module=t,Yo=null,Fo=null,typeof e<"u"&&(typeof e!="number"||e===0||e%65536!==0))throw"invalid stack size";return n.__wbindgen_start(e),n}function sm(i,t){if(n!==void 0)return n;let e;typeof i<"u"&&(Object.getPrototypeOf(i)===Object.prototype?{module:i,memory:t,thread_stack_size:e}=i:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const r=b1();y1(r,t),i instanceof WebAssembly.Module||(i=new WebAssembly.Module(i));const s=new WebAssembly.Instance(i,r);return S1(s,i,e)}async function ic(i,t){if(n!==void 0)return n;let e;typeof i<"u"&&(Object.getPrototypeOf(i)===Object.prototype?{module_or_path:i,memory:t,thread_stack_size:e}=i:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof i>"u"&&(i=new URL("/tfhe_bg.wasm",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ft&&ft.tagName.toUpperCase()==="SCRIPT"&&ft.src||new URL("relayer-sdk-js.umd.cjs",document.baseURI).href));const r=b1();(typeof i=="string"||typeof Request=="function"&&i instanceof Request||typeof URL=="function"&&i instanceof URL)&&(i=fetch(i)),y1(r,t);const{instance:s,module:_}=await im(await i,r);return S1(s,_,e)}var nm=Object.freeze({__proto__:null,Boolean:Ll,BooleanCiphertext:we,BooleanClientKey:qt,BooleanCompressedCiphertext:Ei,BooleanCompressedServerKey:Wi,BooleanEncryptionKeyChoice:H2,BooleanNoiseDistribution:Ci,BooleanParameterSet:J2,BooleanParameters:zi,BooleanPublicKey:Ii,CompactCiphertextList:hi,CompactCiphertextListBuilder:__,CompactCiphertextListExpander:Zi,CompactPkeCrs:oe,CompressedFheBool:qi,CompressedFheInt10:Xi,CompressedFheInt1024:ts,CompressedFheInt104:es,CompressedFheInt112:rs,CompressedFheInt12:is,CompressedFheInt120:ss,CompressedFheInt128:ns,CompressedFheInt136:_s,CompressedFheInt14:os,CompressedFheInt144:as,CompressedFheInt152:cs,CompressedFheInt16:ls,CompressedFheInt160:ps,CompressedFheInt168:fs,CompressedFheInt176:hs,CompressedFheInt184:us,CompressedFheInt192:ds,CompressedFheInt2:ws,CompressedFheInt200:gs,CompressedFheInt2048:As,CompressedFheInt208:bs,CompressedFheInt216:ys,CompressedFheInt224:Ss,CompressedFheInt232:ms,CompressedFheInt24:Rs,CompressedFheInt240:Ps,CompressedFheInt248:Ms,CompressedFheInt256:Es,CompressedFheInt32:Cs,CompressedFheInt4:zs,CompressedFheInt40:Is,CompressedFheInt48:Gs,CompressedFheInt512:Bs,CompressedFheInt56:Ns,CompressedFheInt6:Ks,CompressedFheInt64:vs,CompressedFheInt72:xs,CompressedFheInt8:Us,CompressedFheInt80:Ts,CompressedFheInt88:Os,CompressedFheInt96:ks,CompressedFheUint10:Vs,CompressedFheUint1024:Fs,CompressedFheUint104:Ys,CompressedFheUint112:Ds,CompressedFheUint12:js,CompressedFheUint120:Ls,CompressedFheUint128:Hs,CompressedFheUint136:Js,CompressedFheUint14:Qs,CompressedFheUint144:$s,CompressedFheUint152:Ws,CompressedFheUint16:Zs,CompressedFheUint160:qs,CompressedFheUint168:Xs,CompressedFheUint176:tn,CompressedFheUint184:en,CompressedFheUint192:rn,CompressedFheUint2:sn,CompressedFheUint200:nn,CompressedFheUint2048:_n,CompressedFheUint208:on,CompressedFheUint216:an,CompressedFheUint224:cn,CompressedFheUint232:ln,CompressedFheUint24:pn,CompressedFheUint240:fn,CompressedFheUint248:hn,CompressedFheUint256:un,CompressedFheUint32:dn,CompressedFheUint4:wn,CompressedFheUint40:gn,CompressedFheUint48:An,CompressedFheUint512:bn,CompressedFheUint56:yn,CompressedFheUint6:Sn,CompressedFheUint64:mn,CompressedFheUint72:Rn,CompressedFheUint8:Pn,CompressedFheUint80:Mn,CompressedFheUint88:En,CompressedFheUint96:Cn,FheBool:ge,FheInt10:Ae,FheInt1024:be,FheInt104:ye,FheInt112:Se,FheInt12:me,FheInt120:Re,FheInt128:Pe,FheInt136:Me,FheInt14:Ee,FheInt144:Ce,FheInt152:ze,FheInt16:Ie,FheInt160:Ge,FheInt168:Be,FheInt176:Ne,FheInt184:Ke,FheInt192:ve,FheInt2:xe,FheInt200:Ue,FheInt2048:Te,FheInt208:Oe,FheInt216:ke,FheInt224:Ve,FheInt232:Fe,FheInt24:Ye,FheInt240:De,FheInt248:je,FheInt256:Le,FheInt32:He,FheInt4:Je,FheInt40:Qe,FheInt48:$e,FheInt512:We,FheInt56:Ze,FheInt6:qe,FheInt64:Xe,FheInt72:tr,FheInt8:er,FheInt80:rr,FheInt88:ir,FheInt96:sr,FheTypes:Q2,FheUint10:nr,FheUint1024:_r,FheUint104:or,FheUint112:ar,FheUint12:cr,FheUint120:lr,FheUint128:pr,FheUint136:fr,FheUint14:hr,FheUint144:ur,FheUint152:dr,FheUint16:wr,FheUint160:gr,FheUint168:Ar,FheUint176:br,FheUint184:yr,FheUint192:Sr,FheUint2:mr,FheUint200:Rr,FheUint2048:Pr,FheUint208:Mr,FheUint216:Er,FheUint224:Cr,FheUint232:zr,FheUint24:Ir,FheUint240:Gr,FheUint248:Br,FheUint256:Nr,FheUint32:Kr,FheUint4:vr,FheUint40:xr,FheUint48:Ur,FheUint512:Tr,FheUint56:Or,FheUint6:kr,FheUint64:Vr,FheUint72:Fr,FheUint8:Yr,FheUint80:Dr,FheUint88:jr,FheUint96:Lr,ProvenCompactCiphertextList:Gi,Shortint:Hl,ShortintCiphertext:Hr,ShortintClientKey:Lt,ShortintCompactPublicKeyEncryptionParameters:Bi,ShortintCompactPublicKeyEncryptionParametersName:$2,ShortintCompressedCiphertext:Ni,ShortintCompressedPublicKey:Ki,ShortintCompressedServerKey:zn,ShortintEncryptionKeyChoice:W2,ShortintNoiseDistribution:Xt,ShortintPBSOrder:Z2,ShortintParameters:ui,ShortintParametersName:q2,ShortintPublicKey:vi,TfheClientKey:A,TfheCompactPublicKey:te,TfheCompressedCompactPublicKey:xi,TfheCompressedPublicKey:I,TfheCompressedServerKey:In,TfheConfig:Ui,TfheConfigBuilder:Ti,TfhePublicKey:z,TfheServerKey:o_,ZkComputeLoad:ku,default:ic,initSync:sm,initThreadPool:Ou,init_panic_hook:Tu,set_server_key:Y2,shortint_params_name:D2,shortint_pke_params_name:j2,tfhe:$l,wbg_rayon_PoolBuilder:L_,wbg_rayon_start_worker:L2});let M,dt=0,Do=null;function H_(){return(Do===null||Do.byteLength===0)&&(Do=new Uint8Array(M.memory.buffer)),Do}const sc=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},_m=typeof sc.encodeInto=="function"?function(i,t){return sc.encodeInto(i,t)}:function(i,t){const e=sc.encode(i);return t.set(e),{read:i.length,written:e.length}};function a_(i,t,e){if(e===void 0){const c=sc.encode(i),l=t(c.length,1)>>>0;return H_().subarray(l,l+c.length).set(c),dt=c.length,l}let r=i.length,s=t(r,1)>>>0;const _=H_();let a=0;for(;a<r;a++){const c=i.charCodeAt(a);if(c>127)break;_[s+a]=c}if(a!==r){a!==0&&(i=i.slice(a)),s=e(s,r,r=a+i.length*3,1)>>>0;const c=H_().subarray(s+a,s+r),l=_m(i,c);a+=l.written,s=e(s,r,a,1)>>>0}return dt=a,s}let c_=null;function Jr(){return(c_===null||c_.buffer.detached===!0||c_.buffer.detached===void 0&&c_.buffer!==M.memory.buffer)&&(c_=new DataView(M.memory.buffer)),c_}function J_(i){const t=M.__externref_table_alloc();return M.__wbindgen_export_4.set(t,i),t}function l_(i,t){try{return i.apply(this,t)}catch(e){const r=J_(e);M.__wbindgen_exn_store(r)}}const m1=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&m1.decode();function jo(i,t){return i=i>>>0,m1.decode(H_().subarray(i,i+t))}function Gn(i){return i==null}function Wl(i){const t=typeof i;if(t=="number"||t=="boolean"||i==null)return`${i}`;if(t=="string")return`"${i}"`;if(t=="symbol"){const s=i.description;return s==null?"Symbol":`Symbol(${s})`}if(t=="function"){const s=i.name;return typeof s=="string"&&s.length>0?`Function(${s})`:"Function"}if(Array.isArray(i)){const s=i.length;let _="[";s>0&&(_+=Wl(i[0]));for(let a=1;a<s;a++)_+=", "+Wl(i[a]);return _+="]",_}const e=/\[object ([^\]]+)\]/.exec(toString.call(i));let r;if(e&&e.length>1)r=e[1];else return toString.call(i);if(r=="Object")try{return"Object("+JSON.stringify(i)+")"}catch{return"Object"}return i instanceof Error?`${i.name}: ${i.message}
3
- ${i.stack}`:r}function Qr(i,t){const e=t(i.length*1,1)>>>0;return H_().set(i,e/1),dt=i.length,e}function p_(i,t){if(!(i instanceof t))throw new Error(`expected instance of ${t.name}`)}function $r(i,t){return i=i>>>0,H_().subarray(i/1,i/1+t)}function f_(i){const t=M.__wbindgen_export_4.get(i);return M.__externref_table_dealloc(i),t}function R1(i,t){i=i>>>0;const e=Jr(),r=[];for(let s=i;s<i+4*t;s+=4)r.push(M.__wbindgen_export_4.get(e.getUint32(s,!0)));return M.__externref_drop_slice(i,t),r}function om(i,t,e,r,s,_,a){p_(i,nc),p_(s,Q_),p_(_,h_);const c=M.process_user_decryption_resp_from_js(i.__wbg_ptr,t,e,r,s.__wbg_ptr,_.__wbg_ptr,a);if(c[3])throw f_(c[2]);var l=R1(c[0],c[1]).slice();return M.__wbindgen_free(c[0],c[1]*4,4),l}function P1(i,t){const e=t(i.length*4,4)>>>0;for(let r=0;r<i.length;r++){const s=J_(i[r]);Jr().setUint32(e+4*r,s,!0)}return dt=i.length,e}function am(i,t){const e=a_(t,M.__wbindgen_malloc,M.__wbindgen_realloc),r=dt,s=M.new_server_id_addr(i,e,r);if(s[2])throw f_(s[1]);return $_.__wrap(s[0])}function cm(i){p_(i,Q_);const t=M.ml_kem_pke_pk_to_u8vec(i.__wbg_ptr);if(t[3])throw f_(t[2]);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}function lm(){const i=M.ml_kem_pke_keygen();return h_.__wrap(i)}function pm(i){p_(i,h_);const t=M.ml_kem_pke_sk_to_u8vec(i.__wbg_ptr);if(t[3])throw f_(t[2]);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}function fm(i){const t=Qr(i,M.__wbindgen_malloc),e=dt,r=M.u8vec_to_ml_kem_pke_pk(t,e);if(r[2])throw f_(r[1]);return Q_.__wrap(r[0])}function hm(i){const t=Qr(i,M.__wbindgen_malloc),e=dt,r=M.u8vec_to_ml_kem_pke_sk(t,e);if(r[2])throw f_(r[1]);return h_.__wrap(r[0])}function um(i,t,e){const r=P1(i,M.__wbindgen_malloc),s=dt,_=a_(t,M.__wbindgen_malloc,M.__wbindgen_realloc),a=dt,c=a_(e,M.__wbindgen_malloc,M.__wbindgen_realloc),l=dt,p=M.new_client(r,s,_,a,c,l);if(p[2])throw f_(p[1]);return nc.__wrap(p[0])}function dm(i){p_(i,h_);const t=M.ml_kem_pke_get_pk(i.__wbg_ptr);return Q_.__wrap(t)}typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_ciphertexthandle_free(i>>>0,1));const M1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_client_free(i>>>0,1));class nc{static __wrap(t){t=t>>>0;const e=Object.create(nc.prototype);return e.__wbg_ptr=t,M1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,M1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_client_free(t,0)}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_eip712domainmsg_free(i>>>0,1)),typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_parseduserdecryptionrequest_free(i>>>0,1));const E1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_privateenckeymlkem512_free(i>>>0,1));class h_{static __wrap(t){t=t>>>0;const e=Object.create(h_.prototype);return e.__wbg_ptr=t,E1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,E1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_privateenckeymlkem512_free(t,0)}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_privatesigkey_free(i>>>0,1));const C1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_publicenckeymlkem512_free(i>>>0,1));class Q_{static __wrap(t){t=t>>>0;const e=Object.create(Q_.prototype);return e.__wbg_ptr=t,C1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,C1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_publicenckeymlkem512_free(t,0)}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_publicsigkey_free(i>>>0,1)),typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_requestid_free(i>>>0,1));const z1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_serveridaddr_free(i>>>0,1));class $_{static __wrap(t){t=t>>>0;const e=Object.create($_.prototype);return e.__wbg_ptr=t,z1.register(e,e.__wbg_ptr,e),e}static __unwrap(t){return t instanceof $_?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,z1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_serveridaddr_free(t,0)}}const I1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_typedciphertext_free(i>>>0,1));class Lo{static __wrap(t){t=t>>>0;const e=Object.create(Lo.prototype);return e.__wbg_ptr=t,I1.register(e,e.__wbg_ptr,e),e}static __unwrap(t){return t instanceof Lo?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,I1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_typedciphertext_free(t,0)}get ciphertext(){const t=M.__wbg_get_typedciphertext_ciphertext(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set ciphertext(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_name(this.__wbg_ptr,e,r)}get fhe_type(){return M.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr)}set fhe_type(t){M.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr,t)}get external_handle(){const t=M.__wbg_get_typedciphertext_external_handle(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set external_handle(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_version(this.__wbg_ptr,e,r)}get ciphertext_format(){return M.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr)}set ciphertext_format(t){M.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr,t)}}const G1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_typedplaintext_free(i>>>0,1));class Zl{static __wrap(t){t=t>>>0;const e=Object.create(Zl.prototype);return e.__wbg_ptr=t,G1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,G1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_typedplaintext_free(t,0)}get bytes(){const t=M.__wbg_get_typedplaintext_bytes(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set bytes(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_name(this.__wbg_ptr,e,r)}get fhe_type(){return M.__wbg_get_typedplaintext_fhe_type(this.__wbg_ptr)}set fhe_type(t){M.__wbg_set_typedplaintext_fhe_type(this.__wbg_ptr,t)}}const B1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_typedsigncryptedciphertext_free(i>>>0,1));class Ho{static __wrap(t){t=t>>>0;const e=Object.create(Ho.prototype);return e.__wbg_ptr=t,B1.register(e,e.__wbg_ptr,e),e}static __unwrap(t){return t instanceof Ho?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,B1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_typedsigncryptedciphertext_free(t,0)}get fhe_type(){return M.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr)}set fhe_type(t){M.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr,t)}get signcrypted_ciphertext(){const t=M.__wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set signcrypted_ciphertext(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_name(this.__wbg_ptr,e,r)}get external_handle(){const t=M.__wbg_get_typedsigncryptedciphertext_external_handle(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set external_handle(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_version(this.__wbg_ptr,e,r)}get packing_factor(){return M.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr)>>>0}set packing_factor(t){M.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr,t)}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_userdecryptionrequest_free(i>>>0,1));const wm=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_userdecryptionresponse_free(i>>>0,1));class ql{static __unwrap(t){return t instanceof ql?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,wm.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_userdecryptionresponse_free(t,0)}get signature(){const t=M.__wbg_get_userdecryptionresponse_signature(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set signature(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_name(this.__wbg_ptr,e,r)}get external_signature(){const t=M.__wbg_get_userdecryptionresponse_external_signature(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set external_signature(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_version(this.__wbg_ptr,e,r)}get payload(){const t=M.__wbg_get_userdecryptionresponse_payload(this.__wbg_ptr);return t===0?void 0:_c.__wrap(t)}set payload(t){let e=0;Gn(t)||(p_(t,_c),e=t.__destroy_into_raw()),M.__wbg_set_userdecryptionresponse_payload(this.__wbg_ptr,e)}get extra_data(){const t=M.__wbg_get_userdecryptionresponse_extra_data(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set extra_data(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr,e,r)}}const N1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_userdecryptionresponsepayload_free(i>>>0,1));class _c{static __wrap(t){t=t>>>0;const e=Object.create(_c.prototype);return e.__wbg_ptr=t,N1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,N1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_userdecryptionresponsepayload_free(t,0)}get verification_key(){const t=M.__wbg_get_userdecryptionresponsepayload_verification_key(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set verification_key(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_name(this.__wbg_ptr,e,r)}get digest(){const t=M.__wbg_get_userdecryptionresponsepayload_digest(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set digest(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_version(this.__wbg_ptr,e,r)}get signcrypted_ciphertexts(){const t=M.__wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr);var e=R1(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*4,4),e}set signcrypted_ciphertexts(t){const e=P1(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr,e,r)}get party_id(){return M.__wbg_get_userdecryptionresponsepayload_party_id(this.__wbg_ptr)>>>0}set party_id(t){M.__wbg_set_userdecryptionresponsepayload_party_id(this.__wbg_ptr,t)}get degree(){return M.__wbg_get_userdecryptionresponsepayload_degree(this.__wbg_ptr)>>>0}set degree(t){M.__wbg_set_userdecryptionresponsepayload_degree(this.__wbg_ptr,t)}}async function gm(i,t){if(typeof Response=="function"&&i instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(i,t)}catch(r){if(i.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const e=await i.arrayBuffer();return await WebAssembly.instantiate(e,t)}else{const e=await WebAssembly.instantiate(i,t);return e instanceof WebAssembly.Instance?{instance:e,module:i}:e}}function Am(){const i={};return i.wbg={},i.wbg.__wbg_String_8f0eb39a4a4c2f66=function(t,e){const r=String(e),s=a_(r,M.__wbindgen_malloc,M.__wbindgen_realloc),_=dt;Jr().setInt32(t+4,_,!0),Jr().setInt32(t+0,s,!0)},i.wbg.__wbg_buffer_609cc3eee51ed158=function(t){return t.buffer},i.wbg.__wbg_call_672a4d21634d4a24=function(){return l_(function(t,e){return t.call(e)},arguments)},i.wbg.__wbg_call_7cccdd69e0791ae2=function(){return l_(function(t,e,r){return t.call(e,r)},arguments)},i.wbg.__wbg_crypto_ed58b8e10a292839=function(t){return t.crypto},i.wbg.__wbg_done_769e5ede4b31c67b=function(t){return t.done},i.wbg.__wbg_error_7534b8e9a36f1ab4=function(t,e){let r,s;try{r=t,s=e,console.error(jo(t,e))}finally{M.__wbindgen_free(r,s,1)}},i.wbg.__wbg_getRandomValues_bcb4912f16000dc4=function(){return l_(function(t,e){t.getRandomValues(e)},arguments)},i.wbg.__wbg_get_67b2ba62fc30de12=function(){return l_(function(t,e){return Reflect.get(t,e)},arguments)},i.wbg.__wbg_get_b9b93047fe3cf45b=function(t,e){return t[e>>>0]},i.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(t,e){return t[e]},i.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(t){let e;try{e=t instanceof ArrayBuffer}catch{e=!1}return e},i.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(t){let e;try{e=t instanceof Uint8Array}catch{e=!1}return e},i.wbg.__wbg_isArray_a1eab7e0d067391b=function(t){return Array.isArray(t)},i.wbg.__wbg_isSafeInteger_343e2beeeece1bb0=function(t){return Number.isSafeInteger(t)},i.wbg.__wbg_iterator_9a24c88df860dc65=function(){return Symbol.iterator},i.wbg.__wbg_length_a446193dc22c12f8=function(t){return t.length},i.wbg.__wbg_length_e2d2a49132c1b256=function(t){return t.length},i.wbg.__wbg_msCrypto_0a36e2ec3a343d26=function(t){return t.msCrypto},i.wbg.__wbg_new_8a6f238a6ece86ea=function(){return new Error},i.wbg.__wbg_new_a12002a7f91c75be=function(t){return new Uint8Array(t)},i.wbg.__wbg_newnoargs_105ed471475aaf50=function(t,e){return new Function(jo(t,e))},i.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(t,e,r){return new Uint8Array(t,e>>>0,r>>>0)},i.wbg.__wbg_newwithlength_a381634e90c276d4=function(t){return new Uint8Array(t>>>0)},i.wbg.__wbg_next_25feadfc0913fea9=function(t){return t.next},i.wbg.__wbg_next_6574e1a8a62d1055=function(){return l_(function(t){return t.next()},arguments)},i.wbg.__wbg_node_02999533c4ea02e3=function(t){return t.node},i.wbg.__wbg_process_5c1d670bc53614b8=function(t){return t.process},i.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740=function(){return l_(function(t,e){t.randomFillSync(e)},arguments)},i.wbg.__wbg_require_79b1e9274cde3c87=function(){return l_(function(){return module.require},arguments)},i.wbg.__wbg_serveridaddr_new=function(t){return $_.__wrap(t)},i.wbg.__wbg_serveridaddr_unwrap=function(t){return $_.__unwrap(t)},i.wbg.__wbg_set_65595bdd868b3009=function(t,e,r){t.set(e,r>>>0)},i.wbg.__wbg_stack_0ed75d68575b0f3c=function(t,e){const r=e.stack,s=a_(r,M.__wbindgen_malloc,M.__wbindgen_realloc),_=dt;Jr().setInt32(t+4,_,!0),Jr().setInt32(t+0,s,!0)},i.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07=function(){const t=typeof Xa>"u"?null:Xa;return Gn(t)?0:J_(t)},i.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0=function(){const t=typeof globalThis>"u"?null:globalThis;return Gn(t)?0:J_(t)},i.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819=function(){const t=typeof self>"u"?null:self;return Gn(t)?0:J_(t)},i.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40=function(){const t=typeof window>"u"?null:window;return Gn(t)?0:J_(t)},i.wbg.__wbg_subarray_aa9065fa9dc5df96=function(t,e,r){return t.subarray(e>>>0,r>>>0)},i.wbg.__wbg_typedciphertext_new=function(t){return Lo.__wrap(t)},i.wbg.__wbg_typedciphertext_unwrap=function(t){return Lo.__unwrap(t)},i.wbg.__wbg_typedplaintext_new=function(t){return Zl.__wrap(t)},i.wbg.__wbg_typedsigncryptedciphertext_new=function(t){return Ho.__wrap(t)},i.wbg.__wbg_typedsigncryptedciphertext_unwrap=function(t){return Ho.__unwrap(t)},i.wbg.__wbg_userdecryptionresponse_unwrap=function(t){return ql.__unwrap(t)},i.wbg.__wbg_value_cd1ffa7b1ab794f1=function(t){return t.value},i.wbg.__wbg_versions_c71aa1626a93e0a1=function(t){return t.versions},i.wbg.__wbindgen_as_number=function(t){return+t},i.wbg.__wbindgen_boolean_get=function(t){const e=t;return typeof e=="boolean"?e?1:0:2},i.wbg.__wbindgen_debug_string=function(t,e){const r=Wl(e),s=a_(r,M.__wbindgen_malloc,M.__wbindgen_realloc),_=dt;Jr().setInt32(t+4,_,!0),Jr().setInt32(t+0,s,!0)},i.wbg.__wbindgen_error_new=function(t,e){return new Error(jo(t,e))},i.wbg.__wbindgen_in=function(t,e){return t in e},i.wbg.__wbindgen_init_externref_table=function(){const t=M.__wbindgen_export_4,e=t.grow(4);t.set(0,void 0),t.set(e+0,void 0),t.set(e+1,null),t.set(e+2,!0),t.set(e+3,!1)},i.wbg.__wbindgen_is_function=function(t){return typeof t=="function"},i.wbg.__wbindgen_is_null=function(t){return t===null},i.wbg.__wbindgen_is_object=function(t){const e=t;return typeof e=="object"&&e!==null},i.wbg.__wbindgen_is_string=function(t){return typeof t=="string"},i.wbg.__wbindgen_is_undefined=function(t){return t===void 0},i.wbg.__wbindgen_jsval_loose_eq=function(t,e){return t==e},i.wbg.__wbindgen_memory=function(){return M.memory},i.wbg.__wbindgen_number_get=function(t,e){const r=e,s=typeof r=="number"?r:void 0;Jr().setFloat64(t+8,Gn(s)?0:s,!0),Jr().setInt32(t+0,!Gn(s),!0)},i.wbg.__wbindgen_string_get=function(t,e){const r=e,s=typeof r=="string"?r:void 0;var _=Gn(s)?0:a_(s,M.__wbindgen_malloc,M.__wbindgen_realloc),a=dt;Jr().setInt32(t+4,a,!0),Jr().setInt32(t+0,_,!0)},i.wbg.__wbindgen_string_new=function(t,e){return jo(t,e)},i.wbg.__wbindgen_throw=function(t,e){throw new Error(jo(t,e))},i}function bm(i,t){return M=i.exports,K1.__wbindgen_wasm_module=t,c_=null,Do=null,M.__wbindgen_start(),M}async function K1(i){if(M!==void 0)return M;typeof i<"u"&&(Object.getPrototypeOf(i)===Object.prototype?{module_or_path:i}=i:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof i>"u"&&(i=new URL("/kms_lib_bg.wasm",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ft&&ft.tagName.toUpperCase()==="SCRIPT"&&ft.src||new URL("relayer-sdk-js.umd.cjs",document.baseURI).href));const t=Am();(typeof i=="string"||typeof Request=="function"&&i instanceof Request||typeof URL=="function"&&i instanceof URL)&&(i=fetch(i));const{instance:e,module:r}=await gm(await i,t);return bm(e,r)}const W_="0.4.1",Jo="@zama-fhe/relayer-sdk";class it extends Error{name="RelayerErrorBase";_details;_docsPath;_docsUrl;_version;static VERSION=W_;static DEFAULT_DOCS_BASE_URL="https//docs.zama.org";static FULL_VERSION=`@zama-fhe/relayer-sdk@${it.VERSION}`;constructor(t){let e,r;t.cause instanceof it?(r=t.docsPath||t.cause.docsPath,e=t.details||t.cause.details):(r=t.docsPath,e=t.details||t.cause?.message);const s=r?`${t.docsBaseUrl??it.DEFAULT_DOCS_BASE_URL}${r}${t.docsSlug?`#${t.docsSlug}`:""}`:void 0,_=[t.message||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...e?[`Details: ${e}`]:[],`Version: ${it.FULL_VERSION}`].join(`
4
- `);super(_,t.cause?{cause:t.cause}:void 0),Object.setPrototypeOf(this,new.target.prototype),this._details=e,this._docsPath=r,this._docsUrl=s,this._version=it.VERSION,this.name=t.name??this.name}get docsPath(){return this._docsPath}get docsUrl(){return this._docsUrl}get details(){return this._details}get version(){return this._version}}class ct extends it{_objName;_property;_expectedType;_index;_value;_type;_expectedValue;constructor({objName:t,property:e,index:r,type:s,value:_,expectedValue:a,expectedType:c}){let l=s==="undefined"&&a!==void 0,p;!e||e===""?p=r!==void 0?`${t}[${r}]`:`${t}`:p=r!==void 0?`${t}.${e}[${r}]`:`${t}.${e}`;let u=l?`InvalidPropertyError: Missing '${p}'`:`InvalidPropertyError: ${p}`;s===c?_!==void 0&&(u+=` unexpected value ${_}`):l?(Array.isArray(a)&&(a=a.join("|")),u+=`, expected '${p}: ${a}'.`):c!=="unknown"&&s!=="unknown"&&(u+=` not a ${c}`,s&&(u+=`, type is ${s}`)),super({message:u,name:"InvalidPropertyError"}),this._objName=t,this._property=e,this._value=_,this._type=s,this._expectedValue=a,this._expectedType=c,this._index=r}static missingProperty({objName:t,property:e,expectedType:r,expectedValue:s}){return new ct({objName:t,property:e,expectedType:r,expectedValue:s,type:"undefined"})}static invalidFormat({objName:t,property:e}){return new ct({objName:t,property:e,expectedType:"unknown"})}static invalidObject({objName:t,expectedType:e,type:r}){return new ct({objName:t,property:"",expectedType:e,type:r})}}function ee(i,t){return!(i==null||typeof i!="object"||!(t in i)||i[t]===void 0||i[t]===null)}function ii(i,t,e){if(!ee(i,t))throw new ct({objName:e,property:t,expectedType:"non-nullable",type:si(i,t)})}function ym(i,t){return ee(i,t)?Array.isArray(i[t]):!1}function Bn(i,t,e){if(!ym(i,t))throw new ct({objName:e,property:t,expectedType:"Array",type:si(i,t)})}function Sm(i,t){return ee(i,t)?typeof i[t]=="boolean":!1}function Xl(i,t,e,r){if(!Sm(i,t))throw new ct({objName:e,property:t,expectedType:"boolean",type:si(i,t)});if(r!==void 0&&i[t]!==r)throw new ct({objName:e,property:t,expectedType:"boolean",expectedValue:String(r),type:typeof i[t],value:String(i[t])})}function si(i,t){return ee(i,t)?typeof i[t]:"undefined"}class tp extends it{constructor(t){super({...t,name:"InternalError",message:t.message??"internal error"})}}function re(i){if(!i)throw new tp({message:"Assertion failed"})}function ep(i,t){return i===void 0?"":t.length===0?i:i.endsWith(t)?i.slice(0,-t.length):i}function mm(i){return typeof i=="string"&&i.startsWith("0x")}function Rm(i){return typeof i=="string"&&!i.startsWith("0x")}function Qo(i){return i.startsWith("0x")?i:`0x${i}`}function Z_(i){return i.startsWith("0x")?i.substring(2):i}function Nn(i){return i==null||typeof i!="string"?!1:i.length>0}function Pm(i,t){return ee(i,t)?typeof i[t]=="string":!1}function H(i,t,e,r){if(!Pm(i,t))throw new ct({objName:e,property:t,expectedType:"string",expectedValue:r,type:si(i,t)});if(r!==void 0){if(Array.isArray(r)){for(let s=0;s<r.length;++s)if(i[t]===r[s])return;throw new ct({objName:e,property:t,expectedType:"string",expectedValue:r,type:typeof i[t],value:i[t]})}else if(i[t]!==r)throw new ct({objName:e,property:t,expectedType:"string",expectedValue:r,type:typeof i[t],value:i[t]})}}function Mm(i,t,e){Bn(i,t,e);const r=i[t];for(let s=0;s<r.length;++s)if(typeof r[s]!="string")throw new ct({objName:e,property:`${t}[${s}]`,expectedType:"string",type:typeof r[s]})}function ni(i,t){try{return JSON.stringify(i,(e,r)=>typeof r=="bigint"?r.toString():r,t)}catch{return""}}class At extends it{_varName;_type;_expectedType;_expectedCustomType;constructor({varName:t,type:e,expectedType:r,expectedCustomType:s}){super({message:`InvalidTypeError ${t} ${r} ${e}`,name:"InvalidTypeError"}),this._varName=t,this._type=e,this._expectedType=r,this._expectedCustomType=s}get varName(){return this._varName}get type(){return this._type}get expectedType(){return this._expectedType}get expectedCustomType(){return this._expectedCustomType}}function $o(i,t){return i==null||!(i instanceof Uint8Array)?!1:t!==void 0?i.length===t:!0}function q_(i,t){return!(!mm(i)||t!==void 0&&i.length!==2*t+2||(i.length-2)%2!==0||!/^0x[a-fA-F0-9]*$/.test(i))}function v1(i,t){return!(!Rm(i)||(i.length-2)%2!==0||!/^[a-fA-F0-9]*$/.test(i))}function oc(i){return q_(i,32)}function rp(i){return q_(i,65)}function ip(i){return $o(i,32)}function u_(i,t){if(!q_(i,t))throw new At({type:typeof i,expectedType:"BytesHex"})}function Em(i){if(!rp(i))throw new At({type:typeof i,expectedType:"Bytes65Hex"})}function Cm(i){if(!oc(i))throw new At({type:typeof i,expectedType:"Bytes32Hex"})}function x1(i){if(!ip(i))throw new At({type:typeof i,expectedType:"Bytes32"})}function zm(i){if(!Array.isArray(i))throw new At({type:typeof i,expectedType:"Bytes32HexArray"});for(let t=0;t<i.length;++t)if(!oc(i[t]))throw new At({type:typeof i[t],expectedType:"Bytes32Hex"})}function Wo(i){if(!Array.isArray(i))throw new At({type:typeof i,expectedType:"Bytes65HexArray"});for(let t=0;t<i.length;++t)if(!rp(i[t]))throw new At({type:typeof i[t],expectedType:"Bytes65Hex"})}function Im(i,t){return ee(i,t)?q_(i[t]):!1}function ac(i,t,e){if(!Im(i,t))throw new ct({objName:e,property:t,expectedType:"BytesHex",type:si(i,t)})}function Gm(i,t){return ee(i,t)?v1(i[t]):!1}function Zo(i,t,e){if(!Gm(i,t))throw new ct({objName:e,property:t,expectedType:"BytesHexNo0x",type:si(i,t)})}function U1(i,t,e){Bn(i,t,e);const r=i[t];for(let s=0;s<r.length;++s)if(!oc(r[s]))throw new ct({objName:e,property:`${t}[${s}]`,expectedType:"Bytes32Hex",type:typeof r[s]})}function Bm(i,t,e){Bn(i,t,e);const r=i[t];for(let s=0;s<r.length;++s)if(!rp(r[s]))throw new ct({objName:e,property:`${t}[${s}]`,expectedType:"Bytes65Hex",type:typeof r[s]})}function Nm(i,t,e){Bn(i,t,e);const r=i[t];for(let s=0;s<r.length;++s)if(!q_(r[s]))throw new ct({objName:e,property:`${t}[${s}]`,expectedType:"BytesHex",type:typeof r[s]})}function T1(i,t,e){Bn(i,t,e);const r=i[t];for(let s=0;s<r.length;++s)if(!v1(r[s]))throw new ct({objName:e,property:`${t}[${s}]`,expectedType:"BytesHexNo0x",type:typeof r[s]})}function Km(i,t){return ee(i,t)?i[t]instanceof Uint8Array:!1}function cc(i,t,e){if(!Km(i,t))throw new ct({objName:e,property:t,expectedType:"Uint8Array",type:si(i,t)})}const sp={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};Object.freeze(sp);const vm=Array.from({length:256},(i,t)=>t.toString(16).padStart(2,"0"));Object.freeze(vm);const O1=new Uint8Array([48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102]);function np(i){if(!i||i.length===0)return"";let t="";for(let e=0;e<i.length;e++)t+=i[e].toString(16).padStart(2,"0");return t}function Kn(i){return`0x${np(i)}`}function xm(i){if(!ip(i))throw new Error("Invalid bytes32 argument");return`0x${np(i)}`}function X_(i,t){const e=t===!0?i.length*2:i.length*2+2,r=new Uint8Array(e);let s=0;t!==!0&&(r[0]=48,r[1]=120,s=2);for(let a=0;a<i.length;a++){const c=s+a*2;r[c]=O1[i[a]>>4],r[c+1]=O1[i[a]&15]}const _=new TextDecoder().decode(r);return _}function Ht(i){if(i.length%2!==0)throw new Error("Invalid hex string: odd length");const t=i.replace(/^(0x)/,"").match(/.{1,2}/g);return t?Uint8Array.from(t.map(e=>parseInt(e,16))):new Uint8Array}function Um(i){return Ht("0x"+Z_(i).padStart(64,"0"))}function qo(i,t){const e=t?.strict===!0,r=i[0]==="0"&&i[1]==="x"?2:0,s=i.length-r;if(s%2!==0)throw new Error("Invalid hex string: odd length");const _=new Uint8Array(s/2);for(let a=0;a<_.length;a++){const c=sp[i[r+a*2]],l=sp[i[r+a*2+1]];if((c===void 0||l===void 0)&&e)throw new Error(`Invalid hex character at position ${r+a*2}`);_[a]=c<<4|l}return _}function k1(i){if(!i||i.length===0)return BigInt(0);let t=BigInt(0);for(let e=0;e<i.length;e++)t=t<<BigInt(8)|BigInt(i[e]);return t}function Tm(i){if(!Array.isArray(i))throw new At({expectedType:"Array"});return i.map(t=>{if(typeof t=="string")return Cm(t),t;{x1(t);const e=X_(t);if(e.length!==66)throw new At({expectedType:"Bytes32Hex"});return e}})}function V1(...i){let t=0;for(const s of i)t+=s.length;const e=new Uint8Array(t);let r=0;for(const s of i)e.set(s,r),r+=s.length;return e}function lc(i,t){if(!$o(i)||!$o(t)||i.length!==t.length)return!1;for(let e=0;e<i.length;++e)if(i[e]!==t[e])return!1;return!0}function F1(i){if(i instanceof Uint8Array)return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i))return new Uint8Array(i.buffer,i.byteOffset,i.byteLength);throw new TypeError(`Unsupported bytes type: ${Object.prototype.toString.call(i)}`)}class Y1 extends it{constructor({address:t}){super({message:`Address "${t}" is invalid.`,name:"AddressError"})}}class _p extends it{constructor({address:t,message:e}){super({message:e??(t!=null?`Checksummed address "${t}" is invalid.`:"Checksummed address is invalid."),name:"ChecksummedAddressError"})}}function Om(i){if(!fc(i))throw new At({expectedType:"ChecksummedAddress"});const t=Z_(i),e=new Uint8Array(20);for(let r=0;r<20;r++)e[r]=parseInt(t.slice(r*2,r*2+2),16);return e}function Jt(i){if(typeof i!="string"||!i.startsWith("0x")||i.length!==42)return!1;try{return et(i)===i}catch{return!1}}function ie(i){if(!Jt(i))throw new _p({address:String(i)})}function pc(i){if(!Array.isArray(i))throw new At({type:typeof i,expectedType:"ChecksummedAddressArray"});for(let t=0;t<i.length;++t)if(!Jt(i[t]))throw new _p({address:String(i)})}function fc(i){return!(typeof i!="string"||!i.startsWith("0x")||i.length!==42||!Qy(i))}function km(i){if(!fc(i))throw new Y1({address:String(i)})}function D1(i){if(!Array.isArray(i))throw new At({type:typeof i,expectedType:"AddressArray"});for(let t=0;t<i.length;++t)if(!fc(i[t]))throw new Y1({address:String(i)})}function Vm(i,t){return ee(i,t)?Jt(i[t]):!1}function j1(i,t,e){if(!Vm(i,t))throw new ct({objName:e,property:t,expectedType:"ChecksummedAddress",type:si(i,t)})}const hc=255,L1=65535,H1=4294967295,Fm=0xffffffffffffffffn,Ym=0xffffffffffffffffffffffffffffffffn,Dm=0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn;function J1(i){return typeof i=="number"?i<0?!1:Number.isInteger(i):!1}function op(i){return typeof i=="bigint"?i>=0:!1}function vn(i){return J1(i)?!0:!!op(i)}function uc(i){return vn(i)?i<=hc:!1}function jm(i){return vn(i)?i<=L1:!1}function Q1(i){return vn(i)?i<=H1:!1}function to(i){return vn(i)?BigInt(i)<=Fm:!1}function Lm(i){return vn(i)?BigInt(i)<=Ym:!1}function ap(i){return vn(i)?BigInt(i)<=Dm:!1}function Hm(i){return`0x${i.toString(16)}`}function dc(i){const t=i.toString(16);return t.length%2!==0?`0${t}`:t}function Jm(i){if(!ap(i))throw new At({expectedType:"Uint256"});const t=new ArrayBuffer(32),e=new DataView(t),r=BigInt(i);return e.setBigUint64(24,r&0xffffffffffffffffn,!1),e.setBigUint64(16,r>>64n&0xffffffffffffffffn,!1),e.setBigUint64(8,r>>128n&0xffffffffffffffffn,!1),e.setBigUint64(0,r>>192n&0xffffffffffffffffn,!1),new Uint8Array(t)}function $1(i){if(!to(i))throw new At({expectedType:"Uint64"});const t=new ArrayBuffer(32),e=new DataView(t),r=BigInt(i);return e.setBigUint64(24,r,!1),new Uint8Array(t)}function wc(i){if(!J1(i))throw new At({type:typeof i,expectedType:"UintNumber"})}function cp(i){if(!uc(i))throw new At({type:typeof i,expectedType:"Uint8"})}function Qm(i){if(!Q1(i))throw new At({type:typeof i,expectedType:"Uint32"})}function W1(i){if(!to(i))throw new At({type:typeof i,expectedType:"Uint64"})}function Z1(i){if(!ap(i))throw new At({type:typeof i,expectedType:"Uint256"})}function $m(i,t){return ee(i,t)?vn(i[t]):!1}function q1(i,t,e){if(!$m(i,t))throw new ct({objName:e,property:t,type:si(i,t),expectedType:"Uint"})}function X1(i,t,e){if(si(i,t)!=="bigint"||!op(i[t]))throw new ct({objName:e,property:t,type:si(i,t),expectedType:"UintBigInt"})}class Oi extends it{constructor({handle:t,message:e}){super({message:e??(t?`FHEVM Handle "${t}" is invalid.`:"FHEVM Handle is invalid."),name:"FhevmHandleError"})}}class d_ extends it{constructor({fheTypeId:t,message:e}){super({message:e??(t?`FheTypeId "${t}" is invalid.`:"FheTypeId is invalid."),name:"FheTypeError"})}}const tA=2,gc={ebool:0,euint8:2,euint16:3,euint32:4,euint64:5,euint128:6,eaddress:7,euint256:8},Wm={0:"ebool",2:"euint8",3:"euint16",4:"euint32",5:"euint64",6:"euint128",7:"eaddress",8:"euint256"},lp={0:2,2:8,3:16,4:32,5:64,6:128,7:160,8:256},pp={2:0,8:2,16:3,32:4,64:5,128:6,160:7,256:8},eA={0:"bool",2:"uint256",3:"uint256",4:"uint256",5:"uint256",6:"uint256",7:"address",8:"uint256"};Object.freeze(gc),Object.freeze(lp),Object.freeze(pp),Object.freeze(eA);function eo(i){switch(i){case 0:case 2:case 3:case 4:case 5:case 6:case 7:case 8:return!0;default:return!1}}function fp(i){return typeof i!="string"?!1:i in gc}function Ac(i){return typeof i!="number"?!1:i in pp}function Zm(i,t){if(!Ac(i))throw new At({varName:t,type:typeof i,expectedType:"EncryptionBits"})}function rA(i,t){if(!Array.isArray(i))throw new At({type:typeof i,expectedType:"EncryptionBitsArray"});for(let e=0;e<i.length;++e)if(!Ac(i[e]))throw new At({...t!==void 0?{varName:`${t}[${e.toString()}]`}:{},type:typeof i[e],expectedType:"EncryptionBits"})}function hp(i){if(!Ac(i))throw new d_({message:`Invalid encryption bits ${i}`});return pp[i]}function qm(i){if(!fp(i))throw new d_({message:`Invalid FheType name '${i}'`});return gc[i]}function iA(i){if(!eo(i))throw new d_({message:`Invalid FheType id '${i}'`});return Wm[i]}function up(i){if(!eo(i))throw new d_({message:`Invalid FheType id '${i}'`});return eA[i]}function dp(i){if(!eo(i))throw new d_({message:`Invalid FheType id '${i}'`});const t=lp[i];return nA(t),t}function sA(i){if(!fp(i))throw new d_({message:`Invalid FheType name '${i}'`});const t=lp[gc[i]];return nA(t),t}function nA(i){if(i<tA)throw new d_({message:`Invalid FheType encryption bit width: ${i}. Minimum encryption bit width is ${tA} bits.`})}function ro(i){return i instanceof lt?i.toBytes32Hex():typeof i=="string"?i:xm(i)}function Xm(i){if(!Array.isArray(i))throw new At({type:typeof i,expectedType:"Array"});for(let t=0;t<i.length;++t)tR(i[t])}function tR(i){if(!(i instanceof lt)&&!lt.canParse(i))throw new Oi({handle:i})}class lt{#t;#e;#r;#i;#s;#n;#_;#o;static RAW_CT_HASH_DOMAIN_SEPARATOR="ZK-w_rct";static HANDLE_HASH_DOMAIN_SEPARATOR="ZK-w_hdl";static CURRENT_CIPHERTEXT_VERSION=0;constructor({hash21:t,chainId:e,fheTypeId:r,version:s,computed:_,index:a,handleBytes32:c,handleBytes32Hex:l}){if(!to(e))throw new Oi({message:"ChainId must be a uint64"});if(!q_(t,21))throw new Oi({message:"Hash21 should be 21 bytes long"});this.#o=c,this.#_=l,this.#t=t,this.#e=BigInt(e),this.#r=r,this.#i=s,this.#s=_,a!==void 0&&(this.#n=a)}get hash21(){return this.#t}get chainId(){return this.#e}get fheTypeId(){return this.#r}get fheTypeName(){return iA(this.#r)}get version(){return this.#i}get computed(){return this.#s}get index(){return this.#n}get encryptionBits(){return dp(this.#r)}get solidityPrimitiveTypeName(){return up(this.#r)}toJSON(){return{handle:this.toBytes32Hex(),fheTypeName:this.fheTypeName,fheTypeId:this.fheTypeId,chainId:this.chainId,index:this.index,computed:this.computed,encryptionBits:this.encryptionBits,version:this.version,solidityPrimitiveTypeName:this.solidityPrimitiveTypeName,hash21:this.hash21}}equals(t){return this.#t===t.#t&&this.#e===t.#e&&this.#r===t.#r&&this.#i===t.#i&&this.#s===t.#s&&this.#n===t.#n}toBytes32(){if(this.#o===void 0){re(this.#n===void 0&&this.#s||this.#n!==void 0&&this.#n<255&&!this.#s);const e=$1(this.#e).subarray(24,32),r=Ht(this.#t);re(r.length===21);const s=new Uint8Array(32);s.set(r,0),s[21]=this.#n===void 0?255:this.#n,s.set(e,22),s[30]=this.#r,s[31]=this.#i,this.#o=s}return this.#o}toBytes32Hex(){return this.#_===void 0&&(this.#_=Kn(this.toBytes32())),this.#_}static fromComponents(t){return new lt(t)}static from(t){if(t instanceof lt)return t;if(typeof t=="string")return lt.fromBytes32Hex(t);if($o(t))return lt.fromBytes32(t);throw new Oi({message:"FHEVM Handle must be a Uint8Array or a string."})}static fromBytes32(t){if(!ip(t))throw new Oi({message:"FHEVM Handle is not a valid bytes32 array."});const e=t,r=Kn(e.slice(0,21)),s=e[21],_=s===255,a=_?void 0:s;let c=0;for(let d=22;d<30;d++)c=c*256+e[d];const l=e[30];if(!eo(l))throw new Oi({handle:t,message:`FHEVM Handle "${t}" is invalid. Unknown FheType: ${l}`});const p=e[31];return new lt({hash21:r,chainId:c,fheTypeId:l,version:p,computed:_,index:a,handleBytes32:t})}static fromBytes32Hex(t){if(!oc(t))throw new Oi({handle:t});const e=Ht(t),r=lt.fromBytes32(e);if(r.toBytes32Hex()!==t)throw new Oi({message:"FhevmHandle verification failed!"});return r.#_=t,r}static fromZKProof(t,e=lt.CURRENT_CIPHERTEXT_VERSION){cp(e);const r=t.encryptionBits.map(l=>hp(l));cp(r.length);const _=new TextEncoder().encode(lt.RAW_CT_HASH_DOMAIN_SEPARATOR),a=mt(V1(_,t.ciphertextWithZKProof)),c=[];for(let l=0;l<r.length;++l){const p=lt._computeInputHash21(Ht(a),t.aclContractAddress,t.chainId,l);c.push(new lt({hash21:p,chainId:t.chainId,fheTypeId:r[l],version:e,computed:!1,index:l}))}return c}static canParse(t){try{return lt.from(t),!0}catch{return!1}}static assertIsHandleLike(t){if(!(t instanceof lt)&&!lt.canParse(t))throw new Oi({handle:t})}static currentCiphertextVersion(){return lt.CURRENT_CIPHERTEXT_VERSION}static _computeInputHash21(t,e,r,s){x1(t),ie(e),cp(s),W1(r);const _=new Uint8Array([s]),a=Om(e),c=$1(r),p=new TextEncoder().encode(lt.HANDLE_HASH_DOMAIN_SEPARATOR);return mt(V1(p,t,_,a,c)).slice(0,44)}toString(){return this.toBytes32Hex()}}function _A(i){let t=0;for(const e of i){const r=lt.fromBytes32Hex(e);if(t+=r.encryptionBits,t>2048)throw new Error("Cannot decrypt more than 2048 encrypted bits in a single request")}return t}function eR(i){let t=0;for(const e of i)if(t+=e.encryptionBits,t>2048)throw new Error("Cannot decrypt more than 2048 encrypted bits in a single request");return t}const w_=i=>et(i),oA=["function persistAllowed(bytes32 handle, address account) view returns (bool)"],aA=10,cA=BigInt(365);function rR(i,t){if(t===0)return i===BigInt(1);if(t===7)return w_("0x"+i.toString(16).padStart(40,"0"));if(t>8||t==1)throw new Error(`Unsupported handle type ${t}`);return i}function lA(i,t){try{const e=It.u8vec_to_ml_kem_pke_pk(Ht(i)),r=It.u8vec_to_ml_kem_pke_sk(Ht(t));return{pubKey:e,privKey:r}}catch(e){throw new Error("Invalid public or private key",{cause:e})}}function pA(i){return i.map(t=>({handle:typeof t.handle=="string"?Kn(Ht(t.handle)):Kn(t.handle),contractAddress:w_(t.contractAddress)}))}function fA(i){const t=i.length;if(t===0)throw Error("contractAddresses is empty");if(t>aA)throw Error(`contractAddresses max length of ${aA} exceeded`)}async function hA(i,t,e){const r=t.map(async({handle:s,contractAddress:_})=>{const a=await i.persistAllowed(s,e),c=await i.persistAllowed(s,_);if(!a)throw new Error(`User address ${e} is not authorized to user decrypt handle ${s}!`);if(!c)throw new Error(`dapp contract ${_} is not authorized to user decrypt handle ${s}!`);if(e===_)throw new Error(`User address ${e} should not be equal to contract address when requesting user decryption!`)});await Promise.all(r).catch(s=>{throw s})}function uA(i,t){let e=[];for(const s of i){const _=s.slice(-4,-2).toLowerCase(),a=parseInt(_,16);e.push(a)}const r={};return i.forEach((s,_)=>r[s]=rR(t[_],e[_])),r}function dA(i,t){if(t===BigInt(0))throw Error("durationDays is null");if(t>cA)throw Error(`durationDays is above max duration of ${cA}`);const e=BigInt(Math.floor(Date.now()/1e3));if(i>e)throw Error("startTimestamp is set in the future");const r=t*BigInt(86400);if(i+r<e)throw Error("User decrypt request has expired")}const iR=({kmsSigners:i,gatewayChainId:t,chainId:e,verifyingContractAddressDecryption:r,aclContractAddress:s,relayerProvider:_,provider:a,defaultOptions:c})=>async(l,p,u,d,b,S,R,m,P)=>{const E="0x00",{pubKey:B,privKey:G}=lA(u,p),Y=d.replace(/^(0x)/,""),T=u.replace(/^(0x)/,""),v=pA(l);_A(v.map(st=>st.handle)),dA(BigInt(R),BigInt(m)),fA(b);const F=new de(s,oA,a);await hA(F,v,S);const V={handleContractPairs:v,requestValidity:{startTimestamp:R.toString(),durationDays:m.toString()},contractsChainId:e.toString(),contractAddresses:b.map(st=>w_(st)),userAddress:w_(S),signature:Y,publicKey:T,extraData:E},q=await _.fetchPostUserDecrypt(V,{...c,...P});let J=i.map((st,nt)=>It.new_server_id_addr(nt+1,st));const Z=It.new_client(J,S,"default");try{const st=new ArrayBuffer(32);new DataView(st).setUint32(28,t,!1);const N={name:"Decryption",version:"1",chain_id:new Uint8Array(st),verifying_contract:r,salt:null},k={signature:Y,client_address:S,enc_key:T,ciphertext_handles:v.map(wt=>wt.handle.replace(/^0x/,"")),eip712_verifying_contract:r},pt=It.process_user_decryption_resp_from_js(Z,k,N,q,B,G,!0).map(wt=>k1(wt.bytes));return uA(v.map(wt=>wt.handle),pt)}catch(st){throw new Error("An error occured during decryption",{cause:st})}},sR=({kmsSigners:i,gatewayChainId:t,chainId:e,verifyingContractAddressDecryption:r,aclContractAddress:s,relayerProvider:_,provider:a,defaultOptions:c})=>async(l,p,u,d,b,S,R,m,P,E)=>{const B="0x00",{pubKey:G,privKey:Y}=lA(u,p),T=d.replace(/^(0x)/,""),v=u.replace(/^(0x)/,""),F=pA(l);_A(F.map(nt=>nt.handle)),dA(BigInt(m),BigInt(P)),fA(b);const V=new de(s,oA,a);await hA(V,F,S);const q={handleContractPairs:F,contractsChainId:e.toString(),contractAddresses:b.map(nt=>w_(nt)),delegatorAddress:w_(S),delegateAddress:w_(R),startTimestamp:m.toString(),durationDays:P.toString(),signature:T,publicKey:v,extraData:B},J=await _.fetchPostDelegatedUserDecrypt(q,{...c,...E});let Z=i.map((nt,se)=>It.new_server_id_addr(se+1,nt));const st=It.new_client(Z,R,"default");try{const nt=new ArrayBuffer(32);new DataView(nt).setUint32(28,t,!1);const k={name:"Decryption",version:"1",chain_id:new Uint8Array(nt),verifying_contract:r,salt:null},$={signature:T,client_address:R,enc_key:v,ciphertext_handles:F.map(Gt=>Gt.handle.replace(/^0x/,"")),eip712_verifying_contract:r},_t=It.process_user_decryption_resp_from_js(st,$,k,J,G,Y,!0).map(Gt=>k1(Gt.bytes));return uA(F.map(Gt=>Gt.handle),_t)}catch(nt){throw new Error("An error occurred during the delegated user decryption request.",{cause:nt})}},bc=BigInt(1024*1024*512),g_=BigInt(1024*1024*512),A_=BigInt(1024*1024*512),wA=2048,gA=256,b_=(i,t)=>{if(i==null)throw new Error("Missing value");let e;if(t>=8?e=BigInt(`0x${new Array(t/8).fill(null).reduce(r=>`${r}ff`,"")}`):e=BigInt(2**t-1),typeof i!="number"&&typeof i!="bigint")throw new Error("Value must be a number or a bigint.");if(i>e)throw new Error(`The value exceeds the limit for ${t}bits integer (${e.toString()}).`)},nR=({aclContractAddress:i,chainId:t,tfheCompactPublicKey:e,tfheCompactPkeCrs:r,contractAddress:s,userAddress:_,capacity:a})=>{if(!Jt(s))throw new Error("Contract address is not a valid address.");if(!Jt(_))throw new Error("User address is not a valid address.");const c=[],l=Ut.CompactCiphertextList.builder(e);let p=new Uint8Array;const u=d=>{if(c.reduce((b,S)=>b+Math.max(2,S),0)+d>2048)throw Error("Packing more than 2048 bits in a single input ciphertext is unsupported");if(c.length+1>256)throw Error("Packing more than 256 variables in a single input ciphertext is unsupported")};return{addBool(d){if(d==null)throw new Error("Missing value");if(typeof d!="boolean"&&typeof d!="number"&&typeof d!="bigint")throw new Error("The value must be a boolean, a number or a bigint.");if(Number(d)>1)throw new Error("The value must be 1 or 0.");return b_(Number(d),1),u(2),l.push_boolean(!!d),c.push(2),this},add8(d){return b_(d,8),u(8),l.push_u8(Number(d)),c.push(8),this},add16(d){return b_(d,16),u(16),l.push_u16(Number(d)),c.push(16),this},add32(d){return b_(d,32),u(32),l.push_u32(Number(d)),c.push(32),this},add64(d){return b_(d,64),u(64),l.push_u64(BigInt(d)),c.push(64),this},add128(d){return b_(d,128),u(128),l.push_u128(BigInt(d)),c.push(128),this},addAddress(d){if(!Jt(d))throw new Error("The value must be a valid address.");return u(160),l.push_u160(BigInt(d)),c.push(160),this},add256(d){return b_(d,256),u(256),l.push_u256(BigInt(d)),c.push(256),this},getBits(){return c},encrypt(){if(c.reduce((B,G)=>B+G,0)>a)throw new Error("Too many bits in provided values. Maximum is 2048.");const b=Ht(s),S=Ht(_),R=Ht(i),m=Ht(t.toString(16).padStart(64,"0")),P=new Uint8Array(b.length+S.length+R.length+32);return P.set(b,0),P.set(S,20),P.set(R,40),P.set(m,P.length-m.length),p=l.build_with_proof_packed(r,P,Ut.ZkComputeLoadVerify).safe_serialize(bc),p}}};class Xo extends it{constructor({message:t}){super({message:t??"FHEVM ZKProof is invalid.",name:"ZKProofError"})}}function io(i){if(i instanceof Error)return i;const t=i.message??"Non-Error value caught in exception handler",e=i.name??"ErrorWrapper",r=i.cause??i,s=new Error(t,{cause:r});return s.name=e,s}function wp(i,t){throw new tp({message:t})}function _R(i){let t;for(typeof i=="string"?t=i:i instanceof Error?t=i.message:t=String(i);t.startsWith('"')||t.startsWith("'");)t=t.slice(1);for(;t.endsWith('"')||t.endsWith("'");)t=t.slice(0,-1);return t}class Ct extends it{constructor({message:t,cause:e}){super({message:t,name:"EncryptionError",...e?{cause:io(e)}:{}})}}class gp{#t;#e;#r;constructor(t){this.#t=t.provenCompactCiphertextListWasm,this.#r=t.encryptionBits,this.#e=t.fheTypeIds,Object.freeze(this.#e),Object.freeze(this.#r)}get tfheCompactPublicKeyWasm(){return this.#t}get wasmClassName(){return this.#t.constructor.name}get count(){return this.#e.length}get fheTypeIds(){return this.#e}get encryptionBits(){return this.#r}static fromCiphertextWithZKProof(t){if(t==null)throw new Ct({message:"ciphertextWithZKProof argument is null or undefined."});if(!(t instanceof Uint8Array)&&!Nn(t))throw new Ct({message:"Invalid ciphertextWithZKProof argument."});const e=typeof t=="string"?qo(t,{strict:!0}):t;let r;try{r=Ut.ProvenCompactCiphertextList.safe_deserialize(e,bc)}catch(c){throw new Ct({message:`Invalid ciphertextWithZKProof bytes. ${_R(c)}.`})}const s=r.len(),_=[];for(let c=0;c<s;++c){const l=r.get_kind_of(c);if(!eo(l))throw new Ct({message:`Invalid FheTypeId: ${l}`});_.push(l)}return new gp({provenCompactCiphertextListWasm:r,encryptionBits:_.map(dp),fheTypeIds:_})}}class y_{#t;#e;#r;#i;#s;#n;#_;constructor(t){this.#t=t.chainId,this.#e=t.aclContractAddress,this.#r=t.contractAddress,this.#i=t.userAddress,this.#s=t.ciphertextWithZKProof,this.#n=Object.freeze([...t.encryptionBits]),this.#_=this.#n.map(hp)}get chainId(){return this.#t}get aclContractAddress(){return this.#e}get contractAddress(){return this.#r}get userAddress(){return this.#i}get ciphertextWithZKProof(){if(this.#s.length===0)throw new Xo({message:"Invalid ZKProof.ciphertextWithZKProof property. Uint8Array cannot be empty."});return this.#s}get encryptionBits(){return this.#n}get fheTypeIds(){return this.#_}static fromComponents(t,e){W1(t.chainId);const r=BigInt(t.chainId);ie(t.aclContractAddress),ie(t.contractAddress),ie(t.userAddress),"encryptionBits"in t&&rA(t.encryptionBits,"zkProofLike.encryptionBits");let s;if(typeof t.ciphertextWithZKProof=="string")s=qo(t.ciphertextWithZKProof,{strict:!0});else if($o(t.ciphertextWithZKProof))e?.copy===!0?s=new Uint8Array(t.ciphertextWithZKProof):s=t.ciphertextWithZKProof;else throw new Xo({message:"Invalid ciphertextWithZKProof argument"});if(s.length===0)throw new Xo({message:"ciphertextWithZKProof argument should not be empty"});const _=gp.fromCiphertextWithZKProof(s);if(t.encryptionBits!=null){const a=_.encryptionBits,c=t.encryptionBits;if(a.length!==c.length)throw new Xo({message:`Encryption count mismatch: ciphertextWithZKProof contains ${a.length} encrypted value(s), but encryptionBits specifies ${c.length}.`});for(let l=0;l<a.length;++l)if(a[l]!==c[l])throw new Xo({message:`Encryption type mismatch at index ${l}.`})}return new y_({chainId:r,aclContractAddress:t.aclContractAddress,contractAddress:t.contractAddress,userAddress:t.userAddress,ciphertextWithZKProof:s,encryptionBits:_.encryptionBits})}toJSON(){return{chainId:this.#t<=Number.MAX_SAFE_INTEGER?Number(this.#t):this.#t,aclContractAddress:this.#e,contractAddress:this.#r,userAddress:this.#i,ciphertextWithZKProof:X_(this.#s),encryptionBits:this.#n,fheTypeIds:this.#_}}}class oR extends it{constructor(t){super({...t,name:"RelayerDuplicateCoprocessorSignerError",message:`Duplicate coprocessor signer address found: ${t.duplicateAddress} appears multiple times in recovered addresses`})}}class aR extends it{constructor(t){super({...t,name:"RelayerUnknownCoprocessorSignerError",message:`Invalid address found: ${t.unknownAddress} is not in the list of coprocessor signers`})}}function yc({signature:i,domain:t,types:e,message:r,primaryType:s}){Em(i);const _=s!==void 0?{[s]:e[s]}:e,a=Oh(t,_,r,i);return ie(a),a}const _o=class _o{domain;constructor(t){Z1(t.gatewayChainId),ie(t.verifyingContractAddressInputVerification),this.domain={name:"InputVerification",version:"1",chainId:t.gatewayChainId,verifyingContract:t.verifyingContractAddressInputVerification},Object.freeze(this.domain)}get gatewayChainId(){return this.domain.chainId}get verifyingContractAddressInputVerification(){return this.domain.verifyingContract}get types(){return L(_o,no)}createEIP712({ctHandles:t,contractChainId:e,contractAddress:r,userAddress:s,extraData:_}){Xm(t),ie(s),ie(r),Z1(e),u_(_);const a={domain:{...this.domain},types:{CiphertextVerification:[{name:"ctHandles",type:"bytes32[]"},{name:"userAddress",type:"address"},{name:"contractAddress",type:"address"},{name:"contractChainId",type:"uint256"},{name:"extraData",type:"bytes"}]},message:{ctHandles:t.map(ro),userAddress:s,contractAddress:r,contractChainId:e,extraData:_}};return Object.freeze(a),Object.freeze(a.domain),Object.freeze(a.types),Object.freeze(a.types.CiphertextVerification),Object.freeze(a.message),Object.freeze(a.message.ctHandles),a}verify({signatures:t,message:e}){return Wo(t),t.map(s=>yc({signature:s,domain:this.domain,types:this.types,message:e}))}};no=new WeakMap,zt(_o,no,{CiphertextVerification:[{name:"ctHandles",type:"bytes32[]"},{name:"userAddress",type:"address"},{name:"contractAddress",type:"address"},{name:"contractChainId",type:"uint256"},{name:"extraData",type:"bytes"}]}),Object.freeze(L(_o,no)),Object.freeze(L(_o,no).CiphertextVerification);let Sc=_o;class cR extends it{constructor(){super({name:"RelayerThresholdCoprocessorSignerError",message:"Coprocessor signers threshold is not reached"})}}class lR extends it{constructor(t){super({...t,name:"RelayerTooManyHandlesError",message:`Trying to pack ${t.numberOfHandles} handles. Packing more than 256 variables in a single input ciphertext is unsupported`})}}class AA extends it{constructor(t){super({...t,name:"RelayerInvalidProofError"})}}class ta{#t;#e;#r;#i;constructor({proof:t,signatures:e,handles:r,extraData:s}){this.#t=t,this.#e=e,this.#r=r,this.#i=s,Object.freeze(this.#e),Object.freeze(this.#r)}get proof(){return this.#t}get signatures(){return this.#e}get handles(){return this.#r}get extraData(){return this.#i}toBytes(){return{handles:this.#r.map(t=>Um(t)),inputProof:Ht(this.#t)}}static from({signatures:t,handles:e,extraData:r}){const s=Tm(e);Wo(t),u_(r);const _=e.length,a=t.length;if(_>hc)throw new lR({numberOfHandles:_});re(a<=hc);const c=dc(_),l=dc(_);re(c.length===2),re(l.length===2);let p="";return p+=dc(e.length),p+=dc(t.length),s.map(d=>p+=Z_(d)),t.map(d=>p+=Z_(d)),p+=Z_(r),re(p.length===(2+_*32+a*65)*2+(r.length-2)),new ta({proof:`0x${p}`,signatures:[...t],handles:[...s],extraData:r})}equalsBytes({handles:t,inputProof:e}){const r=this.toBytes();if(t.length!==r.handles.length)return!1;for(let s=0;s<t.length;++s){const _=r.handles[s],a=t[s];if(!lc(_,a))return!1}return lc(r.inputProof,e)}static fromProofBytes(t){if(t.length<2)throw new AA({message:"Invalid proof: too short"});const e=t[0],r=t[1],s=32,_=65,c=2,p=c+e*s,u=p+r*_,d=u;if(t.length<u)throw new AA({message:`Invalid proof: expected at least ${u} bytes, got ${t.length}`});const b=[];for(let E=0;E<e;E++){const B=c+E*s,G=B+s,Y=t.slice(B,G),T=Kn(Y);b.push(T)}const S=[];for(let E=0;E<r;E++){const B=p+E*_,G=B+_,Y=t.slice(B,G),T=Kn(Y);S.push(T)}const R=t.slice(d),m=Kn(R),P=ta.from({signatures:S,handles:b,extraData:m});return re(Kn(t)===P.proof),P}}async function S_(i,t){if(t===!0)return Promise.all(i.map(r=>r()));const e=[];for(const r of i)e.push(await r());return e}class m_{#t;#e;#r;#i;constructor(t){pc(t.coprocessorSigners),this.#t=[...t.coprocessorSigners],this.#r=t.coprocessorSignerThreshold,Object.freeze(this.#t),this.#e=new Set(this.#t.map(e=>e.toLowerCase())),this.#i=new Sc(t)}static fromAddresses(t){return new m_(t)}static async fromProvider(t){ie(t.inputVerifierContractAddress);const e=["function getCoprocessorSigners() view returns (address[])","function getThreshold() view returns (uint256)"],r=new de(t.inputVerifierContractAddress,e,t.provider),s=await S_([()=>r.getCoprocessorSigners(),()=>r.getThreshold()],t.batchRpcCalls),_=s[0],a=s[1];return new m_({...t,coprocessorSigners:_,coprocessorSignerThreshold:a})}get count(){return this.#t.length}get coprocessorSigners(){return this.#t}get coprocessorSignerThreshold(){return this.#r}get gatewayChainId(){return this.#i.gatewayChainId}get verifyingContractAddressInputVerification(){return this.#i.verifyingContractAddressInputVerification}_isThresholdReached(t){const e=new Set;t.forEach(r=>{if(e.has(r.toLowerCase()))throw new oR({duplicateAddress:r});e.add(r)});for(const r of t)if(!this.#e.has(r.toLowerCase()))throw new aR({unknownAddress:r});return t.length>=this.#r}verifyZKProof(t){const r={ctHandles:t.handles.map(s=>s.toBytes32()),userAddress:t.zkProof.userAddress,contractAddress:t.zkProof.contractAddress,contractChainId:t.zkProof.chainId,extraData:t.extraData};this._verify({signatures:t.signatures,message:r})}_verify(t){const e=this.#i.verify(t);if(!this._isThresholdReached(e))throw new cR}verifyAndComputeInputProof(t){this.verifyZKProof(t);const e=t.handles.map(r=>r.toBytes32());return ta.from({signatures:t.signatures,handles:e,extraData:t.extraData})}}async function bA({zkProof:i,coprocessorSignersVerifier:t,relayerProvider:e,extraData:r,options:s}){const _=await e.fetchPostInputProofWithZKProof({zkProof:i,extraData:r},s);return t.verifyAndComputeInputProof({zkProof:i,handles:_.fhevmHandles,signatures:_.result.signatures,extraData:r})}const pR=({fhevm:i,capacity:t,defaultOptions:e})=>(r,s)=>{if(!Jt(r))throw new Error("Contract address is not a valid address.");if(!Jt(s))throw new Error("User address is not a valid address.");const _=i.fhevmHostChain.aclContractAddress,a=i.fhevmHostChain.chainId,c=i.relayerProvider,l=i.fhevmHostChain.coprocessorSigners,p=i.fhevmHostChain.gatewayChainId,u=i.fhevmHostChain.coprocessorSignerThreshold,d=i.fhevmHostChain.verifyingContractAddressInputVerification,b=nR({aclContractAddress:_,chainId:Number(a),tfheCompactPublicKey:i.getPublicKeyWasm().wasm,tfheCompactPkeCrs:i.getPkeCrsWasmForCapacity(t).wasm,contractAddress:r,userAddress:s,capacity:t});return{_input:b,addBool(S){return b.addBool(S),this},add8(S){return b.add8(S),this},add16(S){return b.add16(S),this},add32(S){return b.add32(S),this},add64(S){return b.add64(S),this},add128(S){return b.add128(S),this},add256(S){return b.add256(S),this},addAddress(S){return b.addAddress(S),this},getBits(){return b.getBits()},generateZKProof(){if(b.getBits().length===0)throw new Error("Encrypted input must contain at least one value");return y_.fromComponents({chainId:BigInt(a),aclContractAddress:_,userAddress:s,contractAddress:r,ciphertextWithZKProof:b.encrypt(),encryptionBits:b.getBits()})},encrypt:async S=>{const R="0x00";if(b.getBits().length===0)throw new Error("Encrypted input must contain at least one value");const m=b.encrypt(),P=y_.fromComponents({ciphertextWithZKProof:m,chainId:BigInt(a),aclContractAddress:_,encryptionBits:b.getBits(),userAddress:s,contractAddress:r}),E=m_.fromAddresses({coprocessorSigners:l,gatewayChainId:p,coprocessorSignerThreshold:u,verifyingContractAddressInputVerification:d});return(await bA({zkProof:P,coprocessorSignersVerifier:E,relayerProvider:c,extraData:R,options:{...e,...S}})).toBytes()}}};class Ap extends it{_contractAddress;_contractName;constructor(t){super({...t,name:t.name??"ContractErrorBase"}),this._contractAddress=t.contractAddress,this._contractName=t.contractName}get contractAddress(){return this._contractAddress}get contractName(){return this._contractName}}class fR extends Ap{constructor({contractAddress:t,contractName:e,message:r}){super({contractAddress:t,contractName:e,name:"ContractError",message:r})}}class hR extends Ap{_handles;constructor({contractAddress:t,handles:e}){const r=e.join(", ");super({message:e.length===1?`Handle ${e[0]} is not allowed for public decryption`:`${e.length} handles are not allowed for public decryption: ${r}`,name:"ACLPublicDecryptionError",contractAddress:t,contractName:"ACL"}),this._handles=e}get handles(){return this._handles}}class bp extends Ap{constructor({contractAddress:t,message:e}){super({message:e,name:"ACLUserDecryptionError",contractAddress:t,contractName:"ACL"})}}const oa=class oa{constructor({aclContractAddress:t,provider:e,batchRpcCalls:r}){zt(this,Fi);zt(this,oo);zt(this,ao);if(!Jt(t))throw new _p({address:t});if(e==null)throw new fR({contractAddress:t,contractName:"ACL",message:"Invalid provider."});le(this,ao,r===!0),le(this,Fi,t),le(this,oo,new de(L(this,Fi),L(oa,_a),e))}async isAllowedForDecryption(t,e={checkArguments:!0}){const r=Array.isArray(t),s=r?t:[t];if(e.checkArguments===!0)for(let c=0;c<s.length;++c)lt.assertIsHandleLike(s[c]);const _=s.map(c=>()=>L(this,oo).isAllowedForDecryption(ro(c))),a=await S_(_,L(this,ao));return r?a:a[0]}async checkAllowedForDecryption(t,e={checkArguments:!0}){const r=Array.isArray(t)?t:[t],s=await this.isAllowedForDecryption(r,e),_=r.filter((a,c)=>!s[c]).map(ro);if(_.length>0)throw new hR({contractAddress:L(this,Fi),handles:_})}async persistAllowed(t,e={checkArguments:!0}){const r=Array.isArray(t),s=r?t:[t];if(e.checkArguments===!0)for(const c of s)lt.assertIsHandleLike(c.handle),ie(c.address);const _=s.map(c=>()=>L(this,oo).persistAllowed(ro(c.handle),c.address)),a=await S_(_,L(this,ao));return r?a:a[0]}async checkUserAllowedForDecryption(t,e={checkArguments:!0}){const r=Array.isArray(t.handleContractPairs)?t.handleContractPairs:[t.handleContractPairs];if(e.checkArguments===!0){ie(t.userAddress);for(const l of r)lt.assertIsHandleLike(l.handle),ie(l.contractAddress)}for(const l of r)if(t.userAddress===l.contractAddress)throw new bp({contractAddress:L(this,Fi),message:`userAddress ${t.userAddress} should not be equal to contractAddress when requesting user decryption!`});const s=[],_=new Set;for(const l of r){const p=`${t.userAddress.toLowerCase()}:${l.handle}`;_.has(p)||(_.add(p),s.push({address:t.userAddress,handle:ro(l.handle)}));const u=`${l.contractAddress.toLowerCase()}:${l.handle}`;_.has(u)||(_.add(u),s.push({address:l.contractAddress,handle:ro(l.handle)}))}const a=await this.persistAllowed(s,{checkArguments:!1}),c=new Map;for(let l=0;l<s.length;++l){const p=`${s[l].address.toLowerCase()}:${s[l].handle}`;c.set(p,a[l])}for(const l of r){const p=`${t.userAddress.toLowerCase()}:${l.handle}`;if(c.get(p)!==!0)throw new bp({contractAddress:L(this,Fi),message:`User ${t.userAddress} is not authorized to user decrypt handle ${l.handle}!`})}for(const l of r){const p=`${l.contractAddress.toLowerCase()}:${l.handle}`;if(c.get(p)!==!0)throw new bp({contractAddress:L(this,Fi),message:`dapp contract ${l.contractAddress} is not authorized to user decrypt handle ${l.handle}!`})}}};Fi=new WeakMap,oo=new WeakMap,ao=new WeakMap,_a=new WeakMap,zt(oa,_a,["function persistAllowed(bytes32 handle, address account) view returns (bool)","function isAllowedForDecryption(bytes32 handle) view returns (bool)"]),Object.freeze(L(oa,_a));let mc=oa;function uR(i,t,e){const r=new Map;t.forEach((s,_)=>{if(r.has(s)){const a=s;throw new Error(`Duplicate KMS signer address found: ${a} appears multiple times in recovered addresses`)}r.set(s,_)});for(const s of t)if(!i.includes(s))throw new Error(`Invalid address found: ${s} is not in the list of KMS signers`);return t.length>=e}function dR(i,t){const e=[],r=[];for(let a=0;a<i.length;++a){const c=i[a],l=lt.from(c).fheTypeId;let p=t[c];typeof p=="boolean"&&(p=p?"0x01":"0x00");const u=BigInt(p);switch(e.push("uint256"),l){case 7:{r.push(`0x${u.toString(16).padStart(40,"0")}`);break}case 0:{if(u!==BigInt(0)&&u!==BigInt(1))throw new Error(`Invalid ebool clear text value ${u}. Expecting 0 or 1.`);r.push(u);break}case 2:case 3:case 4:case 5:case 6:case 8:{r.push(u);break}default:wp(l,`Unsupported Fhevm primitive type id: ${l}`)}}const _=pi.defaultAbiCoder().encode(e,r);return{abiTypes:e,abiValues:r,abiEncodedClearValues:_}}function wR(i,t){const e=Va(["uint8"],[i.length]),r=Va(Array(i.length).fill("bytes"),i);return ot([e,r,t])}function gR(i,t){let e=[];for(const p of i)e.push(p.fheTypeId);const r="0x"+"00".repeat(32)+t.slice(2)+"00".repeat(32),s=e.map(p=>up(p)),c=new pi().decode(["uint256",...s,"bytes[]"],r).slice(1,1+e.length),l={};return i.forEach((p,u)=>l[p.toBytes32Hex()]=c[u]),l}const AR=({kmsSigners:i,thresholdSigners:t,gatewayChainId:e,verifyingContractAddressDecryption:r,aclContractAddress:s,relayerProvider:_,provider:a,defaultOptions:c})=>async(l,p)=>{const u="0x00",d=l.map(lt.from),b=d.map(J=>J.toBytes32Hex());eR(d),await new mc({aclContractAddress:s,provider:a}).checkAllowedForDecryption(d);const R={ciphertextHandles:b,extraData:u},m=await _.fetchPostPublicDecrypt(R,{...c,...p}),P=Qo(m.decryptedValue),E=m.signatures.map(Qo),B="0x",G={name:"Decryption",version:"1",chainId:e,verifyingContract:r},Y={PublicDecryptVerification:[{name:"ctHandles",type:"bytes32[]"},{name:"decryptedResult",type:"bytes"},{name:"extraData",type:"bytes"}]},T=E.map(J=>Oh(G,Y,{ctHandles:b,decryptedResult:P,extraData:B},J));if(!uR(i,T,t))throw Error("KMS signers threshold is not reached");const F=gR(d,P),V=dR(b,F),q=wR(E,B);return{clearValues:F,abiEncodedClearValues:V.abiEncodedClearValues,decryptionProof:q}};class bR extends it{_operation;constructor(t){super({...t,name:"RelayerProviderError"}),this._operation=t.operation}get operation(){return this._operation}}class yR extends bR{constructor({cause:t}){super({message:"Invalid relayer response.",name:"RelayerGetKeyUrlError",operation:"KEY_URL",cause:t})}}class yA extends yR{constructor({cause:t}){super({cause:t})}}function SA(i){if(i instanceof Error&&typeof i.cause=="object"&&i.cause!==null)return i.cause}function SR(i){const t=SA(i);if(!(!t||!("code"in t)||!t.code)&&typeof t.code=="string")return t.code}function mR(i){const t=SA(i);if(!(!t||!("status"in t)||t.status===void 0)&&typeof t.status=="number")return t.status}async function yp(i,t){let e;if(t.status===429)e="Relayer rate limit exceeded: Please wait and try again later.";else switch(i){case"PUBLIC_DECRYPT":{e=`Public decrypt failed: relayer respond with HTTP code ${t.status}`;break}case"USER_DECRYPT":{e=`User decrypt failed: relayer respond with HTTP code ${t.status}`;break}case"KEY_URL":{e=`HTTP error! status: ${t.status}`;break}default:{const _=await t.text();e=`Relayer didn't response correctly. Bad status ${t.statusText}. Content: ${_}`;break}}let r;try{r=await t.json()}catch{r=""}const s={code:"RELAYER_FETCH_ERROR",operation:i,status:t.status,statusText:t.statusText,url:t.url,response:t,responseJson:r};throw new Error(e,{cause:s})}function Sp(i,t,e){let r;switch(i){case"PUBLIC_DECRYPT":{r="Public decrypt failed: Relayer didn't return a JSON";break}case"USER_DECRYPT":{r="User decrypt failed: Relayer didn't return a JSON";break}default:{r="Relayer didn't return a JSON";break}}const s={code:"RELAYER_NO_JSON_ERROR",operation:i,error:t,response:e};throw new Error(r,{cause:s})}function mp(i,t){let e;switch(i){case"PUBLIC_DECRYPT":{e="Public decrypt failed: Relayer returned an unexpected JSON response";break}case"USER_DECRYPT":{e="User decrypt failed: Relayer returned an unexpected JSON response";break}default:{e="Relayer returned an unexpected JSON response";break}}const r={code:"RELAYER_UNEXPECTED_JSON_ERROR",operation:i,error:t};throw new Error(e,{cause:r})}function Rp(i,t,e){if(!e)switch(i){case"PUBLIC_DECRYPT":{e="Public decrypt failed: Relayer didn't respond";break}case"USER_DECRYPT":{e="User decrypt failed: Relayer didn't respond";break}default:{e="Relayer didn't response correctly. Bad JSON.";break}}const r={code:"RELAYER_UNKNOWN_ERROR",operation:i,error:t};throw new Error(e??"Relayer didn't response correctly.",{cause:r})}function ea(i,t){if(t)switch(t.__type){case"BearerToken":{i.headers.Authorization=`Bearer ${t.token}`;break}case"ApiKeyHeader":{const e=Nn(t.header)?t.header:"x-api-key";i.headers[e]=t.value;break}case"ApiKeyCookie":{const e=Nn(t.cookie)?t.cookie:"x-api-key";typeof window<"u"?(document.cookie=`${e}=${t.value}; path=/; SameSite=Lax; Secure; HttpOnly;`,i.credentials="include"):i.headers.Cookie=`${e}=${t.value};`;break}}return i}function mA(i){if(i){if(typeof i.throwIfAborted=="function")i.throwIfAborted();else if(i.aborted)throw new DOMException("This operation was aborted","AbortError")}}function RR(i){const t=new Error("Aborted",{cause:i});return t.name="AbortError",t}function PR(i,t){return mA(t),new Promise((e,r)=>{const s=setTimeout(e,i);t?.addEventListener("abort",()=>{clearTimeout(s),r(RR(t.reason))},{once:!0})})}async function RA(i){return typeof i.bytes=="function"?F1(await i.bytes()):F1(await i.arrayBuffer())}async function PA(i){let t,e=i.retries??3;e>1e3&&(e=1e3),e<0&&(e=0);let r=i.retryDelayMs??1e3;r>3600*1e3&&(r=3600*1e3),r<100&&(r=100);const s=i.init,_=i.url;for(let a=0;a<=e;a++){mA(s?.signal);try{return await fetch(_,s)}catch(c){if(c.name==="AbortError")throw c;t=c,a<e&&await PR(r,s?.signal??void 0)}}throw t}class Ot extends it{constructor({message:t,cause:e}){super({message:t,name:"TFHEError",...e?{cause:io(e)}:{}})}}function MR(i,t){H(i,"id",t),q1(i,"capacity",t),H(i,"srcUrl",t)}function ER(i,t){H(i,"id",t),cc(i,"bytes",t),q1(i,"capacity",t),ee(i,"srcUrl")&&H(i,"srcUrl",t)}function CR(i,t){H(i,"id",t),cc(i,"bytes",t),ee(i,"srcUrl")&&H(i,"srcUrl",t)}function zR(i,t){H(i,"id",t),H(i,"srcUrl",t)}class Wr{#t="";#e;#r=-1;#i;constructor(){}get srcUrl(){return this.#i}get wasmClassName(){return this.#e.constructor.name}supportsCapacity(t){return this.#r===t}getWasmForCapacity(t){if(this.#r!==t)throw new Ot({message:`Unsupported FHEVM PkeCrs capacity: ${String(t)}`});return{capacity:t,id:this.#t,wasm:this.#e}}getBytesForCapacity(t){if(this.#r!==t)throw new Ot({message:`Unsupported FHEVM PkeCrs capacity: ${String(t)}`});return{capacity:t,id:this.#t,bytes:this.toBytes().bytes}}static fromWasm(t){return this._fromWasm(t)}static _fromWasm(t){const e=new Wr;return e.#t=t.id,e.#e=t.wasm,e.#i=t.srcUrl,e.#r=t.capacity,e}static fromBytes(t){try{return ER(t,"arg"),Wr._fromBytes(t)}catch(e){throw new Ot({message:"Invalid public key (deserialization failed)",cause:e})}}static _fromBytesHex(t){let e;try{H(t,"bytesHex","arg"),e=qo(t.bytesHex,{strict:!0})}catch(r){throw new Ot({message:"Invalid public key (deserialization failed)",cause:r})}return Wr.fromBytes({id:t.id,capacity:t.capacity,srcUrl:t.srcUrl,bytes:e})}static _fromBytes(t){const e=new Wr;return e.#t=t.id,e.#e=Ut.CompactPkeCrs.safe_deserialize(t.bytes,A_),e.#r=t.capacity,e.#i=t.srcUrl,e}static async fetch(t){try{return MR(t,"arg"),await Wr.#s(t)}catch(e){throw new Ot({message:"Impossible to fetch public key: wrong relayer url.",cause:e})}}static async#s(t){if(t.init?.method!==void 0&&t.init.method!=="GET")throw new Ot({message:`Invalid fetch method: expected 'GET', got '${t.init.method}'`});const e=await PA({url:t.srcUrl,...t.init!==void 0?{init:t.init}:{},...t.retries!==void 0?{retries:t.retries}:{},...t.retryDelayMs!==void 0?{retryDelayMs:t.retryDelayMs}:{}});if(!e.ok)throw new Ot({message:`HTTP error! status: ${e.status} on ${e.url}`});const r=await RA(e);return Wr.fromBytes({bytes:r,id:t.id,capacity:t.capacity,srcUrl:t.srcUrl})}toBytes(){return{bytes:this.#e.safe_serialize(A_),id:this.#t,capacity:this.#r,...this.#i!==void 0?{srcUrl:this.#i}:{}}}_toBytesHex(){return{bytesHex:X_(this.#e.safe_serialize(A_)),id:this.#t,capacity:this.#r,...this.#i!==void 0?{srcUrl:this.#i}:{}}}toJSON(){return{__type:"TFHEPkeCrs",...this._toBytesHex()}}static fromJSON(t){if(t.__type!=="TFHEPkeCrs")throw new Ot({message:"Invalid TFHEPkeCrs JSON."});return Wr._fromBytesHex(t)}}class Zr{#t="";#e;#r;constructor(){}get id(){return this.#t}get srcUrl(){return this.#r}get tfheCompactPublicKeyWasm(){return this.#e}get wasmClassName(){return this.#e.constructor.name}static fromWasm(t){return this._fromWasm(t)}static _fromWasm(t){const e=new Zr;return e.#t=t.id,e.#e=t.wasm,e.#r=t.srcUrl,e}static fromBytes(t){try{return CR(t,"arg"),Zr._fromBytes(t)}catch(e){throw new Ot({message:"Invalid public key (deserialization failed)",cause:e})}}static _fromBytesHex(t){let e;try{H(t,"bytesHex","arg"),e=qo(t.bytesHex,{strict:!0})}catch(r){throw new Ot({message:"Invalid public key (deserialization failed)",cause:r})}return Zr.fromBytes({id:t.id,srcUrl:t.srcUrl,bytes:e})}static _fromBytes(t){const e=new Zr;return e.#t=t.id,e.#e=Ut.TfheCompactPublicKey.safe_deserialize(t.bytes,g_),e.#r=t.srcUrl,e}static async fetch(t){try{return zR(t,"arg"),await Zr.#i(t)}catch(e){throw new Ot({message:"Impossible to fetch public key: wrong relayer url.",cause:e})}}static async#i(t){if(t.init?.method!==void 0&&t.init.method!=="GET")throw new Ot({message:`Invalid fetch method: expected 'GET', got '${t.init.method}'`});const e=await PA({url:t.srcUrl,...t.init!==void 0?{init:t.init}:{},...t.retries!==void 0?{retries:t.retries}:{},...t.retryDelayMs!==void 0?{retryDelayMs:t.retryDelayMs}:{}});if(!e.ok)throw new Ot({message:`HTTP error! status: ${e.status} on ${e.url}`});const r=await RA(e);return Zr.fromBytes({bytes:r,id:t.id,srcUrl:t.srcUrl})}toBytes(){return{bytes:this.#e.safe_serialize(g_),id:this.#t,...this.#r!==void 0?{srcUrl:this.#r}:{}}}_toBytesHex(){return{bytesHex:X_(this.#e.safe_serialize(g_)),id:this.#t,...this.#r!==void 0?{srcUrl:this.#r}:{}}}toJSON(){return{__type:"TFHEPublicKey",...this._toBytesHex()}}static fromJSON(t){if(t.__type!=="TFHEPublicKey")throw new Ot({message:"Invalid TFHEPublicKey JSON."});return Zr._fromBytesHex(t)}}function IR(i){try{return MA(i,""),!0}catch{return!1}}function MA(i,t){H(i,"id",t),cc(i,"data",t)}function EA(i,t){ii(i,"2048",t),BR(i[2048],`${t}.2048`)}function GR(i){try{return EA(i,""),!0}catch{return!1}}function BR(i,t){H(i,"publicParamsId",t),cc(i,"publicParams",t)}class ki{#t;#e;constructor(t){this.#e=t.publicKey,this.#t=t.pkeCrs2048}getTFHEPublicKey(){return this.#e}getTFHEPkeCrs(){return this.#t}static tryFromFhevmPkeConfig(t){if(ee(t,"publicParams")&&GR(t.publicParams)&&ee(t,"publicKey")&&IR(t.publicKey))return ki.fromFhevmPkeConfig({publicKey:t.publicKey,publicParams:t.publicParams})}static fromFhevmPkeConfig(t){EA(t.publicParams,"fhevmPkeConfig.publicParams"),MA(t.publicKey,"fhevmPkeConfig.publicKey");const e=Zr.fromBytes({id:t.publicKey.id,bytes:t.publicKey.data}),r=Wr.fromBytes({id:t.publicParams[2048].publicParamsId,bytes:t.publicParams[2048].publicParams,capacity:2048});return new ki({publicKey:e,pkeCrs2048:r})}static fromWasm(t){const e=Zr.fromWasm(t.publicKey),r=Wr.fromWasm(t.pkeCrs2048);return new ki({publicKey:e,pkeCrs2048:r})}static async fetch(t){if(t.pkeCrsUrl.capacity!==2048)throw new Ot({message:`Invalid pke crs capacity ${t.pkeCrsUrl.capacity.toString()}. Expecting 2048.`});try{const e=await Zr.fetch(t.publicKeyUrl),r=await Wr.fetch(t.pkeCrsUrl);return new ki({publicKey:e,pkeCrs2048:r})}catch(e){throw new Ot({message:"Impossible to fetch public key: wrong relayer url.",cause:e})}}}function NR(i){try{return CA(i,"RelayerGetResponseKeyUrlCamelCase"),!0}catch{return!1}}function KR(i){try{return zA(i,"RelayerGetResponseKeyUrlSnakeCase"),!0}catch{return!1}}function CA(i,t){IA(i,t,{fheKeyInfoName:"fheKeyInfo",fhePublicKeyName:"fhePublicKey",dataIdName:"dataId"})}function zA(i,t){IA(i,t,{fheKeyInfoName:"fhe_key_info",fhePublicKeyName:"fhe_public_key",dataIdName:"data_id"})}function IA(i,t,e){ii(i,"response",t),ii(i.response,"crs",`${t}.response`);const r=i.response.crs,s=Object.keys(r);for(let a=0;a<s.length;++a)GA(r[s[a]],`${t}.response.crs.${s[a]}`,e.dataIdName);Bn(i.response,e.fheKeyInfoName,`${t}.response`);const _=i.response[e.fheKeyInfoName];for(let a=0;a<_.length;++a){const c=_[a],l=`${t}.response.${e.fheKeyInfoName}[${a}]`;ii(c,e.fhePublicKeyName,l),GA(c[e.fhePublicKeyName],`${l}.${e.fhePublicKeyName}`,e.dataIdName)}}function GA(i,t,e){H(i,e,t),Mm(i,"urls",t)}function vR(i){const t=i.response.fheKeyInfo.map(r=>({fhe_public_key:{data_id:r.fhePublicKey.dataId,urls:r.fhePublicKey.urls}})),e={};for(const[r,s]of Object.entries(i.response.crs))e[r]={data_id:s.dataId,urls:s.urls};return{response:{fhe_key_info:t,crs:e}}}function BA(i){if(KR(i))return i;if(NR(i))return vR(i)}const Pp=new Map;class Mp{#t;#e;constructor({relayerUrl:t,auth:e}){this.#t=t,this.#e=e}get url(){return this.#t}get keyUrl(){return`${this.url}/keyurl`}get inputProofUrl(){return`${this.url}/input-proof`}get publicDecryptUrl(){return`${this.url}/public-decrypt`}get userDecryptUrl(){return`${this.url}/user-decrypt`}get delegatedUserDecryptUrl(){return`${this.url}/delegated-user-decrypt`}fetchTFHEPkeParams(){const t=Pp.get(this.#t);if(t!==void 0)return t;const e=this._fetchTFHEPkeParamsImpl().catch(r=>{throw Pp.delete(this.#t),r});return Pp.set(this.#t,e),e}async _fetchTFHEPkeParamsImpl(){const t=await this.fetchTFHEPkeUrls();return ki.fetch(t)}async fetchTFHEPkeUrls(){const t=await this.fetchGetKeyUrl(),e=BA(t);if(!e)throw new Error("Invalid relayer key url response");const r=e.response.fhe_key_info[0].fhe_public_key,s=r.data_id,_=r.urls[0],a=e.response.crs[2048],c=a.data_id,l=a.urls[0];return{publicKeyUrl:{id:s,srcUrl:_},pkeCrsUrl:{capacity:2048,id:c,srcUrl:l}}}async fetchGetKeyUrl(){const t=await this._fetchRelayerGet("KEY_URL",this.keyUrl);let e;if(this.version===2)try{if(CA(t,"fetchGetKeyUrl()"),e=BA(t),!e)throw new tp({message:"Unable to convert fetchGetKeyUrl() to snake case."})}catch(r){throw new yA({cause:io(r)})}else{e=t;try{zA(e,"fetchGetKeyUrl()")}catch(r){throw new yA({cause:io(r)})}}return e}async fetchPostInputProofWithZKProof(t,e){const r=lt.fromZKProof(t.zkProof),s=await this.fetchPostInputProof({contractAddress:t.zkProof.contractAddress,userAddress:t.zkProof.userAddress,ciphertextWithInputVerification:np(t.zkProof.ciphertextWithZKProof),contractChainId:Hm(t.zkProof.chainId),extraData:t.extraData},e);if(r.length!==s.handles.length)throw new Error(`Incorrect Handles list sizes: (expected) ${r.length} != ${s.handles.length} (received)`);const _=s.handles.map(a=>lt.fromBytes32Hex(a));for(let a=0;a<r.length;++a)if(!r[a].equals(_[a]))throw new Error(`Incorrect Handle ${a}: (expected) ${r[a].toBytes32Hex()} != ${_[a].toBytes32Hex()} (received)`);return{result:s,fhevmHandles:r}}async _fetchRelayerGet(t,e){const r=ea({method:"GET",headers:{"ZAMA-SDK-VERSION":W_,"ZAMA-SDK-NAME":Jo}},this.#e);let s,_;try{s=await fetch(e,r)}catch(c){Rp(t,c)}s.ok||await yp(t,s);let a;try{a=await s.json()}catch(c){Sp(t,c,s)}try{xR(a),_=a}catch(c){mp(t,c)}return _}}function NA(i,t){U1(i,"handles",t),Bm(i,"signatures",t)}function KA(i,t){T1(i,"signatures",t),H(i,"decryptedValue",t),ac(i,"extraData",t)}function Ep(i,t){if(!Array.isArray(i))throw ct.invalidObject({objName:t,expectedType:"Array",type:typeof i});for(let e=0;e<i.length;++e)Zo(i[e],"payload",`${t}[i]`),Zo(i[e],"signature",`${t}[i]`)}function xR(i){if(i==null||typeof i!="object")throw new Error("Unexpected response JSON.");if(!("response"in i&&i.response!==null&&i.response!==void 0))throw new Error("Unexpected response JSON format: missing 'response' property.")}class UR extends it{constructor(t){super({...t,name:"InvalidRelayerUrlError"})}}const Rc="https://relayer.mainnet.zama.org",vA=`${Rc}/v1`,xA=`${Rc}/v2`,Pc={aclContractAddress:"0xcA2E8f1F656CD25C01F05d0b243Ab1ecd4a8ffb6",kmsContractAddress:"0x77627828a55156b04Ac0DC0eb30467f1a552BB03",inputVerifierContractAddress:"0xCe0FC2e05CFff1B719EFF7169f7D80Af770c8EA2",verifyingContractAddressDecryption:"0x0f6024a97684f7d90ddb0fAAD79cB15F2C888D24",verifyingContractAddressInputVerification:"0xcB1bB072f38bdAF0F328CdEf1Fc6eDa1DF029287",chainId:1,gatewayChainId:261131};Object.freeze(Pc);const UA={...Pc,relayerUrl:Rc};Object.freeze(UA);const TA={...Pc,relayerUrl:vA};Object.freeze(TA);const OA={...Pc,relayerUrl:xA};Object.freeze(OA);const Mc="https://relayer.testnet.zama.org",kA=`${Mc}/v1`,VA=`${Mc}/v2`,Ec={aclContractAddress:"0xf0Ffdc93b7E186bC2f8CB3dAA75D86d1930A433D",kmsContractAddress:"0xbE0E383937d564D7FF0BC3b46c51f0bF8d5C311A",inputVerifierContractAddress:"0xBBC1fFCdc7C316aAAd72E807D9b0272BE8F84DA0",verifyingContractAddressDecryption:"0x5D8BD78e2ea6bbE41f26dFe9fdaEAa349e077478",verifyingContractAddressInputVerification:"0x483b9dE06E4E4C7D35CCf5837A1668487406D955",chainId:11155111,gatewayChainId:10901};Object.freeze(Ec);const FA={...Ec,relayerUrl:Mc};Object.freeze(FA);const YA={...Ec,relayerUrl:kA};Object.freeze(YA);const DA={...Ec,relayerUrl:VA};Object.freeze(DA);function TR(i,t,e){if(i==null||typeof i!="string")return null;const r=ep(i,"/");if(!URL.canParse(r))return null;if(![Mc,kA,VA,Rc,vA,xA].includes(r))return e===1||e===2?{url:r,version:e}:t!==1&&t!==2?null:{url:r,version:t};if(r.endsWith("/v1"))return{url:r,version:1};if(r.endsWith("/v2"))return{url:r,version:2};let a;if(e===1||e===2)a=e;else{if(t!==1&&t!==2)return null;a=t}return{url:`${r}/v${a}`,version:a}}function jA(i){if(i==null||typeof i!="object")throw new Error("Unexpected response JSON.");if(!("response"in i&&i.response!==null&&i.response!==void 0))throw new Error("Unexpected response JSON format: missing 'response' property.")}async function Cp(i,t,e,r){const s=ea({method:"POST",headers:{"Content-Type":"application/json","ZAMA-SDK-VERSION":W_,"ZAMA-SDK-NAME":Jo},body:JSON.stringify(e)},r?.auth);let _,a;try{_=await fetch(t,s)}catch(l){Rp(i,l)}_.ok||await yp(i,_);let c;try{c=await _.json()}catch(l){Sp(i,l,_)}try{jA(c),a=c}catch(l){mp(i,l)}return a}async function OR(i,t,e){const r=ea({method:"GET",headers:{"ZAMA-SDK-VERSION":W_,"ZAMA-SDK-NAME":Jo}},e?.auth);let s,_;try{s=await fetch(t,r)}catch(c){Rp(i,c)}s.ok||await yp(i,s);let a;try{a=await s.json()}catch(c){Sp(i,c,s)}try{jA(a),_=a}catch(c){mp(i,c)}return _}const zp={};async function LA(i,t,e){if(i in zp)return zp[i];const r=await OR("KEY_URL",`${i}/keyurl`,e);try{let s;if(!Nn(t))s=r.response.fhe_key_info[0].fhe_public_key.urls[0],t=r.response.fhe_key_info[0].fhe_public_key.data_id;else{const R=r.response.fhe_key_info.find(m=>m.fhe_public_key.data_id===t);if(!R)throw new Error(`Could not find FHE key info with data_id ${t}`);s=R.fhe_public_key.urls[0]}const _=await fetch(s);if(!_.ok)throw new Error(`HTTP error! status: ${_.status} on ${_.url}`);let a;typeof _.bytes=="function"?a=await _.bytes():a=new Uint8Array(await _.arrayBuffer());const c=r.response.crs[2048].urls[0],l=r.response.crs[2048].data_id,p=await fetch(c);if(!p.ok)throw new Error(`HTTP error! status: ${p.status} on ${p.url}`);let u;typeof p.bytes=="function"?u=await p.bytes():u=new Uint8Array(await p.arrayBuffer());let d;try{d=Ut.TfheCompactPublicKey.safe_deserialize(a,g_)}catch(R){throw new Error("Invalid public key (deserialization failed)",{cause:R})}let b;try{b=Ut.CompactPkeCrs.safe_deserialize(new Uint8Array(u),A_)}catch(R){throw new Error("Invalid crs (deserialization failed)",{cause:R})}const S={publicKey:d,publicKeyId:t,publicParams:{2048:{publicParams:b,publicParamsId:l}}};return zp[i]=S,S}catch(s){throw new Error("Impossible to fetch public key: wrong relayer url.",{cause:s})}}async function kR(i){if(Nn(i.relayerVersionUrl)&&!i.publicKey){const t=await LA(ep(i.relayerVersionUrl,"/"),void 0,i);return{publicKey:t.publicKey,publicKeyId:t.publicKeyId}}else if(i.publicKey?.data&&Nn(i.publicKey.id)){const t=i.publicKey.data;try{return{publicKey:Ut.TfheCompactPublicKey.safe_deserialize(t,g_),publicKeyId:i.publicKey.id}}catch(e){throw new Error("Invalid public key (deserialization failed)",{cause:e})}}else throw new Error("You must provide a public key with its public key ID.")}async function VR(i){if(Nn(i.relayerVersionUrl)&&!i.publicParams)return(await LA(ep(i.relayerVersionUrl,"/"),void 0,i)).publicParams;if(i.publicParams?.["2048"]){const t=i.publicParams[2048].publicParams;try{return{2048:{publicParams:Ut.CompactPkeCrs.safe_deserialize(t,A_),publicParamsId:i.publicParams[2048].publicParamsId}}}catch(e){throw new Error("Invalid public key (deserialization failed)",{cause:e})}}else throw new Error("You must provide a valid CRS with its CRS ID.")}class HA{#t;constructor(t){this.#t=t.fhevmHostChain}get fhevmHostChain(){return this.#t}get relayerVersionUrl(){return this.relayerProvider.url}}class FR extends Mp{get version(){return 1}async fetchPostInputProof(t,e){const r=await Cp("INPUT_PROOF",this.inputProofUrl,t,e);return NA(r.response,"fetchPostInputProof()"),r.response}async fetchPostPublicDecrypt(t,e){const s=(await Cp("PUBLIC_DECRYPT",this.publicDecryptUrl,t,e)).response[0],_={signatures:s.signatures,decryptedValue:s.decrypted_value,extraData:"0x"};return KA(_,"fetchPostPublicDecrypt()"),_}async fetchPostUserDecrypt(t,e){const r=await Cp("USER_DECRYPT",this.userDecryptUrl,t,e);return Ep(r.response,"RelayerUserDecryptResult()"),r.response}fetchPostDelegatedUserDecrypt(t,e){throw new Error("Delegated user decrypt is not supported in Relayer V1")}}class ae extends it{constructor({message:t}){super({message:t??"Invalid FHEVM config",name:"FhevmConfigError"})}}function YR(i,t){H(i,"name",t,"InputVerification"),H(i,"version",t,"1"),X1(i,"chainId",t),j1(i,"verifyingContract",t)}const lo=class lo{constructor(t){zt(this,ca);zt(this,xn);zt(this,co);zt(this,la);le(this,ca,t.address),le(this,xn,{...t.eip712Domain}),le(this,co,[...t.coprocessorSigners]),le(this,la,t.coprocessorSignerThreshold),Object.freeze(L(this,xn)),Object.freeze(L(this,co))}get address(){return L(this,ca)}get eip712Domain(){return L(this,xn)}get gatewayChainId(){return L(this,xn).chainId}get coprocessorSigners(){return L(this,co)}get coprocessorSignerThreshold(){return L(this,la)}get verifyingContractAddressInputVerification(){return L(this,xn).verifyingContract}static async loadFromChain(t){const e=new de(t.inputVerifierContractAddress,L(lo,aa),t.provider);if(t.batchRpcCalls===!0)throw new Error("Batch RPC Calls not supported!");const s=await S_([()=>e.eip712Domain(),()=>e.getThreshold(),()=>e.getCoprocessorSigners()],t.batchRpcCalls),_=s[0],a=s[1],c=s[2];if(!uc(a))throw new Error("Invalid InputVerifier Coprocessor signers threshold.");try{pc(c)}catch(d){throw new Error("Invalid InputVerifier Coprocessor signers addresses.",{cause:d})}const l=_[3];if(!op(l))throw new Error("Invalid InputVerifier EIP-712 domain chainId.");const p={name:_[1],version:_[2],chainId:l,verifyingContract:_[4]};try{YR(p,"InputVerifier.eip712Domain()")}catch(d){throw new Error("Invalid InputVerifier EIP-712 domain.",{cause:d})}if(p.verifyingContract.toLowerCase()===t.inputVerifierContractAddress.toLowerCase())throw new Error("Invalid InputVerifier EIP-712 domain. Unexpected verifyingContract.");return new lo({address:t.inputVerifierContractAddress,eip712Domain:p,coprocessorSignerThreshold:Number(a),coprocessorSigners:c})}};aa=new WeakMap,ca=new WeakMap,xn=new WeakMap,co=new WeakMap,la=new WeakMap,zt(lo,aa,["function getCoprocessorSigners() view returns (address[])","function getThreshold() view returns (uint256)","function eip712Domain() view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)"]),Object.freeze(L(lo,aa));let Cc=lo;function DR(i,t){H(i,"name",t,"Decryption"),H(i,"version",t,"1"),X1(i,"chainId",t),j1(i,"verifyingContract",t)}const fo=class fo{constructor(t){zt(this,fa);zt(this,ha);zt(this,R_);zt(this,po);zt(this,ua);le(this,fa,t.address),le(this,ha,t.eip712Domain.verifyingContract),le(this,R_,{...t.eip712Domain}),le(this,po,[...t.kmsSigners]),le(this,ua,t.kmsSignerThreshold),Object.freeze(L(this,R_)),Object.freeze(L(this,po))}get address(){return L(this,fa)}get eip712Domain(){return L(this,R_)}get gatewayChainId(){return L(this,R_).chainId}get kmsSigners(){return L(this,po)}get kmsSignerThreshold(){return L(this,ua)}get verifyingContractAddressDecryption(){return L(this,ha)}static async loadFromChain(t){const e=new de(t.kmsContractAddress,L(fo,pa),t.provider);if(t.batchRpcCalls===!0)throw new Error("Batch RPC Calls not supported!");const s=await S_([()=>e.eip712Domain(),()=>e.getThreshold(),()=>e.getKmsSigners()],t.batchRpcCalls),_=s[0],a=s[1],c=s[2];if(!uc(a))throw new Error("Invalid KMSVerifier kms signers threshold.");try{pc(c)}catch(u){throw new Error("Invalid KMSVerifier kms signers addresses.",{cause:u})}const l={name:_[1],version:_[2],chainId:_[3],verifyingContract:_[4]};try{DR(l,"KMSVerifier.eip712Domain()")}catch(u){throw new Error("Invalid KMSVerifier EIP-712 domain.",{cause:u})}if(l.verifyingContract.toLowerCase()===t.kmsContractAddress.toLowerCase())throw new Error("Invalid KMSVerifier EIP-712 domain. Unexpected verifyingContract.");return new fo({address:t.kmsContractAddress,eip712Domain:l,kmsSignerThreshold:Number(a),kmsSigners:c})}};pa=new WeakMap,fa=new WeakMap,ha=new WeakMap,R_=new WeakMap,po=new WeakMap,ua=new WeakMap,zt(fo,pa,["function getKmsSigners() view returns (address[])","function getThreshold() view returns (uint256)","function eip712Domain() view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)"]),Object.freeze(L(fo,pa));let zc=fo;class ra{#t;#e;#r;#i;#s;#n;#_;#o;#u;#a;constructor(t){this.#i=t.hostChainId,this.#t=t.hostACLContractAddress,this.#e=t.hostKMSVerifierContractAddress,this.#r=t.hostInputVerifierContractAddress,this.#s=t.hostNetworkConfig,Object.freeze(this.#s),this.#s.type==="rpc"?this.#n=new N2(this.#s.rpcUrl):this.#n=new i_(this.#s.provider),this.#_=t.gatewayVerifyingContractAddressDecryption,this.#o=t.gatewayVerifyingContractAddressInputVerification,this.#u=t.gatewayChainId,this.#a=t.batchRpcCalls}get chainId(){return this.#i}get aclContractAddress(){return this.#t}get kmsContractAddress(){return this.#e}get inputVerifierContractAddress(){return this.#r}get network(){return this.#s.type==="rpc"?this.#s.rpcUrl:this.#s.provider}get ethersProvider(){return this.#n}get verifyingContractAddressDecryption(){return this.#_}get verifyingContractAddressInputVerification(){return this.#o}get gatewayChainId(){return this.#u}get batchRpcCalls(){return this.#a}static fromUserConfig(t){const e=t.aclContractAddress,r=t.kmsContractAddress,s=t.inputVerifierContractAddress,_=t.verifyingContractAddressDecryption,a=t.verifyingContractAddressInputVerification,c=t.chainId,l=t.gatewayChainId,p=t.network;ia(e,"ACL contract"),ia(r,"KMS contract"),ia(s,"InputVerifier contract"),ia(_,"Verifying contract for Decryption"),ia(a,"Verifying contract for InputVerification"),JA(c,"host chain ID"),JA(l,"gateway chain ID");let u;if(p===void 0)throw new ae({message:"You must provide a network URL or a EIP1193 object (eg: window.ethereum)"});if(typeof p=="string"){if(!URL.canParse(p))throw new ae({message:`Invalid network URL: ${p}`});u={type:"rpc",rpcUrl:p}}else if(jR(p))u={type:"eip1193",provider:p};else throw new ae({message:"Invalid FhevmInstanceConfig.network property, expecting an RPC URL string or an Eip1193Provider"});if(t.publicKey){if(!t.publicParams)throw new ae({message:"Missing config publicParams."})}else if(t.publicParams)throw new ae({message:"Missing config publicKey."});return new ra({hostChainId:BigInt(c),hostNetworkConfig:u,hostACLContractAddress:e,hostKMSVerifierContractAddress:r,hostInputVerifierContractAddress:s,gatewayVerifyingContractAddressDecryption:_,gatewayVerifyingContractAddressInputVerification:a,gatewayChainId:BigInt(l),batchRpcCalls:t.batchRpcCalls===!0})}async loadFromChain(){return Ic.loadFromChain(this)}}class Ic{#t;#e;#r;constructor(t){this.#t=t.config,this.#e=t.inputVerifier,this.#r=t.kmsVerifier}static async loadFromChain(t){if(t.batchRpcCalls)throw new Error("Batch RPC Calls not supported!");const r=await S_([()=>t.ethersProvider.getNetwork(),()=>Cc.loadFromChain({inputVerifierContractAddress:t.inputVerifierContractAddress,provider:t.ethersProvider}),()=>zc.loadFromChain({kmsContractAddress:t.kmsContractAddress,provider:t.ethersProvider})],t.batchRpcCalls),s=r[0],_=r[1],a=r[2];if(s.chainId!==t.chainId)throw new ae({message:`Invalid config chainId ${String(t.chainId)}. Expecting ${String(s.chainId)}.`});if(_.gatewayChainId!==t.gatewayChainId)throw new ae({message:`Invalid config gatewayChainId ${String(t.gatewayChainId)}. Expecting ${String(_.gatewayChainId)}.`});if(_.verifyingContractAddressInputVerification!==t.verifyingContractAddressInputVerification)throw new ae({message:`Invalid config.verifyingContractAddressInputVerification=${t.verifyingContractAddressInputVerification}. Expecting ${t.verifyingContractAddressInputVerification}.`});if(a.verifyingContractAddressDecryption!==t.verifyingContractAddressDecryption)throw new ae({message:`Invalid config.verifyingContractAddressDecryption=${t.verifyingContractAddressDecryption}. Expecting ${a.verifyingContractAddressDecryption}.`});return new Ic({config:t,inputVerifier:_,kmsVerifier:a})}get chainId(){return this.#t.chainId}get ethersProvider(){return this.#t.ethersProvider}get aclContractAddress(){return this.#t.aclContractAddress}get kmsContractAddress(){return this.#t.kmsContractAddress}get inputVerifierContractAddress(){return this.#t.inputVerifierContractAddress}get coprocessorSigners(){return this.#e.coprocessorSigners}get coprocessorSignerThreshold(){return this.#e.coprocessorSignerThreshold}get verifyingContractAddressInputVerification(){return this.#e.verifyingContractAddressInputVerification}get kmsSigners(){return this.#r.kmsSigners}get kmsSignerThreshold(){return this.#r.kmsSignerThreshold}get verifyingContractAddressDecryption(){return this.#r.verifyingContractAddressDecryption}get gatewayChainId(){return this.#e.gatewayChainId}}function ia(i,t){if(i===void 0||i==="")throw new ae({message:`Missing ${t} checksummed address`});if(!Jt(i))throw new ae({message:`Invalid ${t} checksummed address`})}function JA(i,t){if(i===void 0)throw new ae({message:`Missing ${t}`});if(!to(i))throw new ae({message:`Invalid ${t}`})}function jR(i){return typeof i=="object"&&i!==null&&"request"in i&&typeof i.request=="function"}class Ip extends HA{_relayerProvider;_publicKeyData;_publicParamsData;_tfhePkeParams;constructor(t){super(t),this._relayerProvider=t.relayerProvider,this._publicKeyData=t.publicKeyData,this._publicParamsData=t.publicParamsData,this._tfhePkeParams=ki.fromWasm({publicKey:{id:this._publicKeyData.publicKeyId,wasm:this._publicKeyData.publicKey},pkeCrs2048:{id:this._publicParamsData[2048].publicParamsId,wasm:this._publicParamsData[2048].publicParams,capacity:2048}})}get version(){return 1}get tfhePkeParams(){return this._tfhePkeParams}static async fromConfig(t){const e=new FR({relayerUrl:t.relayerVersionUrl,...t.auth!==void 0?{auth:t.auth}:{}}),r=await kR(t),s=await VR(t),a=await ra.fromUserConfig(t).loadFromChain();return new Ip({relayerProvider:e,publicKeyData:r,publicParamsData:s,fhevmHostChain:a})}get relayerProvider(){return this._relayerProvider}getPublicKeyBytes(){return{id:this._publicKeyData.publicKeyId,bytes:this._publicKeyData.publicKey.safe_serialize(g_)}}getPublicKeyWasm(){return{id:this._publicKeyData.publicKeyId,wasm:this._publicKeyData.publicKey}}supportsCapacity(t){return t===2048}getPkeCrsBytesForCapacity(t){if(t===void 0)throw new Error("Missing PublicParams bits format");if(t!==2048)throw new Error(`Unsupported PublicParams bits format '${t}'`);return{capacity:t,id:this._publicParamsData[2048].publicParamsId,bytes:this._publicParamsData[2048].publicParams.safe_serialize(A_)}}getPkeCrsWasmForCapacity(t){if(t===void 0)throw new Error("Missing PublicParams bits format");if(t!==2048)throw new Error(`Unsupported PublicParams bits format '${t}'`);return{capacity:t,id:this._publicParamsData[2048].publicParamsId,wasm:this._publicParamsData[2048].publicParams}}}function QA(i,t){if(H(i,"label",t),!(i.label==="malformed_json"||i.label==="request_error"||i.label==="not_ready_for_decryption"))throw new ct({objName:t,property:"label",expectedType:"string",expectedValue:["malformed_json","request_error","not_ready_for_decryption"],type:typeof i.label,value:i.label});H(i,"message",t)}function $A(i,t){if(H(i,"label",t),!(i.label==="missing_fields"||i.label==="validation_failed"))throw new ct({objName:t,property:"label",expectedType:"string",expectedValue:["missing_fields","validation_failed"],type:typeof i.label,value:i.label});H(i,"message",t),Bn(i,"details",t);const e=i.details;for(let r=0;r<e.length;++r){const s=e[r];H(s,"field",`${t}.details[${r}]`),H(s,"issue",`${t}.details[${r}]`)}}function WA(i,t){H(i,"label",t,["rate_limited","protocol_overload"]),H(i,"message",t)}function ZA(i,t){H(i,"label",t,"internal_server_error"),H(i,"message",t)}function qA(i,t){H(i,"label",t,"not_found"),H(i,"message",t)}function XA(i,t){H(i,"label",t,["protocol_paused","insufficient_balance","insufficient_allowance","gateway_not_reachable","readiness_check_timed_out","response_timed_out"]),H(i,"message",t)}function sa(i,t){H(i,"status",t,"failed"),ii(i,"error",t),LR(i.error,`${t}.error`)}function LR(i,t){if(H(i,"label",t),i.label==="malformed_json"||i.label==="request_error"||i.label==="not_ready_for_decryption")QA(i,t);else if(i.label==="missing_fields"||i.label==="validation_failed")$A(i,t);else if(i.label==="not_found")qA(i,t);else if(i.label==="rate_limited"||i.label==="protocol_overload")WA(i,t);else if(i.label==="internal_server_error")ZA(i,t);else if(i.label==="readiness_check_timed_out"||i.label==="response_timed_out"||i.label==="protocol_paused"||i.label==="insufficient_balance"||i.label==="insufficient_allowance"||i.label==="gateway_not_reachable")XA(i,t);else throw new ct({objName:t,property:"label",expectedType:"string",expectedValue:["malformed_json","request_error","not_ready_for_decryption","missing_fields","validation_failed","rate_limited","internal_server_error","protocol_paused","insufficient_balance","insufficient_allowance","protocol_overload","gateway_not_reachable","readiness_check_timed_out","response_timed_out"],type:typeof i.label,value:i.label})}function tb(i,t){if(sa(i,t),i.error.label==="malformed_json"||i.error.label==="request_error"||i.error.label==="not_ready_for_decryption")QA(i.error,`${t}.error`);else if(i.error.label==="missing_fields"||i.error.label==="validation_failed")$A(i.error,`${t}.error`);else throw new ct({objName:`${t}.error`,property:"label",expectedType:"string",expectedValue:["malformed_json","request_error","not_ready_for_decryption","missing_fields","validation_failed"],type:typeof i.error.label,value:i.error.label})}function HR(i,t){sa(i,t),qA(i.error,`${t}.error`)}function JR(i,t){sa(i,t),WA(i.error,`${t}.error`)}function eb(i,t){sa(i,t),ZA(i.error,`${t}.error`)}function rb(i,t){sa(i,t),XA(i.error,`${t}.error`)}class Gp extends it{_fetchMethod;_url;_jobId;_operation;_retryCount;_elapsed;_state;constructor(t){const e=[...t.metaMessages??[],`url: ${t.url}`,`method: ${t.fetchMethod}`,`operation: ${t.operation}`,`retryCount: ${t.retryCount}`,...t.jobId!==void 0?[`jobId: ${t.jobId}`]:[]];super({...t,metaMessages:e,name:t.name??"RelayerV2FetchErrorBase"}),this._fetchMethod=t.fetchMethod,this._url=t.url,this._operation=t.operation,this._elapsed=t.elapsed,this._retryCount=t.retryCount,this._state=t.state,this._jobId=t.jobId}get url(){return this._url}get operation(){return this._operation}get fetchMethod(){return this._fetchMethod}get jobId(){return this._jobId}get retryCount(){return this._retryCount}get elapsed(){return this._elapsed}get state(){return this._state}get isAbort(){return this.cause!==void 0?this.cause.name==="AbortError":!1}}class Gc extends Gp{_status;constructor(t){const e=[`status: ${t.status}`];super({...t,metaMessages:e,name:t.name??"RelayerV2ResponseErrorBase"}),this._status=t.status}get status(){return this._status}}class QR extends Gc{_bodyJson;constructor(t){super({...t,cause:io(t.cause),name:"RelayerV2ResponseInvalidBodyError",message:"Response body does not match the expected schema"}),this._bodyJson=t.bodyJson}get bodyJson(){return this._bodyJson}}class ib extends Gc{constructor(t){super({...t,name:"RelayerV2ResponseStatusError",message:`Unexpected response status ${t.status}`})}}function $R(i,t){Xl(i,"accepted",t),i.accepted?WR(i,t):ZR(i,t)}function WR(i,t){Xl(i,"accepted",t,!0),U1(i,"handles",t),Nm(i,"signatures",t),ac(i,"extraData",t)}function ZR(i,t){Xl(i,"accepted",t,!1),ac(i,"extraData",t)}function qR(i,t){ii(i,"result",t),H(i,"status",t,"succeeded"),H(i,"requestId",t),$R(i.result,`${t}.result`)}function XR(i,t){T1(i,"signatures",t),Zo(i,"decryptedValue",t),ac(i,"extraData",t)}function tP(i,t){ii(i,"result",t),H(i,"status",t,"succeeded"),H(i,"requestId",t),XR(i.result,`${t}.result`)}function eP(i,t){Bn(i,"result",t);for(let e=0;e<i.result.length;++e)Zo(i.result[e],"payload",`${t}.result[${e}]`),Zo(i.result[e],"signature",`${t}.result[${e}]`)}function rP(i,t){ii(i,"result",t),H(i,"status",t,"succeeded"),H(i,"requestId",t),eP(i.result,`${t}.result`)}class Bp extends it{_url;_operation;_jobId;constructor(t){const e=[...t.metaMessages??[],`url: ${t.url}`,`operation: ${t.operation}`,...t.jobId!==void 0?[`jobId: ${t.jobId}`]:[]];super({...t,name:t.name??"RelayerV2RequestErrorBase",metaMessages:e}),this._url=t.url,this._operation=t.operation,this._jobId=t.jobId}get url(){return this._url}get jobId(){return this._jobId}get operation(){return this._operation}}class iP extends Bp{_status;_state;constructor(t){const e=[...t.metaMessages??[],...t.status!==void 0?[`status: ${t.status}`]:[],...t.state!==void 0?[`state: ${t.state}`]:[]];super({...t,metaMessages:e,name:"RelayerV2RequestInternalError",message:t.message??"Internal error"}),this._status=t.status,this._state=t.state}get status(){return this._status}get state(){return this._state}}class sP extends Gc{_relayerApiError;constructor(t){const e=[`label: ${t.relayerApiError.label}`];super({...t,metaMessages:e,name:"RelayerV2ResponseApiError",message:t.relayerApiError.message}),this._relayerApiError=t.relayerApiError}get relayerApiError(){return this._relayerApiError}}class nP extends Gp{constructor(t){super({...t,name:"RelayerV2FetchError",message:t.message,cause:io(t.cause)})}}class sb extends Gc{constructor(t){super({...t,name:"RelayerV2ResponseInputProofRejectedError",message:"InputProof rejected"})}}class Vi extends it{_state;constructor(t){super({...t,name:"RelayerV2StateError"}),this._state={...t.state},Object.freeze(this._state)}get state(){return this._state}}class _P extends Gp{constructor(t){super({...t,name:"RelayerV2MaxRetryError",message:`Maximum retry limit exceeded (retried ${t.retryCount} times)`})}}function oP(i,t){H(i,"jobId",t)}function aP(i,t){H(i,"status",t,"queued"),H(i,"requestId",t),ii(i,"result",t),oP(i.result,`${t}.result`)}function cP(i,t){H(i,"status",t,"queued"),H(i,"requestId",t)}class lP extends Bp{_timeoutMs;constructor(t){super({...t,name:"RelayerV2TimeoutError",message:`Request timed out after ${t.timeoutMs}ms`}),this._timeoutMs=t.timeoutMs}get timeoutMs(){return this._timeoutMs}}class pP extends Bp{constructor(t){super({...t,name:"RelayerV2AbortError",message:"Request aborted"})}}class Kt{_debug;_fetchMethod;_elapsed;_jobId;_jobIdTimestamp;_state;_relayerOperation;_internalAbortController;_internalAbortSignal;_externalAbortSignal;_terminateReason;_terminateError;_retryCount;_totalSteps;_step;_retryAfterTimeoutID;_url;_payload;_fhevmAuth;_retryAfterTimeoutPromiseFuncReject;_onProgress;_requestMaxDurationInMs;_requestStartTimestamp;_requestGlobalTimeoutID;_throwErrorIfNoRetryAfter;static DEFAULT_RETRY_AFTER_MS=2500;static MINIMUM_RETRY_AFTER_MS=1e3;static DEFAULT_GLOBAL_REQUEST_TIMEOUT_MS=3600*1e3;static MAX_GET_RETRY=1800;static MAX_POST_RETRY=Kt.MAX_GET_RETRY;constructor(t){const e=["INPUT_PROOF","PUBLIC_DECRYPT","USER_DECRYPT","DELEGATED_USER_DECRYPT"];if(!e.includes(t.relayerOperation))throw new ct({objName:"RelayerV2AsyncRequestParams",property:"relayerOperation",expectedType:"string",value:t.relayerOperation,expectedValue:e.join(" | ")});this._step=0,this._totalSteps=1,this._elapsed=0,this._relayerOperation=t.relayerOperation,this._internalAbortController=new AbortController,this._internalAbortSignal=this._internalAbortController.signal,this._internalAbortSignal.addEventListener("abort",this._handleInternalSignalAbort),this._externalAbortSignal=t.options?.signal,this._externalAbortSignal&&this._externalAbortSignal.addEventListener("abort",this._handleExternalSignalAbort),this._url=t.url,this._payload=t.payload,this._debug=t.options?.debug===!0,this._fhevmAuth=t.options?.auth,this._onProgress=t.options?.onProgress,this._state={aborted:!1,canceled:!1,failed:!1,fetching:!1,running:!1,succeeded:!1,terminated:!1,timeout:!1},this._retryCount=0,this._retryAfterTimeoutID=void 0,this._requestGlobalTimeoutID=void 0,this._terminateReason=void 0,this._throwErrorIfNoRetryAfter=t.throwErrorIfNoRetryAfter??!1,this._requestMaxDurationInMs=t.options?.timeout??Kt.DEFAULT_GLOBAL_REQUEST_TIMEOUT_MS}async run(t){if(this._state.terminated)throw new Vi({message:"Relayer.run() failed. Request already terminated.",state:{...this._state}});if(this._state.canceled)throw new Vi({message:"Relayer.run() failed. Request already canceled.",state:{...this._state}});if(this._state.succeeded)throw new Vi({message:"Relayer.run() failed. Request already succeeded.",state:{...this._state}});if(this._state.failed)throw new Vi({message:"Relayer.run() failed. Request already failed.",state:{...this._state}});if(this._state.aborted)throw new Vi({message:"Relayer.run() failed. Request already aborted.",state:{...this._state}});if(this._state.timeout)throw new Vi({message:"Relayer.run() failed. Request already timeout.",state:{...this._state}});if(this._externalAbortSignal?.aborted===!0)throw new Vi({message:`Relayer.run() failed. External AbortSignal already aborted (reason:${this._externalAbortSignal.reason}).`,state:{...this._state}});if(this._internalAbortSignal?.aborted===!0)throw new Vi({message:`Relayer.run() failed. Internal AbortSignal already aborted (reason:${this._internalAbortSignal.reason}).`,state:{...this._state}});if(this._state.running)throw new Vi({message:"Relayer.run() failed. Request already running.",state:{...this._state}});this._state.running=!0,this._requestStartTimestamp=Date.now(),this._setGlobalRequestTimeout(this._requestMaxDurationInMs);try{const e=await this._runPostLoop(t);return this._state.succeeded=!0,this._terminate("succeeded"),e}catch(e){throw this._state.failed=!0,e.name==="AbortError"&&(this._assert(this._state.aborted,"this._state.aborted"),this._assert(this._state.terminated,"this._state.terminated")),this._terminate("failed",e),e}}_canContinue(){return!(this._state.canceled||this._state.terminated||this._state.succeeded||this._state.aborted)}cancel(){if(!this._canContinue()){this._trace("cancel","!this._canContinue()");return}this._state.canceled=!0,this._internalAbortController?.abort("cancel"),this._assert(this._state.aborted,"this._state.aborted"),this._assert(this._state.terminated,"this._state.terminated")}get state(){return{...this._state}}get canceled(){return this._state.canceled}get terminated(){return this._state.terminated}get terminateReason(){return this._terminateReason}get terminateError(){return this._terminateError}get running(){return this._state.running}get fetching(){return this._state.fetching}get failed(){return this._state.failed}get aborted(){return this._state.aborted}get timeout(){return this._state.timeout}get succeeded(){return this._state.succeeded}get startTimeMs(){return this._requestStartTimestamp}get elapsedTimeMs(){if(this._requestStartTimestamp!==void 0)return Date.now()-this._requestStartTimestamp}get retryCount(){return this._retryCount}async _runPostLoop(t){if(this._assert(this._fetchMethod===void 0,"this._fetchMethod === undefined"),this._fetchMethod="POST",this._totalSteps=1,this._step=0,Nn(t?.existingJobId))return this._setJobIdOnce(t.existingJobId),await this._runGetLoop();let e=0;for(;e<Kt.MAX_POST_RETRY;){++e,this._assertCanContinueAfterAwait(),this._elapsed=this._jobId!==void 0?Date.now()-this._jobIdTimestamp:0;const r=await this._fetchPost(),s=r.status;switch(s){case 202:{const _=await this._getResponseJson(r);try{aP(_,"body")}catch(l){this._throwResponseInvalidBodyError({status:s,cause:l,bodyJson:ni(_)})}const a=this._getRetryAfterHeaderValueInMs(r);return this._setJobIdOnce(_.result.jobId),this._postAsyncOnProgressCallback({type:"queued",url:this._url,method:"POST",status:s,requestId:_.requestId,jobId:this.jobId,operation:this._relayerOperation,retryCount:this._retryCount,retryAfterMs:a,elapsed:this._elapsed,step:this._step,totalSteps:this._totalSteps}),await this._setRetryAfterTimeout(a),await this._runGetLoop()}case 400:{const _=await this._getResponseJson(r);try{tb(_,"body")}catch(a){this._throwResponseInvalidBodyError({status:s,cause:a,bodyJson:ni(_)})}this._throwRelayerV2ResponseApiError({status:s,relayerApiError:_.error})}case 401:this._throwUnauthorizedError(s);case 429:{const _=await this._getResponseJson(r);try{JR(_,"body")}catch(c){this._throwResponseInvalidBodyError({status:s,cause:c,bodyJson:ni(_)})}const a=this._getRetryAfterHeaderValueInMs(r);this._postAsyncOnProgressCallback({type:"throttled",operation:this._relayerOperation,url:this._url,method:"POST",status:s,retryAfterMs:a,retryCount:this._retryCount,elapsed:this._elapsed,relayerApiError:_.error,step:this._step,totalSteps:this._totalSteps}),await this._setRetryAfterTimeout(a);continue}case 500:{const _=await this._getResponseJson(r);try{eb(_,"body")}catch(a){this._throwResponseInvalidBodyError({status:s,cause:a,bodyJson:ni(_)})}this._throwRelayerV2ResponseApiError({status:s,relayerApiError:_.error})}case 503:{const _=await this._getResponseJson(r);try{rb(_,"body")}catch(a){this._throwResponseInvalidBodyError({status:s,cause:a,bodyJson:ni(_)})}this._throwRelayerV2ResponseApiError({status:s,relayerApiError:_.error})}default:(a=>{throw new ib({fetchMethod:"POST",status:a,url:this._url,operation:this._relayerOperation,elapsed:this._elapsed,retryCount:this._retryCount,state:{...this._state}})})(s)}}this._throwMaxRetryError({fetchMethod:"POST"})}async _runGetLoop(){this._assert(this._fetchMethod==="POST","this._fetchMethod === 'POST'"),this._assert(this._jobId!==void 0,"this._jobId !== undefined"),this._assert(this._jobIdTimestamp!==void 0,"this._jobIdTimestamp !== undefined"),this._fetchMethod="GET";let t=0;for(;t<Kt.MAX_GET_RETRY;){++t,this._assertCanContinueAfterAwait(),this._elapsed=Date.now()-this._jobIdTimestamp;const e=await this._fetchGet(),r=e.status;switch(r){case 200:{const s=await this._getResponseJson(e);this._step=this._totalSteps;try{if(this._relayerOperation==="INPUT_PROOF"){qR(s,"body");const _=s.result;if(!_.accepted)throw new sb({url:this._url,fetchMethod:"GET",jobId:this.jobId,operation:this._relayerOperation,retryCount:this._retryCount,status:r,state:{...this._state},elapsed:this._elapsed});const c=_;return this._postAsyncOnProgressCallback({type:"succeeded",url:this._url,method:"GET",status:r,jobId:this.jobId,requestId:s.requestId,operation:this._relayerOperation,retryCount:this._retryCount,elapsed:this._elapsed,result:c,step:this._step,totalSteps:this._totalSteps}),c}else if(this._relayerOperation==="PUBLIC_DECRYPT"){tP(s,"body");const a=s.result;return this._postAsyncOnProgressCallback({type:"succeeded",url:this._url,method:"GET",status:r,jobId:this.jobId,requestId:s.requestId,operation:this._relayerOperation,retryCount:this._retryCount,elapsed:this._elapsed,result:a,step:this._step,totalSteps:this._totalSteps}),a}else if(this._relayerOperation==="USER_DECRYPT"||this._relayerOperation==="DELEGATED_USER_DECRYPT"){rP(s,"body");const a=s.result.result;return this._postAsyncOnProgressCallback({type:"succeeded",url:this._url,method:"GET",status:r,jobId:this.jobId,requestId:s.requestId,operation:this._relayerOperation,retryCount:this._retryCount,elapsed:this._elapsed,result:a,step:this._step,totalSteps:this._totalSteps}),a}else wp(this._relayerOperation,`Unknown operation: ${this._relayerOperation}`)}catch(_){if(_ instanceof sb)throw _;this._throwResponseInvalidBodyError({status:r,cause:_,bodyJson:ni(s)})}}case 202:{const s=await this._getResponseJson(e);try{cP(s,"body")}catch(a){this._throwResponseInvalidBodyError({status:r,cause:a,bodyJson:ni(s)})}const _=this._getRetryAfterHeaderValueInMs(e);this._postAsyncOnProgressCallback({type:"queued",url:this._url,method:"GET",status:r,requestId:s.requestId,operation:this._relayerOperation,jobId:this.jobId,retryAfterMs:_,retryCount:this._retryCount,elapsed:this._elapsed,step:this._step,totalSteps:this._totalSteps}),await this._setRetryAfterTimeout(_);continue}case 400:{const s=await this._getResponseJson(e);try{tb(s,"body")}catch(_){this._throwResponseInvalidBodyError({status:r,cause:_,bodyJson:ni(s)})}this._throwRelayerV2ResponseApiError({status:r,relayerApiError:s.error})}case 401:this._throwUnauthorizedError(r);case 404:{const s=await this._getResponseJson(e);try{HR(s,"body")}catch(_){this._throwResponseInvalidBodyError({status:r,cause:_,bodyJson:ni(s)})}this._throwRelayerV2ResponseApiError({status:r,relayerApiError:s.error})}case 500:{const s=await this._getResponseJson(e);try{eb(s,"body")}catch(_){this._throwResponseInvalidBodyError({status:r,cause:_,bodyJson:ni(s)})}this._throwRelayerV2ResponseApiError({status:r,relayerApiError:s.error})}case 503:{const s=await this._getResponseJson(e);try{rb(s,"body")}catch(_){this._throwResponseInvalidBodyError({status:r,cause:_,bodyJson:ni(s)})}this._throwRelayerV2ResponseApiError({status:r,relayerApiError:s.error})}default:(_=>{throw new ib({fetchMethod:"GET",status:_,url:this._url,jobId:this.jobId,operation:this._relayerOperation,elapsed:this._elapsed,retryCount:this._retryCount,state:{...this._state}})})(r)}}this._throwMaxRetryError({fetchMethod:"GET"})}async _getResponseJson(t){try{const e=await t.json();return this._assertCanContinueAfterAwait(),e}catch(e){this._throwFetchError({message:"JSON parsing failed.",cause:e})}}_getRetryAfterHeaderValueInMs(t){if(!t.headers.has("Retry-After")){if(this._throwErrorIfNoRetryAfter)throw new Error("Missing 'Retry-After' header key");return Kt.DEFAULT_RETRY_AFTER_MS}try{const e=Number.parseInt(t.headers.get("Retry-After"));if(vn(e)){const r=e*1e3;return r<Kt.MINIMUM_RETRY_AFTER_MS?Kt.MINIMUM_RETRY_AFTER_MS:r}}catch{}if(this._throwErrorIfNoRetryAfter)throw new Error("Invalid 'Retry-After' header key");return Kt.DEFAULT_RETRY_AFTER_MS}_setJobIdOnce(t){this._assert(t!==void 0,"jobId !== undefined"),this._assert(this._jobId===void 0,"this._jobId === undefined"),this._jobId=t,this._jobIdTimestamp=Date.now()}get jobId(){return this._assert(this._jobId!==void 0,"this._jobId !== undefined"),this._jobId}async _fetchPost(){this._assert(this._fetchMethod==="POST",'this._fetchMethod === "POST"'),this._assert(this._jobId===void 0,"this._jobId === undefined"),this._assert(!this._state.terminated,"!this._state.terminated"),this._assert(!this._state.fetching,"!this._state.fetching"),this._trace("_fetchPost",this._url);const t=ea({method:"POST",headers:{"Content-Type":"application/json","ZAMA-SDK-VERSION":W_,"ZAMA-SDK-NAME":Jo},body:JSON.stringify(this._payload),...this._internalAbortSignal?{signal:this._internalAbortSignal}:{}},this._fhevmAuth);this._state.fetching=!0;let e;try{e=await fetch(this._url,t)}catch(r){if(this._state.fetching=!1,this._trace("_fetchPost",`catch(e) + throw e: ${String(r)}`),r.name==="AbortError")throw r;this._throwFetchError({message:"Fetch POST failed.",cause:r})}return this._state.fetching=!1,this._assert(!this._state.terminated,"!this._state.terminated"),this._assertCanContinueAfterAwait(),this._trace("_fetchPost","return response Ok"),e}async _fetchGet(){this._assert(this._fetchMethod==="GET",'this._fetchMethod === "GET"'),this._assert(this._jobId!==void 0,"this._jobId !== undefined"),this._assert(!this._state.terminated,"!this._state.terminated"),this._assert(!this._state.fetching,"!this._state.fetching"),this._trace("_fetchGet",`jobId=${this.jobId}`);const t=ea({method:"GET",headers:{"ZAMA-SDK-VERSION":W_,"ZAMA-SDK-NAME":Jo},...this._internalAbortSignal?{signal:this._internalAbortSignal}:{}},this._fhevmAuth);this._state.fetching=!0;let e;try{e=await fetch(`${this._url}/${this.jobId}`,t)}catch(r){if(this._state.fetching=!1,this._trace("_fetchGet",`jobId=${this.jobId}, catch(e) + throw e: ${r}`),r.name==="AbortError")throw r;this._throwFetchError({message:"Fetch GET failed.",cause:r})}return this._state.fetching=!1,this._assert(!this._state.terminated,"!this._state.terminated"),this._assertCanContinueAfterAwait(),this._trace("_fetchGet",`jobId=${this.jobId}, return response Ok, status=${e.status}`),e}_handleExternalSignalAbort=t=>{const e=t.currentTarget;this._assert(this instanceof Kt,"this instanceof RelayerV2AsyncRequest"),this._assert(e===this._externalAbortSignal,"signal === this._externalAbortSignal"),this._assert(!this._state.terminated,"!this._state.terminated"),this._assert(!this._state.aborted,"!this._state.aborted"),this._assert(!this._state.canceled,"!this._state.canceled"),this.cancel()};_handleInternalSignalAbort=t=>{const e=t.currentTarget;this._assert(this instanceof Kt,"this instanceof RelayerV2AsyncRequest"),this._assert(e===this._internalAbortSignal,"signal === this._internalAbortSignal"),this._assert(!this._state.terminated,"!this._state.terminated"),this._assert(!this._state.aborted,"!this._state.aborted"),this._state.aborted=!0,e.reason!=="cancel"&&this._assert(!this._state.canceled,"!this._state.canceled"),this._postAsyncOnProgressCallback({type:"abort",url:this._url,step:this._step,totalSteps:this._totalSteps,...this._fetchMethod!==void 0?{method:this._fetchMethod}:{},...this._jobId!==void 0?{jobId:this._jobId}:{},operation:this._relayerOperation,retryCount:this._retryCount}),this._terminate("abort",new pP({operation:this._relayerOperation,jobId:this._jobId,url:this._url}))};_terminate(t,e){if(this._state.terminated){this._trace("_terminate",`reason=${t}. Already terminated with reason='${this._terminateReason}'. IGNORE`),this._assert(this._terminateReason!==void 0,"this._terminateReason !== undefined"),this._assert(this._internalAbortSignal===void 0,"this._signal === undefined"),this._assert(this._requestGlobalTimeoutID===void 0,"this._requestGlobalTimeoutID === undefined"),this._assert(this._retryAfterTimeoutID===void 0,"this._retryAfterTimeoutID === undefined"),this._assert(this._retryAfterTimeoutPromiseFuncReject===void 0,"this._retryAfterTimeoutPromiseFuncReject === undefined");return}this._trace("_terminate",`reason=${t}`),this._terminateReason=t,this._terminateError=e,this._state.terminated=!0,this._tryClearRetryAfterTimeout(e),this._tryClearGlobalRequestTimeout();const r=this._internalAbortSignal,s=this._externalAbortSignal;this._externalAbortSignal=void 0,this._internalAbortSignal=void 0,this._internalAbortController=void 0,s&&s.removeEventListener("abort",this._handleExternalSignalAbort),r&&r.removeEventListener("abort",this._handleInternalSignalAbort),this._trace("_terminate",`reason=${t} completed.`)}async _setRetryAfterTimeout(t){if(this._assert(!this._state.terminated,"!this._state.terminated"),this._assert(this._retryAfterTimeoutID===void 0,"this._retryAfterTimeoutID === undefined"),this._assert(t>=Kt.MINIMUM_RETRY_AFTER_MS,`delayMs >= ${Kt.MINIMUM_RETRY_AFTER_MS}`),this._trace("_setRetryAfterTimeout",`delayMs=${t}`),this._retryAfterTimeoutID!==void 0)return Promise.reject(new Error("retry-after already running."));const e=new Promise((r,s)=>{this._retryAfterTimeoutPromiseFuncReject=s;const _=()=>{this._retryAfterTimeoutID=void 0,this._retryAfterTimeoutPromiseFuncReject=void 0,r()};this._retryCount++,this._retryAfterTimeoutID=setTimeout(_,t)});return this._assert(this._retryAfterTimeoutID!==void 0,"this._retryAfterTimeoutID !== undefined"),this._assert(this._retryAfterTimeoutPromiseFuncReject!==void 0,"this._retryAfterTimeoutPromiseFuncReject !== undefined"),e}_tryClearRetryAfterTimeout(t){if(this._retryAfterTimeoutID===void 0){this._assert(this._retryAfterTimeoutPromiseFuncReject===void 0,"this._retryAfterTimeoutPromiseFuncReject === undefined");return}this._assert(this._retryAfterTimeoutPromiseFuncReject!==void 0,"this._retryAfterTimeoutPromiseFuncReject !== undefined");const e=this._retryAfterTimeoutPromiseFuncReject,r=this._retryAfterTimeoutID;this._retryAfterTimeoutID=void 0,this._retryAfterTimeoutPromiseFuncReject=void 0,clearTimeout(r),e(t??new Error("_tryClearRetryAfterTimeout"))}_setGlobalRequestTimeout(t){this._assert(this._requestGlobalTimeoutID===void 0,"this._requestGlobalTimeoutID === undefined");const e=()=>{this._requestGlobalTimeoutID=void 0,this._handleGlobalRequestTimeout()};this._requestGlobalTimeoutID=setTimeout(e,t)}_handleGlobalRequestTimeout(){this._assert(this instanceof Kt,"this instanceof RelayerV2AsyncRequest"),this._assert(!this._state.terminated,"!this._state.terminated"),this._assert(!this._state.timeout,"!this._state.timeout"),this._state.timeout=!0,this._postAsyncOnProgressCallback({type:"timeout",url:this._url,...this._fetchMethod!==void 0?{method:this._fetchMethod}:{},...this._jobId!==void 0?{jobId:this._jobId}:{},operation:this._relayerOperation,retryCount:this._retryCount,step:this._step,totalSteps:this._totalSteps}),this._terminate("timeout",new lP({operation:this._relayerOperation,jobId:this._jobId,url:this._url,timeoutMs:this._requestMaxDurationInMs}))}_tryClearGlobalRequestTimeout(){if(this._requestGlobalTimeoutID===void 0)return;const t=this._requestGlobalTimeoutID;this._requestGlobalTimeoutID=void 0,clearTimeout(t)}_postAsyncOnProgressCallback(t){const e=this._onProgress;e&&queueMicrotask(()=>{e(t)})}_throwUnauthorizedError(t){this._throwRelayerV2ResponseApiError({status:t,relayerApiError:{label:"unauthorized",message:"Unauthorized, missing or invalid Zama Fhevm API Key."}})}_throwRelayerV2ResponseApiError(t){const e=JSON.parse(JSON.stringify(t.relayerApiError)),r={type:"failed",url:this._url,method:this._fetchMethod,status:t.status,...this._jobId!==void 0?{jobId:this._jobId}:{},operation:this._relayerOperation,retryCount:this._retryCount,elapsed:this._elapsed,relayerApiError:e,step:this._step,totalSteps:this._totalSteps};throw this._postAsyncOnProgressCallback((this._relayerOperation==="INPUT_PROOF"||this._relayerOperation==="PUBLIC_DECRYPT",r)),new sP({url:this._url,fetchMethod:this._fetchMethod,status:t.status,jobId:this._jobId,operation:this._relayerOperation,retryCount:this._retryCount,relayerApiError:t.relayerApiError,elapsed:this._elapsed,state:{...this._state}})}_assert(t,e){t||this._throwInternalError(`Assertion failed: ${e}`)}_throwInternalError(t){throw new iP({operation:this._relayerOperation,url:this._url,message:t,state:JSON.stringify(this._state),jobId:this._jobId})}_throwMaxRetryError(t){const e=this._jobIdTimestamp!==void 0?Date.now()-this._jobIdTimestamp:0;throw new _P({operation:this._relayerOperation,url:this._url,state:{...this._state},retryCount:this._retryCount,jobId:this._jobId,fetchMethod:t.fetchMethod,elapsed:e})}_throwResponseInvalidBodyError(t){throw new QR({...t,fetchMethod:this._fetchMethod,url:this._url,jobId:this._jobId,operation:this._relayerOperation,state:{...this._state},retryCount:this._retryCount,elapsed:this._elapsed})}_throwFetchError(t){throw new nP({...t,elapsed:this._elapsed,url:this._url,jobId:this._jobId,operation:this._relayerOperation,state:{...this._state},retryCount:this._retryCount,fetchMethod:this._fetchMethod})}_assertCanContinueAfterAwait(){this._canContinue()||this._throwInternalError("cannot continue.")}_trace(t,e){this._debug&&console.log(`[RelayerV2AsyncRequest]:${t}: ${e}`)}}class fP extends Mp{get version(){return 2}async fetchPostInputProof(t,e){const s=await new Kt({relayerOperation:"INPUT_PROOF",url:this.inputProofUrl,payload:t,options:e}).run();return NA(s,"fetchPostInputProof()"),s}async fetchPostPublicDecrypt(t,e){const s=await new Kt({relayerOperation:"PUBLIC_DECRYPT",url:this.publicDecryptUrl,payload:t,options:e}).run();return KA(s,"fetchPostPublicDecrypt()"),s}async fetchPostUserDecrypt(t,e){const s=await new Kt({relayerOperation:"USER_DECRYPT",url:this.userDecryptUrl,payload:t,options:e}).run();return Ep(s,"fetchPostUserDecrypt()"),s}async fetchPostDelegatedUserDecrypt(t,e){const s=await new Kt({relayerOperation:"DELEGATED_USER_DECRYPT",url:this.delegatedUserDecryptUrl,payload:t,options:e}).run();return Ep(s,"fetchPostDelegatedUserDecrypt()"),s}}class Np extends HA{#t;#e;constructor(t){super(t),this.#t=t.relayerProvider,this.#e=t.tfhePkeParams}get version(){return 2}get tfhePkeParams(){return this.#e}static async fromConfig(t){const e=new fP({relayerUrl:t.relayerVersionUrl,...t.auth!==void 0?{auth:t.auth}:{}}),r=ki.tryFromFhevmPkeConfig(t)??await e.fetchTFHEPkeParams(),_=await ra.fromUserConfig(t).loadFromChain();return new Np({relayerProvider:e,tfhePkeParams:r,fhevmHostChain:_})}get relayerProvider(){return this.#t}getPublicKeyBytes(){const t=this.#e.getTFHEPublicKey().toBytes();return{id:t.id,bytes:t.bytes}}getPublicKeyWasm(){return{id:this.#e.getTFHEPublicKey().id,wasm:this.#e.getTFHEPublicKey().tfheCompactPublicKeyWasm}}supportsCapacity(t){return this.#e.getTFHEPkeCrs().supportsCapacity(t)}getPkeCrsBytesForCapacity(t){const e=this.#e.getTFHEPkeCrs().getBytesForCapacity(t);return{capacity:t,id:e.id,bytes:e.bytes}}getPkeCrsWasmForCapacity(t){const e=this.#e.getTFHEPkeCrs().getWasmForCapacity(t);return{capacity:t,id:e.id,wasm:e.wasm}}}async function hP(i){const t=TR(i.relayerUrl,i.defaultRelayerVersion,i.relayerRouteVersion);if(!t||t.version!==1&&t.version!==2)throw new UR({message:`Invalid relayerUrl: ${i.relayerUrl}`});return t.version===2?Np.fromConfig({...i,relayerVersionUrl:t.url}):Ip.fromConfig({...i,relayerVersionUrl:t.url})}class uP{#t=0;#e=[];#r=wA;#i=gA;#s;#n;constructor(t){this.#n=t.pkeParams,this.#s=Ut.CompactCiphertextList.builder(this.#n.getTFHEPublicKey().tfheCompactPublicKeyWasm),re(this.#n.getTFHEPkeCrs().supportsCapacity(this.#r))}get count(){return this.#e.length}get totalBits(){return this.#t}getBits(){return[...this.#e]}addBool(t){if(t==null)throw new Ct({message:"Missing value"});if(typeof t!="boolean"&&typeof t!="number"&&typeof t!="bigint")throw new Ct({message:"The value must be a boolean, a number or a bigint."});const e=Number(t);if(e!==0&&e!==1)throw new Ct({message:"The value must be true, false, 0 or 1."});return this.#o("ebool"),this.#s.push_boolean(e===1),this}addUint8(t){if(!uc(t))throw new Ct({message:`The value must be a number or bigint in uint8 range (0-${String(hc)}).`});return this.#o("euint8"),this.#s.push_u8(Number(t)),this}addUint16(t){if(!jm(t))throw new Ct({message:`The value must be a number or bigint in uint16 range (0-${String(L1)}).`});return this.#o("euint16"),this.#s.push_u16(Number(t)),this}addUint32(t){if(!Q1(t))throw new Ct({message:`The value must be a number or bigint in uint32 range (0-${String(H1)}).`});return this.#o("euint32"),this.#s.push_u32(Number(t)),this}addUint64(t){if(!to(t))throw new Ct({message:"The value must be a number or bigint in uint64 range."});return this.#o("euint64"),this.#s.push_u64(BigInt(t)),this}addUint128(t){if(!Lm(t))throw new Ct({message:"The value must be a number or bigint in uint128 range."});return this.#o("euint128"),this.#s.push_u128(BigInt(t)),this}addUint256(t){if(!ap(t))throw new Ct({message:"The value must be a number or bigint in uint256 range."});return this.#o("euint256"),this.#s.push_u256(BigInt(t)),this}addAddress(t){if(!Jt(t))throw new Ct({message:"The value must be a valid checksummed address."});return this.#o("eaddress"),this.#s.push_u160(BigInt(t)),this}generateZKProof({contractAddress:t,userAddress:e,aclContractAddress:r,chainId:s}){if(this.#t===0)throw new Ct({message:"Encrypted input must contain at least one value"});if(re(this.#t<=this.#r),!Jt(t))throw new Ct({message:`Invalid contract checksummed address: ${t}`});if(!Jt(e))throw new Ct({message:`Invalid user checksummed address: ${e}`});if(!Jt(r))throw new Ct({message:`Invalid ACL checksummed address: ${r}`});if(!to(s))throw new Ct({message:`Invalid chain ID uint64: ${s}`});const _=Ht(t);re(_.length===20);const a=Ht(e);re(a.length===20);const c=Ht(r);re(c.length===20);const l=Jm(s);re(l.length===32);const p=92,u=new Uint8Array(p);u.set(_,0),u.set(a,20),u.set(c,40),u.set(l,60),re(u.length-l.length===60);const b=this.#s.build_with_proof_packed(this.#n.getTFHEPkeCrs().getWasmForCapacity(this.#r).wasm,u,Ut.ZkComputeLoadVerify).safe_serialize(bc);return y_.fromComponents({chainId:BigInt(s),aclContractAddress:r,contractAddress:t,userAddress:e,ciphertextWithZKProof:b,encryptionBits:this.#e},{copy:!1})}#_(t){if(this.#t+t>this.#r)throw new Ct({message:`Packing more than ${this.#r.toString()} bits in a single input ciphertext is unsupported`});if(this.#e.length>=this.#i)throw new Ct({message:`Packing more than ${this.#i.toString()} variables in a single input ciphertext is unsupported`})}#o(t){const e=sA(t);this.#_(e),this.#t+=e,this.#e.push(e)}}class dP{#t;#e;constructor(t){this.#t=t.builder,this.#e=m_.fromAddresses(t)}addBool(t){return this.#t.addBool(t),this}add8(t){return this.#t.addUint8(t),this}add16(t){return this.#t.addUint16(t),this}add32(t){return this.#t.addUint32(t),this}add64(t){return this.#t.addUint64(t),this}add128(t){return this.#t.addUint128(t),this}add256(t){return this.#t.addUint256(t),this}addAddress(t){return this.#t.addAddress(t),this}getBits(){return this.#t.getBits()}generateZKProof(t){return this.#t.generateZKProof(t)}async requestCiphertextWithZKProofVerification({zkProof:t,relayerProvider:e,options:r}){const s="0x00",_=await e.fetchPostInputProofWithZKProof({zkProof:t,extraData:s},r);return this.#e.verifyAndComputeInputProof({zkProof:t,handles:_.fhevmHandles,signatures:_.result.signatures,extraData:s})}async encrypt({chainId:t,contractAddress:e,userAddress:r,aclContractAddress:s,relayerProvider:_,options:a}){const c=this.#t.generateZKProof({contractAddress:e,userAddress:r,chainId:t,aclContractAddress:s});return await this.requestCiphertextWithZKProofVerification({zkProof:c,relayerProvider:_,options:a})}}class na{#t;#e;constructor(t){this.#t=t.mlKemPkePk,this.#e=t.mlKemPkeSk,Object.freeze(this.#t),Object.freeze(this.#e),this.verify()}toBytesHex(){return{publicKey:Qo(this.#t.hexNo0x),privateKey:Qo(this.#e.hexNo0x)}}toBytesHexNo0x(){return{publicKey:this.#t.hexNo0x,privateKey:this.#e.hexNo0x}}toBytes(){return{publicKey:this.#t.bytes,privateKey:this.#e.bytes}}get publicKey(){return this.#t.hexNo0x}get privateKey(){return this.#e.hexNo0x}static generate(){const t=It.ml_kem_pke_keygen(),e=It.ml_kem_pke_pk_to_u8vec(It.ml_kem_pke_get_pk(t)),r=It.ml_kem_pke_sk_to_u8vec(t);return new na({mlKemPkePk:Bc(e),mlKemPkeSk:Bc(r)})}verify(){let t;try{t=It.u8vec_to_ml_kem_pke_sk(this.#e.bytes)}catch{throw new Error("Invalid TKMSPkeKeypair privateKey")}const e=It.ml_kem_pke_get_pk(t),r=It.ml_kem_pke_pk_to_u8vec(e),s=It.ml_kem_pke_sk_to_u8vec(t);if(!lc(r,this.#t.bytes))throw new Error("Invalid TKMSPkeKeypair publicKey");if(!lc(s,this.#e.bytes))throw new Error("Invalid TKMSPkeKeypair privateKey")}static from(t){return ii(t,"publicKey","TKMSPkeKeypair.from()"),ii(t,"privateKey","TKMSPkeKeypair.from()"),new na({mlKemPkePk:Bc(t.publicKey),mlKemPkeSk:Bc(t.privateKey)})}toJSON(){return this.toBytesHex()}}function Bc(i){let t,e;if(typeof i=="string")t=qo(i,{strict:!0}),i.startsWith("0x")?e=Z_(i):e=i;else if(i instanceof Uint8Array)e=X_(i,!0),t=i;else throw new Error("Invalid argument, expecting string or Uint8Array");return{bytes:t,hexNo0x:e}}const Tt=class Tt{domain;constructor(t){Qm(t.chainId),ie(t.verifyingContractAddressDecryption),this.domain={name:"Decryption",version:"1",chainId:t.chainId,verifyingContract:t.verifyingContractAddressDecryption},Object.freeze(this.domain)}get chainId(){return this.domain.chainId}get verifyingContractAddressDecryption(){return this.domain.verifyingContract}createUserDecryptEIP712({publicKey:t,contractAddresses:e,startTimestamp:r,durationDays:s,extraData:_}){const a=nb(t);D1(e),wc(r),wc(s),u_(_);const l={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],UserDecryptRequestVerification:[{name:"publicKey",type:"bytes"},{name:"contractAddresses",type:"address[]"},{name:"startTimestamp",type:"uint256"},{name:"durationDays",type:"uint256"},{name:"extraData",type:"bytes"}]},primaryType:"UserDecryptRequestVerification",domain:{...this.domain},message:{publicKey:a,contractAddresses:[...e],startTimestamp:r.toString(),durationDays:s.toString(),extraData:_}};return Object.freeze(l),Object.freeze(l.domain),Object.freeze(l.types),Object.freeze(l.types.EIP712Domain),Object.freeze(l.types.UserDecryptRequestVerification),Object.freeze(l.message),Object.freeze(l.message.contractAddresses),l}createDelegatedUserDecryptEIP712({publicKey:t,contractAddresses:e,delegatorAddress:r,startTimestamp:s,durationDays:_,extraData:a}){const c=nb(t);D1(e),km(r),wc(s),wc(_),u_(a);const p={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],DelegatedUserDecryptRequestVerification:[{name:"publicKey",type:"bytes"},{name:"contractAddresses",type:"address[]"},{name:"delegatorAddress",type:"address"},{name:"startTimestamp",type:"uint256"},{name:"durationDays",type:"uint256"},{name:"extraData",type:"bytes"}]},primaryType:"DelegatedUserDecryptRequestVerification",domain:{...this.domain},message:{publicKey:c,contractAddresses:[...e],delegatorAddress:r,startTimestamp:s.toString(),durationDays:_.toString(),extraData:a}};return Object.freeze(p),Object.freeze(p.domain),Object.freeze(p.types),Object.freeze(p.types.EIP712Domain),Object.freeze(p.types.DelegatedUserDecryptRequestVerification),Object.freeze(p.message),Object.freeze(p.message.contractAddresses),p}createPublicDecryptEIP712({ctHandles:t,decryptedResult:e,extraData:r}){zm(t),u_(e),u_(r);const _={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],PublicDecryptVerification:[{name:"ctHandles",type:"bytes32[]"},{name:"decryptedResult",type:"bytes"},{name:"extraData",type:"bytes"}]},primaryType:"PublicDecryptVerification",domain:{...this.domain},message:{ctHandles:t,decryptedResult:e,extraData:r}};return Object.freeze(_),Object.freeze(_.domain),Object.freeze(_.types),Object.freeze(_.types.EIP712Domain),Object.freeze(_.types.PublicDecryptVerification),Object.freeze(_.message),Object.freeze(_.message.ctHandles),_}verifyPublicDecrypt({signatures:t,message:e}){return Wo(t),t.map(s=>yc({signature:s,domain:this.domain,types:L(Tt,E_),message:e,primaryType:"PublicDecryptVerification"}))}verifyUserDecrypt(t,e){return Wo(t),t.map(s=>yc({signature:s,domain:this.domain,types:L(Tt,P_),message:e,primaryType:"UserDecryptRequestVerification"}))}verifyDelegatedUserDecrypt(t,e){return Wo(t),t.map(s=>yc({signature:s,domain:this.domain,types:L(Tt,M_),message:e,primaryType:"DelegatedUserDecryptRequestVerification"}))}};P_=new WeakMap,M_=new WeakMap,E_=new WeakMap,zt(Tt,P_,{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],UserDecryptRequestVerification:[{name:"publicKey",type:"bytes"},{name:"contractAddresses",type:"address[]"},{name:"startTimestamp",type:"uint256"},{name:"durationDays",type:"uint256"},{name:"extraData",type:"bytes"}]}),zt(Tt,M_,{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],DelegatedUserDecryptRequestVerification:[{name:"publicKey",type:"bytes"},{name:"contractAddresses",type:"address[]"},{name:"delegatorAddress",type:"address"},{name:"startTimestamp",type:"uint256"},{name:"durationDays",type:"uint256"},{name:"extraData",type:"bytes"}]}),zt(Tt,E_,{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],PublicDecryptVerification:[{name:"ctHandles",type:"bytes32[]"},{name:"decryptedResult",type:"bytes"},{name:"extraData",type:"bytes"}]}),Object.freeze(L(Tt,P_)),Object.freeze(L(Tt,P_).EIP712Domain),Object.freeze(L(Tt,P_).UserDecryptRequestVerification),Object.freeze(L(Tt,M_)),Object.freeze(L(Tt,M_).EIP712Domain),Object.freeze(L(Tt,M_).DelegatedUserDecryptRequestVerification),Object.freeze(L(Tt,E_)),Object.freeze(L(Tt,E_).EIP712Domain),Object.freeze(L(Tt,E_).PublicDecryptVerification);let so=Tt;function nb(i){if(i==null)throw new Error("Missing publicKey argument.");let t,e;if(typeof i=="object"&&"publicKey"in i?e=i.publicKey:e=i,typeof e=="string")t=Qo(e),u_(t);else if(e instanceof Uint8Array)t=X_(e);else throw new Error("Invalid publicKey argument.");return t}class wP extends it{constructor(t){super({...t,name:"RelayerDuplicateKmsSignerError",message:`Duplicate kms signer address found: ${t.duplicateAddress} appears multiple times in recovered addresses`})}}class gP extends it{constructor(t){super({...t,name:"RelayerUnknownKmsSignerError",message:`Invalid address found: ${t.unknownAddress} is not in the list of kms signers`})}}class AP extends it{constructor(){super({name:"RelayerThresholdKmsSignerError",message:"Kms signers threshold is not reached"})}}class Nc{#t;#e;#r;#i;#s;constructor(t){this.#t=t.proof,this.#r=Object.freeze([...t.orderedClearValues]),this.#e=Object.freeze([...t.orderedHandles]),this.#i=t.extraData,this.#s=this._abiEncodeOrderedClearValues().abiEncodedClearValues}get proof(){return this.#t}get orderedHandles(){return this.#e}get orderedClearValues(){return this.#r}get orderedAbiEncodedClearValues(){return this.#s}get extraData(){return this.#i}static from({orderedHandles:t,orderedDecryptedResult:e,signatures:r,extraData:s}){const _=Va(["uint8"],[r.length]),a=Va(Array(r.length).fill("bytes"),r),c=ot([_,a,s]),l=t.map(b=>b.solidityPrimitiveTypeName),u=new pi().decode(l,e);if(u.length!==t.length)throw new Error("Invalid decrypted result.");const d=t.map((b,S)=>u[S]);return new Nc({orderedHandles:t,orderedClearValues:d,proof:c,extraData:s})}_abiEncodeOrderedClearValues(){const t=[],e=[];for(let _=0;_<this.#e.length;++_){const a=this.#e[_].fheTypeId;let c=this.#r[_];typeof c=="boolean"&&(c=c?"0x01":"0x00");const l=BigInt(c);switch(t.push("uint256"),a){case 7:{e.push(`0x${l.toString(16).padStart(40,"0")}`);break}case 0:{if(l!==BigInt(0)&&l!==BigInt(1))throw new Error(`Invalid ebool clear text value ${l}. Expecting 0 or 1.`);e.push(l);break}case 2:case 3:case 4:case 5:case 6:case 8:{e.push(l);break}default:wp(a,`Unsupported Fhevm primitive type id: ${a}`)}}const s=pi.defaultAbiCoder().encode(t,e);return{abiTypes:t,abiValues:e,abiEncodedClearValues:s}}toPublicDecryptResults(){const t={};return this.#e.forEach((e,r)=>t[e.toBytes32Hex()]=this.#r[r]),Object.freeze(t),Object.freeze({clearValues:t,decryptionProof:this.#t,abiEncodedClearValues:this.#s})}}class Kc{#t;#e;#r;#i;constructor(t){pc(t.kmsSigners),this.#t=[...t.kmsSigners],this.#r=t.threshold,Object.freeze(this.#t),this.#e=new Set(this.#t.map(e=>e.toLowerCase())),this.#i=new so(t)}static fromAddresses(t){return new Kc(t)}static async fromProvider(t){ie(t.kmsVerifierContractAddress);const e=["function getKmsSigners() view returns (address[])","function getThreshold() view returns (uint256)"],r=new de(t.kmsVerifierContractAddress,e,t.provider),s=await S_([()=>r.getKmsSigners(),()=>r.getThreshold()],t.batchRpcCalls),_=s[0],a=s[1];return new Kc({...t,kmsSigners:_,threshold:a})}get count(){return this.#t.length}get kmsSigners(){return this.#t}get threshold(){return this.#r}get chainId(){return this.#i.chainId}get verifyingContractAddressDecryption(){return this.#i.verifyingContractAddressDecryption}_isThresholdReached(t){const e=new Set;t.forEach(r=>{if(e.has(r.toLowerCase()))throw new wP({duplicateAddress:r});e.add(r)});for(const r of t)if(!this.#e.has(r.toLowerCase()))throw new gP({unknownAddress:r});return t.length>=this.#r}verifyPublicDecrypt(t){const r={ctHandles:t.orderedHandles.map(s=>s.toBytes32Hex()),decryptedResult:t.orderedDecryptedResult,extraData:t.extraData};this._verifyPublicDecrypt({signatures:t.signatures,message:r})}verifyAndComputePublicDecryptionProof(t){return this.verifyPublicDecrypt(t),Nc.from(t)}_verifyPublicDecrypt(t){const e=this.#i.verifyPublicDecrypt(t);if(!this._isThresholdReached(e))throw new AP}}const bP=async i=>{const t=await hP({...i,defaultRelayerVersion:2}),e=i.auth,r={...e!=null&&{auth:e},debug:i.debug},s=t.fhevmHostChain.aclContractAddress,_=t.fhevmHostChain.verifyingContractAddressInputVerification,a=t.fhevmHostChain.verifyingContractAddressDecryption,c=BigInt(t.fhevmHostChain.gatewayChainId),l=Number(t.fhevmHostChain.chainId),p=t.fhevmHostChain.kmsSigners,u=t.fhevmHostChain.kmsSignerThreshold,d=t.fhevmHostChain.coprocessorSigners,b=t.fhevmHostChain.coprocessorSignerThreshold,S=t.fhevmHostChain.ethersProvider;return{config:t.fhevmHostChain,createEncryptedInput:pR({fhevm:t,capacity:2048,defaultOptions:r}),requestZKProofVerification:async(R,m)=>{if(R.chainId!==BigInt(l)||R.aclContractAddress!==s)throw new Error("Invalid ZKProof");const P=m_.fromAddresses({coprocessorSigners:d,gatewayChainId:BigInt(c),coprocessorSignerThreshold:b,verifyingContractAddressInputVerification:_});return(await bA({zkProof:y_.fromComponents(R,{copy:!1}),coprocessorSignersVerifier:P,extraData:"0x00",relayerProvider:t.relayerProvider,options:{...r,...m}})).toBytes()},generateKeypair:()=>na.generate().toBytesHexNo0x(),createEIP712:(R,m,P,E)=>new so({chainId:BigInt(l),verifyingContractAddressDecryption:a}).createUserDecryptEIP712({publicKey:R,contractAddresses:m,startTimestamp:P,durationDays:E,extraData:"0x00"}),createDelegatedUserDecryptEIP712:(R,m,P,E,B)=>new so({chainId:BigInt(l),verifyingContractAddressDecryption:a}).createDelegatedUserDecryptEIP712({publicKey:R,contractAddresses:m,delegatorAddress:P,startTimestamp:E,durationDays:B,extraData:"0x00"}),publicDecrypt:AR({kmsSigners:p,thresholdSigners:u,gatewayChainId:Number(c),verifyingContractAddressDecryption:a,aclContractAddress:s,relayerProvider:t.relayerProvider,provider:S,defaultOptions:r}),userDecrypt:iR({kmsSigners:p,gatewayChainId:Number(c),chainId:l,verifyingContractAddressDecryption:a,aclContractAddress:s,relayerProvider:t.relayerProvider,provider:S,defaultOptions:r}),delegatedUserDecrypt:sR({kmsSigners:p,gatewayChainId:Number(c),chainId:l,verifyingContractAddressDecryption:a,aclContractAddress:s,relayerProvider:t.relayerProvider,provider:S,defaultOptions:r}),getPublicKey:()=>{const R=t.getPublicKeyBytes();return{publicKey:R.bytes,publicKeyId:R.id}},getPublicParams:R=>{if(t.supportsCapacity(R)){const m=t.getPkeCrsBytesForCapacity(R);return{publicParamsId:m.id,publicParams:m.bytes}}else return null}}};let _b=!1;const yP=async({tfheParams:i,kmsParams:t,thread:e}={})=>{if(!Ut.initTFHE||!It.initTKMS||!Ut.initThreadPool)throw new Error("Unable to load TFHE or TKMS web wasm modules");return e==null&&(e=navigator.hardwareConcurrency),await v2()||(console.warn(`This browser does not support threads. Verify that your server returns correct headers:
3
+ ${i.stack}`:r}function Qr(i,t){const e=t(i.length*1,1)>>>0;return H_().set(i,e/1),dt=i.length,e}function p_(i,t){if(!(i instanceof t))throw new Error(`expected instance of ${t.name}`)}function $r(i,t){return i=i>>>0,H_().subarray(i/1,i/1+t)}function f_(i){const t=M.__wbindgen_export_4.get(i);return M.__externref_table_dealloc(i),t}function R1(i,t){i=i>>>0;const e=Jr(),r=[];for(let s=i;s<i+4*t;s+=4)r.push(M.__wbindgen_export_4.get(e.getUint32(s,!0)));return M.__externref_drop_slice(i,t),r}function om(i,t,e,r,s,_,a){p_(i,nc),p_(s,Q_),p_(_,h_);const c=M.process_user_decryption_resp_from_js(i.__wbg_ptr,t,e,r,s.__wbg_ptr,_.__wbg_ptr,a);if(c[3])throw f_(c[2]);var l=R1(c[0],c[1]).slice();return M.__wbindgen_free(c[0],c[1]*4,4),l}function P1(i,t){const e=t(i.length*4,4)>>>0;for(let r=0;r<i.length;r++){const s=J_(i[r]);Jr().setUint32(e+4*r,s,!0)}return dt=i.length,e}function am(i,t){const e=a_(t,M.__wbindgen_malloc,M.__wbindgen_realloc),r=dt,s=M.new_server_id_addr(i,e,r);if(s[2])throw f_(s[1]);return $_.__wrap(s[0])}function cm(i){p_(i,Q_);const t=M.ml_kem_pke_pk_to_u8vec(i.__wbg_ptr);if(t[3])throw f_(t[2]);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}function lm(){const i=M.ml_kem_pke_keygen();return h_.__wrap(i)}function pm(i){p_(i,h_);const t=M.ml_kem_pke_sk_to_u8vec(i.__wbg_ptr);if(t[3])throw f_(t[2]);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}function fm(i){const t=Qr(i,M.__wbindgen_malloc),e=dt,r=M.u8vec_to_ml_kem_pke_pk(t,e);if(r[2])throw f_(r[1]);return Q_.__wrap(r[0])}function hm(i){const t=Qr(i,M.__wbindgen_malloc),e=dt,r=M.u8vec_to_ml_kem_pke_sk(t,e);if(r[2])throw f_(r[1]);return h_.__wrap(r[0])}function um(i,t,e){const r=P1(i,M.__wbindgen_malloc),s=dt,_=a_(t,M.__wbindgen_malloc,M.__wbindgen_realloc),a=dt,c=a_(e,M.__wbindgen_malloc,M.__wbindgen_realloc),l=dt,p=M.new_client(r,s,_,a,c,l);if(p[2])throw f_(p[1]);return nc.__wrap(p[0])}function dm(i){p_(i,h_);const t=M.ml_kem_pke_get_pk(i.__wbg_ptr);return Q_.__wrap(t)}typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_ciphertexthandle_free(i>>>0,1));const M1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_client_free(i>>>0,1));class nc{static __wrap(t){t=t>>>0;const e=Object.create(nc.prototype);return e.__wbg_ptr=t,M1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,M1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_client_free(t,0)}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_eip712domainmsg_free(i>>>0,1)),typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_parseduserdecryptionrequest_free(i>>>0,1));const E1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_privateenckeymlkem512_free(i>>>0,1));class h_{static __wrap(t){t=t>>>0;const e=Object.create(h_.prototype);return e.__wbg_ptr=t,E1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,E1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_privateenckeymlkem512_free(t,0)}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_privatesigkey_free(i>>>0,1));const C1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_publicenckeymlkem512_free(i>>>0,1));class Q_{static __wrap(t){t=t>>>0;const e=Object.create(Q_.prototype);return e.__wbg_ptr=t,C1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,C1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_publicenckeymlkem512_free(t,0)}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_publicsigkey_free(i>>>0,1)),typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_requestid_free(i>>>0,1));const z1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_serveridaddr_free(i>>>0,1));class $_{static __wrap(t){t=t>>>0;const e=Object.create($_.prototype);return e.__wbg_ptr=t,z1.register(e,e.__wbg_ptr,e),e}static __unwrap(t){return t instanceof $_?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,z1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_serveridaddr_free(t,0)}}const I1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_typedciphertext_free(i>>>0,1));class Lo{static __wrap(t){t=t>>>0;const e=Object.create(Lo.prototype);return e.__wbg_ptr=t,I1.register(e,e.__wbg_ptr,e),e}static __unwrap(t){return t instanceof Lo?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,I1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_typedciphertext_free(t,0)}get ciphertext(){const t=M.__wbg_get_typedciphertext_ciphertext(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set ciphertext(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_name(this.__wbg_ptr,e,r)}get fhe_type(){return M.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr)}set fhe_type(t){M.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr,t)}get external_handle(){const t=M.__wbg_get_typedciphertext_external_handle(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set external_handle(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_version(this.__wbg_ptr,e,r)}get ciphertext_format(){return M.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr)}set ciphertext_format(t){M.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr,t)}}const G1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_typedplaintext_free(i>>>0,1));class Zl{static __wrap(t){t=t>>>0;const e=Object.create(Zl.prototype);return e.__wbg_ptr=t,G1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,G1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_typedplaintext_free(t,0)}get bytes(){const t=M.__wbg_get_typedplaintext_bytes(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set bytes(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_name(this.__wbg_ptr,e,r)}get fhe_type(){return M.__wbg_get_typedplaintext_fhe_type(this.__wbg_ptr)}set fhe_type(t){M.__wbg_set_typedplaintext_fhe_type(this.__wbg_ptr,t)}}const B1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_typedsigncryptedciphertext_free(i>>>0,1));class Ho{static __wrap(t){t=t>>>0;const e=Object.create(Ho.prototype);return e.__wbg_ptr=t,B1.register(e,e.__wbg_ptr,e),e}static __unwrap(t){return t instanceof Ho?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,B1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_typedsigncryptedciphertext_free(t,0)}get fhe_type(){return M.__wbg_get_typedciphertext_fhe_type(this.__wbg_ptr)}set fhe_type(t){M.__wbg_set_typedciphertext_fhe_type(this.__wbg_ptr,t)}get signcrypted_ciphertext(){const t=M.__wbg_get_typedsigncryptedciphertext_signcrypted_ciphertext(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set signcrypted_ciphertext(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_name(this.__wbg_ptr,e,r)}get external_handle(){const t=M.__wbg_get_typedsigncryptedciphertext_external_handle(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set external_handle(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_version(this.__wbg_ptr,e,r)}get packing_factor(){return M.__wbg_get_typedciphertext_ciphertext_format(this.__wbg_ptr)>>>0}set packing_factor(t){M.__wbg_set_typedciphertext_ciphertext_format(this.__wbg_ptr,t)}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(i=>M.__wbg_userdecryptionrequest_free(i>>>0,1));const wm=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_userdecryptionresponse_free(i>>>0,1));class ql{static __unwrap(t){return t instanceof ql?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,wm.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_userdecryptionresponse_free(t,0)}get signature(){const t=M.__wbg_get_userdecryptionresponse_signature(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set signature(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_name(this.__wbg_ptr,e,r)}get external_signature(){const t=M.__wbg_get_userdecryptionresponse_external_signature(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set external_signature(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_version(this.__wbg_ptr,e,r)}get payload(){const t=M.__wbg_get_userdecryptionresponse_payload(this.__wbg_ptr);return t===0?void 0:_c.__wrap(t)}set payload(t){let e=0;Gn(t)||(p_(t,_c),e=t.__destroy_into_raw()),M.__wbg_set_userdecryptionresponse_payload(this.__wbg_ptr,e)}get extra_data(){const t=M.__wbg_get_userdecryptionresponse_extra_data(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set extra_data(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr,e,r)}}const N1=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(i=>M.__wbg_userdecryptionresponsepayload_free(i>>>0,1));class _c{static __wrap(t){t=t>>>0;const e=Object.create(_c.prototype);return e.__wbg_ptr=t,N1.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,N1.unregister(this),t}free(){const t=this.__destroy_into_raw();M.__wbg_userdecryptionresponsepayload_free(t,0)}get verification_key(){const t=M.__wbg_get_userdecryptionresponsepayload_verification_key(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set verification_key(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_name(this.__wbg_ptr,e,r)}get digest(){const t=M.__wbg_get_userdecryptionresponsepayload_digest(this.__wbg_ptr);var e=$r(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*1,1),e}set digest(t){const e=Qr(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_eip712domainmsg_version(this.__wbg_ptr,e,r)}get signcrypted_ciphertexts(){const t=M.__wbg_get_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr);var e=R1(t[0],t[1]).slice();return M.__wbindgen_free(t[0],t[1]*4,4),e}set signcrypted_ciphertexts(t){const e=P1(t,M.__wbindgen_malloc),r=dt;M.__wbg_set_userdecryptionresponsepayload_signcrypted_ciphertexts(this.__wbg_ptr,e,r)}get party_id(){return M.__wbg_get_userdecryptionresponsepayload_party_id(this.__wbg_ptr)>>>0}set party_id(t){M.__wbg_set_userdecryptionresponsepayload_party_id(this.__wbg_ptr,t)}get degree(){return M.__wbg_get_userdecryptionresponsepayload_degree(this.__wbg_ptr)>>>0}set degree(t){M.__wbg_set_userdecryptionresponsepayload_degree(this.__wbg_ptr,t)}}async function gm(i,t){if(typeof Response=="function"&&i instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(i,t)}catch(r){if(i.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const e=await i.arrayBuffer();return await WebAssembly.instantiate(e,t)}else{const e=await WebAssembly.instantiate(i,t);return e instanceof WebAssembly.Instance?{instance:e,module:i}:e}}function Am(){const i={};return i.wbg={},i.wbg.__wbg_String_8f0eb39a4a4c2f66=function(t,e){const r=String(e),s=a_(r,M.__wbindgen_malloc,M.__wbindgen_realloc),_=dt;Jr().setInt32(t+4,_,!0),Jr().setInt32(t+0,s,!0)},i.wbg.__wbg_buffer_609cc3eee51ed158=function(t){return t.buffer},i.wbg.__wbg_call_672a4d21634d4a24=function(){return l_(function(t,e){return t.call(e)},arguments)},i.wbg.__wbg_call_7cccdd69e0791ae2=function(){return l_(function(t,e,r){return t.call(e,r)},arguments)},i.wbg.__wbg_crypto_ed58b8e10a292839=function(t){return t.crypto},i.wbg.__wbg_done_769e5ede4b31c67b=function(t){return t.done},i.wbg.__wbg_error_7534b8e9a36f1ab4=function(t,e){let r,s;try{r=t,s=e,console.error(jo(t,e))}finally{M.__wbindgen_free(r,s,1)}},i.wbg.__wbg_getRandomValues_bcb4912f16000dc4=function(){return l_(function(t,e){t.getRandomValues(e)},arguments)},i.wbg.__wbg_get_67b2ba62fc30de12=function(){return l_(function(t,e){return Reflect.get(t,e)},arguments)},i.wbg.__wbg_get_b9b93047fe3cf45b=function(t,e){return t[e>>>0]},i.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(t,e){return t[e]},i.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(t){let e;try{e=t instanceof ArrayBuffer}catch{e=!1}return e},i.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(t){let e;try{e=t instanceof Uint8Array}catch{e=!1}return e},i.wbg.__wbg_isArray_a1eab7e0d067391b=function(t){return Array.isArray(t)},i.wbg.__wbg_isSafeInteger_343e2beeeece1bb0=function(t){return Number.isSafeInteger(t)},i.wbg.__wbg_iterator_9a24c88df860dc65=function(){return Symbol.iterator},i.wbg.__wbg_length_a446193dc22c12f8=function(t){return t.length},i.wbg.__wbg_length_e2d2a49132c1b256=function(t){return t.length},i.wbg.__wbg_msCrypto_0a36e2ec3a343d26=function(t){return t.msCrypto},i.wbg.__wbg_new_8a6f238a6ece86ea=function(){return new Error},i.wbg.__wbg_new_a12002a7f91c75be=function(t){return new Uint8Array(t)},i.wbg.__wbg_newnoargs_105ed471475aaf50=function(t,e){return new Function(jo(t,e))},i.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(t,e,r){return new Uint8Array(t,e>>>0,r>>>0)},i.wbg.__wbg_newwithlength_a381634e90c276d4=function(t){return new Uint8Array(t>>>0)},i.wbg.__wbg_next_25feadfc0913fea9=function(t){return t.next},i.wbg.__wbg_next_6574e1a8a62d1055=function(){return l_(function(t){return t.next()},arguments)},i.wbg.__wbg_node_02999533c4ea02e3=function(t){return t.node},i.wbg.__wbg_process_5c1d670bc53614b8=function(t){return t.process},i.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740=function(){return l_(function(t,e){t.randomFillSync(e)},arguments)},i.wbg.__wbg_require_79b1e9274cde3c87=function(){return l_(function(){return module.require},arguments)},i.wbg.__wbg_serveridaddr_new=function(t){return $_.__wrap(t)},i.wbg.__wbg_serveridaddr_unwrap=function(t){return $_.__unwrap(t)},i.wbg.__wbg_set_65595bdd868b3009=function(t,e,r){t.set(e,r>>>0)},i.wbg.__wbg_stack_0ed75d68575b0f3c=function(t,e){const r=e.stack,s=a_(r,M.__wbindgen_malloc,M.__wbindgen_realloc),_=dt;Jr().setInt32(t+4,_,!0),Jr().setInt32(t+0,s,!0)},i.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07=function(){const t=typeof Xa>"u"?null:Xa;return Gn(t)?0:J_(t)},i.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0=function(){const t=typeof globalThis>"u"?null:globalThis;return Gn(t)?0:J_(t)},i.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819=function(){const t=typeof self>"u"?null:self;return Gn(t)?0:J_(t)},i.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40=function(){const t=typeof window>"u"?null:window;return Gn(t)?0:J_(t)},i.wbg.__wbg_subarray_aa9065fa9dc5df96=function(t,e,r){return t.subarray(e>>>0,r>>>0)},i.wbg.__wbg_typedciphertext_new=function(t){return Lo.__wrap(t)},i.wbg.__wbg_typedciphertext_unwrap=function(t){return Lo.__unwrap(t)},i.wbg.__wbg_typedplaintext_new=function(t){return Zl.__wrap(t)},i.wbg.__wbg_typedsigncryptedciphertext_new=function(t){return Ho.__wrap(t)},i.wbg.__wbg_typedsigncryptedciphertext_unwrap=function(t){return Ho.__unwrap(t)},i.wbg.__wbg_userdecryptionresponse_unwrap=function(t){return ql.__unwrap(t)},i.wbg.__wbg_value_cd1ffa7b1ab794f1=function(t){return t.value},i.wbg.__wbg_versions_c71aa1626a93e0a1=function(t){return t.versions},i.wbg.__wbindgen_as_number=function(t){return+t},i.wbg.__wbindgen_boolean_get=function(t){const e=t;return typeof e=="boolean"?e?1:0:2},i.wbg.__wbindgen_debug_string=function(t,e){const r=Wl(e),s=a_(r,M.__wbindgen_malloc,M.__wbindgen_realloc),_=dt;Jr().setInt32(t+4,_,!0),Jr().setInt32(t+0,s,!0)},i.wbg.__wbindgen_error_new=function(t,e){return new Error(jo(t,e))},i.wbg.__wbindgen_in=function(t,e){return t in e},i.wbg.__wbindgen_init_externref_table=function(){const t=M.__wbindgen_export_4,e=t.grow(4);t.set(0,void 0),t.set(e+0,void 0),t.set(e+1,null),t.set(e+2,!0),t.set(e+3,!1)},i.wbg.__wbindgen_is_function=function(t){return typeof t=="function"},i.wbg.__wbindgen_is_null=function(t){return t===null},i.wbg.__wbindgen_is_object=function(t){const e=t;return typeof e=="object"&&e!==null},i.wbg.__wbindgen_is_string=function(t){return typeof t=="string"},i.wbg.__wbindgen_is_undefined=function(t){return t===void 0},i.wbg.__wbindgen_jsval_loose_eq=function(t,e){return t==e},i.wbg.__wbindgen_memory=function(){return M.memory},i.wbg.__wbindgen_number_get=function(t,e){const r=e,s=typeof r=="number"?r:void 0;Jr().setFloat64(t+8,Gn(s)?0:s,!0),Jr().setInt32(t+0,!Gn(s),!0)},i.wbg.__wbindgen_string_get=function(t,e){const r=e,s=typeof r=="string"?r:void 0;var _=Gn(s)?0:a_(s,M.__wbindgen_malloc,M.__wbindgen_realloc),a=dt;Jr().setInt32(t+4,a,!0),Jr().setInt32(t+0,_,!0)},i.wbg.__wbindgen_string_new=function(t,e){return jo(t,e)},i.wbg.__wbindgen_throw=function(t,e){throw new Error(jo(t,e))},i}function bm(i,t){return M=i.exports,K1.__wbindgen_wasm_module=t,c_=null,Do=null,M.__wbindgen_start(),M}async function K1(i){if(M!==void 0)return M;typeof i<"u"&&(Object.getPrototypeOf(i)===Object.prototype?{module_or_path:i}=i:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof i>"u"&&(i=new URL("/kms_lib_bg.wasm",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ft&&ft.tagName.toUpperCase()==="SCRIPT"&&ft.src||new URL("relayer-sdk-js.umd.cjs",document.baseURI).href));const t=Am();(typeof i=="string"||typeof Request=="function"&&i instanceof Request||typeof URL=="function"&&i instanceof URL)&&(i=fetch(i));const{instance:e,module:r}=await gm(await i,t);return bm(e,r)}const W_="0.4.2",Jo="@zama-fhe/relayer-sdk";class it extends Error{name="RelayerErrorBase";_details;_docsPath;_docsUrl;_version;static VERSION=W_;static DEFAULT_DOCS_BASE_URL="https//docs.zama.org";static FULL_VERSION=`@zama-fhe/relayer-sdk@${it.VERSION}`;constructor(t){let e,r;t.cause instanceof it?(r=t.docsPath||t.cause.docsPath,e=t.details||t.cause.details):(r=t.docsPath,e=t.details||t.cause?.message);const s=r?`${t.docsBaseUrl??it.DEFAULT_DOCS_BASE_URL}${r}${t.docsSlug?`#${t.docsSlug}`:""}`:void 0,_=[t.message||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...e?[`Details: ${e}`]:[],`Version: ${it.FULL_VERSION}`].join(`
4
+ `);super(_,t.cause?{cause:t.cause}:void 0),Object.setPrototypeOf(this,new.target.prototype),this._details=e,this._docsPath=r,this._docsUrl=s,this._version=it.VERSION,this.name=t.name??this.name}get docsPath(){return this._docsPath}get docsUrl(){return this._docsUrl}get details(){return this._details}get version(){return this._version}}class ct extends it{_objName;_property;_expectedType;_index;_value;_type;_expectedValue;constructor({objName:t,property:e,index:r,type:s,value:_,expectedValue:a,expectedType:c}){let l=s==="undefined"&&a!==void 0,p;!e||e===""?p=r!==void 0?`${t}[${r}]`:`${t}`:p=r!==void 0?`${t}.${e}[${r}]`:`${t}.${e}`;let u=l?`InvalidPropertyError: Missing '${p}'`:`InvalidPropertyError: ${p}`;s===c?_!==void 0&&(u+=` unexpected value ${_}`):l?(Array.isArray(a)&&(a=a.join("|")),u+=`, expected '${p}: ${a}'.`):c!=="unknown"&&s!=="unknown"&&(u+=` not a ${c}`,s&&(u+=`, type is ${s}`)),super({message:u,name:"InvalidPropertyError"}),this._objName=t,this._property=e,this._value=_,this._type=s,this._expectedValue=a,this._expectedType=c,this._index=r}static missingProperty({objName:t,property:e,expectedType:r,expectedValue:s}){return new ct({objName:t,property:e,expectedType:r,expectedValue:s,type:"undefined"})}static invalidFormat({objName:t,property:e}){return new ct({objName:t,property:e,expectedType:"unknown"})}static invalidObject({objName:t,expectedType:e,type:r}){return new ct({objName:t,property:"",expectedType:e,type:r})}}function ee(i,t){return!(i==null||typeof i!="object"||!(t in i)||i[t]===void 0||i[t]===null)}function ii(i,t,e){if(!ee(i,t))throw new ct({objName:e,property:t,expectedType:"non-nullable",type:si(i,t)})}function ym(i,t){return ee(i,t)?Array.isArray(i[t]):!1}function Bn(i,t,e){if(!ym(i,t))throw new ct({objName:e,property:t,expectedType:"Array",type:si(i,t)})}function Sm(i,t){return ee(i,t)?typeof i[t]=="boolean":!1}function Xl(i,t,e,r){if(!Sm(i,t))throw new ct({objName:e,property:t,expectedType:"boolean",type:si(i,t)});if(r!==void 0&&i[t]!==r)throw new ct({objName:e,property:t,expectedType:"boolean",expectedValue:String(r),type:typeof i[t],value:String(i[t])})}function si(i,t){return ee(i,t)?typeof i[t]:"undefined"}class tp extends it{constructor(t){super({...t,name:"InternalError",message:t.message??"internal error"})}}function re(i){if(!i)throw new tp({message:"Assertion failed"})}function ep(i,t){return i===void 0?"":t.length===0?i:i.endsWith(t)?i.slice(0,-t.length):i}function mm(i){return typeof i=="string"&&i.startsWith("0x")}function Rm(i){return typeof i=="string"&&!i.startsWith("0x")}function Qo(i){return i.startsWith("0x")?i:`0x${i}`}function Z_(i){return i.startsWith("0x")?i.substring(2):i}function Nn(i){return i==null||typeof i!="string"?!1:i.length>0}function Pm(i,t){return ee(i,t)?typeof i[t]=="string":!1}function H(i,t,e,r){if(!Pm(i,t))throw new ct({objName:e,property:t,expectedType:"string",expectedValue:r,type:si(i,t)});if(r!==void 0){if(Array.isArray(r)){for(let s=0;s<r.length;++s)if(i[t]===r[s])return;throw new ct({objName:e,property:t,expectedType:"string",expectedValue:r,type:typeof i[t],value:i[t]})}else if(i[t]!==r)throw new ct({objName:e,property:t,expectedType:"string",expectedValue:r,type:typeof i[t],value:i[t]})}}function Mm(i,t,e){Bn(i,t,e);const r=i[t];for(let s=0;s<r.length;++s)if(typeof r[s]!="string")throw new ct({objName:e,property:`${t}[${s}]`,expectedType:"string",type:typeof r[s]})}function ni(i,t){try{return JSON.stringify(i,(e,r)=>typeof r=="bigint"?r.toString():r,t)}catch{return""}}class At extends it{_varName;_type;_expectedType;_expectedCustomType;constructor({varName:t,type:e,expectedType:r,expectedCustomType:s}){super({message:`InvalidTypeError ${t} ${r} ${e}`,name:"InvalidTypeError"}),this._varName=t,this._type=e,this._expectedType=r,this._expectedCustomType=s}get varName(){return this._varName}get type(){return this._type}get expectedType(){return this._expectedType}get expectedCustomType(){return this._expectedCustomType}}function $o(i,t){return i==null||!(i instanceof Uint8Array)?!1:t!==void 0?i.length===t:!0}function q_(i,t){return!(!mm(i)||t!==void 0&&i.length!==2*t+2||(i.length-2)%2!==0||!/^0x[a-fA-F0-9]*$/.test(i))}function v1(i,t){return!(!Rm(i)||(i.length-2)%2!==0||!/^[a-fA-F0-9]*$/.test(i))}function oc(i){return q_(i,32)}function rp(i){return q_(i,65)}function ip(i){return $o(i,32)}function u_(i,t){if(!q_(i,t))throw new At({type:typeof i,expectedType:"BytesHex"})}function Em(i){if(!rp(i))throw new At({type:typeof i,expectedType:"Bytes65Hex"})}function Cm(i){if(!oc(i))throw new At({type:typeof i,expectedType:"Bytes32Hex"})}function x1(i){if(!ip(i))throw new At({type:typeof i,expectedType:"Bytes32"})}function zm(i){if(!Array.isArray(i))throw new At({type:typeof i,expectedType:"Bytes32HexArray"});for(let t=0;t<i.length;++t)if(!oc(i[t]))throw new At({type:typeof i[t],expectedType:"Bytes32Hex"})}function Wo(i){if(!Array.isArray(i))throw new At({type:typeof i,expectedType:"Bytes65HexArray"});for(let t=0;t<i.length;++t)if(!rp(i[t]))throw new At({type:typeof i[t],expectedType:"Bytes65Hex"})}function Im(i,t){return ee(i,t)?q_(i[t]):!1}function ac(i,t,e){if(!Im(i,t))throw new ct({objName:e,property:t,expectedType:"BytesHex",type:si(i,t)})}function Gm(i,t){return ee(i,t)?v1(i[t]):!1}function Zo(i,t,e){if(!Gm(i,t))throw new ct({objName:e,property:t,expectedType:"BytesHexNo0x",type:si(i,t)})}function U1(i,t,e){Bn(i,t,e);const r=i[t];for(let s=0;s<r.length;++s)if(!oc(r[s]))throw new ct({objName:e,property:`${t}[${s}]`,expectedType:"Bytes32Hex",type:typeof r[s]})}function Bm(i,t,e){Bn(i,t,e);const r=i[t];for(let s=0;s<r.length;++s)if(!rp(r[s]))throw new ct({objName:e,property:`${t}[${s}]`,expectedType:"Bytes65Hex",type:typeof r[s]})}function Nm(i,t,e){Bn(i,t,e);const r=i[t];for(let s=0;s<r.length;++s)if(!q_(r[s]))throw new ct({objName:e,property:`${t}[${s}]`,expectedType:"BytesHex",type:typeof r[s]})}function T1(i,t,e){Bn(i,t,e);const r=i[t];for(let s=0;s<r.length;++s)if(!v1(r[s]))throw new ct({objName:e,property:`${t}[${s}]`,expectedType:"BytesHexNo0x",type:typeof r[s]})}function Km(i,t){return ee(i,t)?i[t]instanceof Uint8Array:!1}function cc(i,t,e){if(!Km(i,t))throw new ct({objName:e,property:t,expectedType:"Uint8Array",type:si(i,t)})}const sp={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};Object.freeze(sp);const vm=Array.from({length:256},(i,t)=>t.toString(16).padStart(2,"0"));Object.freeze(vm);const O1=new Uint8Array([48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102]);function np(i){if(!i||i.length===0)return"";let t="";for(let e=0;e<i.length;e++)t+=i[e].toString(16).padStart(2,"0");return t}function Kn(i){return`0x${np(i)}`}function xm(i){if(!ip(i))throw new Error("Invalid bytes32 argument");return`0x${np(i)}`}function X_(i,t){const e=t===!0?i.length*2:i.length*2+2,r=new Uint8Array(e);let s=0;t!==!0&&(r[0]=48,r[1]=120,s=2);for(let a=0;a<i.length;a++){const c=s+a*2;r[c]=O1[i[a]>>4],r[c+1]=O1[i[a]&15]}const _=new TextDecoder().decode(r);return _}function Ht(i){if(i.length%2!==0)throw new Error("Invalid hex string: odd length");const t=i.replace(/^(0x)/,"").match(/.{1,2}/g);return t?Uint8Array.from(t.map(e=>parseInt(e,16))):new Uint8Array}function Um(i){return Ht("0x"+Z_(i).padStart(64,"0"))}function qo(i,t){const e=t?.strict===!0,r=i[0]==="0"&&i[1]==="x"?2:0,s=i.length-r;if(s%2!==0)throw new Error("Invalid hex string: odd length");const _=new Uint8Array(s/2);for(let a=0;a<_.length;a++){const c=sp[i[r+a*2]],l=sp[i[r+a*2+1]];if((c===void 0||l===void 0)&&e)throw new Error(`Invalid hex character at position ${r+a*2}`);_[a]=c<<4|l}return _}function k1(i){if(!i||i.length===0)return BigInt(0);let t=BigInt(0);for(let e=0;e<i.length;e++)t=t<<BigInt(8)|BigInt(i[e]);return t}function Tm(i){if(!Array.isArray(i))throw new At({expectedType:"Array"});return i.map(t=>{if(typeof t=="string")return Cm(t),t;{x1(t);const e=X_(t);if(e.length!==66)throw new At({expectedType:"Bytes32Hex"});return e}})}function V1(...i){let t=0;for(const s of i)t+=s.length;const e=new Uint8Array(t);let r=0;for(const s of i)e.set(s,r),r+=s.length;return e}function lc(i,t){if(!$o(i)||!$o(t)||i.length!==t.length)return!1;for(let e=0;e<i.length;++e)if(i[e]!==t[e])return!1;return!0}function F1(i){if(i instanceof Uint8Array)return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i))return new Uint8Array(i.buffer,i.byteOffset,i.byteLength);throw new TypeError(`Unsupported bytes type: ${Object.prototype.toString.call(i)}`)}class Y1 extends it{constructor({address:t}){super({message:`Address "${t}" is invalid.`,name:"AddressError"})}}class _p extends it{constructor({address:t,message:e}){super({message:e??(t!=null?`Checksummed address "${t}" is invalid.`:"Checksummed address is invalid."),name:"ChecksummedAddressError"})}}function Om(i){if(!fc(i))throw new At({expectedType:"ChecksummedAddress"});const t=Z_(i),e=new Uint8Array(20);for(let r=0;r<20;r++)e[r]=parseInt(t.slice(r*2,r*2+2),16);return e}function Jt(i){if(typeof i!="string"||!i.startsWith("0x")||i.length!==42)return!1;try{return et(i)===i}catch{return!1}}function ie(i){if(!Jt(i))throw new _p({address:String(i)})}function pc(i){if(!Array.isArray(i))throw new At({type:typeof i,expectedType:"ChecksummedAddressArray"});for(let t=0;t<i.length;++t)if(!Jt(i[t]))throw new _p({address:String(i)})}function fc(i){return!(typeof i!="string"||!i.startsWith("0x")||i.length!==42||!Qy(i))}function km(i){if(!fc(i))throw new Y1({address:String(i)})}function D1(i){if(!Array.isArray(i))throw new At({type:typeof i,expectedType:"AddressArray"});for(let t=0;t<i.length;++t)if(!fc(i[t]))throw new Y1({address:String(i)})}function Vm(i,t){return ee(i,t)?Jt(i[t]):!1}function j1(i,t,e){if(!Vm(i,t))throw new ct({objName:e,property:t,expectedType:"ChecksummedAddress",type:si(i,t)})}const hc=255,L1=65535,H1=4294967295,Fm=0xffffffffffffffffn,Ym=0xffffffffffffffffffffffffffffffffn,Dm=0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn;function J1(i){return typeof i=="number"?i<0?!1:Number.isInteger(i):!1}function op(i){return typeof i=="bigint"?i>=0:!1}function vn(i){return J1(i)?!0:!!op(i)}function uc(i){return vn(i)?i<=hc:!1}function jm(i){return vn(i)?i<=L1:!1}function Q1(i){return vn(i)?i<=H1:!1}function to(i){return vn(i)?BigInt(i)<=Fm:!1}function Lm(i){return vn(i)?BigInt(i)<=Ym:!1}function ap(i){return vn(i)?BigInt(i)<=Dm:!1}function Hm(i){return`0x${i.toString(16)}`}function dc(i){const t=i.toString(16);return t.length%2!==0?`0${t}`:t}function Jm(i){if(!ap(i))throw new At({expectedType:"Uint256"});const t=new ArrayBuffer(32),e=new DataView(t),r=BigInt(i);return e.setBigUint64(24,r&0xffffffffffffffffn,!1),e.setBigUint64(16,r>>64n&0xffffffffffffffffn,!1),e.setBigUint64(8,r>>128n&0xffffffffffffffffn,!1),e.setBigUint64(0,r>>192n&0xffffffffffffffffn,!1),new Uint8Array(t)}function $1(i){if(!to(i))throw new At({expectedType:"Uint64"});const t=new ArrayBuffer(32),e=new DataView(t),r=BigInt(i);return e.setBigUint64(24,r,!1),new Uint8Array(t)}function wc(i){if(!J1(i))throw new At({type:typeof i,expectedType:"UintNumber"})}function cp(i){if(!uc(i))throw new At({type:typeof i,expectedType:"Uint8"})}function Qm(i){if(!Q1(i))throw new At({type:typeof i,expectedType:"Uint32"})}function W1(i){if(!to(i))throw new At({type:typeof i,expectedType:"Uint64"})}function Z1(i){if(!ap(i))throw new At({type:typeof i,expectedType:"Uint256"})}function $m(i,t){return ee(i,t)?vn(i[t]):!1}function q1(i,t,e){if(!$m(i,t))throw new ct({objName:e,property:t,type:si(i,t),expectedType:"Uint"})}function X1(i,t,e){if(si(i,t)!=="bigint"||!op(i[t]))throw new ct({objName:e,property:t,type:si(i,t),expectedType:"UintBigInt"})}class Oi extends it{constructor({handle:t,message:e}){super({message:e??(t?`FHEVM Handle "${t}" is invalid.`:"FHEVM Handle is invalid."),name:"FhevmHandleError"})}}class d_ extends it{constructor({fheTypeId:t,message:e}){super({message:e??(t?`FheTypeId "${t}" is invalid.`:"FheTypeId is invalid."),name:"FheTypeError"})}}const tA=2,gc={ebool:0,euint8:2,euint16:3,euint32:4,euint64:5,euint128:6,eaddress:7,euint256:8},Wm={0:"ebool",2:"euint8",3:"euint16",4:"euint32",5:"euint64",6:"euint128",7:"eaddress",8:"euint256"},lp={0:2,2:8,3:16,4:32,5:64,6:128,7:160,8:256},pp={2:0,8:2,16:3,32:4,64:5,128:6,160:7,256:8},eA={0:"bool",2:"uint256",3:"uint256",4:"uint256",5:"uint256",6:"uint256",7:"address",8:"uint256"};Object.freeze(gc),Object.freeze(lp),Object.freeze(pp),Object.freeze(eA);function eo(i){switch(i){case 0:case 2:case 3:case 4:case 5:case 6:case 7:case 8:return!0;default:return!1}}function fp(i){return typeof i!="string"?!1:i in gc}function Ac(i){return typeof i!="number"?!1:i in pp}function Zm(i,t){if(!Ac(i))throw new At({varName:t,type:typeof i,expectedType:"EncryptionBits"})}function rA(i,t){if(!Array.isArray(i))throw new At({type:typeof i,expectedType:"EncryptionBitsArray"});for(let e=0;e<i.length;++e)if(!Ac(i[e]))throw new At({...t!==void 0?{varName:`${t}[${e.toString()}]`}:{},type:typeof i[e],expectedType:"EncryptionBits"})}function hp(i){if(!Ac(i))throw new d_({message:`Invalid encryption bits ${i}`});return pp[i]}function qm(i){if(!fp(i))throw new d_({message:`Invalid FheType name '${i}'`});return gc[i]}function iA(i){if(!eo(i))throw new d_({message:`Invalid FheType id '${i}'`});return Wm[i]}function up(i){if(!eo(i))throw new d_({message:`Invalid FheType id '${i}'`});return eA[i]}function dp(i){if(!eo(i))throw new d_({message:`Invalid FheType id '${i}'`});const t=lp[i];return nA(t),t}function sA(i){if(!fp(i))throw new d_({message:`Invalid FheType name '${i}'`});const t=lp[gc[i]];return nA(t),t}function nA(i){if(i<tA)throw new d_({message:`Invalid FheType encryption bit width: ${i}. Minimum encryption bit width is ${tA} bits.`})}function ro(i){return i instanceof lt?i.toBytes32Hex():typeof i=="string"?i:xm(i)}function Xm(i){if(!Array.isArray(i))throw new At({type:typeof i,expectedType:"Array"});for(let t=0;t<i.length;++t)tR(i[t])}function tR(i){if(!(i instanceof lt)&&!lt.canParse(i))throw new Oi({handle:i})}class lt{#t;#e;#r;#i;#s;#n;#_;#o;static RAW_CT_HASH_DOMAIN_SEPARATOR="ZK-w_rct";static HANDLE_HASH_DOMAIN_SEPARATOR="ZK-w_hdl";static CURRENT_CIPHERTEXT_VERSION=0;constructor({hash21:t,chainId:e,fheTypeId:r,version:s,computed:_,index:a,handleBytes32:c,handleBytes32Hex:l}){if(!to(e))throw new Oi({message:"ChainId must be a uint64"});if(!q_(t,21))throw new Oi({message:"Hash21 should be 21 bytes long"});this.#o=c,this.#_=l,this.#t=t,this.#e=BigInt(e),this.#r=r,this.#i=s,this.#s=_,a!==void 0&&(this.#n=a)}get hash21(){return this.#t}get chainId(){return this.#e}get fheTypeId(){return this.#r}get fheTypeName(){return iA(this.#r)}get version(){return this.#i}get computed(){return this.#s}get index(){return this.#n}get encryptionBits(){return dp(this.#r)}get solidityPrimitiveTypeName(){return up(this.#r)}toJSON(){return{handle:this.toBytes32Hex(),fheTypeName:this.fheTypeName,fheTypeId:this.fheTypeId,chainId:this.chainId,index:this.index,computed:this.computed,encryptionBits:this.encryptionBits,version:this.version,solidityPrimitiveTypeName:this.solidityPrimitiveTypeName,hash21:this.hash21}}equals(t){return this.#t===t.#t&&this.#e===t.#e&&this.#r===t.#r&&this.#i===t.#i&&this.#s===t.#s&&this.#n===t.#n}toBytes32(){if(this.#o===void 0){re(this.#n===void 0&&this.#s||this.#n!==void 0&&this.#n<255&&!this.#s);const e=$1(this.#e).subarray(24,32),r=Ht(this.#t);re(r.length===21);const s=new Uint8Array(32);s.set(r,0),s[21]=this.#n===void 0?255:this.#n,s.set(e,22),s[30]=this.#r,s[31]=this.#i,this.#o=s}return this.#o}toBytes32Hex(){return this.#_===void 0&&(this.#_=Kn(this.toBytes32())),this.#_}static fromComponents(t){return new lt(t)}static from(t){if(t instanceof lt)return t;if(typeof t=="string")return lt.fromBytes32Hex(t);if($o(t))return lt.fromBytes32(t);throw new Oi({message:"FHEVM Handle must be a Uint8Array or a string."})}static fromBytes32(t){if(!ip(t))throw new Oi({message:"FHEVM Handle is not a valid bytes32 array."});const e=t,r=Kn(e.slice(0,21)),s=e[21],_=s===255,a=_?void 0:s;let c=0;for(let d=22;d<30;d++)c=c*256+e[d];const l=e[30];if(!eo(l))throw new Oi({handle:t,message:`FHEVM Handle "${t}" is invalid. Unknown FheType: ${l}`});const p=e[31];return new lt({hash21:r,chainId:c,fheTypeId:l,version:p,computed:_,index:a,handleBytes32:t})}static fromBytes32Hex(t){if(!oc(t))throw new Oi({handle:t});const e=Ht(t),r=lt.fromBytes32(e);if(r.toBytes32Hex()!==t)throw new Oi({message:"FhevmHandle verification failed!"});return r.#_=t,r}static fromZKProof(t,e=lt.CURRENT_CIPHERTEXT_VERSION){cp(e);const r=t.encryptionBits.map(l=>hp(l));cp(r.length);const _=new TextEncoder().encode(lt.RAW_CT_HASH_DOMAIN_SEPARATOR),a=mt(V1(_,t.ciphertextWithZKProof)),c=[];for(let l=0;l<r.length;++l){const p=lt._computeInputHash21(Ht(a),t.aclContractAddress,t.chainId,l);c.push(new lt({hash21:p,chainId:t.chainId,fheTypeId:r[l],version:e,computed:!1,index:l}))}return c}static canParse(t){try{return lt.from(t),!0}catch{return!1}}static assertIsHandleLike(t){if(!(t instanceof lt)&&!lt.canParse(t))throw new Oi({handle:t})}static currentCiphertextVersion(){return lt.CURRENT_CIPHERTEXT_VERSION}static _computeInputHash21(t,e,r,s){x1(t),ie(e),cp(s),W1(r);const _=new Uint8Array([s]),a=Om(e),c=$1(r),p=new TextEncoder().encode(lt.HANDLE_HASH_DOMAIN_SEPARATOR);return mt(V1(p,t,_,a,c)).slice(0,44)}toString(){return this.toBytes32Hex()}}function _A(i){let t=0;for(const e of i){const r=lt.fromBytes32Hex(e);if(t+=r.encryptionBits,t>2048)throw new Error("Cannot decrypt more than 2048 encrypted bits in a single request")}return t}function eR(i){let t=0;for(const e of i)if(t+=e.encryptionBits,t>2048)throw new Error("Cannot decrypt more than 2048 encrypted bits in a single request");return t}const w_=i=>et(i),oA=["function persistAllowed(bytes32 handle, address account) view returns (bool)"],aA=10,cA=BigInt(365);function rR(i,t){if(t===0)return i===BigInt(1);if(t===7)return w_("0x"+i.toString(16).padStart(40,"0"));if(t>8||t==1)throw new Error(`Unsupported handle type ${t}`);return i}function lA(i,t){try{const e=It.u8vec_to_ml_kem_pke_pk(Ht(i)),r=It.u8vec_to_ml_kem_pke_sk(Ht(t));return{pubKey:e,privKey:r}}catch(e){throw new Error("Invalid public or private key",{cause:e})}}function pA(i){return i.map(t=>({handle:typeof t.handle=="string"?Kn(Ht(t.handle)):Kn(t.handle),contractAddress:w_(t.contractAddress)}))}function fA(i){const t=i.length;if(t===0)throw Error("contractAddresses is empty");if(t>aA)throw Error(`contractAddresses max length of ${aA} exceeded`)}async function hA(i,t,e){const r=t.map(async({handle:s,contractAddress:_})=>{const a=await i.persistAllowed(s,e),c=await i.persistAllowed(s,_);if(!a)throw new Error(`User address ${e} is not authorized to user decrypt handle ${s}!`);if(!c)throw new Error(`dapp contract ${_} is not authorized to user decrypt handle ${s}!`);if(e===_)throw new Error(`User address ${e} should not be equal to contract address when requesting user decryption!`)});await Promise.all(r).catch(s=>{throw s})}function uA(i,t){let e=[];for(const s of i){const _=s.slice(-4,-2).toLowerCase(),a=parseInt(_,16);e.push(a)}const r={};return i.forEach((s,_)=>r[s]=rR(t[_],e[_])),r}function dA(i,t){if(t===BigInt(0))throw Error("durationDays is null");if(t>cA)throw Error(`durationDays is above max duration of ${cA}`);const e=BigInt(Math.floor(Date.now()/1e3));if(i>e)throw Error("startTimestamp is set in the future");const r=t*BigInt(86400);if(i+r<e)throw Error("User decrypt request has expired")}const iR=({kmsSigners:i,gatewayChainId:t,chainId:e,verifyingContractAddressDecryption:r,aclContractAddress:s,relayerProvider:_,provider:a,defaultOptions:c})=>async(l,p,u,d,b,S,R,m,P)=>{const E="0x00",{pubKey:B,privKey:G}=lA(u,p),Y=d.replace(/^(0x)/,""),T=u.replace(/^(0x)/,""),v=pA(l);_A(v.map(st=>st.handle)),dA(BigInt(R),BigInt(m)),fA(b);const F=new de(s,oA,a);await hA(F,v,S);const V={handleContractPairs:v,requestValidity:{startTimestamp:R.toString(),durationDays:m.toString()},contractsChainId:e.toString(),contractAddresses:b.map(st=>w_(st)),userAddress:w_(S),signature:Y,publicKey:T,extraData:E},q=await _.fetchPostUserDecrypt(V,{...c,...P});let J=i.map((st,nt)=>It.new_server_id_addr(nt+1,st));const Z=It.new_client(J,S,"default");try{const st=new ArrayBuffer(32);new DataView(st).setUint32(28,t,!1);const N={name:"Decryption",version:"1",chain_id:new Uint8Array(st),verifying_contract:r,salt:null},k={signature:Y,client_address:S,enc_key:T,ciphertext_handles:v.map(wt=>wt.handle.replace(/^0x/,"")),eip712_verifying_contract:r},pt=It.process_user_decryption_resp_from_js(Z,k,N,q,B,G,!0).map(wt=>k1(wt.bytes));return uA(v.map(wt=>wt.handle),pt)}catch(st){throw new Error("An error occured during decryption",{cause:st})}},sR=({kmsSigners:i,gatewayChainId:t,chainId:e,verifyingContractAddressDecryption:r,aclContractAddress:s,relayerProvider:_,provider:a,defaultOptions:c})=>async(l,p,u,d,b,S,R,m,P,E)=>{const B="0x00",{pubKey:G,privKey:Y}=lA(u,p),T=d.replace(/^(0x)/,""),v=u.replace(/^(0x)/,""),F=pA(l);_A(F.map(nt=>nt.handle)),dA(BigInt(m),BigInt(P)),fA(b);const V=new de(s,oA,a);await hA(V,F,S);const q={handleContractPairs:F,contractsChainId:e.toString(),contractAddresses:b.map(nt=>w_(nt)),delegatorAddress:w_(S),delegateAddress:w_(R),startTimestamp:m.toString(),durationDays:P.toString(),signature:T,publicKey:v,extraData:B},J=await _.fetchPostDelegatedUserDecrypt(q,{...c,...E});let Z=i.map((nt,se)=>It.new_server_id_addr(se+1,nt));const st=It.new_client(Z,R,"default");try{const nt=new ArrayBuffer(32);new DataView(nt).setUint32(28,t,!1);const k={name:"Decryption",version:"1",chain_id:new Uint8Array(nt),verifying_contract:r,salt:null},$={signature:T,client_address:R,enc_key:v,ciphertext_handles:F.map(Gt=>Gt.handle.replace(/^0x/,"")),eip712_verifying_contract:r},_t=It.process_user_decryption_resp_from_js(st,$,k,J,G,Y,!0).map(Gt=>k1(Gt.bytes));return uA(F.map(Gt=>Gt.handle),_t)}catch(nt){throw new Error("An error occurred during the delegated user decryption request.",{cause:nt})}},bc=BigInt(1024*1024*512),g_=BigInt(1024*1024*512),A_=BigInt(1024*1024*512),wA=2048,gA=256,b_=(i,t)=>{if(i==null)throw new Error("Missing value");let e;if(t>=8?e=BigInt(`0x${new Array(t/8).fill(null).reduce(r=>`${r}ff`,"")}`):e=BigInt(2**t-1),typeof i!="number"&&typeof i!="bigint")throw new Error("Value must be a number or a bigint.");if(i>e)throw new Error(`The value exceeds the limit for ${t}bits integer (${e.toString()}).`)},nR=({aclContractAddress:i,chainId:t,tfheCompactPublicKey:e,tfheCompactPkeCrs:r,contractAddress:s,userAddress:_,capacity:a})=>{if(!Jt(s))throw new Error("Contract address is not a valid address.");if(!Jt(_))throw new Error("User address is not a valid address.");const c=[],l=Ut.CompactCiphertextList.builder(e);let p=new Uint8Array;const u=d=>{if(c.reduce((b,S)=>b+Math.max(2,S),0)+d>2048)throw Error("Packing more than 2048 bits in a single input ciphertext is unsupported");if(c.length+1>256)throw Error("Packing more than 256 variables in a single input ciphertext is unsupported")};return{addBool(d){if(d==null)throw new Error("Missing value");if(typeof d!="boolean"&&typeof d!="number"&&typeof d!="bigint")throw new Error("The value must be a boolean, a number or a bigint.");if(Number(d)>1)throw new Error("The value must be 1 or 0.");return b_(Number(d),1),u(2),l.push_boolean(!!d),c.push(2),this},add8(d){return b_(d,8),u(8),l.push_u8(Number(d)),c.push(8),this},add16(d){return b_(d,16),u(16),l.push_u16(Number(d)),c.push(16),this},add32(d){return b_(d,32),u(32),l.push_u32(Number(d)),c.push(32),this},add64(d){return b_(d,64),u(64),l.push_u64(BigInt(d)),c.push(64),this},add128(d){return b_(d,128),u(128),l.push_u128(BigInt(d)),c.push(128),this},addAddress(d){if(!Jt(d))throw new Error("The value must be a valid address.");return u(160),l.push_u160(BigInt(d)),c.push(160),this},add256(d){return b_(d,256),u(256),l.push_u256(BigInt(d)),c.push(256),this},getBits(){return c},encrypt(){if(c.reduce((B,G)=>B+G,0)>a)throw new Error("Too many bits in provided values. Maximum is 2048.");const b=Ht(s),S=Ht(_),R=Ht(i),m=Ht(t.toString(16).padStart(64,"0")),P=new Uint8Array(b.length+S.length+R.length+32);return P.set(b,0),P.set(S,20),P.set(R,40),P.set(m,P.length-m.length),p=l.build_with_proof_packed(r,P,Ut.ZkComputeLoadVerify).safe_serialize(bc),p}}};class Xo extends it{constructor({message:t}){super({message:t??"FHEVM ZKProof is invalid.",name:"ZKProofError"})}}function io(i){if(i instanceof Error)return i;const t=i.message??"Non-Error value caught in exception handler",e=i.name??"ErrorWrapper",r=i.cause??i,s=new Error(t,{cause:r});return s.name=e,s}function wp(i,t){throw new tp({message:t})}function _R(i){let t;for(typeof i=="string"?t=i:i instanceof Error?t=i.message:t=String(i);t.startsWith('"')||t.startsWith("'");)t=t.slice(1);for(;t.endsWith('"')||t.endsWith("'");)t=t.slice(0,-1);return t}class Ct extends it{constructor({message:t,cause:e}){super({message:t,name:"EncryptionError",...e?{cause:io(e)}:{}})}}class gp{#t;#e;#r;constructor(t){this.#t=t.provenCompactCiphertextListWasm,this.#r=t.encryptionBits,this.#e=t.fheTypeIds,Object.freeze(this.#e),Object.freeze(this.#r)}get tfheCompactPublicKeyWasm(){return this.#t}get wasmClassName(){return this.#t.constructor.name}get count(){return this.#e.length}get fheTypeIds(){return this.#e}get encryptionBits(){return this.#r}static fromCiphertextWithZKProof(t){if(t==null)throw new Ct({message:"ciphertextWithZKProof argument is null or undefined."});if(!(t instanceof Uint8Array)&&!Nn(t))throw new Ct({message:"Invalid ciphertextWithZKProof argument."});const e=typeof t=="string"?qo(t,{strict:!0}):t;let r;try{r=Ut.ProvenCompactCiphertextList.safe_deserialize(e,bc)}catch(c){throw new Ct({message:`Invalid ciphertextWithZKProof bytes. ${_R(c)}.`})}const s=r.len(),_=[];for(let c=0;c<s;++c){const l=r.get_kind_of(c);if(!eo(l))throw new Ct({message:`Invalid FheTypeId: ${l}`});_.push(l)}return new gp({provenCompactCiphertextListWasm:r,encryptionBits:_.map(dp),fheTypeIds:_})}}class y_{#t;#e;#r;#i;#s;#n;#_;constructor(t){this.#t=t.chainId,this.#e=t.aclContractAddress,this.#r=t.contractAddress,this.#i=t.userAddress,this.#s=t.ciphertextWithZKProof,this.#n=Object.freeze([...t.encryptionBits]),this.#_=this.#n.map(hp)}get chainId(){return this.#t}get aclContractAddress(){return this.#e}get contractAddress(){return this.#r}get userAddress(){return this.#i}get ciphertextWithZKProof(){if(this.#s.length===0)throw new Xo({message:"Invalid ZKProof.ciphertextWithZKProof property. Uint8Array cannot be empty."});return this.#s}get encryptionBits(){return this.#n}get fheTypeIds(){return this.#_}static fromComponents(t,e){W1(t.chainId);const r=BigInt(t.chainId);ie(t.aclContractAddress),ie(t.contractAddress),ie(t.userAddress),"encryptionBits"in t&&rA(t.encryptionBits,"zkProofLike.encryptionBits");let s;if(typeof t.ciphertextWithZKProof=="string")s=qo(t.ciphertextWithZKProof,{strict:!0});else if($o(t.ciphertextWithZKProof))e?.copy===!0?s=new Uint8Array(t.ciphertextWithZKProof):s=t.ciphertextWithZKProof;else throw new Xo({message:"Invalid ciphertextWithZKProof argument"});if(s.length===0)throw new Xo({message:"ciphertextWithZKProof argument should not be empty"});const _=gp.fromCiphertextWithZKProof(s);if(t.encryptionBits!=null){const a=_.encryptionBits,c=t.encryptionBits;if(a.length!==c.length)throw new Xo({message:`Encryption count mismatch: ciphertextWithZKProof contains ${a.length} encrypted value(s), but encryptionBits specifies ${c.length}.`});for(let l=0;l<a.length;++l)if(a[l]!==c[l])throw new Xo({message:`Encryption type mismatch at index ${l}.`})}return new y_({chainId:r,aclContractAddress:t.aclContractAddress,contractAddress:t.contractAddress,userAddress:t.userAddress,ciphertextWithZKProof:s,encryptionBits:_.encryptionBits})}toJSON(){return{chainId:this.#t<=Number.MAX_SAFE_INTEGER?Number(this.#t):this.#t,aclContractAddress:this.#e,contractAddress:this.#r,userAddress:this.#i,ciphertextWithZKProof:X_(this.#s),encryptionBits:this.#n,fheTypeIds:this.#_}}}class oR extends it{constructor(t){super({...t,name:"RelayerDuplicateCoprocessorSignerError",message:`Duplicate coprocessor signer address found: ${t.duplicateAddress} appears multiple times in recovered addresses`})}}class aR extends it{constructor(t){super({...t,name:"RelayerUnknownCoprocessorSignerError",message:`Invalid address found: ${t.unknownAddress} is not in the list of coprocessor signers`})}}function yc({signature:i,domain:t,types:e,message:r,primaryType:s}){Em(i);const _=s!==void 0?{[s]:e[s]}:e,a=Oh(t,_,r,i);return ie(a),a}const _o=class _o{domain;constructor(t){Z1(t.gatewayChainId),ie(t.verifyingContractAddressInputVerification),this.domain={name:"InputVerification",version:"1",chainId:t.gatewayChainId,verifyingContract:t.verifyingContractAddressInputVerification},Object.freeze(this.domain)}get gatewayChainId(){return this.domain.chainId}get verifyingContractAddressInputVerification(){return this.domain.verifyingContract}get types(){return L(_o,no)}createEIP712({ctHandles:t,contractChainId:e,contractAddress:r,userAddress:s,extraData:_}){Xm(t),ie(s),ie(r),Z1(e),u_(_);const a={domain:{...this.domain},types:{CiphertextVerification:[{name:"ctHandles",type:"bytes32[]"},{name:"userAddress",type:"address"},{name:"contractAddress",type:"address"},{name:"contractChainId",type:"uint256"},{name:"extraData",type:"bytes"}]},message:{ctHandles:t.map(ro),userAddress:s,contractAddress:r,contractChainId:e,extraData:_}};return Object.freeze(a),Object.freeze(a.domain),Object.freeze(a.types),Object.freeze(a.types.CiphertextVerification),Object.freeze(a.message),Object.freeze(a.message.ctHandles),a}verify({signatures:t,message:e}){return Wo(t),t.map(s=>yc({signature:s,domain:this.domain,types:this.types,message:e}))}};no=new WeakMap,zt(_o,no,{CiphertextVerification:[{name:"ctHandles",type:"bytes32[]"},{name:"userAddress",type:"address"},{name:"contractAddress",type:"address"},{name:"contractChainId",type:"uint256"},{name:"extraData",type:"bytes"}]}),Object.freeze(L(_o,no)),Object.freeze(L(_o,no).CiphertextVerification);let Sc=_o;class cR extends it{constructor(){super({name:"RelayerThresholdCoprocessorSignerError",message:"Coprocessor signers threshold is not reached"})}}class lR extends it{constructor(t){super({...t,name:"RelayerTooManyHandlesError",message:`Trying to pack ${t.numberOfHandles} handles. Packing more than 256 variables in a single input ciphertext is unsupported`})}}class AA extends it{constructor(t){super({...t,name:"RelayerInvalidProofError"})}}class ta{#t;#e;#r;#i;constructor({proof:t,signatures:e,handles:r,extraData:s}){this.#t=t,this.#e=e,this.#r=r,this.#i=s,Object.freeze(this.#e),Object.freeze(this.#r)}get proof(){return this.#t}get signatures(){return this.#e}get handles(){return this.#r}get extraData(){return this.#i}toBytes(){return{handles:this.#r.map(t=>Um(t)),inputProof:Ht(this.#t)}}static from({signatures:t,handles:e,extraData:r}){const s=Tm(e);Wo(t),u_(r);const _=e.length,a=t.length;if(_>hc)throw new lR({numberOfHandles:_});re(a<=hc);const c=dc(_),l=dc(_);re(c.length===2),re(l.length===2);let p="";return p+=dc(e.length),p+=dc(t.length),s.map(d=>p+=Z_(d)),t.map(d=>p+=Z_(d)),p+=Z_(r),re(p.length===(2+_*32+a*65)*2+(r.length-2)),new ta({proof:`0x${p}`,signatures:[...t],handles:[...s],extraData:r})}equalsBytes({handles:t,inputProof:e}){const r=this.toBytes();if(t.length!==r.handles.length)return!1;for(let s=0;s<t.length;++s){const _=r.handles[s],a=t[s];if(!lc(_,a))return!1}return lc(r.inputProof,e)}static fromProofBytes(t){if(t.length<2)throw new AA({message:"Invalid proof: too short"});const e=t[0],r=t[1],s=32,_=65,c=2,p=c+e*s,u=p+r*_,d=u;if(t.length<u)throw new AA({message:`Invalid proof: expected at least ${u} bytes, got ${t.length}`});const b=[];for(let E=0;E<e;E++){const B=c+E*s,G=B+s,Y=t.slice(B,G),T=Kn(Y);b.push(T)}const S=[];for(let E=0;E<r;E++){const B=p+E*_,G=B+_,Y=t.slice(B,G),T=Kn(Y);S.push(T)}const R=t.slice(d),m=Kn(R),P=ta.from({signatures:S,handles:b,extraData:m});return re(Kn(t)===P.proof),P}}async function S_(i,t){if(t===!0)return Promise.all(i.map(r=>r()));const e=[];for(const r of i)e.push(await r());return e}class m_{#t;#e;#r;#i;constructor(t){pc(t.coprocessorSigners),this.#t=[...t.coprocessorSigners],this.#r=t.coprocessorSignerThreshold,Object.freeze(this.#t),this.#e=new Set(this.#t.map(e=>e.toLowerCase())),this.#i=new Sc(t)}static fromAddresses(t){return new m_(t)}static async fromProvider(t){ie(t.inputVerifierContractAddress);const e=["function getCoprocessorSigners() view returns (address[])","function getThreshold() view returns (uint256)"],r=new de(t.inputVerifierContractAddress,e,t.provider),s=await S_([()=>r.getCoprocessorSigners(),()=>r.getThreshold()],t.batchRpcCalls),_=s[0],a=s[1];return new m_({...t,coprocessorSigners:_,coprocessorSignerThreshold:a})}get count(){return this.#t.length}get coprocessorSigners(){return this.#t}get coprocessorSignerThreshold(){return this.#r}get gatewayChainId(){return this.#i.gatewayChainId}get verifyingContractAddressInputVerification(){return this.#i.verifyingContractAddressInputVerification}_isThresholdReached(t){const e=new Set;t.forEach(r=>{if(e.has(r.toLowerCase()))throw new oR({duplicateAddress:r});e.add(r)});for(const r of t)if(!this.#e.has(r.toLowerCase()))throw new aR({unknownAddress:r});return t.length>=this.#r}verifyZKProof(t){const r={ctHandles:t.handles.map(s=>s.toBytes32()),userAddress:t.zkProof.userAddress,contractAddress:t.zkProof.contractAddress,contractChainId:t.zkProof.chainId,extraData:t.extraData};this._verify({signatures:t.signatures,message:r})}_verify(t){const e=this.#i.verify(t);if(!this._isThresholdReached(e))throw new cR}verifyAndComputeInputProof(t){this.verifyZKProof(t);const e=t.handles.map(r=>r.toBytes32());return ta.from({signatures:t.signatures,handles:e,extraData:t.extraData})}}async function bA({zkProof:i,coprocessorSignersVerifier:t,relayerProvider:e,extraData:r,options:s}){const _=await e.fetchPostInputProofWithZKProof({zkProof:i,extraData:r},s);return t.verifyAndComputeInputProof({zkProof:i,handles:_.fhevmHandles,signatures:_.result.signatures,extraData:r})}const pR=({fhevm:i,capacity:t,defaultOptions:e})=>(r,s)=>{if(!Jt(r))throw new Error("Contract address is not a valid address.");if(!Jt(s))throw new Error("User address is not a valid address.");const _=i.fhevmHostChain.aclContractAddress,a=i.fhevmHostChain.chainId,c=i.relayerProvider,l=i.fhevmHostChain.coprocessorSigners,p=i.fhevmHostChain.gatewayChainId,u=i.fhevmHostChain.coprocessorSignerThreshold,d=i.fhevmHostChain.verifyingContractAddressInputVerification,b=nR({aclContractAddress:_,chainId:Number(a),tfheCompactPublicKey:i.getPublicKeyWasm().wasm,tfheCompactPkeCrs:i.getPkeCrsWasmForCapacity(t).wasm,contractAddress:r,userAddress:s,capacity:t});return{_input:b,addBool(S){return b.addBool(S),this},add8(S){return b.add8(S),this},add16(S){return b.add16(S),this},add32(S){return b.add32(S),this},add64(S){return b.add64(S),this},add128(S){return b.add128(S),this},add256(S){return b.add256(S),this},addAddress(S){return b.addAddress(S),this},getBits(){return b.getBits()},generateZKProof(){if(b.getBits().length===0)throw new Error("Encrypted input must contain at least one value");return y_.fromComponents({chainId:BigInt(a),aclContractAddress:_,userAddress:s,contractAddress:r,ciphertextWithZKProof:b.encrypt(),encryptionBits:b.getBits()})},encrypt:async S=>{const R="0x00";if(b.getBits().length===0)throw new Error("Encrypted input must contain at least one value");const m=b.encrypt(),P=y_.fromComponents({ciphertextWithZKProof:m,chainId:BigInt(a),aclContractAddress:_,encryptionBits:b.getBits(),userAddress:s,contractAddress:r}),E=m_.fromAddresses({coprocessorSigners:l,gatewayChainId:p,coprocessorSignerThreshold:u,verifyingContractAddressInputVerification:d});return(await bA({zkProof:P,coprocessorSignersVerifier:E,relayerProvider:c,extraData:R,options:{...e,...S}})).toBytes()}}};class Ap extends it{_contractAddress;_contractName;constructor(t){super({...t,name:t.name??"ContractErrorBase"}),this._contractAddress=t.contractAddress,this._contractName=t.contractName}get contractAddress(){return this._contractAddress}get contractName(){return this._contractName}}class fR extends Ap{constructor({contractAddress:t,contractName:e,message:r}){super({contractAddress:t,contractName:e,name:"ContractError",message:r})}}class hR extends Ap{_handles;constructor({contractAddress:t,handles:e}){const r=e.join(", ");super({message:e.length===1?`Handle ${e[0]} is not allowed for public decryption`:`${e.length} handles are not allowed for public decryption: ${r}`,name:"ACLPublicDecryptionError",contractAddress:t,contractName:"ACL"}),this._handles=e}get handles(){return this._handles}}class bp extends Ap{constructor({contractAddress:t,message:e}){super({message:e,name:"ACLUserDecryptionError",contractAddress:t,contractName:"ACL"})}}const oa=class oa{constructor({aclContractAddress:t,provider:e,batchRpcCalls:r}){zt(this,Fi);zt(this,oo);zt(this,ao);if(!Jt(t))throw new _p({address:t});if(e==null)throw new fR({contractAddress:t,contractName:"ACL",message:"Invalid provider."});le(this,ao,r===!0),le(this,Fi,t),le(this,oo,new de(L(this,Fi),L(oa,_a),e))}async isAllowedForDecryption(t,e={checkArguments:!0}){const r=Array.isArray(t),s=r?t:[t];if(e.checkArguments===!0)for(let c=0;c<s.length;++c)lt.assertIsHandleLike(s[c]);const _=s.map(c=>()=>L(this,oo).isAllowedForDecryption(ro(c))),a=await S_(_,L(this,ao));return r?a:a[0]}async checkAllowedForDecryption(t,e={checkArguments:!0}){const r=Array.isArray(t)?t:[t],s=await this.isAllowedForDecryption(r,e),_=r.filter((a,c)=>!s[c]).map(ro);if(_.length>0)throw new hR({contractAddress:L(this,Fi),handles:_})}async persistAllowed(t,e={checkArguments:!0}){const r=Array.isArray(t),s=r?t:[t];if(e.checkArguments===!0)for(const c of s)lt.assertIsHandleLike(c.handle),ie(c.address);const _=s.map(c=>()=>L(this,oo).persistAllowed(ro(c.handle),c.address)),a=await S_(_,L(this,ao));return r?a:a[0]}async checkUserAllowedForDecryption(t,e={checkArguments:!0}){const r=Array.isArray(t.handleContractPairs)?t.handleContractPairs:[t.handleContractPairs];if(e.checkArguments===!0){ie(t.userAddress);for(const l of r)lt.assertIsHandleLike(l.handle),ie(l.contractAddress)}for(const l of r)if(t.userAddress===l.contractAddress)throw new bp({contractAddress:L(this,Fi),message:`userAddress ${t.userAddress} should not be equal to contractAddress when requesting user decryption!`});const s=[],_=new Set;for(const l of r){const p=`${t.userAddress.toLowerCase()}:${l.handle}`;_.has(p)||(_.add(p),s.push({address:t.userAddress,handle:ro(l.handle)}));const u=`${l.contractAddress.toLowerCase()}:${l.handle}`;_.has(u)||(_.add(u),s.push({address:l.contractAddress,handle:ro(l.handle)}))}const a=await this.persistAllowed(s,{checkArguments:!1}),c=new Map;for(let l=0;l<s.length;++l){const p=`${s[l].address.toLowerCase()}:${s[l].handle}`;c.set(p,a[l])}for(const l of r){const p=`${t.userAddress.toLowerCase()}:${l.handle}`;if(c.get(p)!==!0)throw new bp({contractAddress:L(this,Fi),message:`User ${t.userAddress} is not authorized to user decrypt handle ${l.handle}!`})}for(const l of r){const p=`${l.contractAddress.toLowerCase()}:${l.handle}`;if(c.get(p)!==!0)throw new bp({contractAddress:L(this,Fi),message:`dapp contract ${l.contractAddress} is not authorized to user decrypt handle ${l.handle}!`})}}};Fi=new WeakMap,oo=new WeakMap,ao=new WeakMap,_a=new WeakMap,zt(oa,_a,["function persistAllowed(bytes32 handle, address account) view returns (bool)","function isAllowedForDecryption(bytes32 handle) view returns (bool)"]),Object.freeze(L(oa,_a));let mc=oa;function uR(i,t,e){const r=new Map;t.forEach((s,_)=>{if(r.has(s)){const a=s;throw new Error(`Duplicate KMS signer address found: ${a} appears multiple times in recovered addresses`)}r.set(s,_)});for(const s of t)if(!i.includes(s))throw new Error(`Invalid address found: ${s} is not in the list of KMS signers`);return t.length>=e}function dR(i,t){const e=[],r=[];for(let a=0;a<i.length;++a){const c=i[a],l=lt.from(c).fheTypeId;let p=t[c];typeof p=="boolean"&&(p=p?"0x01":"0x00");const u=BigInt(p);switch(e.push("uint256"),l){case 7:{r.push(`0x${u.toString(16).padStart(40,"0")}`);break}case 0:{if(u!==BigInt(0)&&u!==BigInt(1))throw new Error(`Invalid ebool clear text value ${u}. Expecting 0 or 1.`);r.push(u);break}case 2:case 3:case 4:case 5:case 6:case 8:{r.push(u);break}default:wp(l,`Unsupported Fhevm primitive type id: ${l}`)}}const _=pi.defaultAbiCoder().encode(e,r);return{abiTypes:e,abiValues:r,abiEncodedClearValues:_}}function wR(i,t){const e=Va(["uint8"],[i.length]),r=Va(Array(i.length).fill("bytes"),i);return ot([e,r,t])}function gR(i,t){let e=[];for(const p of i)e.push(p.fheTypeId);const r="0x"+"00".repeat(32)+t.slice(2)+"00".repeat(32),s=e.map(p=>up(p)),c=new pi().decode(["uint256",...s,"bytes[]"],r).slice(1,1+e.length),l={};return i.forEach((p,u)=>l[p.toBytes32Hex()]=c[u]),l}const AR=({kmsSigners:i,thresholdSigners:t,gatewayChainId:e,verifyingContractAddressDecryption:r,aclContractAddress:s,relayerProvider:_,provider:a,defaultOptions:c})=>async(l,p)=>{const u="0x00",d=l.map(lt.from),b=d.map(J=>J.toBytes32Hex());eR(d),await new mc({aclContractAddress:s,provider:a}).checkAllowedForDecryption(d);const R={ciphertextHandles:b,extraData:u},m=await _.fetchPostPublicDecrypt(R,{...c,...p}),P=Qo(m.decryptedValue),E=m.signatures.map(Qo),B="0x",G={name:"Decryption",version:"1",chainId:e,verifyingContract:r},Y={PublicDecryptVerification:[{name:"ctHandles",type:"bytes32[]"},{name:"decryptedResult",type:"bytes"},{name:"extraData",type:"bytes"}]},T=E.map(J=>Oh(G,Y,{ctHandles:b,decryptedResult:P,extraData:B},J));if(!uR(i,T,t))throw Error("KMS signers threshold is not reached");const F=gR(d,P),V=dR(b,F),q=wR(E,B);return{clearValues:F,abiEncodedClearValues:V.abiEncodedClearValues,decryptionProof:q}};class bR extends it{_operation;constructor(t){super({...t,name:"RelayerProviderError"}),this._operation=t.operation}get operation(){return this._operation}}class yR extends bR{constructor({cause:t}){super({message:"Invalid relayer response.",name:"RelayerGetKeyUrlError",operation:"KEY_URL",cause:t})}}class yA extends yR{constructor({cause:t}){super({cause:t})}}function SA(i){if(i instanceof Error&&typeof i.cause=="object"&&i.cause!==null)return i.cause}function SR(i){const t=SA(i);if(!(!t||!("code"in t)||!t.code)&&typeof t.code=="string")return t.code}function mR(i){const t=SA(i);if(!(!t||!("status"in t)||t.status===void 0)&&typeof t.status=="number")return t.status}async function yp(i,t){let e;if(t.status===429)e="Relayer rate limit exceeded: Please wait and try again later.";else switch(i){case"PUBLIC_DECRYPT":{e=`Public decrypt failed: relayer respond with HTTP code ${t.status}`;break}case"USER_DECRYPT":{e=`User decrypt failed: relayer respond with HTTP code ${t.status}`;break}case"KEY_URL":{e=`HTTP error! status: ${t.status}`;break}default:{const _=await t.text();e=`Relayer didn't response correctly. Bad status ${t.statusText}. Content: ${_}`;break}}let r;try{r=await t.json()}catch{r=""}const s={code:"RELAYER_FETCH_ERROR",operation:i,status:t.status,statusText:t.statusText,url:t.url,response:t,responseJson:r};throw new Error(e,{cause:s})}function Sp(i,t,e){let r;switch(i){case"PUBLIC_DECRYPT":{r="Public decrypt failed: Relayer didn't return a JSON";break}case"USER_DECRYPT":{r="User decrypt failed: Relayer didn't return a JSON";break}default:{r="Relayer didn't return a JSON";break}}const s={code:"RELAYER_NO_JSON_ERROR",operation:i,error:t,response:e};throw new Error(r,{cause:s})}function mp(i,t){let e;switch(i){case"PUBLIC_DECRYPT":{e="Public decrypt failed: Relayer returned an unexpected JSON response";break}case"USER_DECRYPT":{e="User decrypt failed: Relayer returned an unexpected JSON response";break}default:{e="Relayer returned an unexpected JSON response";break}}const r={code:"RELAYER_UNEXPECTED_JSON_ERROR",operation:i,error:t};throw new Error(e,{cause:r})}function Rp(i,t,e){if(!e)switch(i){case"PUBLIC_DECRYPT":{e="Public decrypt failed: Relayer didn't respond";break}case"USER_DECRYPT":{e="User decrypt failed: Relayer didn't respond";break}default:{e="Relayer didn't response correctly. Bad JSON.";break}}const r={code:"RELAYER_UNKNOWN_ERROR",operation:i,error:t};throw new Error(e??"Relayer didn't response correctly.",{cause:r})}function ea(i,t){if(t)switch(t.__type){case"BearerToken":{i.headers.Authorization=`Bearer ${t.token}`;break}case"ApiKeyHeader":{const e=Nn(t.header)?t.header:"x-api-key";i.headers[e]=t.value;break}case"ApiKeyCookie":{const e=Nn(t.cookie)?t.cookie:"x-api-key";typeof window<"u"?(document.cookie=`${e}=${t.value}; path=/; SameSite=Lax; Secure; HttpOnly;`,i.credentials="include"):i.headers.Cookie=`${e}=${t.value};`;break}}return i}function mA(i){if(i){if(typeof i.throwIfAborted=="function")i.throwIfAborted();else if(i.aborted)throw new DOMException("This operation was aborted","AbortError")}}function RR(i){const t=new Error("Aborted",{cause:i});return t.name="AbortError",t}function PR(i,t){return mA(t),new Promise((e,r)=>{const s=setTimeout(e,i);t?.addEventListener("abort",()=>{clearTimeout(s),r(RR(t.reason))},{once:!0})})}async function RA(i){return typeof i.bytes=="function"?F1(await i.bytes()):F1(await i.arrayBuffer())}async function PA(i){let t,e=i.retries??3;e>1e3&&(e=1e3),e<0&&(e=0);let r=i.retryDelayMs??1e3;r>3600*1e3&&(r=3600*1e3),r<100&&(r=100);const s=i.init,_=i.url;for(let a=0;a<=e;a++){mA(s?.signal);try{return await fetch(_,s)}catch(c){if(c.name==="AbortError")throw c;t=c,a<e&&await PR(r,s?.signal??void 0)}}throw t}class Ot extends it{constructor({message:t,cause:e}){super({message:t,name:"TFHEError",...e?{cause:io(e)}:{}})}}function MR(i,t){H(i,"id",t),q1(i,"capacity",t),H(i,"srcUrl",t)}function ER(i,t){H(i,"id",t),cc(i,"bytes",t),q1(i,"capacity",t),ee(i,"srcUrl")&&H(i,"srcUrl",t)}function CR(i,t){H(i,"id",t),cc(i,"bytes",t),ee(i,"srcUrl")&&H(i,"srcUrl",t)}function zR(i,t){H(i,"id",t),H(i,"srcUrl",t)}class Wr{#t="";#e;#r=-1;#i;constructor(){}get srcUrl(){return this.#i}get wasmClassName(){return this.#e.constructor.name}supportsCapacity(t){return this.#r===t}getWasmForCapacity(t){if(this.#r!==t)throw new Ot({message:`Unsupported FHEVM PkeCrs capacity: ${String(t)}`});return{capacity:t,id:this.#t,wasm:this.#e}}getBytesForCapacity(t){if(this.#r!==t)throw new Ot({message:`Unsupported FHEVM PkeCrs capacity: ${String(t)}`});return{capacity:t,id:this.#t,bytes:this.toBytes().bytes}}static fromWasm(t){return this._fromWasm(t)}static _fromWasm(t){const e=new Wr;return e.#t=t.id,e.#e=t.wasm,e.#i=t.srcUrl,e.#r=t.capacity,e}static fromBytes(t){try{return ER(t,"arg"),Wr._fromBytes(t)}catch(e){throw new Ot({message:"Invalid public key (deserialization failed)",cause:e})}}static _fromBytesHex(t){let e;try{H(t,"bytesHex","arg"),e=qo(t.bytesHex,{strict:!0})}catch(r){throw new Ot({message:"Invalid public key (deserialization failed)",cause:r})}return Wr.fromBytes({id:t.id,capacity:t.capacity,srcUrl:t.srcUrl,bytes:e})}static _fromBytes(t){const e=new Wr;return e.#t=t.id,e.#e=Ut.CompactPkeCrs.safe_deserialize(t.bytes,A_),e.#r=t.capacity,e.#i=t.srcUrl,e}static async fetch(t){try{return MR(t,"arg"),await Wr.#s(t)}catch(e){throw new Ot({message:"Impossible to fetch public key: wrong relayer url.",cause:e})}}static async#s(t){if(t.init?.method!==void 0&&t.init.method!=="GET")throw new Ot({message:`Invalid fetch method: expected 'GET', got '${t.init.method}'`});const e=await PA({url:t.srcUrl,...t.init!==void 0?{init:t.init}:{},...t.retries!==void 0?{retries:t.retries}:{},...t.retryDelayMs!==void 0?{retryDelayMs:t.retryDelayMs}:{}});if(!e.ok)throw new Ot({message:`HTTP error! status: ${e.status} on ${e.url}`});const r=await RA(e);return Wr.fromBytes({bytes:r,id:t.id,capacity:t.capacity,srcUrl:t.srcUrl})}toBytes(){return{bytes:this.#e.safe_serialize(A_),id:this.#t,capacity:this.#r,...this.#i!==void 0?{srcUrl:this.#i}:{}}}_toBytesHex(){return{bytesHex:X_(this.#e.safe_serialize(A_)),id:this.#t,capacity:this.#r,...this.#i!==void 0?{srcUrl:this.#i}:{}}}toJSON(){return{__type:"TFHEPkeCrs",...this._toBytesHex()}}static fromJSON(t){if(t.__type!=="TFHEPkeCrs")throw new Ot({message:"Invalid TFHEPkeCrs JSON."});return Wr._fromBytesHex(t)}}class Zr{#t="";#e;#r;constructor(){}get id(){return this.#t}get srcUrl(){return this.#r}get tfheCompactPublicKeyWasm(){return this.#e}get wasmClassName(){return this.#e.constructor.name}static fromWasm(t){return this._fromWasm(t)}static _fromWasm(t){const e=new Zr;return e.#t=t.id,e.#e=t.wasm,e.#r=t.srcUrl,e}static fromBytes(t){try{return CR(t,"arg"),Zr._fromBytes(t)}catch(e){throw new Ot({message:"Invalid public key (deserialization failed)",cause:e})}}static _fromBytesHex(t){let e;try{H(t,"bytesHex","arg"),e=qo(t.bytesHex,{strict:!0})}catch(r){throw new Ot({message:"Invalid public key (deserialization failed)",cause:r})}return Zr.fromBytes({id:t.id,srcUrl:t.srcUrl,bytes:e})}static _fromBytes(t){const e=new Zr;return e.#t=t.id,e.#e=Ut.TfheCompactPublicKey.safe_deserialize(t.bytes,g_),e.#r=t.srcUrl,e}static async fetch(t){try{return zR(t,"arg"),await Zr.#i(t)}catch(e){throw new Ot({message:"Impossible to fetch public key: wrong relayer url.",cause:e})}}static async#i(t){if(t.init?.method!==void 0&&t.init.method!=="GET")throw new Ot({message:`Invalid fetch method: expected 'GET', got '${t.init.method}'`});const e=await PA({url:t.srcUrl,...t.init!==void 0?{init:t.init}:{},...t.retries!==void 0?{retries:t.retries}:{},...t.retryDelayMs!==void 0?{retryDelayMs:t.retryDelayMs}:{}});if(!e.ok)throw new Ot({message:`HTTP error! status: ${e.status} on ${e.url}`});const r=await RA(e);return Zr.fromBytes({bytes:r,id:t.id,srcUrl:t.srcUrl})}toBytes(){return{bytes:this.#e.safe_serialize(g_),id:this.#t,...this.#r!==void 0?{srcUrl:this.#r}:{}}}_toBytesHex(){return{bytesHex:X_(this.#e.safe_serialize(g_)),id:this.#t,...this.#r!==void 0?{srcUrl:this.#r}:{}}}toJSON(){return{__type:"TFHEPublicKey",...this._toBytesHex()}}static fromJSON(t){if(t.__type!=="TFHEPublicKey")throw new Ot({message:"Invalid TFHEPublicKey JSON."});return Zr._fromBytesHex(t)}}function IR(i){try{return MA(i,""),!0}catch{return!1}}function MA(i,t){H(i,"id",t),cc(i,"data",t)}function EA(i,t){ii(i,"2048",t),BR(i[2048],`${t}.2048`)}function GR(i){try{return EA(i,""),!0}catch{return!1}}function BR(i,t){H(i,"publicParamsId",t),cc(i,"publicParams",t)}class ki{#t;#e;constructor(t){this.#e=t.publicKey,this.#t=t.pkeCrs2048}getTFHEPublicKey(){return this.#e}getTFHEPkeCrs(){return this.#t}static tryFromFhevmPkeConfig(t){if(ee(t,"publicParams")&&GR(t.publicParams)&&ee(t,"publicKey")&&IR(t.publicKey))return ki.fromFhevmPkeConfig({publicKey:t.publicKey,publicParams:t.publicParams})}static fromFhevmPkeConfig(t){EA(t.publicParams,"fhevmPkeConfig.publicParams"),MA(t.publicKey,"fhevmPkeConfig.publicKey");const e=Zr.fromBytes({id:t.publicKey.id,bytes:t.publicKey.data}),r=Wr.fromBytes({id:t.publicParams[2048].publicParamsId,bytes:t.publicParams[2048].publicParams,capacity:2048});return new ki({publicKey:e,pkeCrs2048:r})}static fromWasm(t){const e=Zr.fromWasm(t.publicKey),r=Wr.fromWasm(t.pkeCrs2048);return new ki({publicKey:e,pkeCrs2048:r})}static async fetch(t){if(t.pkeCrsUrl.capacity!==2048)throw new Ot({message:`Invalid pke crs capacity ${t.pkeCrsUrl.capacity.toString()}. Expecting 2048.`});try{const e=await Zr.fetch(t.publicKeyUrl),r=await Wr.fetch(t.pkeCrsUrl);return new ki({publicKey:e,pkeCrs2048:r})}catch(e){throw new Ot({message:"Impossible to fetch public key: wrong relayer url.",cause:e})}}}function NR(i){try{return CA(i,"RelayerGetResponseKeyUrlCamelCase"),!0}catch{return!1}}function KR(i){try{return zA(i,"RelayerGetResponseKeyUrlSnakeCase"),!0}catch{return!1}}function CA(i,t){IA(i,t,{fheKeyInfoName:"fheKeyInfo",fhePublicKeyName:"fhePublicKey",dataIdName:"dataId"})}function zA(i,t){IA(i,t,{fheKeyInfoName:"fhe_key_info",fhePublicKeyName:"fhe_public_key",dataIdName:"data_id"})}function IA(i,t,e){ii(i,"response",t),ii(i.response,"crs",`${t}.response`);const r=i.response.crs,s=Object.keys(r);for(let a=0;a<s.length;++a)GA(r[s[a]],`${t}.response.crs.${s[a]}`,e.dataIdName);Bn(i.response,e.fheKeyInfoName,`${t}.response`);const _=i.response[e.fheKeyInfoName];for(let a=0;a<_.length;++a){const c=_[a],l=`${t}.response.${e.fheKeyInfoName}[${a}]`;ii(c,e.fhePublicKeyName,l),GA(c[e.fhePublicKeyName],`${l}.${e.fhePublicKeyName}`,e.dataIdName)}}function GA(i,t,e){H(i,e,t),Mm(i,"urls",t)}function vR(i){const t=i.response.fheKeyInfo.map(r=>({fhe_public_key:{data_id:r.fhePublicKey.dataId,urls:r.fhePublicKey.urls}})),e={};for(const[r,s]of Object.entries(i.response.crs))e[r]={data_id:s.dataId,urls:s.urls};return{response:{fhe_key_info:t,crs:e}}}function BA(i){if(KR(i))return i;if(NR(i))return vR(i)}const Pp=new Map;class Mp{#t;#e;constructor({relayerUrl:t,auth:e}){this.#t=t,this.#e=e}get url(){return this.#t}get keyUrl(){return`${this.url}/keyurl`}get inputProofUrl(){return`${this.url}/input-proof`}get publicDecryptUrl(){return`${this.url}/public-decrypt`}get userDecryptUrl(){return`${this.url}/user-decrypt`}get delegatedUserDecryptUrl(){return`${this.url}/delegated-user-decrypt`}fetchTFHEPkeParams(){const t=Pp.get(this.#t);if(t!==void 0)return t;const e=this._fetchTFHEPkeParamsImpl().catch(r=>{throw Pp.delete(this.#t),r});return Pp.set(this.#t,e),e}async _fetchTFHEPkeParamsImpl(){const t=await this.fetchTFHEPkeUrls();return ki.fetch(t)}async fetchTFHEPkeUrls(){const t=await this.fetchGetKeyUrl(),e=BA(t);if(!e)throw new Error("Invalid relayer key url response");const r=e.response.fhe_key_info[0].fhe_public_key,s=r.data_id,_=r.urls[0],a=e.response.crs[2048],c=a.data_id,l=a.urls[0];return{publicKeyUrl:{id:s,srcUrl:_},pkeCrsUrl:{capacity:2048,id:c,srcUrl:l}}}async fetchGetKeyUrl(){const t=await this._fetchRelayerGet("KEY_URL",this.keyUrl);let e;if(this.version===2)try{if(CA(t,"fetchGetKeyUrl()"),e=BA(t),!e)throw new tp({message:"Unable to convert fetchGetKeyUrl() to snake case."})}catch(r){throw new yA({cause:io(r)})}else{e=t;try{zA(e,"fetchGetKeyUrl()")}catch(r){throw new yA({cause:io(r)})}}return e}async fetchPostInputProofWithZKProof(t,e){const r=lt.fromZKProof(t.zkProof),s=await this.fetchPostInputProof({contractAddress:t.zkProof.contractAddress,userAddress:t.zkProof.userAddress,ciphertextWithInputVerification:np(t.zkProof.ciphertextWithZKProof),contractChainId:Hm(t.zkProof.chainId),extraData:t.extraData},e);if(r.length!==s.handles.length)throw new Error(`Incorrect Handles list sizes: (expected) ${r.length} != ${s.handles.length} (received)`);const _=s.handles.map(a=>lt.fromBytes32Hex(a));for(let a=0;a<r.length;++a)if(!r[a].equals(_[a]))throw new Error(`Incorrect Handle ${a}: (expected) ${r[a].toBytes32Hex()} != ${_[a].toBytes32Hex()} (received)`);return{result:s,fhevmHandles:r}}async _fetchRelayerGet(t,e){const r=ea({method:"GET",headers:{"ZAMA-SDK-VERSION":W_,"ZAMA-SDK-NAME":Jo}},this.#e);let s,_;try{s=await fetch(e,r)}catch(c){Rp(t,c)}s.ok||await yp(t,s);let a;try{a=await s.json()}catch(c){Sp(t,c,s)}try{xR(a),_=a}catch(c){mp(t,c)}return _}}function NA(i,t){U1(i,"handles",t),Bm(i,"signatures",t)}function KA(i,t){T1(i,"signatures",t),H(i,"decryptedValue",t),ac(i,"extraData",t)}function Ep(i,t){if(!Array.isArray(i))throw ct.invalidObject({objName:t,expectedType:"Array",type:typeof i});for(let e=0;e<i.length;++e)Zo(i[e],"payload",`${t}[i]`),Zo(i[e],"signature",`${t}[i]`)}function xR(i){if(i==null||typeof i!="object")throw new Error("Unexpected response JSON.");if(!("response"in i&&i.response!==null&&i.response!==void 0))throw new Error("Unexpected response JSON format: missing 'response' property.")}class UR extends it{constructor(t){super({...t,name:"InvalidRelayerUrlError"})}}const Rc="https://relayer.mainnet.zama.org",vA=`${Rc}/v1`,xA=`${Rc}/v2`,Pc={aclContractAddress:"0xcA2E8f1F656CD25C01F05d0b243Ab1ecd4a8ffb6",kmsContractAddress:"0x77627828a55156b04Ac0DC0eb30467f1a552BB03",inputVerifierContractAddress:"0xCe0FC2e05CFff1B719EFF7169f7D80Af770c8EA2",verifyingContractAddressDecryption:"0x0f6024a97684f7d90ddb0fAAD79cB15F2C888D24",verifyingContractAddressInputVerification:"0xcB1bB072f38bdAF0F328CdEf1Fc6eDa1DF029287",chainId:1,gatewayChainId:261131};Object.freeze(Pc);const UA={...Pc,relayerUrl:Rc};Object.freeze(UA);const TA={...Pc,relayerUrl:vA};Object.freeze(TA);const OA={...Pc,relayerUrl:xA};Object.freeze(OA);const Mc="https://relayer.testnet.zama.org",kA=`${Mc}/v1`,VA=`${Mc}/v2`,Ec={aclContractAddress:"0xf0Ffdc93b7E186bC2f8CB3dAA75D86d1930A433D",kmsContractAddress:"0xbE0E383937d564D7FF0BC3b46c51f0bF8d5C311A",inputVerifierContractAddress:"0xBBC1fFCdc7C316aAAd72E807D9b0272BE8F84DA0",verifyingContractAddressDecryption:"0x5D8BD78e2ea6bbE41f26dFe9fdaEAa349e077478",verifyingContractAddressInputVerification:"0x483b9dE06E4E4C7D35CCf5837A1668487406D955",chainId:11155111,gatewayChainId:10901};Object.freeze(Ec);const FA={...Ec,relayerUrl:Mc};Object.freeze(FA);const YA={...Ec,relayerUrl:kA};Object.freeze(YA);const DA={...Ec,relayerUrl:VA};Object.freeze(DA);function TR(i,t,e){if(i==null||typeof i!="string")return null;const r=ep(i,"/");if(!URL.canParse(r))return null;if(![Mc,kA,VA,Rc,vA,xA].includes(r))return e===1||e===2?{url:r,version:e}:t!==1&&t!==2?null:{url:r,version:t};if(r.endsWith("/v1"))return{url:r,version:1};if(r.endsWith("/v2"))return{url:r,version:2};let a;if(e===1||e===2)a=e;else{if(t!==1&&t!==2)return null;a=t}return{url:`${r}/v${a}`,version:a}}function jA(i){if(i==null||typeof i!="object")throw new Error("Unexpected response JSON.");if(!("response"in i&&i.response!==null&&i.response!==void 0))throw new Error("Unexpected response JSON format: missing 'response' property.")}async function Cp(i,t,e,r){const s=ea({method:"POST",headers:{"Content-Type":"application/json","ZAMA-SDK-VERSION":W_,"ZAMA-SDK-NAME":Jo},body:JSON.stringify(e)},r?.auth);let _,a;try{_=await fetch(t,s)}catch(l){Rp(i,l)}_.ok||await yp(i,_);let c;try{c=await _.json()}catch(l){Sp(i,l,_)}try{jA(c),a=c}catch(l){mp(i,l)}return a}async function OR(i,t,e){const r=ea({method:"GET",headers:{"ZAMA-SDK-VERSION":W_,"ZAMA-SDK-NAME":Jo}},e?.auth);let s,_;try{s=await fetch(t,r)}catch(c){Rp(i,c)}s.ok||await yp(i,s);let a;try{a=await s.json()}catch(c){Sp(i,c,s)}try{jA(a),_=a}catch(c){mp(i,c)}return _}const zp={};async function LA(i,t,e){if(i in zp)return zp[i];const r=await OR("KEY_URL",`${i}/keyurl`,e);try{let s;if(!Nn(t))s=r.response.fhe_key_info[0].fhe_public_key.urls[0],t=r.response.fhe_key_info[0].fhe_public_key.data_id;else{const R=r.response.fhe_key_info.find(m=>m.fhe_public_key.data_id===t);if(!R)throw new Error(`Could not find FHE key info with data_id ${t}`);s=R.fhe_public_key.urls[0]}const _=await fetch(s);if(!_.ok)throw new Error(`HTTP error! status: ${_.status} on ${_.url}`);let a;typeof _.bytes=="function"?a=await _.bytes():a=new Uint8Array(await _.arrayBuffer());const c=r.response.crs[2048].urls[0],l=r.response.crs[2048].data_id,p=await fetch(c);if(!p.ok)throw new Error(`HTTP error! status: ${p.status} on ${p.url}`);let u;typeof p.bytes=="function"?u=await p.bytes():u=new Uint8Array(await p.arrayBuffer());let d;try{d=Ut.TfheCompactPublicKey.safe_deserialize(a,g_)}catch(R){throw new Error("Invalid public key (deserialization failed)",{cause:R})}let b;try{b=Ut.CompactPkeCrs.safe_deserialize(new Uint8Array(u),A_)}catch(R){throw new Error("Invalid crs (deserialization failed)",{cause:R})}const S={publicKey:d,publicKeyId:t,publicParams:{2048:{publicParams:b,publicParamsId:l}}};return zp[i]=S,S}catch(s){throw new Error("Impossible to fetch public key: wrong relayer url.",{cause:s})}}async function kR(i){if(Nn(i.relayerVersionUrl)&&!i.publicKey){const t=await LA(ep(i.relayerVersionUrl,"/"),void 0,i);return{publicKey:t.publicKey,publicKeyId:t.publicKeyId}}else if(i.publicKey?.data&&Nn(i.publicKey.id)){const t=i.publicKey.data;try{return{publicKey:Ut.TfheCompactPublicKey.safe_deserialize(t,g_),publicKeyId:i.publicKey.id}}catch(e){throw new Error("Invalid public key (deserialization failed)",{cause:e})}}else throw new Error("You must provide a public key with its public key ID.")}async function VR(i){if(Nn(i.relayerVersionUrl)&&!i.publicParams)return(await LA(ep(i.relayerVersionUrl,"/"),void 0,i)).publicParams;if(i.publicParams?.["2048"]){const t=i.publicParams[2048].publicParams;try{return{2048:{publicParams:Ut.CompactPkeCrs.safe_deserialize(t,A_),publicParamsId:i.publicParams[2048].publicParamsId}}}catch(e){throw new Error("Invalid public key (deserialization failed)",{cause:e})}}else throw new Error("You must provide a valid CRS with its CRS ID.")}class HA{#t;constructor(t){this.#t=t.fhevmHostChain}get fhevmHostChain(){return this.#t}get relayerVersionUrl(){return this.relayerProvider.url}}class FR extends Mp{get version(){return 1}async fetchPostInputProof(t,e){const r=await Cp("INPUT_PROOF",this.inputProofUrl,t,e);return NA(r.response,"fetchPostInputProof()"),r.response}async fetchPostPublicDecrypt(t,e){const s=(await Cp("PUBLIC_DECRYPT",this.publicDecryptUrl,t,e)).response[0],_={signatures:s.signatures,decryptedValue:s.decrypted_value,extraData:"0x"};return KA(_,"fetchPostPublicDecrypt()"),_}async fetchPostUserDecrypt(t,e){const r=await Cp("USER_DECRYPT",this.userDecryptUrl,t,e);return Ep(r.response,"RelayerUserDecryptResult()"),r.response}fetchPostDelegatedUserDecrypt(t,e){throw new Error("Delegated user decrypt is not supported in Relayer V1")}}class ae extends it{constructor({message:t}){super({message:t??"Invalid FHEVM config",name:"FhevmConfigError"})}}function YR(i,t){H(i,"name",t,"InputVerification"),H(i,"version",t,"1"),X1(i,"chainId",t),j1(i,"verifyingContract",t)}const lo=class lo{constructor(t){zt(this,ca);zt(this,xn);zt(this,co);zt(this,la);le(this,ca,t.address),le(this,xn,{...t.eip712Domain}),le(this,co,[...t.coprocessorSigners]),le(this,la,t.coprocessorSignerThreshold),Object.freeze(L(this,xn)),Object.freeze(L(this,co))}get address(){return L(this,ca)}get eip712Domain(){return L(this,xn)}get gatewayChainId(){return L(this,xn).chainId}get coprocessorSigners(){return L(this,co)}get coprocessorSignerThreshold(){return L(this,la)}get verifyingContractAddressInputVerification(){return L(this,xn).verifyingContract}static async loadFromChain(t){const e=new de(t.inputVerifierContractAddress,L(lo,aa),t.provider);if(t.batchRpcCalls===!0)throw new Error("Batch RPC Calls not supported!");const s=await S_([()=>e.eip712Domain(),()=>e.getThreshold(),()=>e.getCoprocessorSigners()],t.batchRpcCalls),_=s[0],a=s[1],c=s[2];if(!uc(a))throw new Error("Invalid InputVerifier Coprocessor signers threshold.");try{pc(c)}catch(d){throw new Error("Invalid InputVerifier Coprocessor signers addresses.",{cause:d})}const l=_[3];if(!op(l))throw new Error("Invalid InputVerifier EIP-712 domain chainId.");const p={name:_[1],version:_[2],chainId:l,verifyingContract:_[4]};try{YR(p,"InputVerifier.eip712Domain()")}catch(d){throw new Error("Invalid InputVerifier EIP-712 domain.",{cause:d})}if(p.verifyingContract.toLowerCase()===t.inputVerifierContractAddress.toLowerCase())throw new Error("Invalid InputVerifier EIP-712 domain. Unexpected verifyingContract.");return new lo({address:t.inputVerifierContractAddress,eip712Domain:p,coprocessorSignerThreshold:Number(a),coprocessorSigners:c})}};aa=new WeakMap,ca=new WeakMap,xn=new WeakMap,co=new WeakMap,la=new WeakMap,zt(lo,aa,["function getCoprocessorSigners() view returns (address[])","function getThreshold() view returns (uint256)","function eip712Domain() view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)"]),Object.freeze(L(lo,aa));let Cc=lo;function DR(i,t){H(i,"name",t,"Decryption"),H(i,"version",t,"1"),X1(i,"chainId",t),j1(i,"verifyingContract",t)}const fo=class fo{constructor(t){zt(this,fa);zt(this,ha);zt(this,R_);zt(this,po);zt(this,ua);le(this,fa,t.address),le(this,ha,t.eip712Domain.verifyingContract),le(this,R_,{...t.eip712Domain}),le(this,po,[...t.kmsSigners]),le(this,ua,t.kmsSignerThreshold),Object.freeze(L(this,R_)),Object.freeze(L(this,po))}get address(){return L(this,fa)}get eip712Domain(){return L(this,R_)}get gatewayChainId(){return L(this,R_).chainId}get kmsSigners(){return L(this,po)}get kmsSignerThreshold(){return L(this,ua)}get verifyingContractAddressDecryption(){return L(this,ha)}static async loadFromChain(t){const e=new de(t.kmsContractAddress,L(fo,pa),t.provider);if(t.batchRpcCalls===!0)throw new Error("Batch RPC Calls not supported!");const s=await S_([()=>e.eip712Domain(),()=>e.getThreshold(),()=>e.getKmsSigners()],t.batchRpcCalls),_=s[0],a=s[1],c=s[2];if(!uc(a))throw new Error("Invalid KMSVerifier kms signers threshold.");try{pc(c)}catch(u){throw new Error("Invalid KMSVerifier kms signers addresses.",{cause:u})}const l={name:_[1],version:_[2],chainId:_[3],verifyingContract:_[4]};try{DR(l,"KMSVerifier.eip712Domain()")}catch(u){throw new Error("Invalid KMSVerifier EIP-712 domain.",{cause:u})}if(l.verifyingContract.toLowerCase()===t.kmsContractAddress.toLowerCase())throw new Error("Invalid KMSVerifier EIP-712 domain. Unexpected verifyingContract.");return new fo({address:t.kmsContractAddress,eip712Domain:l,kmsSignerThreshold:Number(a),kmsSigners:c})}};pa=new WeakMap,fa=new WeakMap,ha=new WeakMap,R_=new WeakMap,po=new WeakMap,ua=new WeakMap,zt(fo,pa,["function getKmsSigners() view returns (address[])","function getThreshold() view returns (uint256)","function eip712Domain() view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)"]),Object.freeze(L(fo,pa));let zc=fo;class ra{#t;#e;#r;#i;#s;#n;#_;#o;#u;#a;constructor(t){this.#i=t.hostChainId,this.#t=t.hostACLContractAddress,this.#e=t.hostKMSVerifierContractAddress,this.#r=t.hostInputVerifierContractAddress,this.#s=t.hostNetworkConfig,Object.freeze(this.#s),this.#s.type==="rpc"?this.#n=new N2(this.#s.rpcUrl):this.#n=new i_(this.#s.provider),this.#_=t.gatewayVerifyingContractAddressDecryption,this.#o=t.gatewayVerifyingContractAddressInputVerification,this.#u=t.gatewayChainId,this.#a=t.batchRpcCalls}get chainId(){return this.#i}get aclContractAddress(){return this.#t}get kmsContractAddress(){return this.#e}get inputVerifierContractAddress(){return this.#r}get network(){return this.#s.type==="rpc"?this.#s.rpcUrl:this.#s.provider}get ethersProvider(){return this.#n}get verifyingContractAddressDecryption(){return this.#_}get verifyingContractAddressInputVerification(){return this.#o}get gatewayChainId(){return this.#u}get batchRpcCalls(){return this.#a}static fromUserConfig(t){const e=t.aclContractAddress,r=t.kmsContractAddress,s=t.inputVerifierContractAddress,_=t.verifyingContractAddressDecryption,a=t.verifyingContractAddressInputVerification,c=t.chainId,l=t.gatewayChainId,p=t.network;ia(e,"ACL contract"),ia(r,"KMS contract"),ia(s,"InputVerifier contract"),ia(_,"Verifying contract for Decryption"),ia(a,"Verifying contract for InputVerification"),JA(c,"host chain ID"),JA(l,"gateway chain ID");let u;if(p===void 0)throw new ae({message:"You must provide a network URL or a EIP1193 object (eg: window.ethereum)"});if(typeof p=="string"){if(!URL.canParse(p))throw new ae({message:`Invalid network URL: ${p}`});u={type:"rpc",rpcUrl:p}}else if(jR(p))u={type:"eip1193",provider:p};else throw new ae({message:"Invalid FhevmInstanceConfig.network property, expecting an RPC URL string or an Eip1193Provider"});if(t.publicKey){if(!t.publicParams)throw new ae({message:"Missing config publicParams."})}else if(t.publicParams)throw new ae({message:"Missing config publicKey."});return new ra({hostChainId:BigInt(c),hostNetworkConfig:u,hostACLContractAddress:e,hostKMSVerifierContractAddress:r,hostInputVerifierContractAddress:s,gatewayVerifyingContractAddressDecryption:_,gatewayVerifyingContractAddressInputVerification:a,gatewayChainId:BigInt(l),batchRpcCalls:t.batchRpcCalls===!0})}async loadFromChain(){return Ic.loadFromChain(this)}}class Ic{#t;#e;#r;constructor(t){this.#t=t.config,this.#e=t.inputVerifier,this.#r=t.kmsVerifier}static async loadFromChain(t){if(t.batchRpcCalls)throw new Error("Batch RPC Calls not supported!");const r=await S_([()=>t.ethersProvider.getNetwork(),()=>Cc.loadFromChain({inputVerifierContractAddress:t.inputVerifierContractAddress,provider:t.ethersProvider}),()=>zc.loadFromChain({kmsContractAddress:t.kmsContractAddress,provider:t.ethersProvider})],t.batchRpcCalls),s=r[0],_=r[1],a=r[2];if(s.chainId!==t.chainId)throw new ae({message:`Invalid config chainId ${String(t.chainId)}. Expecting ${String(s.chainId)}.`});if(_.gatewayChainId!==t.gatewayChainId)throw new ae({message:`Invalid config gatewayChainId ${String(t.gatewayChainId)}. Expecting ${String(_.gatewayChainId)}.`});if(_.verifyingContractAddressInputVerification!==t.verifyingContractAddressInputVerification)throw new ae({message:`Invalid config.verifyingContractAddressInputVerification=${t.verifyingContractAddressInputVerification}. Expecting ${t.verifyingContractAddressInputVerification}.`});if(a.verifyingContractAddressDecryption!==t.verifyingContractAddressDecryption)throw new ae({message:`Invalid config.verifyingContractAddressDecryption=${t.verifyingContractAddressDecryption}. Expecting ${a.verifyingContractAddressDecryption}.`});return new Ic({config:t,inputVerifier:_,kmsVerifier:a})}get chainId(){return this.#t.chainId}get ethersProvider(){return this.#t.ethersProvider}get aclContractAddress(){return this.#t.aclContractAddress}get kmsContractAddress(){return this.#t.kmsContractAddress}get inputVerifierContractAddress(){return this.#t.inputVerifierContractAddress}get coprocessorSigners(){return this.#e.coprocessorSigners}get coprocessorSignerThreshold(){return this.#e.coprocessorSignerThreshold}get verifyingContractAddressInputVerification(){return this.#e.verifyingContractAddressInputVerification}get kmsSigners(){return this.#r.kmsSigners}get kmsSignerThreshold(){return this.#r.kmsSignerThreshold}get verifyingContractAddressDecryption(){return this.#r.verifyingContractAddressDecryption}get gatewayChainId(){return this.#e.gatewayChainId}}function ia(i,t){if(i===void 0||i==="")throw new ae({message:`Missing ${t} checksummed address`});if(!Jt(i))throw new ae({message:`Invalid ${t} checksummed address`})}function JA(i,t){if(i===void 0)throw new ae({message:`Missing ${t}`});if(!to(i))throw new ae({message:`Invalid ${t}`})}function jR(i){return typeof i=="object"&&i!==null&&"request"in i&&typeof i.request=="function"}class Ip extends HA{_relayerProvider;_publicKeyData;_publicParamsData;_tfhePkeParams;constructor(t){super(t),this._relayerProvider=t.relayerProvider,this._publicKeyData=t.publicKeyData,this._publicParamsData=t.publicParamsData,this._tfhePkeParams=ki.fromWasm({publicKey:{id:this._publicKeyData.publicKeyId,wasm:this._publicKeyData.publicKey},pkeCrs2048:{id:this._publicParamsData[2048].publicParamsId,wasm:this._publicParamsData[2048].publicParams,capacity:2048}})}get version(){return 1}get tfhePkeParams(){return this._tfhePkeParams}static async fromConfig(t){const e=new FR({relayerUrl:t.relayerVersionUrl,...t.auth!==void 0?{auth:t.auth}:{}}),r=await kR(t),s=await VR(t),a=await ra.fromUserConfig(t).loadFromChain();return new Ip({relayerProvider:e,publicKeyData:r,publicParamsData:s,fhevmHostChain:a})}get relayerProvider(){return this._relayerProvider}getPublicKeyBytes(){return{id:this._publicKeyData.publicKeyId,bytes:this._publicKeyData.publicKey.safe_serialize(g_)}}getPublicKeyWasm(){return{id:this._publicKeyData.publicKeyId,wasm:this._publicKeyData.publicKey}}supportsCapacity(t){return t===2048}getPkeCrsBytesForCapacity(t){if(t===void 0)throw new Error("Missing PublicParams bits format");if(t!==2048)throw new Error(`Unsupported PublicParams bits format '${t}'`);return{capacity:t,id:this._publicParamsData[2048].publicParamsId,bytes:this._publicParamsData[2048].publicParams.safe_serialize(A_)}}getPkeCrsWasmForCapacity(t){if(t===void 0)throw new Error("Missing PublicParams bits format");if(t!==2048)throw new Error(`Unsupported PublicParams bits format '${t}'`);return{capacity:t,id:this._publicParamsData[2048].publicParamsId,wasm:this._publicParamsData[2048].publicParams}}}function QA(i,t){if(H(i,"label",t),!(i.label==="malformed_json"||i.label==="request_error"||i.label==="not_ready_for_decryption"||i.label==="not_allowed_on_host_acl"))throw new ct({objName:t,property:"label",expectedType:"string",expectedValue:["malformed_json","request_error","not_ready_for_decryption","not_allowed_on_host_acl"],type:typeof i.label,value:i.label});H(i,"message",t)}function $A(i,t){if(H(i,"label",t),!(i.label==="missing_fields"||i.label==="validation_failed"))throw new ct({objName:t,property:"label",expectedType:"string",expectedValue:["missing_fields","validation_failed"],type:typeof i.label,value:i.label});H(i,"message",t),Bn(i,"details",t);const e=i.details;for(let r=0;r<e.length;++r){const s=e[r];H(s,"field",`${t}.details[${r}]`),H(s,"issue",`${t}.details[${r}]`)}}function WA(i,t){H(i,"label",t,["rate_limited","protocol_overload"]),H(i,"message",t)}function ZA(i,t){H(i,"label",t,"internal_server_error"),H(i,"message",t)}function qA(i,t){H(i,"label",t,"not_found"),H(i,"message",t)}function XA(i,t){H(i,"label",t,["protocol_paused","insufficient_balance","insufficient_allowance","gateway_not_reachable","readiness_check_timed_out","response_timed_out"]),H(i,"message",t)}function sa(i,t){H(i,"status",t,"failed"),ii(i,"error",t),LR(i.error,`${t}.error`)}function LR(i,t){if(H(i,"label",t),i.label==="malformed_json"||i.label==="request_error"||i.label==="not_ready_for_decryption"||i.label==="not_allowed_on_host_acl")QA(i,t);else if(i.label==="missing_fields"||i.label==="validation_failed")$A(i,t);else if(i.label==="not_found")qA(i,t);else if(i.label==="rate_limited"||i.label==="protocol_overload")WA(i,t);else if(i.label==="internal_server_error")ZA(i,t);else if(i.label==="readiness_check_timed_out"||i.label==="response_timed_out"||i.label==="protocol_paused"||i.label==="insufficient_balance"||i.label==="insufficient_allowance"||i.label==="gateway_not_reachable")XA(i,t);else throw new ct({objName:t,property:"label",expectedType:"string",expectedValue:["malformed_json","request_error","not_ready_for_decryption","not_allowed_on_host_acl","missing_fields","validation_failed","rate_limited","internal_server_error","protocol_paused","insufficient_balance","insufficient_allowance","protocol_overload","gateway_not_reachable","readiness_check_timed_out","response_timed_out"],type:typeof i.label,value:i.label})}function tb(i,t){if(sa(i,t),i.error.label==="malformed_json"||i.error.label==="request_error"||i.error.label==="not_ready_for_decryption"||i.error.label==="not_allowed_on_host_acl")QA(i.error,`${t}.error`);else if(i.error.label==="missing_fields"||i.error.label==="validation_failed")$A(i.error,`${t}.error`);else throw new ct({objName:`${t}.error`,property:"label",expectedType:"string",expectedValue:["malformed_json","request_error","not_ready_for_decryption","not_allowed_on_host_acl","missing_fields","validation_failed"],type:typeof i.error.label,value:i.error.label})}function HR(i,t){sa(i,t),qA(i.error,`${t}.error`)}function JR(i,t){sa(i,t),WA(i.error,`${t}.error`)}function eb(i,t){sa(i,t),ZA(i.error,`${t}.error`)}function rb(i,t){sa(i,t),XA(i.error,`${t}.error`)}class Gp extends it{_fetchMethod;_url;_jobId;_operation;_retryCount;_elapsed;_state;constructor(t){const e=[...t.metaMessages??[],`url: ${t.url}`,`method: ${t.fetchMethod}`,`operation: ${t.operation}`,`retryCount: ${t.retryCount}`,...t.jobId!==void 0?[`jobId: ${t.jobId}`]:[]];super({...t,metaMessages:e,name:t.name??"RelayerV2FetchErrorBase"}),this._fetchMethod=t.fetchMethod,this._url=t.url,this._operation=t.operation,this._elapsed=t.elapsed,this._retryCount=t.retryCount,this._state=t.state,this._jobId=t.jobId}get url(){return this._url}get operation(){return this._operation}get fetchMethod(){return this._fetchMethod}get jobId(){return this._jobId}get retryCount(){return this._retryCount}get elapsed(){return this._elapsed}get state(){return this._state}get isAbort(){return this.cause!==void 0?this.cause.name==="AbortError":!1}}class Gc extends Gp{_status;constructor(t){const e=[`status: ${t.status}`];super({...t,metaMessages:e,name:t.name??"RelayerV2ResponseErrorBase"}),this._status=t.status}get status(){return this._status}}class QR extends Gc{_bodyJson;constructor(t){super({...t,cause:io(t.cause),name:"RelayerV2ResponseInvalidBodyError",message:"Response body does not match the expected schema"}),this._bodyJson=t.bodyJson}get bodyJson(){return this._bodyJson}}class ib extends Gc{constructor(t){super({...t,name:"RelayerV2ResponseStatusError",message:`Unexpected response status ${t.status}`})}}function $R(i,t){Xl(i,"accepted",t),i.accepted?WR(i,t):ZR(i,t)}function WR(i,t){Xl(i,"accepted",t,!0),U1(i,"handles",t),Nm(i,"signatures",t),ac(i,"extraData",t)}function ZR(i,t){Xl(i,"accepted",t,!1),ac(i,"extraData",t)}function qR(i,t){ii(i,"result",t),H(i,"status",t,"succeeded"),H(i,"requestId",t),$R(i.result,`${t}.result`)}function XR(i,t){T1(i,"signatures",t),Zo(i,"decryptedValue",t),ac(i,"extraData",t)}function tP(i,t){ii(i,"result",t),H(i,"status",t,"succeeded"),H(i,"requestId",t),XR(i.result,`${t}.result`)}function eP(i,t){Bn(i,"result",t);for(let e=0;e<i.result.length;++e)Zo(i.result[e],"payload",`${t}.result[${e}]`),Zo(i.result[e],"signature",`${t}.result[${e}]`)}function rP(i,t){ii(i,"result",t),H(i,"status",t,"succeeded"),H(i,"requestId",t),eP(i.result,`${t}.result`)}class Bp extends it{_url;_operation;_jobId;constructor(t){const e=[...t.metaMessages??[],`url: ${t.url}`,`operation: ${t.operation}`,...t.jobId!==void 0?[`jobId: ${t.jobId}`]:[]];super({...t,name:t.name??"RelayerV2RequestErrorBase",metaMessages:e}),this._url=t.url,this._operation=t.operation,this._jobId=t.jobId}get url(){return this._url}get jobId(){return this._jobId}get operation(){return this._operation}}class iP extends Bp{_status;_state;constructor(t){const e=[...t.metaMessages??[],...t.status!==void 0?[`status: ${t.status}`]:[],...t.state!==void 0?[`state: ${t.state}`]:[]];super({...t,metaMessages:e,name:"RelayerV2RequestInternalError",message:t.message??"Internal error"}),this._status=t.status,this._state=t.state}get status(){return this._status}get state(){return this._state}}class sP extends Gc{_relayerApiError;constructor(t){const e=[`label: ${t.relayerApiError.label}`];super({...t,metaMessages:e,name:"RelayerV2ResponseApiError",message:t.relayerApiError.message}),this._relayerApiError=t.relayerApiError}get relayerApiError(){return this._relayerApiError}}class nP extends Gp{constructor(t){super({...t,name:"RelayerV2FetchError",message:t.message,cause:io(t.cause)})}}class sb extends Gc{constructor(t){super({...t,name:"RelayerV2ResponseInputProofRejectedError",message:"InputProof rejected"})}}class Vi extends it{_state;constructor(t){super({...t,name:"RelayerV2StateError"}),this._state={...t.state},Object.freeze(this._state)}get state(){return this._state}}class _P extends Gp{constructor(t){super({...t,name:"RelayerV2MaxRetryError",message:`Maximum retry limit exceeded (retried ${t.retryCount} times)`})}}function oP(i,t){H(i,"jobId",t)}function aP(i,t){H(i,"status",t,"queued"),H(i,"requestId",t),ii(i,"result",t),oP(i.result,`${t}.result`)}function cP(i,t){H(i,"status",t,"queued"),H(i,"requestId",t)}class lP extends Bp{_timeoutMs;constructor(t){super({...t,name:"RelayerV2TimeoutError",message:`Request timed out after ${t.timeoutMs}ms`}),this._timeoutMs=t.timeoutMs}get timeoutMs(){return this._timeoutMs}}class pP extends Bp{constructor(t){super({...t,name:"RelayerV2AbortError",message:"Request aborted"})}}class Kt{_debug;_fetchMethod;_elapsed;_jobId;_jobIdTimestamp;_state;_relayerOperation;_internalAbortController;_internalAbortSignal;_externalAbortSignal;_terminateReason;_terminateError;_retryCount;_totalSteps;_step;_retryAfterTimeoutID;_url;_payload;_fhevmAuth;_retryAfterTimeoutPromiseFuncReject;_onProgress;_requestMaxDurationInMs;_requestStartTimestamp;_requestGlobalTimeoutID;_throwErrorIfNoRetryAfter;static DEFAULT_RETRY_AFTER_MS=2500;static MINIMUM_RETRY_AFTER_MS=1e3;static DEFAULT_GLOBAL_REQUEST_TIMEOUT_MS=3600*1e3;static MAX_GET_RETRY=1800;static MAX_POST_RETRY=Kt.MAX_GET_RETRY;constructor(t){const e=["INPUT_PROOF","PUBLIC_DECRYPT","USER_DECRYPT","DELEGATED_USER_DECRYPT"];if(!e.includes(t.relayerOperation))throw new ct({objName:"RelayerV2AsyncRequestParams",property:"relayerOperation",expectedType:"string",value:t.relayerOperation,expectedValue:e.join(" | ")});this._step=0,this._totalSteps=1,this._elapsed=0,this._relayerOperation=t.relayerOperation,this._internalAbortController=new AbortController,this._internalAbortSignal=this._internalAbortController.signal,this._internalAbortSignal.addEventListener("abort",this._handleInternalSignalAbort),this._externalAbortSignal=t.options?.signal,this._externalAbortSignal&&this._externalAbortSignal.addEventListener("abort",this._handleExternalSignalAbort),this._url=t.url,this._payload=t.payload,this._debug=t.options?.debug===!0,this._fhevmAuth=t.options?.auth,this._onProgress=t.options?.onProgress,this._state={aborted:!1,canceled:!1,failed:!1,fetching:!1,running:!1,succeeded:!1,terminated:!1,timeout:!1},this._retryCount=0,this._retryAfterTimeoutID=void 0,this._requestGlobalTimeoutID=void 0,this._terminateReason=void 0,this._throwErrorIfNoRetryAfter=t.throwErrorIfNoRetryAfter??!1,this._requestMaxDurationInMs=t.options?.timeout??Kt.DEFAULT_GLOBAL_REQUEST_TIMEOUT_MS}async run(t){if(this._state.terminated)throw new Vi({message:"Relayer.run() failed. Request already terminated.",state:{...this._state}});if(this._state.canceled)throw new Vi({message:"Relayer.run() failed. Request already canceled.",state:{...this._state}});if(this._state.succeeded)throw new Vi({message:"Relayer.run() failed. Request already succeeded.",state:{...this._state}});if(this._state.failed)throw new Vi({message:"Relayer.run() failed. Request already failed.",state:{...this._state}});if(this._state.aborted)throw new Vi({message:"Relayer.run() failed. Request already aborted.",state:{...this._state}});if(this._state.timeout)throw new Vi({message:"Relayer.run() failed. Request already timeout.",state:{...this._state}});if(this._externalAbortSignal?.aborted===!0)throw new Vi({message:`Relayer.run() failed. External AbortSignal already aborted (reason:${this._externalAbortSignal.reason}).`,state:{...this._state}});if(this._internalAbortSignal?.aborted===!0)throw new Vi({message:`Relayer.run() failed. Internal AbortSignal already aborted (reason:${this._internalAbortSignal.reason}).`,state:{...this._state}});if(this._state.running)throw new Vi({message:"Relayer.run() failed. Request already running.",state:{...this._state}});this._state.running=!0,this._requestStartTimestamp=Date.now(),this._setGlobalRequestTimeout(this._requestMaxDurationInMs);try{const e=await this._runPostLoop(t);return this._state.succeeded=!0,this._terminate("succeeded"),e}catch(e){throw this._state.failed=!0,e.name==="AbortError"&&(this._assert(this._state.aborted,"this._state.aborted"),this._assert(this._state.terminated,"this._state.terminated")),this._terminate("failed",e),e}}_canContinue(){return!(this._state.canceled||this._state.terminated||this._state.succeeded||this._state.aborted)}cancel(){if(!this._canContinue()){this._trace("cancel","!this._canContinue()");return}this._state.canceled=!0,this._internalAbortController?.abort("cancel"),this._assert(this._state.aborted,"this._state.aborted"),this._assert(this._state.terminated,"this._state.terminated")}get state(){return{...this._state}}get canceled(){return this._state.canceled}get terminated(){return this._state.terminated}get terminateReason(){return this._terminateReason}get terminateError(){return this._terminateError}get running(){return this._state.running}get fetching(){return this._state.fetching}get failed(){return this._state.failed}get aborted(){return this._state.aborted}get timeout(){return this._state.timeout}get succeeded(){return this._state.succeeded}get startTimeMs(){return this._requestStartTimestamp}get elapsedTimeMs(){if(this._requestStartTimestamp!==void 0)return Date.now()-this._requestStartTimestamp}get retryCount(){return this._retryCount}async _runPostLoop(t){if(this._assert(this._fetchMethod===void 0,"this._fetchMethod === undefined"),this._fetchMethod="POST",this._totalSteps=1,this._step=0,Nn(t?.existingJobId))return this._setJobIdOnce(t.existingJobId),await this._runGetLoop();let e=0;for(;e<Kt.MAX_POST_RETRY;){++e,this._assertCanContinueAfterAwait(),this._elapsed=this._jobId!==void 0?Date.now()-this._jobIdTimestamp:0;const r=await this._fetchPost(),s=r.status;switch(s){case 202:{const _=await this._getResponseJson(r);try{aP(_,"body")}catch(l){this._throwResponseInvalidBodyError({status:s,cause:l,bodyJson:ni(_)})}const a=this._getRetryAfterHeaderValueInMs(r);return this._setJobIdOnce(_.result.jobId),this._postAsyncOnProgressCallback({type:"queued",url:this._url,method:"POST",status:s,requestId:_.requestId,jobId:this.jobId,operation:this._relayerOperation,retryCount:this._retryCount,retryAfterMs:a,elapsed:this._elapsed,step:this._step,totalSteps:this._totalSteps}),await this._setRetryAfterTimeout(a),await this._runGetLoop()}case 400:{const _=await this._getResponseJson(r);try{tb(_,"body")}catch(a){this._throwResponseInvalidBodyError({status:s,cause:a,bodyJson:ni(_)})}this._throwRelayerV2ResponseApiError({status:s,relayerApiError:_.error})}case 401:this._throwUnauthorizedError(s);case 429:{const _=await this._getResponseJson(r);try{JR(_,"body")}catch(c){this._throwResponseInvalidBodyError({status:s,cause:c,bodyJson:ni(_)})}const a=this._getRetryAfterHeaderValueInMs(r);this._postAsyncOnProgressCallback({type:"throttled",operation:this._relayerOperation,url:this._url,method:"POST",status:s,retryAfterMs:a,retryCount:this._retryCount,elapsed:this._elapsed,relayerApiError:_.error,step:this._step,totalSteps:this._totalSteps}),await this._setRetryAfterTimeout(a);continue}case 500:{const _=await this._getResponseJson(r);try{eb(_,"body")}catch(a){this._throwResponseInvalidBodyError({status:s,cause:a,bodyJson:ni(_)})}this._throwRelayerV2ResponseApiError({status:s,relayerApiError:_.error})}case 503:{const _=await this._getResponseJson(r);try{rb(_,"body")}catch(a){this._throwResponseInvalidBodyError({status:s,cause:a,bodyJson:ni(_)})}this._throwRelayerV2ResponseApiError({status:s,relayerApiError:_.error})}default:(a=>{throw new ib({fetchMethod:"POST",status:a,url:this._url,operation:this._relayerOperation,elapsed:this._elapsed,retryCount:this._retryCount,state:{...this._state}})})(s)}}this._throwMaxRetryError({fetchMethod:"POST"})}async _runGetLoop(){this._assert(this._fetchMethod==="POST","this._fetchMethod === 'POST'"),this._assert(this._jobId!==void 0,"this._jobId !== undefined"),this._assert(this._jobIdTimestamp!==void 0,"this._jobIdTimestamp !== undefined"),this._fetchMethod="GET";let t=0;for(;t<Kt.MAX_GET_RETRY;){++t,this._assertCanContinueAfterAwait(),this._elapsed=Date.now()-this._jobIdTimestamp;const e=await this._fetchGet(),r=e.status;switch(r){case 200:{const s=await this._getResponseJson(e);this._step=this._totalSteps;try{if(this._relayerOperation==="INPUT_PROOF"){qR(s,"body");const _=s.result;if(!_.accepted)throw new sb({url:this._url,fetchMethod:"GET",jobId:this.jobId,operation:this._relayerOperation,retryCount:this._retryCount,status:r,state:{...this._state},elapsed:this._elapsed});const c=_;return this._postAsyncOnProgressCallback({type:"succeeded",url:this._url,method:"GET",status:r,jobId:this.jobId,requestId:s.requestId,operation:this._relayerOperation,retryCount:this._retryCount,elapsed:this._elapsed,result:c,step:this._step,totalSteps:this._totalSteps}),c}else if(this._relayerOperation==="PUBLIC_DECRYPT"){tP(s,"body");const a=s.result;return this._postAsyncOnProgressCallback({type:"succeeded",url:this._url,method:"GET",status:r,jobId:this.jobId,requestId:s.requestId,operation:this._relayerOperation,retryCount:this._retryCount,elapsed:this._elapsed,result:a,step:this._step,totalSteps:this._totalSteps}),a}else if(this._relayerOperation==="USER_DECRYPT"||this._relayerOperation==="DELEGATED_USER_DECRYPT"){rP(s,"body");const a=s.result.result;return this._postAsyncOnProgressCallback({type:"succeeded",url:this._url,method:"GET",status:r,jobId:this.jobId,requestId:s.requestId,operation:this._relayerOperation,retryCount:this._retryCount,elapsed:this._elapsed,result:a,step:this._step,totalSteps:this._totalSteps}),a}else wp(this._relayerOperation,`Unknown operation: ${this._relayerOperation}`)}catch(_){if(_ instanceof sb)throw _;this._throwResponseInvalidBodyError({status:r,cause:_,bodyJson:ni(s)})}}case 202:{const s=await this._getResponseJson(e);try{cP(s,"body")}catch(a){this._throwResponseInvalidBodyError({status:r,cause:a,bodyJson:ni(s)})}const _=this._getRetryAfterHeaderValueInMs(e);this._postAsyncOnProgressCallback({type:"queued",url:this._url,method:"GET",status:r,requestId:s.requestId,operation:this._relayerOperation,jobId:this.jobId,retryAfterMs:_,retryCount:this._retryCount,elapsed:this._elapsed,step:this._step,totalSteps:this._totalSteps}),await this._setRetryAfterTimeout(_);continue}case 400:{const s=await this._getResponseJson(e);try{tb(s,"body")}catch(_){this._throwResponseInvalidBodyError({status:r,cause:_,bodyJson:ni(s)})}this._throwRelayerV2ResponseApiError({status:r,relayerApiError:s.error})}case 401:this._throwUnauthorizedError(r);case 404:{const s=await this._getResponseJson(e);try{HR(s,"body")}catch(_){this._throwResponseInvalidBodyError({status:r,cause:_,bodyJson:ni(s)})}this._throwRelayerV2ResponseApiError({status:r,relayerApiError:s.error})}case 500:{const s=await this._getResponseJson(e);try{eb(s,"body")}catch(_){this._throwResponseInvalidBodyError({status:r,cause:_,bodyJson:ni(s)})}this._throwRelayerV2ResponseApiError({status:r,relayerApiError:s.error})}case 503:{const s=await this._getResponseJson(e);try{rb(s,"body")}catch(_){this._throwResponseInvalidBodyError({status:r,cause:_,bodyJson:ni(s)})}this._throwRelayerV2ResponseApiError({status:r,relayerApiError:s.error})}default:(_=>{throw new ib({fetchMethod:"GET",status:_,url:this._url,jobId:this.jobId,operation:this._relayerOperation,elapsed:this._elapsed,retryCount:this._retryCount,state:{...this._state}})})(r)}}this._throwMaxRetryError({fetchMethod:"GET"})}async _getResponseJson(t){try{const e=await t.json();return this._assertCanContinueAfterAwait(),e}catch(e){this._throwFetchError({message:"JSON parsing failed.",cause:e})}}_getRetryAfterHeaderValueInMs(t){if(!t.headers.has("Retry-After")){if(this._throwErrorIfNoRetryAfter)throw new Error("Missing 'Retry-After' header key");return Kt.DEFAULT_RETRY_AFTER_MS}try{const e=Number.parseInt(t.headers.get("Retry-After"));if(vn(e)){const r=e*1e3;return r<Kt.MINIMUM_RETRY_AFTER_MS?Kt.MINIMUM_RETRY_AFTER_MS:r}}catch{}if(this._throwErrorIfNoRetryAfter)throw new Error("Invalid 'Retry-After' header key");return Kt.DEFAULT_RETRY_AFTER_MS}_setJobIdOnce(t){this._assert(t!==void 0,"jobId !== undefined"),this._assert(this._jobId===void 0,"this._jobId === undefined"),this._jobId=t,this._jobIdTimestamp=Date.now()}get jobId(){return this._assert(this._jobId!==void 0,"this._jobId !== undefined"),this._jobId}async _fetchPost(){this._assert(this._fetchMethod==="POST",'this._fetchMethod === "POST"'),this._assert(this._jobId===void 0,"this._jobId === undefined"),this._assert(!this._state.terminated,"!this._state.terminated"),this._assert(!this._state.fetching,"!this._state.fetching"),this._trace("_fetchPost",this._url);const t=ea({method:"POST",headers:{"Content-Type":"application/json","ZAMA-SDK-VERSION":W_,"ZAMA-SDK-NAME":Jo},body:JSON.stringify(this._payload),...this._internalAbortSignal?{signal:this._internalAbortSignal}:{}},this._fhevmAuth);this._state.fetching=!0;let e;try{e=await fetch(this._url,t)}catch(r){if(this._state.fetching=!1,this._trace("_fetchPost",`catch(e) + throw e: ${String(r)}`),r.name==="AbortError")throw r;this._throwFetchError({message:"Fetch POST failed.",cause:r})}return this._state.fetching=!1,this._assert(!this._state.terminated,"!this._state.terminated"),this._assertCanContinueAfterAwait(),this._trace("_fetchPost","return response Ok"),e}async _fetchGet(){this._assert(this._fetchMethod==="GET",'this._fetchMethod === "GET"'),this._assert(this._jobId!==void 0,"this._jobId !== undefined"),this._assert(!this._state.terminated,"!this._state.terminated"),this._assert(!this._state.fetching,"!this._state.fetching"),this._trace("_fetchGet",`jobId=${this.jobId}`);const t=ea({method:"GET",headers:{"ZAMA-SDK-VERSION":W_,"ZAMA-SDK-NAME":Jo},...this._internalAbortSignal?{signal:this._internalAbortSignal}:{}},this._fhevmAuth);this._state.fetching=!0;let e;try{e=await fetch(`${this._url}/${this.jobId}`,t)}catch(r){if(this._state.fetching=!1,this._trace("_fetchGet",`jobId=${this.jobId}, catch(e) + throw e: ${r}`),r.name==="AbortError")throw r;this._throwFetchError({message:"Fetch GET failed.",cause:r})}return this._state.fetching=!1,this._assert(!this._state.terminated,"!this._state.terminated"),this._assertCanContinueAfterAwait(),this._trace("_fetchGet",`jobId=${this.jobId}, return response Ok, status=${e.status}`),e}_handleExternalSignalAbort=t=>{const e=t.currentTarget;this._assert(this instanceof Kt,"this instanceof RelayerV2AsyncRequest"),this._assert(e===this._externalAbortSignal,"signal === this._externalAbortSignal"),this._assert(!this._state.terminated,"!this._state.terminated"),this._assert(!this._state.aborted,"!this._state.aborted"),this._assert(!this._state.canceled,"!this._state.canceled"),this.cancel()};_handleInternalSignalAbort=t=>{const e=t.currentTarget;this._assert(this instanceof Kt,"this instanceof RelayerV2AsyncRequest"),this._assert(e===this._internalAbortSignal,"signal === this._internalAbortSignal"),this._assert(!this._state.terminated,"!this._state.terminated"),this._assert(!this._state.aborted,"!this._state.aborted"),this._state.aborted=!0,e.reason!=="cancel"&&this._assert(!this._state.canceled,"!this._state.canceled"),this._postAsyncOnProgressCallback({type:"abort",url:this._url,step:this._step,totalSteps:this._totalSteps,...this._fetchMethod!==void 0?{method:this._fetchMethod}:{},...this._jobId!==void 0?{jobId:this._jobId}:{},operation:this._relayerOperation,retryCount:this._retryCount}),this._terminate("abort",new pP({operation:this._relayerOperation,jobId:this._jobId,url:this._url}))};_terminate(t,e){if(this._state.terminated){this._trace("_terminate",`reason=${t}. Already terminated with reason='${this._terminateReason}'. IGNORE`),this._assert(this._terminateReason!==void 0,"this._terminateReason !== undefined"),this._assert(this._internalAbortSignal===void 0,"this._signal === undefined"),this._assert(this._requestGlobalTimeoutID===void 0,"this._requestGlobalTimeoutID === undefined"),this._assert(this._retryAfterTimeoutID===void 0,"this._retryAfterTimeoutID === undefined"),this._assert(this._retryAfterTimeoutPromiseFuncReject===void 0,"this._retryAfterTimeoutPromiseFuncReject === undefined");return}this._trace("_terminate",`reason=${t}`),this._terminateReason=t,this._terminateError=e,this._state.terminated=!0,this._tryClearRetryAfterTimeout(e),this._tryClearGlobalRequestTimeout();const r=this._internalAbortSignal,s=this._externalAbortSignal;this._externalAbortSignal=void 0,this._internalAbortSignal=void 0,this._internalAbortController=void 0,s&&s.removeEventListener("abort",this._handleExternalSignalAbort),r&&r.removeEventListener("abort",this._handleInternalSignalAbort),this._trace("_terminate",`reason=${t} completed.`)}async _setRetryAfterTimeout(t){if(this._assert(!this._state.terminated,"!this._state.terminated"),this._assert(this._retryAfterTimeoutID===void 0,"this._retryAfterTimeoutID === undefined"),this._assert(t>=Kt.MINIMUM_RETRY_AFTER_MS,`delayMs >= ${Kt.MINIMUM_RETRY_AFTER_MS}`),this._trace("_setRetryAfterTimeout",`delayMs=${t}`),this._retryAfterTimeoutID!==void 0)return Promise.reject(new Error("retry-after already running."));const e=new Promise((r,s)=>{this._retryAfterTimeoutPromiseFuncReject=s;const _=()=>{this._retryAfterTimeoutID=void 0,this._retryAfterTimeoutPromiseFuncReject=void 0,r()};this._retryCount++,this._retryAfterTimeoutID=setTimeout(_,t)});return this._assert(this._retryAfterTimeoutID!==void 0,"this._retryAfterTimeoutID !== undefined"),this._assert(this._retryAfterTimeoutPromiseFuncReject!==void 0,"this._retryAfterTimeoutPromiseFuncReject !== undefined"),e}_tryClearRetryAfterTimeout(t){if(this._retryAfterTimeoutID===void 0){this._assert(this._retryAfterTimeoutPromiseFuncReject===void 0,"this._retryAfterTimeoutPromiseFuncReject === undefined");return}this._assert(this._retryAfterTimeoutPromiseFuncReject!==void 0,"this._retryAfterTimeoutPromiseFuncReject !== undefined");const e=this._retryAfterTimeoutPromiseFuncReject,r=this._retryAfterTimeoutID;this._retryAfterTimeoutID=void 0,this._retryAfterTimeoutPromiseFuncReject=void 0,clearTimeout(r),e(t??new Error("_tryClearRetryAfterTimeout"))}_setGlobalRequestTimeout(t){this._assert(this._requestGlobalTimeoutID===void 0,"this._requestGlobalTimeoutID === undefined");const e=()=>{this._requestGlobalTimeoutID=void 0,this._handleGlobalRequestTimeout()};this._requestGlobalTimeoutID=setTimeout(e,t)}_handleGlobalRequestTimeout(){this._assert(this instanceof Kt,"this instanceof RelayerV2AsyncRequest"),this._assert(!this._state.terminated,"!this._state.terminated"),this._assert(!this._state.timeout,"!this._state.timeout"),this._state.timeout=!0,this._postAsyncOnProgressCallback({type:"timeout",url:this._url,...this._fetchMethod!==void 0?{method:this._fetchMethod}:{},...this._jobId!==void 0?{jobId:this._jobId}:{},operation:this._relayerOperation,retryCount:this._retryCount,step:this._step,totalSteps:this._totalSteps}),this._terminate("timeout",new lP({operation:this._relayerOperation,jobId:this._jobId,url:this._url,timeoutMs:this._requestMaxDurationInMs}))}_tryClearGlobalRequestTimeout(){if(this._requestGlobalTimeoutID===void 0)return;const t=this._requestGlobalTimeoutID;this._requestGlobalTimeoutID=void 0,clearTimeout(t)}_postAsyncOnProgressCallback(t){const e=this._onProgress;e&&queueMicrotask(()=>{e(t)})}_throwUnauthorizedError(t){this._throwRelayerV2ResponseApiError({status:t,relayerApiError:{label:"unauthorized",message:"Unauthorized, missing or invalid Zama Fhevm API Key."}})}_throwRelayerV2ResponseApiError(t){const e=JSON.parse(JSON.stringify(t.relayerApiError)),r={type:"failed",url:this._url,method:this._fetchMethod,status:t.status,...this._jobId!==void 0?{jobId:this._jobId}:{},operation:this._relayerOperation,retryCount:this._retryCount,elapsed:this._elapsed,relayerApiError:e,step:this._step,totalSteps:this._totalSteps};throw this._postAsyncOnProgressCallback((this._relayerOperation==="INPUT_PROOF"||this._relayerOperation==="PUBLIC_DECRYPT",r)),new sP({url:this._url,fetchMethod:this._fetchMethod,status:t.status,jobId:this._jobId,operation:this._relayerOperation,retryCount:this._retryCount,relayerApiError:t.relayerApiError,elapsed:this._elapsed,state:{...this._state}})}_assert(t,e){t||this._throwInternalError(`Assertion failed: ${e}`)}_throwInternalError(t){throw new iP({operation:this._relayerOperation,url:this._url,message:t,state:JSON.stringify(this._state),jobId:this._jobId})}_throwMaxRetryError(t){const e=this._jobIdTimestamp!==void 0?Date.now()-this._jobIdTimestamp:0;throw new _P({operation:this._relayerOperation,url:this._url,state:{...this._state},retryCount:this._retryCount,jobId:this._jobId,fetchMethod:t.fetchMethod,elapsed:e})}_throwResponseInvalidBodyError(t){throw new QR({...t,fetchMethod:this._fetchMethod,url:this._url,jobId:this._jobId,operation:this._relayerOperation,state:{...this._state},retryCount:this._retryCount,elapsed:this._elapsed})}_throwFetchError(t){throw new nP({...t,elapsed:this._elapsed,url:this._url,jobId:this._jobId,operation:this._relayerOperation,state:{...this._state},retryCount:this._retryCount,fetchMethod:this._fetchMethod})}_assertCanContinueAfterAwait(){this._canContinue()||this._throwInternalError("cannot continue.")}_trace(t,e){this._debug&&console.log(`[RelayerV2AsyncRequest]:${t}: ${e}`)}}class fP extends Mp{get version(){return 2}async fetchPostInputProof(t,e){const s=await new Kt({relayerOperation:"INPUT_PROOF",url:this.inputProofUrl,payload:t,options:e}).run();return NA(s,"fetchPostInputProof()"),s}async fetchPostPublicDecrypt(t,e){const s=await new Kt({relayerOperation:"PUBLIC_DECRYPT",url:this.publicDecryptUrl,payload:t,options:e}).run();return KA(s,"fetchPostPublicDecrypt()"),s}async fetchPostUserDecrypt(t,e){const s=await new Kt({relayerOperation:"USER_DECRYPT",url:this.userDecryptUrl,payload:t,options:e}).run();return Ep(s,"fetchPostUserDecrypt()"),s}async fetchPostDelegatedUserDecrypt(t,e){const s=await new Kt({relayerOperation:"DELEGATED_USER_DECRYPT",url:this.delegatedUserDecryptUrl,payload:t,options:e}).run();return Ep(s,"fetchPostDelegatedUserDecrypt()"),s}}class Np extends HA{#t;#e;constructor(t){super(t),this.#t=t.relayerProvider,this.#e=t.tfhePkeParams}get version(){return 2}get tfhePkeParams(){return this.#e}static async fromConfig(t){const e=new fP({relayerUrl:t.relayerVersionUrl,...t.auth!==void 0?{auth:t.auth}:{}}),r=ki.tryFromFhevmPkeConfig(t)??await e.fetchTFHEPkeParams(),_=await ra.fromUserConfig(t).loadFromChain();return new Np({relayerProvider:e,tfhePkeParams:r,fhevmHostChain:_})}get relayerProvider(){return this.#t}getPublicKeyBytes(){const t=this.#e.getTFHEPublicKey().toBytes();return{id:t.id,bytes:t.bytes}}getPublicKeyWasm(){return{id:this.#e.getTFHEPublicKey().id,wasm:this.#e.getTFHEPublicKey().tfheCompactPublicKeyWasm}}supportsCapacity(t){return this.#e.getTFHEPkeCrs().supportsCapacity(t)}getPkeCrsBytesForCapacity(t){const e=this.#e.getTFHEPkeCrs().getBytesForCapacity(t);return{capacity:t,id:e.id,bytes:e.bytes}}getPkeCrsWasmForCapacity(t){const e=this.#e.getTFHEPkeCrs().getWasmForCapacity(t);return{capacity:t,id:e.id,wasm:e.wasm}}}async function hP(i){const t=TR(i.relayerUrl,i.defaultRelayerVersion,i.relayerRouteVersion);if(!t||t.version!==1&&t.version!==2)throw new UR({message:`Invalid relayerUrl: ${i.relayerUrl}`});return t.version===2?Np.fromConfig({...i,relayerVersionUrl:t.url}):Ip.fromConfig({...i,relayerVersionUrl:t.url})}class uP{#t=0;#e=[];#r=wA;#i=gA;#s;#n;constructor(t){this.#n=t.pkeParams,this.#s=Ut.CompactCiphertextList.builder(this.#n.getTFHEPublicKey().tfheCompactPublicKeyWasm),re(this.#n.getTFHEPkeCrs().supportsCapacity(this.#r))}get count(){return this.#e.length}get totalBits(){return this.#t}getBits(){return[...this.#e]}addBool(t){if(t==null)throw new Ct({message:"Missing value"});if(typeof t!="boolean"&&typeof t!="number"&&typeof t!="bigint")throw new Ct({message:"The value must be a boolean, a number or a bigint."});const e=Number(t);if(e!==0&&e!==1)throw new Ct({message:"The value must be true, false, 0 or 1."});return this.#o("ebool"),this.#s.push_boolean(e===1),this}addUint8(t){if(!uc(t))throw new Ct({message:`The value must be a number or bigint in uint8 range (0-${String(hc)}).`});return this.#o("euint8"),this.#s.push_u8(Number(t)),this}addUint16(t){if(!jm(t))throw new Ct({message:`The value must be a number or bigint in uint16 range (0-${String(L1)}).`});return this.#o("euint16"),this.#s.push_u16(Number(t)),this}addUint32(t){if(!Q1(t))throw new Ct({message:`The value must be a number or bigint in uint32 range (0-${String(H1)}).`});return this.#o("euint32"),this.#s.push_u32(Number(t)),this}addUint64(t){if(!to(t))throw new Ct({message:"The value must be a number or bigint in uint64 range."});return this.#o("euint64"),this.#s.push_u64(BigInt(t)),this}addUint128(t){if(!Lm(t))throw new Ct({message:"The value must be a number or bigint in uint128 range."});return this.#o("euint128"),this.#s.push_u128(BigInt(t)),this}addUint256(t){if(!ap(t))throw new Ct({message:"The value must be a number or bigint in uint256 range."});return this.#o("euint256"),this.#s.push_u256(BigInt(t)),this}addAddress(t){if(!Jt(t))throw new Ct({message:"The value must be a valid checksummed address."});return this.#o("eaddress"),this.#s.push_u160(BigInt(t)),this}generateZKProof({contractAddress:t,userAddress:e,aclContractAddress:r,chainId:s}){if(this.#t===0)throw new Ct({message:"Encrypted input must contain at least one value"});if(re(this.#t<=this.#r),!Jt(t))throw new Ct({message:`Invalid contract checksummed address: ${t}`});if(!Jt(e))throw new Ct({message:`Invalid user checksummed address: ${e}`});if(!Jt(r))throw new Ct({message:`Invalid ACL checksummed address: ${r}`});if(!to(s))throw new Ct({message:`Invalid chain ID uint64: ${s}`});const _=Ht(t);re(_.length===20);const a=Ht(e);re(a.length===20);const c=Ht(r);re(c.length===20);const l=Jm(s);re(l.length===32);const p=92,u=new Uint8Array(p);u.set(_,0),u.set(a,20),u.set(c,40),u.set(l,60),re(u.length-l.length===60);const b=this.#s.build_with_proof_packed(this.#n.getTFHEPkeCrs().getWasmForCapacity(this.#r).wasm,u,Ut.ZkComputeLoadVerify).safe_serialize(bc);return y_.fromComponents({chainId:BigInt(s),aclContractAddress:r,contractAddress:t,userAddress:e,ciphertextWithZKProof:b,encryptionBits:this.#e},{copy:!1})}#_(t){if(this.#t+t>this.#r)throw new Ct({message:`Packing more than ${this.#r.toString()} bits in a single input ciphertext is unsupported`});if(this.#e.length>=this.#i)throw new Ct({message:`Packing more than ${this.#i.toString()} variables in a single input ciphertext is unsupported`})}#o(t){const e=sA(t);this.#_(e),this.#t+=e,this.#e.push(e)}}class dP{#t;#e;constructor(t){this.#t=t.builder,this.#e=m_.fromAddresses(t)}addBool(t){return this.#t.addBool(t),this}add8(t){return this.#t.addUint8(t),this}add16(t){return this.#t.addUint16(t),this}add32(t){return this.#t.addUint32(t),this}add64(t){return this.#t.addUint64(t),this}add128(t){return this.#t.addUint128(t),this}add256(t){return this.#t.addUint256(t),this}addAddress(t){return this.#t.addAddress(t),this}getBits(){return this.#t.getBits()}generateZKProof(t){return this.#t.generateZKProof(t)}async requestCiphertextWithZKProofVerification({zkProof:t,relayerProvider:e,options:r}){const s="0x00",_=await e.fetchPostInputProofWithZKProof({zkProof:t,extraData:s},r);return this.#e.verifyAndComputeInputProof({zkProof:t,handles:_.fhevmHandles,signatures:_.result.signatures,extraData:s})}async encrypt({chainId:t,contractAddress:e,userAddress:r,aclContractAddress:s,relayerProvider:_,options:a}){const c=this.#t.generateZKProof({contractAddress:e,userAddress:r,chainId:t,aclContractAddress:s});return await this.requestCiphertextWithZKProofVerification({zkProof:c,relayerProvider:_,options:a})}}class na{#t;#e;constructor(t){this.#t=t.mlKemPkePk,this.#e=t.mlKemPkeSk,Object.freeze(this.#t),Object.freeze(this.#e),this.verify()}toBytesHex(){return{publicKey:Qo(this.#t.hexNo0x),privateKey:Qo(this.#e.hexNo0x)}}toBytesHexNo0x(){return{publicKey:this.#t.hexNo0x,privateKey:this.#e.hexNo0x}}toBytes(){return{publicKey:this.#t.bytes,privateKey:this.#e.bytes}}get publicKey(){return this.#t.hexNo0x}get privateKey(){return this.#e.hexNo0x}static generate(){const t=It.ml_kem_pke_keygen(),e=It.ml_kem_pke_pk_to_u8vec(It.ml_kem_pke_get_pk(t)),r=It.ml_kem_pke_sk_to_u8vec(t);return new na({mlKemPkePk:Bc(e),mlKemPkeSk:Bc(r)})}verify(){let t;try{t=It.u8vec_to_ml_kem_pke_sk(this.#e.bytes)}catch{throw new Error("Invalid TKMSPkeKeypair privateKey")}const e=It.ml_kem_pke_get_pk(t),r=It.ml_kem_pke_pk_to_u8vec(e),s=It.ml_kem_pke_sk_to_u8vec(t);if(!lc(r,this.#t.bytes))throw new Error("Invalid TKMSPkeKeypair publicKey");if(!lc(s,this.#e.bytes))throw new Error("Invalid TKMSPkeKeypair privateKey")}static from(t){return ii(t,"publicKey","TKMSPkeKeypair.from()"),ii(t,"privateKey","TKMSPkeKeypair.from()"),new na({mlKemPkePk:Bc(t.publicKey),mlKemPkeSk:Bc(t.privateKey)})}toJSON(){return this.toBytesHex()}}function Bc(i){let t,e;if(typeof i=="string")t=qo(i,{strict:!0}),i.startsWith("0x")?e=Z_(i):e=i;else if(i instanceof Uint8Array)e=X_(i,!0),t=i;else throw new Error("Invalid argument, expecting string or Uint8Array");return{bytes:t,hexNo0x:e}}const Tt=class Tt{domain;constructor(t){Qm(t.chainId),ie(t.verifyingContractAddressDecryption),this.domain={name:"Decryption",version:"1",chainId:t.chainId,verifyingContract:t.verifyingContractAddressDecryption},Object.freeze(this.domain)}get chainId(){return this.domain.chainId}get verifyingContractAddressDecryption(){return this.domain.verifyingContract}createUserDecryptEIP712({publicKey:t,contractAddresses:e,startTimestamp:r,durationDays:s,extraData:_}){const a=nb(t);D1(e),wc(r),wc(s),u_(_);const l={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],UserDecryptRequestVerification:[{name:"publicKey",type:"bytes"},{name:"contractAddresses",type:"address[]"},{name:"startTimestamp",type:"uint256"},{name:"durationDays",type:"uint256"},{name:"extraData",type:"bytes"}]},primaryType:"UserDecryptRequestVerification",domain:{...this.domain},message:{publicKey:a,contractAddresses:[...e],startTimestamp:r.toString(),durationDays:s.toString(),extraData:_}};return Object.freeze(l),Object.freeze(l.domain),Object.freeze(l.types),Object.freeze(l.types.EIP712Domain),Object.freeze(l.types.UserDecryptRequestVerification),Object.freeze(l.message),Object.freeze(l.message.contractAddresses),l}createDelegatedUserDecryptEIP712({publicKey:t,contractAddresses:e,delegatorAddress:r,startTimestamp:s,durationDays:_,extraData:a}){const c=nb(t);D1(e),km(r),wc(s),wc(_),u_(a);const p={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],DelegatedUserDecryptRequestVerification:[{name:"publicKey",type:"bytes"},{name:"contractAddresses",type:"address[]"},{name:"delegatorAddress",type:"address"},{name:"startTimestamp",type:"uint256"},{name:"durationDays",type:"uint256"},{name:"extraData",type:"bytes"}]},primaryType:"DelegatedUserDecryptRequestVerification",domain:{...this.domain},message:{publicKey:c,contractAddresses:[...e],delegatorAddress:r,startTimestamp:s.toString(),durationDays:_.toString(),extraData:a}};return Object.freeze(p),Object.freeze(p.domain),Object.freeze(p.types),Object.freeze(p.types.EIP712Domain),Object.freeze(p.types.DelegatedUserDecryptRequestVerification),Object.freeze(p.message),Object.freeze(p.message.contractAddresses),p}createPublicDecryptEIP712({ctHandles:t,decryptedResult:e,extraData:r}){zm(t),u_(e),u_(r);const _={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],PublicDecryptVerification:[{name:"ctHandles",type:"bytes32[]"},{name:"decryptedResult",type:"bytes"},{name:"extraData",type:"bytes"}]},primaryType:"PublicDecryptVerification",domain:{...this.domain},message:{ctHandles:t,decryptedResult:e,extraData:r}};return Object.freeze(_),Object.freeze(_.domain),Object.freeze(_.types),Object.freeze(_.types.EIP712Domain),Object.freeze(_.types.PublicDecryptVerification),Object.freeze(_.message),Object.freeze(_.message.ctHandles),_}verifyPublicDecrypt({signatures:t,message:e}){return Wo(t),t.map(s=>yc({signature:s,domain:this.domain,types:L(Tt,E_),message:e,primaryType:"PublicDecryptVerification"}))}verifyUserDecrypt(t,e){return Wo(t),t.map(s=>yc({signature:s,domain:this.domain,types:L(Tt,P_),message:e,primaryType:"UserDecryptRequestVerification"}))}verifyDelegatedUserDecrypt(t,e){return Wo(t),t.map(s=>yc({signature:s,domain:this.domain,types:L(Tt,M_),message:e,primaryType:"DelegatedUserDecryptRequestVerification"}))}};P_=new WeakMap,M_=new WeakMap,E_=new WeakMap,zt(Tt,P_,{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],UserDecryptRequestVerification:[{name:"publicKey",type:"bytes"},{name:"contractAddresses",type:"address[]"},{name:"startTimestamp",type:"uint256"},{name:"durationDays",type:"uint256"},{name:"extraData",type:"bytes"}]}),zt(Tt,M_,{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],DelegatedUserDecryptRequestVerification:[{name:"publicKey",type:"bytes"},{name:"contractAddresses",type:"address[]"},{name:"delegatorAddress",type:"address"},{name:"startTimestamp",type:"uint256"},{name:"durationDays",type:"uint256"},{name:"extraData",type:"bytes"}]}),zt(Tt,E_,{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],PublicDecryptVerification:[{name:"ctHandles",type:"bytes32[]"},{name:"decryptedResult",type:"bytes"},{name:"extraData",type:"bytes"}]}),Object.freeze(L(Tt,P_)),Object.freeze(L(Tt,P_).EIP712Domain),Object.freeze(L(Tt,P_).UserDecryptRequestVerification),Object.freeze(L(Tt,M_)),Object.freeze(L(Tt,M_).EIP712Domain),Object.freeze(L(Tt,M_).DelegatedUserDecryptRequestVerification),Object.freeze(L(Tt,E_)),Object.freeze(L(Tt,E_).EIP712Domain),Object.freeze(L(Tt,E_).PublicDecryptVerification);let so=Tt;function nb(i){if(i==null)throw new Error("Missing publicKey argument.");let t,e;if(typeof i=="object"&&"publicKey"in i?e=i.publicKey:e=i,typeof e=="string")t=Qo(e),u_(t);else if(e instanceof Uint8Array)t=X_(e);else throw new Error("Invalid publicKey argument.");return t}class wP extends it{constructor(t){super({...t,name:"RelayerDuplicateKmsSignerError",message:`Duplicate kms signer address found: ${t.duplicateAddress} appears multiple times in recovered addresses`})}}class gP extends it{constructor(t){super({...t,name:"RelayerUnknownKmsSignerError",message:`Invalid address found: ${t.unknownAddress} is not in the list of kms signers`})}}class AP extends it{constructor(){super({name:"RelayerThresholdKmsSignerError",message:"Kms signers threshold is not reached"})}}class Nc{#t;#e;#r;#i;#s;constructor(t){this.#t=t.proof,this.#r=Object.freeze([...t.orderedClearValues]),this.#e=Object.freeze([...t.orderedHandles]),this.#i=t.extraData,this.#s=this._abiEncodeOrderedClearValues().abiEncodedClearValues}get proof(){return this.#t}get orderedHandles(){return this.#e}get orderedClearValues(){return this.#r}get orderedAbiEncodedClearValues(){return this.#s}get extraData(){return this.#i}static from({orderedHandles:t,orderedDecryptedResult:e,signatures:r,extraData:s}){const _=Va(["uint8"],[r.length]),a=Va(Array(r.length).fill("bytes"),r),c=ot([_,a,s]),l=t.map(b=>b.solidityPrimitiveTypeName),u=new pi().decode(l,e);if(u.length!==t.length)throw new Error("Invalid decrypted result.");const d=t.map((b,S)=>u[S]);return new Nc({orderedHandles:t,orderedClearValues:d,proof:c,extraData:s})}_abiEncodeOrderedClearValues(){const t=[],e=[];for(let _=0;_<this.#e.length;++_){const a=this.#e[_].fheTypeId;let c=this.#r[_];typeof c=="boolean"&&(c=c?"0x01":"0x00");const l=BigInt(c);switch(t.push("uint256"),a){case 7:{e.push(`0x${l.toString(16).padStart(40,"0")}`);break}case 0:{if(l!==BigInt(0)&&l!==BigInt(1))throw new Error(`Invalid ebool clear text value ${l}. Expecting 0 or 1.`);e.push(l);break}case 2:case 3:case 4:case 5:case 6:case 8:{e.push(l);break}default:wp(a,`Unsupported Fhevm primitive type id: ${a}`)}}const s=pi.defaultAbiCoder().encode(t,e);return{abiTypes:t,abiValues:e,abiEncodedClearValues:s}}toPublicDecryptResults(){const t={};return this.#e.forEach((e,r)=>t[e.toBytes32Hex()]=this.#r[r]),Object.freeze(t),Object.freeze({clearValues:t,decryptionProof:this.#t,abiEncodedClearValues:this.#s})}}class Kc{#t;#e;#r;#i;constructor(t){pc(t.kmsSigners),this.#t=[...t.kmsSigners],this.#r=t.threshold,Object.freeze(this.#t),this.#e=new Set(this.#t.map(e=>e.toLowerCase())),this.#i=new so(t)}static fromAddresses(t){return new Kc(t)}static async fromProvider(t){ie(t.kmsVerifierContractAddress);const e=["function getKmsSigners() view returns (address[])","function getThreshold() view returns (uint256)"],r=new de(t.kmsVerifierContractAddress,e,t.provider),s=await S_([()=>r.getKmsSigners(),()=>r.getThreshold()],t.batchRpcCalls),_=s[0],a=s[1];return new Kc({...t,kmsSigners:_,threshold:a})}get count(){return this.#t.length}get kmsSigners(){return this.#t}get threshold(){return this.#r}get chainId(){return this.#i.chainId}get verifyingContractAddressDecryption(){return this.#i.verifyingContractAddressDecryption}_isThresholdReached(t){const e=new Set;t.forEach(r=>{if(e.has(r.toLowerCase()))throw new wP({duplicateAddress:r});e.add(r)});for(const r of t)if(!this.#e.has(r.toLowerCase()))throw new gP({unknownAddress:r});return t.length>=this.#r}verifyPublicDecrypt(t){const r={ctHandles:t.orderedHandles.map(s=>s.toBytes32Hex()),decryptedResult:t.orderedDecryptedResult,extraData:t.extraData};this._verifyPublicDecrypt({signatures:t.signatures,message:r})}verifyAndComputePublicDecryptionProof(t){return this.verifyPublicDecrypt(t),Nc.from(t)}_verifyPublicDecrypt(t){const e=this.#i.verifyPublicDecrypt(t);if(!this._isThresholdReached(e))throw new AP}}const bP=async i=>{const t=await hP({...i,defaultRelayerVersion:2}),e=i.auth,r={...e!=null&&{auth:e},debug:i.debug},s=t.fhevmHostChain.aclContractAddress,_=t.fhevmHostChain.verifyingContractAddressInputVerification,a=t.fhevmHostChain.verifyingContractAddressDecryption,c=BigInt(t.fhevmHostChain.gatewayChainId),l=Number(t.fhevmHostChain.chainId),p=t.fhevmHostChain.kmsSigners,u=t.fhevmHostChain.kmsSignerThreshold,d=t.fhevmHostChain.coprocessorSigners,b=t.fhevmHostChain.coprocessorSignerThreshold,S=t.fhevmHostChain.ethersProvider;return{config:t.fhevmHostChain,createEncryptedInput:pR({fhevm:t,capacity:2048,defaultOptions:r}),requestZKProofVerification:async(R,m)=>{if(R.chainId!==BigInt(l)||R.aclContractAddress!==s)throw new Error("Invalid ZKProof");const P=m_.fromAddresses({coprocessorSigners:d,gatewayChainId:BigInt(c),coprocessorSignerThreshold:b,verifyingContractAddressInputVerification:_});return(await bA({zkProof:y_.fromComponents(R,{copy:!1}),coprocessorSignersVerifier:P,extraData:"0x00",relayerProvider:t.relayerProvider,options:{...r,...m}})).toBytes()},generateKeypair:()=>na.generate().toBytesHexNo0x(),createEIP712:(R,m,P,E)=>new so({chainId:BigInt(l),verifyingContractAddressDecryption:a}).createUserDecryptEIP712({publicKey:R,contractAddresses:m,startTimestamp:P,durationDays:E,extraData:"0x00"}),createDelegatedUserDecryptEIP712:(R,m,P,E,B)=>new so({chainId:BigInt(l),verifyingContractAddressDecryption:a}).createDelegatedUserDecryptEIP712({publicKey:R,contractAddresses:m,delegatorAddress:P,startTimestamp:E,durationDays:B,extraData:"0x00"}),publicDecrypt:AR({kmsSigners:p,thresholdSigners:u,gatewayChainId:Number(c),verifyingContractAddressDecryption:a,aclContractAddress:s,relayerProvider:t.relayerProvider,provider:S,defaultOptions:r}),userDecrypt:iR({kmsSigners:p,gatewayChainId:Number(c),chainId:l,verifyingContractAddressDecryption:a,aclContractAddress:s,relayerProvider:t.relayerProvider,provider:S,defaultOptions:r}),delegatedUserDecrypt:sR({kmsSigners:p,gatewayChainId:Number(c),chainId:l,verifyingContractAddressDecryption:a,aclContractAddress:s,relayerProvider:t.relayerProvider,provider:S,defaultOptions:r}),getPublicKey:()=>{const R=t.getPublicKeyBytes();return{publicKey:R.bytes,publicKeyId:R.id}},getPublicParams:R=>{if(t.supportsCapacity(R)){const m=t.getPkeCrsBytesForCapacity(R);return{publicParamsId:m.id,publicParams:m.bytes}}else return null}}};let _b=!1;const yP=async({tfheParams:i,kmsParams:t,thread:e}={})=>{if(!Ut.initTFHE||!It.initTKMS||!Ut.initThreadPool)throw new Error("Unable to load TFHE or TKMS web wasm modules");return e==null&&(e=navigator.hardwareConcurrency),await v2()||(console.warn(`This browser does not support threads. Verify that your server returns correct headers:
5
5
  `,`'Cross-Origin-Opener-Policy': 'same-origin'
6
6
  `,"'Cross-Origin-Embedder-Policy': 'require-corp'"),e=void 0),_b||(await Ut.initTFHE({module_or_path:i}),await It.initTKMS({module_or_path:t}),e&&(Ut.init_panic_hook(),await Ut.initThreadPool(e)),_b=!0),!0};T2({default:ic,initThreadPool:Ou,init_panic_hook:Tu,TfheCompactPublicKey:te,CompactPkeCrs:oe,CompactCiphertextList:hi,ZkComputeLoad:ku,ProvenCompactCiphertextList:Gi}),O2({default:K1,u8vec_to_ml_kem_pke_pk:fm,u8vec_to_ml_kem_pke_sk:hm,new_client:um,new_server_id_addr:am,process_user_decryption_resp_from_js:om,ml_kem_pke_keygen:lm,ml_kem_pke_pk_to_u8vec:cm,ml_kem_pke_sk_to_u8vec:pm,ml_kem_pke_get_pk:dm}),x.ACL=mc,x.AbstractRelayerProvider=Mp,x.CoprocessorEIP712=Sc,x.CoprocessorSignersVerifier=m_,x.FhevmHandle=lt,x.FhevmHostChain=Ic,x.FhevmHostChainConfig=ra,x.InputProof=ta,x.InputVerifier=Cc,x.KMSVerifier=zc,x.KmsEIP712=so,x.KmsSignersVerifier=Kc,x.MainnetConfig=UA,x.MainnetConfigV1=TA,x.MainnetConfigV2=OA,x.PublicDecryptionProof=Nc,x.RelayerZKProofBuilder=dP,x.SERIALIZED_SIZE_LIMIT_CIPHERTEXT=bc,x.SERIALIZED_SIZE_LIMIT_CRS=A_,x.SERIALIZED_SIZE_LIMIT_PK=g_,x.SepoliaConfig=FA,x.SepoliaConfigV1=YA,x.SepoliaConfigV2=DA,x.TFHEPkeCrs=Wr,x.TFHEPkeParams=ki,x.TFHEPublicKey=Zr,x.TFHEZKProofBuilder=uP,x.TFHE_CRS_BITS_CAPACITY=wA,x.TFHE_ZKPROOF_CIPHERTEXT_CAPACITY=gA,x.TKMSPkeKeypair=na,x.ZKProof=y_,x.assertIsEncryptionBits=Zm,x.assertIsEncryptionBitsArray=rA,x.createInstance=bP,x.encryptionBitsFromFheTypeId=dp,x.encryptionBitsFromFheTypeName=sA,x.fheTypeIdFromEncryptionBits=hp,x.fheTypeIdFromName=qm,x.fheTypeNameFromId=iA,x.getErrorCauseCode=SR,x.getErrorCauseStatus=mR,x.initSDK=yP,x.isAddress=fc,x.isChecksummedAddress=Jt,x.isEncryptionBits=Ac,x.isFheTypeId=eo,x.isFheTypeName=fp,x.solidityPrimitiveTypeNameFromFheTypeId=up,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));