@vaxxnz/nzcp
Version:
A JavaScript implementation of the NZ COVID Pass verification
1 lines • 845 kB
JavaScript
var Ya=Object.create,Bt=Object.defineProperty,Ga=Object.defineProperties,Qa=Object.getOwnPropertyDescriptor,en=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertyNames,qi=Object.getOwnPropertySymbols,rn=Object.getPrototypeOf,Fi=Object.prototype.hasOwnProperty,fn=Object.prototype.propertyIsEnumerable;var Di=(t,e,r)=>e in t?Bt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vt=(t,e)=>{for(var r in e||(e={}))Fi.call(e,r)&&Di(t,r,e[r]);if(qi)for(var r of qi(e))fn.call(e,r)&&Di(t,r,e[r]);return t},Ut=(t,e)=>Ga(t,en(e)),Oi=t=>Bt(t,"__esModule",{value:!0});var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),an=(t,e)=>{for(var r in e)Bt(t,r,{get:e[r],enumerable:!0})},nn=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of tn(e))!Fi.call(t,f)&&f!=="default"&&Bt(t,f,{get:()=>e[f],enumerable:!(r=Qa(e,f))||r.enumerable});return t},$t=t=>nn(Oi(Bt(t!=null?Ya(rn(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Yt=(t,e,r)=>new Promise((f,a)=>{var d=v=>{try{o(r.next(v))}catch(y){a(y)}},l=v=>{try{o(r.throw(v))}catch(y){a(y)}},o=v=>v.done?f(v.value):Promise.resolve(v.value).then(d,l);o((r=r.apply(t,e)).next())});var ji=T(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});function St(t,e,r){var f;if(r===void 0&&(r={}),!e.codes){e.codes={};for(var a=0;a<e.chars.length;++a)e.codes[e.chars[a]]=a}if(!r.loose&&t.length*e.bits&7)throw new SyntaxError("Invalid padding");for(var d=t.length;t[d-1]==="=";)if(--d,!r.loose&&!((t.length-d)*e.bits&7))throw new SyntaxError("Invalid padding");for(var l=new((f=r.out)!=null?f:Uint8Array)(d*e.bits/8|0),o=0,v=0,y=0,x=0;x<d;++x){var w=e.codes[t[x]];if(w===void 0)throw new SyntaxError("Invalid character "+t[x]);v=v<<e.bits|w,o+=e.bits,o>=8&&(o-=8,l[y++]=255&v>>o)}if(o>=e.bits||255&v<<8-o)throw new SyntaxError("Unexpected end of data");return l}function _t(t,e,r){r===void 0&&(r={});for(var f=r,a=f.pad,d=a===void 0?!0:a,l=(1<<e.bits)-1,o="",v=0,y=0,x=0;x<t.length;++x)for(y=y<<8|255&t[x],v+=8;v>e.bits;)v-=e.bits,o+=e.chars[l&y>>v];if(v&&(o+=e.chars[l&y<<e.bits-v]),d)for(;o.length*e.bits&7;)o+="=";return o}var Bi={chars:"0123456789ABCDEF",bits:4},Ui={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bits:5},ki={chars:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bits:5},Ni={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bits:6},Vi={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bits:6},dn={parse:function(e,r){return St(e.toUpperCase(),Bi,r)},stringify:function(e,r){return _t(e,Bi,r)}},sn={parse:function(e,r){return r===void 0&&(r={}),St(r.loose?e.toUpperCase().replace(/0/g,"O").replace(/1/g,"L").replace(/8/g,"B"):e,Ui,r)},stringify:function(e,r){return _t(e,Ui,r)}},on={parse:function(e,r){return St(e,ki,r)},stringify:function(e,r){return _t(e,ki,r)}},cn={parse:function(e,r){return St(e,Ni,r)},stringify:function(e,r){return _t(e,Ni,r)}},hn={parse:function(e,r){return St(e,Vi,r)},stringify:function(e,r){return _t(e,Vi,r)}},un={parse:St,stringify:_t};dt.base16=dn;dt.base32=sn;dt.base32hex=on;dt.base64=cn;dt.base64url=hn;dt.codec=un});var Zi=T((tt,Ki)=>{var Ji=typeof self!="undefined"?self:tt,Qt=function(){function t(){this.fetch=!1,this.DOMException=Ji.DOMException}return t.prototype=Ji,new t}();(function(t){var e=function(r){var f={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(c){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};function a(c){return c&&DataView.prototype.isPrototypeOf(c)}if(f.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(c){return c&&d.indexOf(Object.prototype.toString.call(c))>-1};function o(c){if(typeof c!="string"&&(c=String(c)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(c))throw new TypeError("Invalid character in header field name");return c.toLowerCase()}function v(c){return typeof c!="string"&&(c=String(c)),c}function y(c){var i={next:function(){var s=c.shift();return{done:s===void 0,value:s}}};return f.iterable&&(i[Symbol.iterator]=function(){return i}),i}function x(c){this.map={},c instanceof x?c.forEach(function(i,s){this.append(s,i)},this):Array.isArray(c)?c.forEach(function(i){this.append(i[0],i[1])},this):c&&Object.getOwnPropertyNames(c).forEach(function(i){this.append(i,c[i])},this)}x.prototype.append=function(c,i){c=o(c),i=v(i);var s=this.map[c];this.map[c]=s?s+", "+i:i},x.prototype.delete=function(c){delete this.map[o(c)]},x.prototype.get=function(c){return c=o(c),this.has(c)?this.map[c]:null},x.prototype.has=function(c){return this.map.hasOwnProperty(o(c))},x.prototype.set=function(c,i){this.map[o(c)]=v(i)},x.prototype.forEach=function(c,i){for(var s in this.map)this.map.hasOwnProperty(s)&&c.call(i,this.map[s],s,this)},x.prototype.keys=function(){var c=[];return this.forEach(function(i,s){c.push(s)}),y(c)},x.prototype.values=function(){var c=[];return this.forEach(function(i){c.push(i)}),y(c)},x.prototype.entries=function(){var c=[];return this.forEach(function(i,s){c.push([s,i])}),y(c)},f.iterable&&(x.prototype[Symbol.iterator]=x.prototype.entries);function w(c){if(c.bodyUsed)return Promise.reject(new TypeError("Already read"));c.bodyUsed=!0}function _(c){return new Promise(function(i,s){c.onload=function(){i(c.result)},c.onerror=function(){s(c.error)}})}function S(c){var i=new FileReader,s=_(i);return i.readAsArrayBuffer(c),s}function A(c){var i=new FileReader,s=_(i);return i.readAsText(c),s}function R(c){for(var i=new Uint8Array(c),s=new Array(i.length),h=0;h<i.length;h++)s[h]=String.fromCharCode(i[h]);return s.join("")}function H(c){if(c.slice)return c.slice(0);var i=new Uint8Array(c.byteLength);return i.set(new Uint8Array(c)),i.buffer}function P(){return this.bodyUsed=!1,this._initBody=function(c){this._bodyInit=c,c?typeof c=="string"?this._bodyText=c:f.blob&&Blob.prototype.isPrototypeOf(c)?this._bodyBlob=c:f.formData&&FormData.prototype.isPrototypeOf(c)?this._bodyFormData=c:f.searchParams&&URLSearchParams.prototype.isPrototypeOf(c)?this._bodyText=c.toString():f.arrayBuffer&&f.blob&&a(c)?(this._bodyArrayBuffer=H(c.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):f.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(c)||l(c))?this._bodyArrayBuffer=H(c):this._bodyText=c=Object.prototype.toString.call(c):this._bodyText="",this.headers.get("content-type")||(typeof c=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):f.searchParams&&URLSearchParams.prototype.isPrototypeOf(c)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f.blob&&(this.blob=function(){var c=w(this);if(c)return c;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?w(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(S)}),this.text=function(){var c=w(this);if(c)return c;if(this._bodyBlob)return A(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(R(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},f.formData&&(this.formData=function(){return this.text().then(J)}),this.json=function(){return this.text().then(JSON.parse)},this}var B=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function D(c){var i=c.toUpperCase();return B.indexOf(i)>-1?i:c}function X(c,i){i=i||{};var s=i.body;if(c instanceof X){if(c.bodyUsed)throw new TypeError("Already read");this.url=c.url,this.credentials=c.credentials,i.headers||(this.headers=new x(c.headers)),this.method=c.method,this.mode=c.mode,this.signal=c.signal,!s&&c._bodyInit!=null&&(s=c._bodyInit,c.bodyUsed=!0)}else this.url=String(c);if(this.credentials=i.credentials||this.credentials||"same-origin",(i.headers||!this.headers)&&(this.headers=new x(i.headers)),this.method=D(i.method||this.method||"GET"),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&s)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(s)}X.prototype.clone=function(){return new X(this,{body:this._bodyInit})};function J(c){var i=new FormData;return c.trim().split("&").forEach(function(s){if(s){var h=s.split("="),u=h.shift().replace(/\+/g," "),b=h.join("=").replace(/\+/g," ");i.append(decodeURIComponent(u),decodeURIComponent(b))}}),i}function qe(c){var i=new x,s=c.replace(/\r?\n[\t ]+/g," ");return s.split(/\r?\n/).forEach(function(h){var u=h.split(":"),b=u.shift().trim();if(b){var g=u.join(":").trim();i.append(b,g)}}),i}P.call(X.prototype);function j(c,i){i||(i={}),this.type="default",this.status=i.status===void 0?200:i.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in i?i.statusText:"OK",this.headers=new x(i.headers),this.url=i.url||"",this._initBody(c)}P.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new x(this.headers),url:this.url})},j.error=function(){var c=new j(null,{status:0,statusText:""});return c.type="error",c};var F=[301,302,303,307,308];j.redirect=function(c,i){if(F.indexOf(i)===-1)throw new RangeError("Invalid status code");return new j(null,{status:i,headers:{location:c}})},r.DOMException=t.DOMException;try{new r.DOMException}catch(c){r.DOMException=function(i,s){this.message=i,this.name=s;var h=Error(i);this.stack=h.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function K(c,i){return new Promise(function(s,h){var u=new X(c,i);if(u.signal&&u.signal.aborted)return h(new r.DOMException("Aborted","AbortError"));var b=new XMLHttpRequest;function g(){b.abort()}b.onload=function(){var M={status:b.status,statusText:b.statusText,headers:qe(b.getAllResponseHeaders()||"")};M.url="responseURL"in b?b.responseURL:M.headers.get("X-Request-URL");var p="response"in b?b.response:b.responseText;s(new j(p,M))},b.onerror=function(){h(new TypeError("Network request failed"))},b.ontimeout=function(){h(new TypeError("Network request failed"))},b.onabort=function(){h(new r.DOMException("Aborted","AbortError"))},b.open(u.method,u.url,!0),u.credentials==="include"?b.withCredentials=!0:u.credentials==="omit"&&(b.withCredentials=!1),"responseType"in b&&f.blob&&(b.responseType="blob"),u.headers.forEach(function(M,p){b.setRequestHeader(p,M)}),u.signal&&(u.signal.addEventListener("abort",g),b.onreadystatechange=function(){b.readyState===4&&u.signal.removeEventListener("abort",g)}),b.send(typeof u._bodyInit=="undefined"?null:u._bodyInit)})}return K.polyfill=!0,t.fetch||(t.fetch=K,t.Headers=x,t.Request=X,t.Response=j),r.Headers=x,r.Request=X,r.Response=j,r.fetch=K,Object.defineProperty(r,"__esModule",{value:!0}),r}({})})(Qt);Qt.fetch.ponyfill=!0;delete Qt.fetch.polyfill;var At=Qt;tt=At.fetch;tt.default=At.fetch;tt.fetch=At.fetch;tt.Headers=At.Headers;tt.Request=At.Request;tt.Response=At.Response;Ki.exports=tt});var ef=T((exports,module)=>{(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,e){return function(r){return new Sha256(e,!0).update(r)[t]()}},createMethod=function(t){var e=createOutputMethod("hex",t);NODE_JS&&(e=nodeWrap(e,t)),e.create=function(){return new Sha256(t)},e.update=function(a){return e.create().update(a)};for(var r=0;r<OUTPUT_TYPES.length;++r){var f=OUTPUT_TYPES[r];e[f]=createOutputMethod(f,t)}return e},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if(typeof t=="string")return crypto.createHash(algorithm).update(t,"utf8").digest("hex");if(t==null)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,e){return function(r,f){return new HmacSha256(r,e,!0).update(f)[t]()}},createHmacMethod=function(t){var e=createHmacOutputMethod("hex",t);e.create=function(a){return new HmacSha256(a,t)},e.update=function(a,d){return e.create(a).update(d)};for(var r=0;r<OUTPUT_TYPES.length;++r){var f=OUTPUT_TYPES[r];e[f]=createHmacOutputMethod(f,t)}return e};function Sha256(t,e){e?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}Sha256.prototype.update=function(t){if(!this.finalized){var e,r=typeof t;if(r!=="string"){if(r==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);e=!0}for(var f,a=0,d,l=t.length,o=this.blocks;a<l;){if(this.hashed&&(this.hashed=!1,o[0]=this.block,o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),e)for(d=this.start;a<l&&d<64;++a)o[d>>2]|=t[a]<<SHIFT[d++&3];else for(d=this.start;a<l&&d<64;++a)f=t.charCodeAt(a),f<128?o[d>>2]|=f<<SHIFT[d++&3]:f<2048?(o[d>>2]|=(192|f>>6)<<SHIFT[d++&3],o[d>>2]|=(128|f&63)<<SHIFT[d++&3]):f<55296||f>=57344?(o[d>>2]|=(224|f>>12)<<SHIFT[d++&3],o[d>>2]|=(128|f>>6&63)<<SHIFT[d++&3],o[d>>2]|=(128|f&63)<<SHIFT[d++&3]):(f=65536+((f&1023)<<10|t.charCodeAt(++a)&1023),o[d>>2]|=(240|f>>18)<<SHIFT[d++&3],o[d>>2]|=(128|f>>12&63)<<SHIFT[d++&3],o[d>>2]|=(128|f>>6&63)<<SHIFT[d++&3],o[d>>2]|=(128|f&63)<<SHIFT[d++&3]);this.lastByteIndex=d,this.bytes+=d-this.start,d>=64?(this.block=o[16],this.start=d-64,this.hash(),this.hashed=!0):this.start=d}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[e&3],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t=this.h0,e=this.h1,r=this.h2,f=this.h3,a=this.h4,d=this.h5,l=this.h6,o=this.h7,v=this.blocks,y,x,w,_,S,A,R,H,P,B,D;for(y=16;y<64;++y)S=v[y-15],x=(S>>>7|S<<25)^(S>>>18|S<<14)^S>>>3,S=v[y-2],w=(S>>>17|S<<15)^(S>>>19|S<<13)^S>>>10,v[y]=v[y-16]+x+v[y-7]+w<<0;for(D=e&r,y=0;y<64;y+=4)this.first?(this.is224?(H=300032,S=v[0]-1413257819,o=S-150054599<<0,f=S+24177077<<0):(H=704751109,S=v[0]-210244248,o=S-1521486534<<0,f=S+143694565<<0),this.first=!1):(x=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),w=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),H=t&e,_=H^t&r^D,R=a&d^~a&l,S=o+w+R+K[y]+v[y],A=x+_,o=f+S<<0,f=S+A<<0),x=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),w=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),P=f&t,_=P^f&e^H,R=o&a^~o&d,S=l+w+R+K[y+1]+v[y+1],A=x+_,l=r+S<<0,r=S+A<<0,x=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),w=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),B=r&f,_=B^r&t^P,R=l&o^~l&a,S=d+w+R+K[y+2]+v[y+2],A=x+_,d=e+S<<0,e=S+A<<0,x=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),w=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),D=e&r,_=D^e&f^B,R=d&l^~d&o,S=a+w+R+K[y+3]+v[y+3],A=x+_,a=t+S<<0,t=S+A<<0;this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+r<<0,this.h3=this.h3+f<<0,this.h4=this.h4+a<<0,this.h5=this.h5+d<<0,this.h6=this.h6+l<<0,this.h7=this.h7+o<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,f=this.h3,a=this.h4,d=this.h5,l=this.h6,o=this.h7,v=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[f>>28&15]+HEX_CHARS[f>>24&15]+HEX_CHARS[f>>20&15]+HEX_CHARS[f>>16&15]+HEX_CHARS[f>>12&15]+HEX_CHARS[f>>8&15]+HEX_CHARS[f>>4&15]+HEX_CHARS[f&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]+HEX_CHARS[d>>28&15]+HEX_CHARS[d>>24&15]+HEX_CHARS[d>>20&15]+HEX_CHARS[d>>16&15]+HEX_CHARS[d>>12&15]+HEX_CHARS[d>>8&15]+HEX_CHARS[d>>4&15]+HEX_CHARS[d&15]+HEX_CHARS[l>>28&15]+HEX_CHARS[l>>24&15]+HEX_CHARS[l>>20&15]+HEX_CHARS[l>>16&15]+HEX_CHARS[l>>12&15]+HEX_CHARS[l>>8&15]+HEX_CHARS[l>>4&15]+HEX_CHARS[l&15];return this.is224||(v+=HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]),v},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,f=this.h3,a=this.h4,d=this.h5,l=this.h6,o=this.h7,v=[t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,r>>24&255,r>>16&255,r>>8&255,r&255,f>>24&255,f>>16&255,f>>8&255,f&255,a>>24&255,a>>16&255,a>>8&255,a&255,d>>24&255,d>>16&255,d>>8&255,d&255,l>>24&255,l>>16&255,l>>8&255,l&255];return this.is224||v.push(o>>24&255,o>>16&255,o>>8&255,o&255),v},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t};function HmacSha256(t,e,r){var f,a=typeof t;if(a==="string"){var d=[],l=t.length,o=0,v;for(f=0;f<l;++f)v=t.charCodeAt(f),v<128?d[o++]=v:v<2048?(d[o++]=192|v>>6,d[o++]=128|v&63):v<55296||v>=57344?(d[o++]=224|v>>12,d[o++]=128|v>>6&63,d[o++]=128|v&63):(v=65536+((v&1023)<<10|t.charCodeAt(++f)&1023),d[o++]=240|v>>18,d[o++]=128|v>>12&63,d[o++]=128|v>>6&63,d[o++]=128|v&63);t=d}else if(a==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);t.length>64&&(t=new Sha256(e,!0).update(t).array());var y=[],x=[];for(f=0;f<64;++f){var w=t[f]||0;y[f]=92^w,x[f]=54^w}Sha256.call(this,e,r),this.update(x),this.oKeyPad=y,this.inner=!0,this.sharedMemory=r}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var tf=T((is,qn)=>{qn.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var rf=T(()=>{});var Je=T((ff,Ur)=>{(function(t,e){"use strict";function r(c,i){if(!c)throw new Error(i||"Assertion failed")}function f(c,i){c.super_=i;var s=function(){};s.prototype=i.prototype,c.prototype=new s,c.prototype.constructor=c}function a(c,i,s){if(a.isBN(c))return c;this.negative=0,this.words=null,this.length=0,this.red=null,c!==null&&((i==="le"||i==="be")&&(s=i,i=10),this._init(c||0,i||10,s||"be"))}typeof t=="object"?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;var d;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?d=window.Buffer:d=rf().Buffer}catch(c){}a.isBN=function(i){return i instanceof a?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===a.wordSize&&Array.isArray(i.words)},a.max=function(i,s){return i.cmp(s)>0?i:s},a.min=function(i,s){return i.cmp(s)<0?i:s},a.prototype._init=function(i,s,h){if(typeof i=="number")return this._initNumber(i,s,h);if(typeof i=="object")return this._initArray(i,s,h);s==="hex"&&(s=16),r(s===(s|0)&&s>=2&&s<=36),i=i.toString().replace(/\s+/g,"");var u=0;i[0]==="-"&&(u++,this.negative=1),u<i.length&&(s===16?this._parseHex(i,u,h):(this._parseBase(i,s,u),h==="le"&&this._initArray(this.toArray(),s,h)))},a.prototype._initNumber=function(i,s,h){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(r(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),s,h)},a.prototype._initArray=function(i,s,h){if(r(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var u=0;u<this.length;u++)this.words[u]=0;var b,g,M=0;if(h==="be")for(u=i.length-1,b=0;u>=0;u-=3)g=i[u]|i[u-1]<<8|i[u-2]<<16,this.words[b]|=g<<M&67108863,this.words[b+1]=g>>>26-M&67108863,M+=24,M>=26&&(M-=26,b++);else if(h==="le")for(u=0,b=0;u<i.length;u+=3)g=i[u]|i[u+1]<<8|i[u+2]<<16,this.words[b]|=g<<M&67108863,this.words[b+1]=g>>>26-M&67108863,M+=24,M>=26&&(M-=26,b++);return this.strip()};function l(c,i){var s=c.charCodeAt(i);return s>=65&&s<=70?s-55:s>=97&&s<=102?s-87:s-48&15}function o(c,i,s){var h=l(c,s);return s-1>=i&&(h|=l(c,s-1)<<4),h}a.prototype._parseHex=function(i,s,h){this.length=Math.ceil((i.length-s)/6),this.words=new Array(this.length);for(var u=0;u<this.length;u++)this.words[u]=0;var b=0,g=0,M;if(h==="be")for(u=i.length-1;u>=s;u-=2)M=o(i,s,u)<<b,this.words[g]|=M&67108863,b>=18?(b-=18,g+=1,this.words[g]|=M>>>26):b+=8;else{var p=i.length-s;for(u=p%2==0?s+1:s;u<i.length;u+=2)M=o(i,s,u)<<b,this.words[g]|=M&67108863,b>=18?(b-=18,g+=1,this.words[g]|=M>>>26):b+=8}this.strip()};function v(c,i,s,h){for(var u=0,b=Math.min(c.length,s),g=i;g<b;g++){var M=c.charCodeAt(g)-48;u*=h,M>=49?u+=M-49+10:M>=17?u+=M-17+10:u+=M}return u}a.prototype._parseBase=function(i,s,h){this.words=[0],this.length=1;for(var u=0,b=1;b<=67108863;b*=s)u++;u--,b=b/s|0;for(var g=i.length-h,M=g%u,p=Math.min(g,g-M)+h,n=0,m=h;m<p;m+=u)n=v(i,m,m+u,s),this.imuln(b),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n);if(M!==0){var I=1;for(n=v(i,m,i.length,s),m=0;m<M;m++)I*=s;this.imuln(I),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n)}this.strip()},a.prototype.copy=function(i){i.words=new Array(this.length);for(var s=0;s<this.length;s++)i.words[s]=this.words[s];i.length=this.length,i.negative=this.negative,i.red=this.red},a.prototype.clone=function(){var i=new a(null);return this.copy(i),i},a.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],w=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(i,s){i=i||10,s=s|0||1;var h;if(i===16||i==="hex"){h="";for(var u=0,b=0,g=0;g<this.length;g++){var M=this.words[g],p=((M<<u|b)&16777215).toString(16);b=M>>>24-u&16777215,b!==0||g!==this.length-1?h=y[6-p.length]+p+h:h=p+h,u+=2,u>=26&&(u-=26,g--)}for(b!==0&&(h=b.toString(16)+h);h.length%s!=0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(i===(i|0)&&i>=2&&i<=36){var n=x[i],m=w[i];h="";var I=this.clone();for(I.negative=0;!I.isZero();){var E=I.modn(m).toString(i);I=I.idivn(m),I.isZero()?h=E+h:h=y[n-E.length]+E+h}for(this.isZero()&&(h="0"+h);h.length%s!=0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(i,s){return r(typeof d!="undefined"),this.toArrayLike(d,i,s)},a.prototype.toArray=function(i,s){return this.toArrayLike(Array,i,s)},a.prototype.toArrayLike=function(i,s,h){var u=this.byteLength(),b=h||Math.max(1,u);r(u<=b,"byte array longer than desired length"),r(b>0,"Requested array length <= 0"),this.strip();var g=s==="le",M=new i(b),p,n,m=this.clone();if(g){for(n=0;!m.isZero();n++)p=m.andln(255),m.iushrn(8),M[n]=p;for(;n<b;n++)M[n]=0}else{for(n=0;n<b-u;n++)M[n]=0;for(n=0;!m.isZero();n++)p=m.andln(255),m.iushrn(8),M[b-n-1]=p}return M},Math.clz32?a.prototype._countBits=function(i){return 32-Math.clz32(i)}:a.prototype._countBits=function(i){var s=i,h=0;return s>=4096&&(h+=13,s>>>=13),s>=64&&(h+=7,s>>>=7),s>=8&&(h+=4,s>>>=4),s>=2&&(h+=2,s>>>=2),h+s},a.prototype._zeroBits=function(i){if(i===0)return 26;var s=i,h=0;return(s&8191)==0&&(h+=13,s>>>=13),(s&127)==0&&(h+=7,s>>>=7),(s&15)==0&&(h+=4,s>>>=4),(s&3)==0&&(h+=2,s>>>=2),(s&1)==0&&h++,h},a.prototype.bitLength=function(){var i=this.words[this.length-1],s=this._countBits(i);return(this.length-1)*26+s};function _(c){for(var i=new Array(c.bitLength()),s=0;s<i.length;s++){var h=s/26|0,u=s%26;i[s]=(c.words[h]&1<<u)>>>u}return i}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,s=0;s<this.length;s++){var h=this._zeroBits(this.words[s]);if(i+=h,h!==26)break}return i},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},a.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var s=0;s<i.length;s++)this.words[s]=this.words[s]|i.words[s];return this.strip()},a.prototype.ior=function(i){return r((this.negative|i.negative)==0),this.iuor(i)},a.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},a.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},a.prototype.iuand=function(i){var s;this.length>i.length?s=i:s=this;for(var h=0;h<s.length;h++)this.words[h]=this.words[h]&i.words[h];return this.length=s.length,this.strip()},a.prototype.iand=function(i){return r((this.negative|i.negative)==0),this.iuand(i)},a.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},a.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},a.prototype.iuxor=function(i){var s,h;this.length>i.length?(s=this,h=i):(s=i,h=this);for(var u=0;u<h.length;u++)this.words[u]=s.words[u]^h.words[u];if(this!==s)for(;u<s.length;u++)this.words[u]=s.words[u];return this.length=s.length,this.strip()},a.prototype.ixor=function(i){return r((this.negative|i.negative)==0),this.iuxor(i)},a.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},a.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},a.prototype.inotn=function(i){r(typeof i=="number"&&i>=0);var s=Math.ceil(i/26)|0,h=i%26;this._expand(s),h>0&&s--;for(var u=0;u<s;u++)this.words[u]=~this.words[u]&67108863;return h>0&&(this.words[u]=~this.words[u]&67108863>>26-h),this.strip()},a.prototype.notn=function(i){return this.clone().inotn(i)},a.prototype.setn=function(i,s){r(typeof i=="number"&&i>=0);var h=i/26|0,u=i%26;return this._expand(h+1),s?this.words[h]=this.words[h]|1<<u:this.words[h]=this.words[h]&~(1<<u),this.strip()},a.prototype.iadd=function(i){var s;if(this.negative!==0&&i.negative===0)return this.negative=0,s=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,s=this.isub(i),i.negative=1,s._normSign();var h,u;this.length>i.length?(h=this,u=i):(h=i,u=this);for(var b=0,g=0;g<u.length;g++)s=(h.words[g]|0)+(u.words[g]|0)+b,this.words[g]=s&67108863,b=s>>>26;for(;b!==0&&g<h.length;g++)s=(h.words[g]|0)+b,this.words[g]=s&67108863,b=s>>>26;if(this.length=h.length,b!==0)this.words[this.length]=b,this.length++;else if(h!==this)for(;g<h.length;g++)this.words[g]=h.words[g];return this},a.prototype.add=function(i){var s;return i.negative!==0&&this.negative===0?(i.negative=0,s=this.sub(i),i.negative^=1,s):i.negative===0&&this.negative!==0?(this.negative=0,s=i.sub(this),this.negative=1,s):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},a.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var s=this.iadd(i);return i.negative=1,s._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var h=this.cmp(i);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var u,b;h>0?(u=this,b=i):(u=i,b=this);for(var g=0,M=0;M<b.length;M++)s=(u.words[M]|0)-(b.words[M]|0)+g,g=s>>26,this.words[M]=s&67108863;for(;g!==0&&M<u.length;M++)s=(u.words[M]|0)+g,g=s>>26,this.words[M]=s&67108863;if(g===0&&M<u.length&&u!==this)for(;M<u.length;M++)this.words[M]=u.words[M];return this.length=Math.max(this.length,M),u!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(i){return this.clone().isub(i)};function S(c,i,s){s.negative=i.negative^c.negative;var h=c.length+i.length|0;s.length=h,h=h-1|0;var u=c.words[0]|0,b=i.words[0]|0,g=u*b,M=g&67108863,p=g/67108864|0;s.words[0]=M;for(var n=1;n<h;n++){for(var m=p>>>26,I=p&67108863,E=Math.min(n,i.length-1),C=Math.max(0,n-c.length+1);C<=E;C++){var z=n-C|0;u=c.words[z]|0,b=i.words[C]|0,g=u*b+I,m+=g/67108864|0,I=g&67108863}s.words[n]=I|0,p=m|0}return p!==0?s.words[n]=p|0:s.length--,s.strip()}var A=function(i,s,h){var u=i.words,b=s.words,g=h.words,M=0,p,n,m,I=u[0]|0,E=I&8191,C=I>>>13,z=u[1]|0,O=z&8191,k=z>>>13,nt=u[2]|0,N=nt&8191,L=nt>>>13,mi=u[3]|0,Z=mi&8191,$=mi>>>13,xi=u[4]|0,Y=xi&8191,G=xi>>>13,yi=u[5]|0,Q=yi&8191,ee=yi>>>13,gi=u[6]|0,te=gi&8191,re=gi>>>13,wi=u[7]|0,ie=wi&8191,fe=wi>>>13,Mi=u[8]|0,ae=Mi&8191,ne=Mi>>>13,Si=u[9]|0,de=Si&8191,se=Si>>>13,_i=b[0]|0,oe=_i&8191,ce=_i>>>13,Ai=b[1]|0,he=Ai&8191,ue=Ai>>>13,Ri=b[2]|0,le=Ri&8191,be=Ri>>>13,Ii=b[3]|0,ve=Ii&8191,pe=Ii>>>13,Ei=b[4]|0,me=Ei&8191,xe=Ei>>>13,Ci=b[5]|0,ye=Ci&8191,ge=Ci>>>13,Pi=b[6]|0,we=Pi&8191,Me=Pi>>>13,zi=b[7]|0,Se=zi&8191,_e=zi>>>13,Ti=b[8]|0,Ae=Ti&8191,Re=Ti>>>13,Hi=b[9]|0,Ie=Hi&8191,Ee=Hi>>>13;h.negative=i.negative^s.negative,h.length=19,p=Math.imul(E,oe),n=Math.imul(E,ce),n=n+Math.imul(C,oe)|0,m=Math.imul(C,ce);var mr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(mr>>>26)|0,mr&=67108863,p=Math.imul(O,oe),n=Math.imul(O,ce),n=n+Math.imul(k,oe)|0,m=Math.imul(k,ce),p=p+Math.imul(E,he)|0,n=n+Math.imul(E,ue)|0,n=n+Math.imul(C,he)|0,m=m+Math.imul(C,ue)|0;var xr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(xr>>>26)|0,xr&=67108863,p=Math.imul(N,oe),n=Math.imul(N,ce),n=n+Math.imul(L,oe)|0,m=Math.imul(L,ce),p=p+Math.imul(O,he)|0,n=n+Math.imul(O,ue)|0,n=n+Math.imul(k,he)|0,m=m+Math.imul(k,ue)|0,p=p+Math.imul(E,le)|0,n=n+Math.imul(E,be)|0,n=n+Math.imul(C,le)|0,m=m+Math.imul(C,be)|0;var yr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(yr>>>26)|0,yr&=67108863,p=Math.imul(Z,oe),n=Math.imul(Z,ce),n=n+Math.imul($,oe)|0,m=Math.imul($,ce),p=p+Math.imul(N,he)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(L,he)|0,m=m+Math.imul(L,ue)|0,p=p+Math.imul(O,le)|0,n=n+Math.imul(O,be)|0,n=n+Math.imul(k,le)|0,m=m+Math.imul(k,be)|0,p=p+Math.imul(E,ve)|0,n=n+Math.imul(E,pe)|0,n=n+Math.imul(C,ve)|0,m=m+Math.imul(C,pe)|0;var gr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(gr>>>26)|0,gr&=67108863,p=Math.imul(Y,oe),n=Math.imul(Y,ce),n=n+Math.imul(G,oe)|0,m=Math.imul(G,ce),p=p+Math.imul(Z,he)|0,n=n+Math.imul(Z,ue)|0,n=n+Math.imul($,he)|0,m=m+Math.imul($,ue)|0,p=p+Math.imul(N,le)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,le)|0,m=m+Math.imul(L,be)|0,p=p+Math.imul(O,ve)|0,n=n+Math.imul(O,pe)|0,n=n+Math.imul(k,ve)|0,m=m+Math.imul(k,pe)|0,p=p+Math.imul(E,me)|0,n=n+Math.imul(E,xe)|0,n=n+Math.imul(C,me)|0,m=m+Math.imul(C,xe)|0;var wr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(wr>>>26)|0,wr&=67108863,p=Math.imul(Q,oe),n=Math.imul(Q,ce),n=n+Math.imul(ee,oe)|0,m=Math.imul(ee,ce),p=p+Math.imul(Y,he)|0,n=n+Math.imul(Y,ue)|0,n=n+Math.imul(G,he)|0,m=m+Math.imul(G,ue)|0,p=p+Math.imul(Z,le)|0,n=n+Math.imul(Z,be)|0,n=n+Math.imul($,le)|0,m=m+Math.imul($,be)|0,p=p+Math.imul(N,ve)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,ve)|0,m=m+Math.imul(L,pe)|0,p=p+Math.imul(O,me)|0,n=n+Math.imul(O,xe)|0,n=n+Math.imul(k,me)|0,m=m+Math.imul(k,xe)|0,p=p+Math.imul(E,ye)|0,n=n+Math.imul(E,ge)|0,n=n+Math.imul(C,ye)|0,m=m+Math.imul(C,ge)|0;var Mr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,p=Math.imul(te,oe),n=Math.imul(te,ce),n=n+Math.imul(re,oe)|0,m=Math.imul(re,ce),p=p+Math.imul(Q,he)|0,n=n+Math.imul(Q,ue)|0,n=n+Math.imul(ee,he)|0,m=m+Math.imul(ee,ue)|0,p=p+Math.imul(Y,le)|0,n=n+Math.imul(Y,be)|0,n=n+Math.imul(G,le)|0,m=m+Math.imul(G,be)|0,p=p+Math.imul(Z,ve)|0,n=n+Math.imul(Z,pe)|0,n=n+Math.imul($,ve)|0,m=m+Math.imul($,pe)|0,p=p+Math.imul(N,me)|0,n=n+Math.imul(N,xe)|0,n=n+Math.imul(L,me)|0,m=m+Math.imul(L,xe)|0,p=p+Math.imul(O,ye)|0,n=n+Math.imul(O,ge)|0,n=n+Math.imul(k,ye)|0,m=m+Math.imul(k,ge)|0,p=p+Math.imul(E,we)|0,n=n+Math.imul(E,Me)|0,n=n+Math.imul(C,we)|0,m=m+Math.imul(C,Me)|0;var Sr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,p=Math.imul(ie,oe),n=Math.imul(ie,ce),n=n+Math.imul(fe,oe)|0,m=Math.imul(fe,ce),p=p+Math.imul(te,he)|0,n=n+Math.imul(te,ue)|0,n=n+Math.imul(re,he)|0,m=m+Math.imul(re,ue)|0,p=p+Math.imul(Q,le)|0,n=n+Math.imul(Q,be)|0,n=n+Math.imul(ee,le)|0,m=m+Math.imul(ee,be)|0,p=p+Math.imul(Y,ve)|0,n=n+Math.imul(Y,pe)|0,n=n+Math.imul(G,ve)|0,m=m+Math.imul(G,pe)|0,p=p+Math.imul(Z,me)|0,n=n+Math.imul(Z,xe)|0,n=n+Math.imul($,me)|0,m=m+Math.imul($,xe)|0,p=p+Math.imul(N,ye)|0,n=n+Math.imul(N,ge)|0,n=n+Math.imul(L,ye)|0,m=m+Math.imul(L,ge)|0,p=p+Math.imul(O,we)|0,n=n+Math.imul(O,Me)|0,n=n+Math.imul(k,we)|0,m=m+Math.imul(k,Me)|0,p=p+Math.imul(E,Se)|0,n=n+Math.imul(E,_e)|0,n=n+Math.imul(C,Se)|0,m=m+Math.imul(C,_e)|0;var _r=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(_r>>>26)|0,_r&=67108863,p=Math.imul(ae,oe),n=Math.imul(ae,ce),n=n+Math.imul(ne,oe)|0,m=Math.imul(ne,ce),p=p+Math.imul(ie,he)|0,n=n+Math.imul(ie,ue)|0,n=n+Math.imul(fe,he)|0,m=m+Math.imul(fe,ue)|0,p=p+Math.imul(te,le)|0,n=n+Math.imul(te,be)|0,n=n+Math.imul(re,le)|0,m=m+Math.imul(re,be)|0,p=p+Math.imul(Q,ve)|0,n=n+Math.imul(Q,pe)|0,n=n+Math.imul(ee,ve)|0,m=m+Math.imul(ee,pe)|0,p=p+Math.imul(Y,me)|0,n=n+Math.imul(Y,xe)|0,n=n+Math.imul(G,me)|0,m=m+Math.imul(G,xe)|0,p=p+Math.imul(Z,ye)|0,n=n+Math.imul(Z,ge)|0,n=n+Math.imul($,ye)|0,m=m+Math.imul($,ge)|0,p=p+Math.imul(N,we)|0,n=n+Math.imul(N,Me)|0,n=n+Math.imul(L,we)|0,m=m+Math.imul(L,Me)|0,p=p+Math.imul(O,Se)|0,n=n+Math.imul(O,_e)|0,n=n+Math.imul(k,Se)|0,m=m+Math.imul(k,_e)|0,p=p+Math.imul(E,Ae)|0,n=n+Math.imul(E,Re)|0,n=n+Math.imul(C,Ae)|0,m=m+Math.imul(C,Re)|0;var Ar=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,p=Math.imul(de,oe),n=Math.imul(de,ce),n=n+Math.imul(se,oe)|0,m=Math.imul(se,ce),p=p+Math.imul(ae,he)|0,n=n+Math.imul(ae,ue)|0,n=n+Math.imul(ne,he)|0,m=m+Math.imul(ne,ue)|0,p=p+Math.imul(ie,le)|0,n=n+Math.imul(ie,be)|0,n=n+Math.imul(fe,le)|0,m=m+Math.imul(fe,be)|0,p=p+Math.imul(te,ve)|0,n=n+Math.imul(te,pe)|0,n=n+Math.imul(re,ve)|0,m=m+Math.imul(re,pe)|0,p=p+Math.imul(Q,me)|0,n=n+Math.imul(Q,xe)|0,n=n+Math.imul(ee,me)|0,m=m+Math.imul(ee,xe)|0,p=p+Math.imul(Y,ye)|0,n=n+Math.imul(Y,ge)|0,n=n+Math.imul(G,ye)|0,m=m+Math.imul(G,ge)|0,p=p+Math.imul(Z,we)|0,n=n+Math.imul(Z,Me)|0,n=n+Math.imul($,we)|0,m=m+Math.imul($,Me)|0,p=p+Math.imul(N,Se)|0,n=n+Math.imul(N,_e)|0,n=n+Math.imul(L,Se)|0,m=m+Math.imul(L,_e)|0,p=p+Math.imul(O,Ae)|0,n=n+Math.imul(O,Re)|0,n=n+Math.imul(k,Ae)|0,m=m+Math.imul(k,Re)|0,p=p+Math.imul(E,Ie)|0,n=n+Math.imul(E,Ee)|0,n=n+Math.imul(C,Ie)|0,m=m+Math.imul(C,Ee)|0;var Rr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,p=Math.imul(de,he),n=Math.imul(de,ue),n=n+Math.imul(se,he)|0,m=Math.imul(se,ue),p=p+Math.imul(ae,le)|0,n=n+Math.imul(ae,be)|0,n=n+Math.imul(ne,le)|0,m=m+Math.imul(ne,be)|0,p=p+Math.imul(ie,ve)|0,n=n+Math.imul(ie,pe)|0,n=n+Math.imul(fe,ve)|0,m=m+Math.imul(fe,pe)|0,p=p+Math.imul(te,me)|0,n=n+Math.imul(te,xe)|0,n=n+Math.imul(re,me)|0,m=m+Math.imul(re,xe)|0,p=p+Math.imul(Q,ye)|0,n=n+Math.imul(Q,ge)|0,n=n+Math.imul(ee,ye)|0,m=m+Math.imul(ee,ge)|0,p=p+Math.imul(Y,we)|0,n=n+Math.imul(Y,Me)|0,n=n+Math.imul(G,we)|0,m=m+Math.imul(G,Me)|0,p=p+Math.imul(Z,Se)|0,n=n+Math.imul(Z,_e)|0,n=n+Math.imul($,Se)|0,m=m+Math.imul($,_e)|0,p=p+Math.imul(N,Ae)|0,n=n+Math.imul(N,Re)|0,n=n+Math.imul(L,Ae)|0,m=m+Math.imul(L,Re)|0,p=p+Math.imul(O,Ie)|0,n=n+Math.imul(O,Ee)|0,n=n+Math.imul(k,Ie)|0,m=m+Math.imul(k,Ee)|0;var Ir=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,p=Math.imul(de,le),n=Math.imul(de,be),n=n+Math.imul(se,le)|0,m=Math.imul(se,be),p=p+Math.imul(ae,ve)|0,n=n+Math.imul(ae,pe)|0,n=n+Math.imul(ne,ve)|0,m=m+Math.imul(ne,pe)|0,p=p+Math.imul(ie,me)|0,n=n+Math.imul(ie,xe)|0,n=n+Math.imul(fe,me)|0,m=m+Math.imul(fe,xe)|0,p=p+Math.imul(te,ye)|0,n=n+Math.imul(te,ge)|0,n=n+Math.imul(re,ye)|0,m=m+Math.imul(re,ge)|0,p=p+Math.imul(Q,we)|0,n=n+Math.imul(Q,Me)|0,n=n+Math.imul(ee,we)|0,m=m+Math.imul(ee,Me)|0,p=p+Math.imul(Y,Se)|0,n=n+Math.imul(Y,_e)|0,n=n+Math.imul(G,Se)|0,m=m+Math.imul(G,_e)|0,p=p+Math.imul(Z,Ae)|0,n=n+Math.imul(Z,Re)|0,n=n+Math.imul($,Ae)|0,m=m+Math.imul($,Re)|0,p=p+Math.imul(N,Ie)|0,n=n+Math.imul(N,Ee)|0,n=n+Math.imul(L,Ie)|0,m=m+Math.imul(L,Ee)|0;var Er=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(Er>>>26)|0,Er&=67108863,p=Math.imul(de,ve),n=Math.imul(de,pe),n=n+Math.imul(se,ve)|0,m=Math.imul(se,pe),p=p+Math.imul(ae,me)|0,n=n+Math.imul(ae,xe)|0,n=n+Math.imul(ne,me)|0,m=m+Math.imul(ne,xe)|0,p=p+Math.imul(ie,ye)|0,n=n+Math.imul(ie,ge)|0,n=n+Math.imul(fe,ye)|0,m=m+Math.imul(fe,ge)|0,p=p+Math.imul(te,we)|0,n=n+Math.imul(te,Me)|0,n=n+Math.imul(re,we)|0,m=m+Math.imul(re,Me)|0,p=p+Math.imul(Q,Se)|0,n=n+Math.imul(Q,_e)|0,n=n+Math.imul(ee,Se)|0,m=m+Math.imul(ee,_e)|0,p=p+Math.imul(Y,Ae)|0,n=n+Math.imul(Y,Re)|0,n=n+Math.imul(G,Ae)|0,m=m+Math.imul(G,Re)|0,p=p+Math.imul(Z,Ie)|0,n=n+Math.imul(Z,Ee)|0,n=n+Math.imul($,Ie)|0,m=m+Math.imul($,Ee)|0;var Cr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,p=Math.imul(de,me),n=Math.imul(de,xe),n=n+Math.imul(se,me)|0,m=Math.imul(se,xe),p=p+Math.imul(ae,ye)|0,n=n+Math.imul(ae,ge)|0,n=n+Math.imul(ne,ye)|0,m=m+Math.imul(ne,ge)|0,p=p+Math.imul(ie,we)|0,n=n+Math.imul(ie,Me)|0,n=n+Math.imul(fe,we)|0,m=m+Math.imul(fe,Me)|0,p=p+Math.imul(te,Se)|0,n=n+Math.imul(te,_e)|0,n=n+Math.imul(re,Se)|0,m=m+Math.imul(re,_e)|0,p=p+Math.imul(Q,Ae)|0,n=n+Math.imul(Q,Re)|0,n=n+Math.imul(ee,Ae)|0,m=m+Math.imul(ee,Re)|0,p=p+Math.imul(Y,Ie)|0,n=n+Math.imul(Y,Ee)|0,n=n+Math.imul(G,Ie)|0,m=m+Math.imul(G,Ee)|0;var Pr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,p=Math.imul(de,ye),n=Math.imul(de,ge),n=n+Math.imul(se,ye)|0,m=Math.imul(se,ge),p=p+Math.imul(ae,we)|0,n=n+Math.imul(ae,Me)|0,n=n+Math.imul(ne,we)|0,m=m+Math.imul(ne,Me)|0,p=p+Math.imul(ie,Se)|0,n=n+Math.imul(ie,_e)|0,n=n+Math.imul(fe,Se)|0,m=m+Math.imul(fe,_e)|0,p=p+Math.imul(te,Ae)|0,n=n+Math.imul(te,Re)|0,n=n+Math.imul(re,Ae)|0,m=m+Math.imul(re,Re)|0,p=p+Math.imul(Q,Ie)|0,n=n+Math.imul(Q,Ee)|0,n=n+Math.imul(ee,Ie)|0,m=m+Math.imul(ee,Ee)|0;var zr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(zr>>>26)|0,zr&=67108863,p=Math.imul(de,we),n=Math.imul(de,Me),n=n+Math.imul(se,we)|0,m=Math.imul(se,Me),p=p+Math.imul(ae,Se)|0,n=n+Math.imul(ae,_e)|0,n=n+Math.imul(ne,Se)|0,m=m+Math.imul(ne,_e)|0,p=p+Math.imul(ie,Ae)|0,n=n+Math.imul(ie,Re)|0,n=n+Math.imul(fe,Ae)|0,m=m+Math.imul(fe,Re)|0,p=p+Math.imul(te,Ie)|0,n=n+Math.imul(te,Ee)|0,n=n+Math.imul(re,Ie)|0,m=m+Math.imul(re,Ee)|0;var Tr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,p=Math.imul(de,Se),n=Math.imul(de,_e),n=n+Math.imul(se,Se)|0,m=Math.imul(se,_e),p=p+Math.imul(ae,Ae)|0,n=n+Math.imul(ae,Re)|0,n=n+Math.imul(ne,Ae)|0,m=m+Math.imul(ne,Re)|0,p=p+Math.imul(ie,Ie)|0,n=n+Math.imul(ie,Ee)|0,n=n+Math.imul(fe,Ie)|0,m=m+Math.imul(fe,Ee)|0;var Hr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,p=Math.imul(de,Ae),n=Math.imul(de,Re),n=n+Math.imul(se,Ae)|0,m=Math.imul(se,Re),p=p+Math.imul(ae,Ie)|0,n=n+Math.imul(ae,Ee)|0,n=n+Math.imul(ne,Ie)|0,m=m+Math.imul(ne,Ee)|0;var qr=(M+p|0)+((n&8191)<<13)|0;M=(m+(n>>>13)|0)+(qr>>>26)|0,qr&=67108863,p=Math.imul(de,Ie),n=Math.imul(de,Ee),n=n+Math.imul(se,Ie)|0,m=Math.imul(se,Ee);var Fr=(M+p|0)+((n&8191)<<13)|0;return M=(m+(n>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,g[0]=mr,g[1]=xr,g[2]=yr,g[3]=gr,g[4]=wr,g[5]=Mr,g[6]=Sr,g[7]=_r,g[8]=Ar,g[9]=Rr,g[10]=Ir,g[11]=Er,g[12]=Cr,g[13]=Pr,g[14]=zr,g[15]=Tr,g[16]=Hr,g[17]=qr,g[18]=Fr,M!==0&&(g[19]=M,h.length++),h};Math.imul||(A=S);function R(c,i,s){s.negative=i.negative^c.negative,s.length=c.length+i.length;for(var h=0,u=0,b=0;b<s.length-1;b++){var g=u;u=0;for(var M=h&67108863,p=Math.min(b,i.length-1),n=Math.max(0,b-c.length+1);n<=p;n++){var m=b-n,I=c.words[m]|0,E=i.words[n]|0,C=I*E,z=C&67108863;g=g+(C/67108864|0)|0,z=z+M|0,M=z&67108863,g=g+(z>>>26)|0,u+=g>>>26,g&=67108863}s.words[b]=M,h=g,g=u}return h!==0?s.words[b]=h:s.length--,s.strip()}function H(c,i,s){var h=new P;return h.mulp(c,i,s)}a.prototype.mulTo=function(i,s){var h,u=this.length+i.length;return this.length===10&&i.length===10?h=A(this,i,s):u<63?h=S(this,i,s):u<1024?h=R(this,i,s):h=H(this,i,s),h};function P(c,i){this.x=c,this.y=i}P.prototype.makeRBT=function(i){for(var s=new Array(i),h=a.prototype._countBits(i)-1,u=0;u<i;u++)s[u]=this.revBin(u,h,i);return s},P.prototype.revBin=function(i,s,h){if(i===0||i===h-1)return i;for(var u=0,b=0;b<s;b++)u|=(i&1)<<s-b-1,i>>=1;return u},P.prototype.permute=function(i,s,h,u,b,g){for(var M=0;M<g;M++)u[M]=s[i[M]],b[M]=h[i[M]]},P.prototype.transform=function(i,s,h,u,b,g){this.permute(g,i,s,h,u,b);for(var M=1;M<b;M<<=1)for(var p=M<<1,n=Math.cos(2*Math.PI/p),m=Math.sin(2*Math.PI/p),I=0;I<b;I+=p)for(var E=n,C=m,z=0;z<M;z++){var O=h[I+z],k=u[I+z],nt=h[I+z+M],N=u[I+z+M],L=E*nt-C*N;N=E*N+C*nt,nt=L,h[I+z]=O+nt,u[I+z]=k+N,h[I+z+M]=O-nt,u[I+z+M]=k-N,z!==p&&(L=n*E-m*C,C=n*C+m*E,E=L)}},P.prototype.guessLen13b=function(i,s){var h=Math.max(s,i)|1,u=h&1,b=0;for(h=h/2|0;h;h=h>>>1)b++;return 1<<b+1+u},P.prototype.conjugate=function(i,s,h){if(!(h<=1))for(var u=0;u<h/2;u++){var b=i[u];i[u]=i[h-u-1],i[h-u-1]=b,b=s[u],s[u]=-s[h-u-1],s[h-u-1]=-b}},P.prototype.normalize13b=function(i,s){for(var h=0,u=0;u<s/2;u++){var b=Math.round(i[2*u+1]/s)*8192+Math.round(i[2*u]/s)+h;i[u]=b&67108863,b<67108864?h=0:h=b/67108864|0}return i},P.prototype.convert13b=function(i,s,h,u){for(var b=0,g=0;g<s;g++)b=b+(i[g]|0),h[2*g]=b&8191,b=b>>>13,h[2*g+1]=b&8191,b=b>>>13;for(g=2*s;g<u;++g)h[g]=0;r(b===0),r((b&~8191)==0)},P.prototype.stub=function(i){for(var s=new Array(i),h=0;h<i;h++)s[h]=0;return s},P.prototype.mulp=function(i,s,h){var u=2*this.guessLen13b(i.length,s.length),b=this.makeRBT(u),g=this.stub(u),M=new Array(u),p=new Array(u),n=new Array(u),m=new Array(u),I=new Array(u),E=new Array(u),C=h.words;C.length=u,this.convert13b(i.words,i.length,M,u),this.convert13b(s.words,s.length,m,u),this.transform(M,g,p,n,u,b),this.transform(m,g,I,E,u,b);for(var z=0;z<u;z++){var O=p[z]*I[z]-n[z]*E[z];n[z]=p[z]*E[z]+n[z]*I[z],p[z]=O}return this.conjugate(p,n,u),this.transform(p,n,C,g,u,b),this.conjugate(C,g,u),this.normalize13b(C,u),h.negative=i.negative^s.negative,h.length=i.length+s.length,h.strip()},a.prototype.mul=function(i){var s=new a(null);return s.words=new Array(this.length+i.length),this.mulTo(i,s)},a.prototype.mulf=function(i){var s=new a(null);return s.words=new Array(this.length+i.length),H(this,i,s)},a.prototype.imul=function(i){return this.clone().mulTo(i,this)},a.prototype.imuln=function(i){r(typeof i=="number"),r(i<67108864);for(var s=0,h=0;h<this.length;h++){var u=(this.words[h]|0)*i,b=(u&67108863)+(s&67108863);s>>=26,s+=u/67108864|0,s+=b>>>26,this.words[h]=b&67108863}return s!==0&&(this.words[h]=s,this.length++),this},a.prototype.muln=function(i){return this.clone().imuln(i)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(i){var s=_(i);if(s.length===0)return new a(1);for(var h=this,u=0;u<s.length&&s[u]===0;u++,h=h.sqr());if(++u<s.length)for(var b=h.sqr();u<s.length;u++,b=b.sqr())s[u]!==0&&(h=h.mul(b));return h},a.prototype.iushln=function(i){r(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,u=67108863>>>26-s<<26-s,b;if(s!==0){var g=0;for(b=0;b<this.length;b++){var M=this.words[b]&u,p=(this.words[b]|0)-M<<s;this.words[b]=p|g,g=M>>>26-s}g&&(this.words[b]=g,this.length++)}if(h!==0){for(b=this.length-1;b>=0;b--)this.words[b+h]=this.words[b];for(b=0;b<h;b++)this.words[b]=0;this.length+=h}return this.strip()},a.prototype.ishln=function(i){return r(this.negative===0),this.iushln(i)},a.prototype.iushrn=function(i,s,h){r(typeof i=="number"&&i>=0);var u;s?u=(s-s%26)/26:u=0;var b=i%26,g=Math.min((i-b)/26,this.length),M=67108863^67108863>>>b<<b,p=h;if(u-=g,u=Math.max(0,u),p){for(var n=0;n<g;n++)p.words[n]=this.words[n];p.length=g}if(g!==0)if(this.length>g)for(this.length-=g,n=0;n<this.length;n++)this.words[n]=this.words[n+g];else