"use strict";(self.webpackChunkrln_reactts=self.webpackChunkrln_reactts||[]).push([[440],{2497:function(n,t,e){e.d(t,{BG:function(){return U},Di:function(){return S},LK:function(){return k},Of:function(){return x},RP:function(){return W},T8:function(){return Z},ur:function(){return A},xG:function(){return B}});var r,i=e(6097),a=e(7324);n=e.hmd(n);var o=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});o.decode();var s=new Uint8Array;function u(){return 0===s.byteLength&&(s=new Uint8Array(r.memory.buffer)),s}function c(n,t){return o.decode(u().subarray(n,n+t))}var f=new Array(32).fill(void 0);f.push(void 0,null,!0,!1);var _=f.length;function b(n){_===f.length&&f.push(f.length+1);var t=_;return _=f[t],f[t]=n,t}function w(n){return f[n]}function g(n){var t=w(n);return function(n){n<36||(f[n]=_,_=n)}(n),t}var l=0,h=new TextEncoder("utf-8"),p="function"===typeof h.encodeInto?function(n,t){return h.encodeInto(n,t)}:function(n,t){var e=h.encode(n);return t.set(e),{read:n.length,written:e.length}};function d(n,t,e){if(void 0===e){var r=h.encode(n),i=t(r.length);return u().subarray(i,i+r.length).set(r),l=r.length,i}for(var a=n.length,o=t(a),s=u(),c=0;c127)break;s[o+c]=f}if(c!==a){0!==c&&(n=n.slice(c)),o=e(o,a,a=c+3*n.length);var _=u().subarray(o+c,o+a);c+=p(n,_).written}return l=c,o}var y=new Int32Array;function v(){return 0===y.byteLength&&(y=new Int32Array(r.memory.buffer)),y}function m(n){var t=typeof n;if("number"==t||"boolean"==t||null==n)return"".concat(n);if("string"==t)return'"'.concat(n,'"');if("symbol"==t){var e=n.description;return null==e?"Symbol":"Symbol(".concat(e,")")}if("function"==t){var r=n.name;return"string"==typeof r&&r.length>0?"Function(".concat(r,")"):"Function"}if(Array.isArray(n)){var i=n.length,a="[";i>0&&(a+=m(n[0]));for(var o=1;o1))return toString.call(n);if("Object"==(s=u[1]))try{return"Object("+JSON.stringify(n)+")"}catch(c){return"Object"}return n instanceof Error?"".concat(n.name,": ").concat(n.message,"\n").concat(n.stack):s}function x(){r.init_panic_hook()}function k(n,t,e){return r.newRLN(n,b(t),b(e))}function A(n,t){return g(r.getSerializedRLNWitness(n,b(t)))}function S(n,t){try{var e=r.__wbindgen_add_to_stack_pointer(-16);r.insertMember(e,n,b(t));var i=v()[e/4+0];if(v()[e/4+1])throw g(i)}finally{r.__wbindgen_add_to_stack_pointer(16)}}function Z(n,t){return g(r.RLNWitnessToJson(n,b(t)))}var I=new Uint32Array;function R(n,t){for(var e=t(4*n.length),i=(0===I.byteLength&&(I=new Uint32Array(r.memory.buffer)),I),a=0;a>>0]=g(e)},t.wbg.__wbg_toString_d9cd5f001405e8ff=function(){return C((function(n,t){return b(w(n).toString(t))}),arguments)},t.wbg.__wbg_new_8d2af00bc1e329ee=function(n,t){return b(new Error(c(n,t)))},t.wbg.__wbg_set_933729cf5b66ac11=function(n,t,e){return b(w(n).set(w(t),w(e)))},t.wbg.__wbg_fromEntries_7abdcb92016eb4b9=function(){return C((function(n){return b(Object.fromEntries(w(n)))}),arguments)},t.wbg.__wbg_buffer_3f3d764d4747d564=function(n){return b(w(n).buffer)},t.wbg.__wbg_newwithbyteoffsetandlength_d9aa266703cb98be=function(n,t,e){return b(new Uint8Array(w(n),t>>>0,e>>>0))},t.wbg.__wbg_new_8c3f0052272a457a=function(n){return b(new Uint8Array(w(n)))},t.wbg.__wbg_set_83db9690f9353e79=function(n,t,e){w(n).set(w(t),e>>>0)},t.wbg.__wbg_length_9e1ae1900cb0fbd5=function(n){return w(n).length},t.wbg.__wbg_newwithlength_f5933855e4f48a19=function(n){return b(new Uint8Array(n>>>0))},t.wbg.__wbg_subarray_58ad4efbb5bcb886=function(n,t,e){return b(w(n).subarray(t>>>0,e>>>0))},t.wbg.__wbindgen_debug_string=function(n,t){var e=d(m(w(t)),r.__wbindgen_malloc,r.__wbindgen_realloc),i=l;v()[n/4+1]=i,v()[n/4+0]=e},t.wbg.__wbindgen_throw=function(n,t){throw new Error(c(n,t))},t.wbg.__wbindgen_memory=function(){return b(r.memory)},t}function N(n,t){return r=n.exports,O.__wbindgen_wasm_module=t,y=new Int32Array,I=new Uint32Array,s=new Uint8Array,r}function O(n){return T.apply(this,arguments)}function T(){return T=(0,a.Z)((0,i.Z)().mark((function n(t){var r,a,o,s;return(0,i.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return"undefined"===typeof t&&(t=new URL(e(3526),e.b)),r=E(),("string"===typeof t||"function"===typeof Request&&t instanceof Request||"function"===typeof URL&&t instanceof URL)&&(t=fetch(t)),n.t0=L,n.next=7,t;case 7:return n.t1=n.sent,n.t2=r,n.next=11,(0,n.t0)(n.t1,n.t2);case 11:return a=n.sent,o=a.instance,s=a.module,n.abrupt("return",N(o,s));case 15:case"end":return n.stop()}}),n)}))),T.apply(this,arguments)}t.ZP=O},8787:function(n,t,e){n.exports=e.p+"static/media/rln.f6192b0957fff38c1530.wasm"},7094:function(n,t,e){n.exports=e.p+"static/media/rln_final.e5ef772309f5b4cb8510.zkey"},3526:function(n,t,e){n.exports=e.p+"static/media/rln_wasm_bg.2d6b5f9857f37ea8a65b.wasm"},440:function(n,t,e){e.r(t),e.d(t,{MembershipKey:function(){return S},RLNInstance:function(){return W},RateLimitProof:function(){return R},create:function(){return k},toEpoch:function(){return I}});var r={};e.r(r),e.d(r,{builder:function(){return f}});var i=e(6097),a=e(6568),o=e(1584),s=e(7324),u=e(2497),c={protocol:"groth16",curve:"bn128",nPublic:6,vk_alpha_1:["1805378556360488226980822394597799963030511477964155500103132920745199284516","11990395240534218699464972016456017378439762088320057798320175886595281336136","1"],vk_beta_2:[["11031529986141021025408838211017932346992429731488270384177563837022796743627","16042159910707312759082561183373181639420894978640710177581040523252926273854"],["20112698439519222240302944148895052359035104222313380895334495118294612255131","19441583024670359810872018179190533814486480928824742448673677460151702019379"],["1","0"]],vk_gamma_2:[["10857046999023057135944570762232829481370756359578518086990519993285655852781","11559732032986387107991004021392285783925812861821192530917403151452391805634"],["8495653923123431417604973247489272438418190587263600148770280649306958101930","4082367875863433681332203403145435568316851327593401208105741076214120093531"],["1","0"]],vk_delta_2:[["1948496782571164085469528023647105317580208688174386157591917599801657832035","20445814069256658101339037520922621162739470138213615104905368409238414511981"],["10024680869920840984813249386422727863826862577760330492647062850849851925340","10512156247842686783409460795717734694774542185222602679117887145206209285142"],["1","0"]],vk_alphabeta_12:[[["5151991366823434428398919091000210787450832786814248297320989361921939794156","15735191313289001022885148627913534790382722933676436876510746491415970766821"],["3387907257437913904447588318761906430938415556102110876587455322225272831272","1998779853452712881084781956683721603875246565720647583735935725110674288056"],["14280074182991498185075387990446437410077692353432005297922275464876153151820","17092408446352310039633488224969232803092763095456307462247653153107223117633"]],[["4359046709531668109201634396816565829237358165496082832279660960675584351266","4511888308846208349307186938266411423935335853916317436093178288331845821336"],["11429499807090785857812316277335883295048773373068683863667725283965356423273","16232274853200678548795010078253506586114563833318973594428907292096178657392"],["18068999605870933925311275504102553573815570223888590384919752303726860800970","17309569111965782732372130116757295842160193489132771344011460471298173784984"]]],IC:[["18693301901828818437917730940595978397160482710354161265484535387752523310572","17985273354976640088538673802000794244421192643855111089693820179790551470769","1"],["21164641723988537620541455173278629777250883365474191521194244273980931825942","998385854410718613441067082771678946155853656328717326195057262123686425518","1"],["21666968581672145768705229094968410656430989593283335488162701230986314747515","17996457608540683483506630273632100555125353447506062045735279661096094677264","1"],["20137761979695192602424300886442379728165712610493092740175904438282083668117","19184814924890679891263780109959113289320127263583260218200636509492157834679","1"],["10943171273393803842589314082509655332154393332394322726077270895078286354146","10872472035685319847811233167729172672344935625121511932198535224727331126439","1"],["13049169779481227658517545034348883391527506091990880778783387628208561946597","10083689369261379027228809473568899816311684698866922944902456565434209079955","1"],["19633516378466409167014413361365552102431118630694133723053441455184566611083","8059525100726933978719058611146131904598011633549012007359165766216730722269","1"]]};function f(n,t){return _.apply(this,arguments)}function _(){return(_=(0,s.Z)((0,i.Z)().mark((function n(t,e){var r,a,o,s,u,c,f;return(0,i.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return f=function(){for(var n=u.exports.getFieldNumLen32(),t=new Uint32Array(n),e=0;eu)throw new Error("Too many values for input signal ".concat(n,"\n"));for(var c=0;c0;)e.unshift(0),i--;return e}function g(n){for(var t=BigInt(0),e=BigInt(4294967296),r=0;r>>=0,r>>>=0,i)||function(n,t,e,r,i,a){if(t>i||tn.length)throw new RangeError("Index out of range")}(n,t,e,r,Math.pow(2,8*r)-1,0);var a=1,o=0;for(n[e]=255&t;++o1&&void 0!==arguments[1]?arguments[1]:10,e=Math.floor(n.getTime()/1e3/t);return Z(new Uint8Array(32),e,0,8)}var R=function(){function n(t){if((0,o.Z)(this,n),t.length<320)throw"invalid proof";this.proof=t.subarray(0,128),this.merkleRoot=t.subarray(128,160),this.epoch=t.subarray(160,192),this.shareX=t.subarray(192,224),this.shareY=t.subarray(224,256),this.nullifier=t.subarray(256,288),this.rlnIdentifier=t.subarray(288,320)}return(0,a.Z)(n,[{key:"toBytes",value:function(){return p(this.proof,this.merkleRoot,this.epoch,this.shareX,this.shareY,this.nullifier,this.rlnIdentifier)}}]),n}(),W=function(){function n(t,e){(0,o.Z)(this,n),this.zkRLN=t,this.witnessCalculator=e}return(0,a.Z)(n,[{key:"generateMembershipKey",value:function(){var n=u.BG(this.zkRLN);return new S(n)}},{key:"insertMember",value:function(n){u.Di(this.zkRLN,n)}},{key:"serializeMessage",value:function(n,t,e,r){var i=Z(new Uint8Array(8),n.length,0,8);return p(r,Z(new Uint8Array(8),t,0,8),e,i,n)}},{key:"generateProof",value:function(){var n=(0,s.Z)((0,i.Z)().mark((function n(t,e,r,a){var o,s,c,f,_;return(0,i.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0==r?r=I(new Date):r instanceof Date&&(r=I(r)),32==r.length){n.next=3;break}throw"invalid epoch";case 3:if(32==a.length){n.next=5;break}throw"invalid id key";case 5:if(!(e<0)){n.next=7;break}throw"index must be >= 0";case 7:return o=this.serializeMessage(t,e,r,a),s=u.ur(this.zkRLN,o),c=u.T8(this.zkRLN,s),n.next=12,this.witnessCalculator.calculateWitness(c,!1);case 12:return f=n.sent,_=u.RP(this.zkRLN,f,s),n.abrupt("return",new R(_));case 15:case"end":return n.stop()}}),n,this)})));return function(t,e,r,i){return n.apply(this,arguments)}}()},{key:"verifyProof",value:function(n){return n instanceof R&&(n=n.toBytes()),u.xG(this.zkRLN,n)}}]),n}()}}]); //# sourceMappingURL=440.b375a52d.chunk.js.map